Add a link to a service's event when showing the host's history

This commit is contained in:
Johannes Meyer 2014-12-11 10:56:47 +01:00
parent 73f9328f12
commit 8779e80291

View File

@ -13,6 +13,7 @@
<?php <?php
$self = $this; $self = $this;
$hostContext = $object->getType() === 'host';
function contactsLink($match, $view) { function contactsLink($match, $view) {
$links = array(); $links = array();
foreach (preg_split('/,\s/', $match[1]) as $contact) { foreach (preg_split('/,\s/', $match[1]) as $contact) {
@ -132,7 +133,13 @@ $output = $this->tickets ? preg_replace_callback(
?> ?>
<?php if ($isService): ?> <?php if ($isService): ?>
<?= $this->escape($event->service_description) . ' ' . $this->translate('on') . ' ' . $this->escape($event->host_name); ?> <?= $hostContext ? $this->qlink(
$this->escape($event->service_description),
'monitoring/show/service',
array(
'host' => $event->host_name,
'service' => $event->service_description)
) : $this->escape($event->service_description); ?> <?= $this->translate('on') . ' ' . $this->escape($event->host_name); ?>
<?php else: ?> <?php else: ?>
<?= $this->escape($event->host_name); ?> <?= $this->escape($event->host_name); ?>
<?php endif ?> <?php endif ?>