Display a message when a list view is empty

fixes #6469
This commit is contained in:
Matthias Jentsch 2014-06-30 10:47:25 +02:00
parent 54f9ecb62f
commit a2fa5c055c
14 changed files with 64 additions and 10 deletions

View File

@ -13,6 +13,10 @@
$cf = $this->getHelper('CommandForm');
if (count($comments) === 0) {
echo t('No comments matching the filter');
}
foreach ($comments as $comment):
?>

View File

@ -5,6 +5,13 @@
<?php endif ?>
<div class="content">
<div class="boxview" data-base-target="_next">
<?php
if (count($groupData) === 0) {
echo t('No contacts matching the filter');
}
?>
<?php foreach ($groupData as $groupName => $groupInfo): ?>
<div class="box contactgroup">
<h2><?= $groupInfo['alias']; ?></h2>

View File

@ -27,6 +27,11 @@ $contactHelper = $this->getHelper('ContactFlags');
<table class="table table-condensed pull-left">
<tbody>
<?php
if (count($contacts) === 0) {
echo t('No contacts matching the filter');
}
?>
<?php foreach($contacts as $contact): ?>
<?php $periodLink = $this->href('monitoring/show/contacts', array('contact' => $contact->contact_name)); ?>
<tr>

View File

@ -12,6 +12,11 @@ $helper = $this->getHelper('CommandForm');
<div class="content downtimes">
<table data-base-target="_next" class="action">
<tbody>
<?php
if (count($downtimes) === 0) {
echo t('No downtimes matching the filter');
}
?>
<?php foreach ($this->downtimes as $downtime): ?>
<tr>
<td>

View File

@ -14,6 +14,11 @@
<table data-base-target="_next" class="action">
<tbody>
<?php
if (count($history) === 0) {
echo t('No history events matching the filter');
}
?>
<?php foreach ($history as $event): ?>
<?php
$class = null;

View File

@ -5,6 +5,12 @@
<?php endif ?>
<div class="content">
<div class="boxview" data-base-target="_next">
<?php
if (count($hostgroups) === 0) {
echo t('No host groups matching the filter');
}
?>
<?php foreach($hostgroups as $h): ?>
<div class="box hostgroup">
<h2>

View File

@ -20,14 +20,13 @@ if (! $this->compact): ?>
<?php
endif;
if ($hosts->count() === 0): ?>
<?= $this->translate('No host found') ?>
<?php if (! $this->compact): ?>
</div>
<?php
endif;
return;
endif;
if ($hosts->count() === 0) {
echo t('No hosts matching the filter');
if (! $this->compact) {
echo '</div>';
}
return;
}
?>
<table

View File

@ -22,6 +22,9 @@ if (empty($this->notifications)) {
<tbody>
<?php
if (count($notifications) === 0) {
echo t('No notifications matching the filter');
}
foreach ($notifications as $notification):
if (isset($notification->service)) {

View File

@ -5,6 +5,12 @@
<?php endif ?>
<div class="content">
<div class="boxview" data-base-target="_next">
<?php
if (count($servicegroups) === 0) {
echo t('No service groups matching the filter');
}
?>
<?php foreach($servicegroups as $servicegroup): ?>
<div class="box servicegroup">
<h2>

View File

@ -23,7 +23,7 @@ $hostFilter = '(' . implode('|', array_keys($pivotData)) . ')';
?>
<?php if (count($pivotData) === 0): ?>
<?= $this->translate('No Service Found'); ?>
<?= $this->translate('No Services matching the filter'); ?>
<?php endif ?>
<?php foreach ($pivotData as $host_name => $serviceStates): ?>

View File

@ -29,6 +29,9 @@ if (!$this->compact): ?>
<tbody>
<?php
if (count($services) === 0) {
echo t('No services matching the filter');
}
foreach ($services as $service):
$serviceLink = $this->href(
'monitoring/show/service',

View File

@ -7,6 +7,10 @@
$grid->setColor('#FC0707');
$data = array();
if (count($summary) === 0) {
echo t('No history entry matching the filter');
}
foreach ($summary as $entry) {
$day = $entry->day;
$value = $entry->cnt_critical;

View File

@ -9,8 +9,10 @@ $this->target = array('host' => $this->hostquery);
</div>
<div class="content">
<?php if (count($objects) === 0): ?>
<?= t('No hosts matching the filter'); ?>
<?php else: ?>
<h1> Summary for <?= count($objects) ?> hosts </h1>
<?= $this->render('multi/components/objectlist.phtml'); ?>
<table class="avp">
<tr>
@ -47,6 +49,7 @@ $this->target = array('host' => $this->hostquery);
</table>
<?= $this->render('multi/components/flags.phtml') ?>
<?php endif ?>
</div>
<a

View File

@ -13,6 +13,9 @@ $this->target = array(
</div>
<div class="content">
<?php if (count($objects) === 0): ?>
<?= t('No services matching the filter'); ?>
<?php else: ?>
<h1> Summary for <?= count($objects) ?> services </h1>
<table style="width: 100%; font-size: 0.8em;">
@ -54,4 +57,5 @@ $this->target = array(
</table>
<?= $this->render('multi/components/flags.phtml') ?>
<?php endif ?>
</div>