monitoring: Use the link helper in the downtimes overview

This commit is contained in:
Eric Lippmann 2015-01-21 15:56:58 +01:00
parent 423e4c55a8
commit 439052ad97
1 changed files with 9 additions and 15 deletions

View File

@ -31,8 +31,10 @@ use Icinga\Module\Monitoring\Object\Service;
<?php foreach ($downtimes as $downtime): ?>
<?php
if (isset($downtime->service)) {
$isService = true;
$stateName = Service::getStateText($downtime->service_state);
} else {
$isService = false;
$stateName = Host::getStateText($downtime->host_state);
}
?>
@ -52,22 +54,14 @@ use Icinga\Module\Monitoring\Object\Service;
?>
</td>
<td>
<?php if (isset($downtime->service)): ?>
<?= $this->icon('service'); ?> <a href="<?= $this->href('monitoring/service/show', array(
'host' => $downtime->host,
'service' => $downtime->service
)); ?>">
<?= $this->escape($downtime->service_display_name) ?>
</a>
<small>
<?= $this->translate('on'); ?> <?= $this->escape($downtime->host_display_name) ?>
</small>
<?php if ($isService): ?>
<?= $this->icon('service') ?>
<?= $this->link()->service(
$downtime->service, $downtime->service_display_name, $downtime->host, $downtime->host_display_name
) ?>
<?php else: ?>
<?= $this->icon('host'); ?> <a href="<?= $this->href('monitoring/host/show', array(
'host' => $downtime->host
)); ?>">
<?= $this->escape($downtime->host_display_name) ?>
</a>
<?= $this->icon('host') ?>
<?= $this->link()->host($downtime->host, $downtime->host_display_name) ?>
<?php endif ?>
<br>
<?= $this->icon('comment') ?> [<?= $this->escape($downtime->author) ?>] <?= $this->escape($downtime->comment) ?>