mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-24 06:14:25 +02:00
Host History: Use $query->hasResult() instead of $query->count()
refs #9632
This commit is contained in:
parent
7bd8b4b19a
commit
54590bfaf1
@ -2,6 +2,19 @@
|
|||||||
use Icinga\Module\Monitoring\Object\Host;
|
use Icinga\Module\Monitoring\Object\Host;
|
||||||
use Icinga\Module\Monitoring\Object\Service;
|
use Icinga\Module\Monitoring\Object\Service;
|
||||||
|
|
||||||
|
function contactsLink($match, $view) {
|
||||||
|
$links = array();
|
||||||
|
foreach (preg_split('/,\s/', $match[1]) as $contact) {
|
||||||
|
$links[] = $view->qlink(
|
||||||
|
$contact,
|
||||||
|
'monitoring/show/contact',
|
||||||
|
array('contact_name' => $contact),
|
||||||
|
array('title' => sprintf($view->translate('Show detailed information about %s'), $contact))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return '[' . implode(', ', $links) . ']';
|
||||||
|
}
|
||||||
|
|
||||||
$self = $this;
|
$self = $this;
|
||||||
|
|
||||||
if (! $this->compact): ?>
|
if (! $this->compact): ?>
|
||||||
@ -16,29 +29,6 @@ if (! $this->compact): ?>
|
|||||||
</div>
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<?php
|
|
||||||
|
|
||||||
if (count($history) === 0) {
|
|
||||||
echo $this->translate('No history events found matching the filter') . '</div>';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
function contactsLink($match, $view) {
|
|
||||||
$links = array();
|
|
||||||
foreach (preg_split('/,\s/', $match[1]) as $contact) {
|
|
||||||
$links[] = $view->qlink(
|
|
||||||
$contact,
|
|
||||||
'monitoring/show/contact',
|
|
||||||
array('contact_name' => $contact),
|
|
||||||
array('title' => sprintf($view->translate('Show detailed information about %s'), $contact))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return '[' . implode(', ', $links) . ']';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<table data-base-target="_next" class="action objecthistory">
|
<table data-base-target="_next" class="action objecthistory">
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($history as $event): ?>
|
<?php foreach ($history as $event): ?>
|
||||||
@ -152,7 +142,10 @@ $output = $this->tickets ? preg_replace_callback(
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<?php if (! $history->hasResult()): ?>
|
||||||
|
<?= $this->translate('No history events found matching the filter'); ?>
|
||||||
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user