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