1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
<?php
/** @var \Icinga\Module\Eventdb\Event $event */
/** @var array $additionalColumns */
/** @var \Icinga\Repository\RepositoryQuery $comments */
/** @var \Icinga\Repository\RepositoryQuery $groupedEvents */
$commentTypes = array(
$this->translate('Comment'),
$this->translate('Acknowledgement'),
$this->translate('Revocation'),
);
$displayColumns = array_merge(array('program', 'message', 'facility'), $additionalColumns);
?>
<?= $this->translate('Timestamp') ?>: <?= $event->created ?>
<?= $this->translate('Priority') ?>: <?= strtoupper($event->getPriority()) ?>
<?= $event->ack ? sprintf(' (%s)', $this->translate('Acknowledged')) : '' ?>
<?= $this->translate('Type') ?>: <?= $event->getType() ?>
<?php foreach ($displayColumns as $col): ?>
<?= $this->columnHeader($col, null, true) ?>: <?= htmlspecialchars($event->offsetGet($col)) ?>
<?php endforeach ?>
<?php if ($comments->hasResult()): ?>
[ <?= $this->translate('Comments') ?> ]
<?php foreach ($comments as $comment): ?>
<?= $commentTypes[$comment->type] ?>: <?= $comment->created ?>
<?= $this->translate('User') ?>: <?= $comment->user ?>
<?= $this->translate('Message') ?>: <?= $comment->message ?>
<?php endforeach ?>
<?php endif; ?>
<?php if ($groupedEvents !== null && $groupedEvents->hasResult()): ?>
[ <?= $this->translate('Grouped Events') ?> ]
<?php foreach ($groupedEvents as $groupedEventData):
/** @var \Icinga\Module\Eventdb\Event $groupedEvent */
$groupedEvent = $this->event($groupedEventData);
?>
<?= $this->translate('Timestamp') ?>: <?= $event->created ?>
<?= $this->translate('Priority') ?>: <?= strtoupper($event->getPriority()) ?>
<?= $event->ack ? sprintf(' (%s)', $this->translate('Acknowledged')) : '' ?>
<?= $this->translate('Type') ?>: <?= $event->getType() ?>
<?php foreach (array('host_name', 'program', 'message') as $col): ?>
<?= $this->columnHeader($col, null, true) ?>: <?= htmlspecialchars($event->offsetGet($col)) ?>
<?php endforeach ?>
<?php endforeach ?>
<?php endif; ?>
|