2013-10-15 16:23:46 +02:00
|
|
|
<?php
|
2014-02-18 20:17:33 +01:00
|
|
|
|
|
|
|
$cf = $this->getHelper('CommandForm');
|
|
|
|
|
|
|
|
$data = array('host' => $object->host_name);
|
|
|
|
if ($object->service_description) {
|
|
|
|
$data['service'] = $object->service_description;
|
|
|
|
}
|
|
|
|
|
2014-03-07 11:30:23 +01:00
|
|
|
$list = array();
|
|
|
|
foreach ($object->comments as $comment) {
|
|
|
|
|
|
|
|
// Ticket hook sample
|
|
|
|
$text = $this->tickets ? preg_replace_callback(
|
|
|
|
$this->tickets->getPattern(),
|
|
|
|
array($this->tickets, 'createLink'),
|
2014-03-09 19:29:23 +01:00
|
|
|
$this->escape($comment->comment)
|
|
|
|
) : $this->escape($comment->comment);
|
2014-03-07 11:30:23 +01:00
|
|
|
|
|
|
|
$deleteData = $data;
|
2014-03-09 19:29:23 +01:00
|
|
|
$deleteData['commentid'] = $comment->id;
|
2014-03-07 11:30:23 +01:00
|
|
|
|
2014-06-23 14:39:55 +02:00
|
|
|
// $iconForm = $cf->iconSubmitForm(
|
|
|
|
// 'img/icons/remove_petrol.png',
|
|
|
|
$iconForm = $cf->labelSubmitForm(
|
|
|
|
'X',
|
2014-03-07 11:30:23 +01:00
|
|
|
'Remove comment',
|
2014-03-08 17:16:42 +01:00
|
|
|
'link-like',
|
2014-03-07 11:30:23 +01:00
|
|
|
'removecomment',
|
|
|
|
$deleteData
|
|
|
|
);
|
2014-03-07 10:41:59 +01:00
|
|
|
|
2014-03-07 11:30:23 +01:00
|
|
|
$list[] = sprintf(
|
2014-08-14 10:23:04 +02:00
|
|
|
'<tr><th>%s (%s)</th><td><table><tr><td style="vertical-align: top;" data-base-target="_self">%s (%s):</td><td style="padding-left: .5em;">%s</td></tr></table></td></tr>',
|
2014-03-09 19:29:23 +01:00
|
|
|
$this->escape($comment->author),
|
|
|
|
$this->timeSince($comment->timestamp),
|
2014-03-21 19:56:55 +01:00
|
|
|
$iconForm,
|
|
|
|
ucfirst($comment->type),
|
2014-08-14 10:23:04 +02:00
|
|
|
str_replace(array('\r\n', '\n'), '<br>', $text)
|
2014-03-07 11:30:23 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<th><?= $this->translate('Comments') ?></th>
|
|
|
|
<td>
|
|
|
|
<a href="<?= $this->href('monitoring/command/addComment', $data) ?>"><?= $this->icon('comment_petrol.png') ?> <?= $this->translate('Add comment') ?></a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2014-03-21 19:56:55 +01:00
|
|
|
<?= implode("\n", $list) ?>
|