From dbc2f98053f7957a55024f6a0ecb177dfb59fb94 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 3 Aug 2015 14:09:55 +0200 Subject: [PATCH 01/18] SimpleQuery: Initialize self::$iteratorPosition as late as possible refs #9632 --- library/Icinga/Data/SimpleQuery.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Data/SimpleQuery.php b/library/Icinga/Data/SimpleQuery.php index ae6506e27..33745a822 100644 --- a/library/Icinga/Data/SimpleQuery.php +++ b/library/Icinga/Data/SimpleQuery.php @@ -158,7 +158,7 @@ class SimpleQuery implements QueryInterface, Queryable, Iterator } $this->iterator->rewind(); - $this->iteratorPosition = 0; + $this->iteratorPosition = null; Benchmark::measure('Query result iteration started'); } @@ -190,6 +190,8 @@ class SimpleQuery implements QueryInterface, Queryable, Iterator if (! $valid) { Benchmark::measure('Query result iteration finished'); return false; + } elseif ($this->iteratorPosition === null) { + $this->iteratorPosition = 0; } return true; From 9a0e47a3e1ed081461db1252d7c00a27933883e2 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 3 Aug 2015 14:49:33 +0200 Subject: [PATCH 02/18] SimpleQuery: Add method hasResult() refs #9632 --- library/Icinga/Data/SimpleQuery.php | 10 ++++++++++ library/Icinga/Repository/RepositoryQuery.php | 10 ++++++++++ .../library/Monitoring/DataView/DataView.php | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/library/Icinga/Data/SimpleQuery.php b/library/Icinga/Data/SimpleQuery.php index 33745a822..2dcecfc9c 100644 --- a/library/Icinga/Data/SimpleQuery.php +++ b/library/Icinga/Data/SimpleQuery.php @@ -422,6 +422,16 @@ class SimpleQuery implements QueryInterface, Queryable, Iterator return $this->hasMore; } + /** + * Return whether this query will or has yielded any result + * + * @return bool + */ + public function hasResult() + { + return $this->iteratorPosition !== null || $this->fetchRow() !== false; + } + /** * Set a limit count and offset to the query * diff --git a/library/Icinga/Repository/RepositoryQuery.php b/library/Icinga/Repository/RepositoryQuery.php index 163bb40ff..c975654db 100644 --- a/library/Icinga/Repository/RepositoryQuery.php +++ b/library/Icinga/Repository/RepositoryQuery.php @@ -367,6 +367,16 @@ class RepositoryQuery implements QueryInterface, SortRules, Iterator return $this->query->hasMore(); } + /** + * Return whether this query will or has yielded any result + * + * @return bool + */ + public function hasResult() + { + return $this->query->hasResult(); + } + /** * Limit this query's results * diff --git a/modules/monitoring/library/Monitoring/DataView/DataView.php b/modules/monitoring/library/Monitoring/DataView/DataView.php index 49f14a2e9..11543351c 100644 --- a/modules/monitoring/library/Monitoring/DataView/DataView.php +++ b/modules/monitoring/library/Monitoring/DataView/DataView.php @@ -433,6 +433,16 @@ abstract class DataView implements QueryInterface, SortRules, IteratorAggregate return $this->query->hasMore(); } + /** + * Return whether this query will or has yielded any result + * + * @return bool + */ + public function hasResult() + { + return $this->query->hasResult(); + } + /** * Set a limit count and offset * From 39d29c79d2e0fc568699a1a1ba31d2ec7b7f1c63 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 3 Aug 2015 15:06:22 +0200 Subject: [PATCH 03/18] Hostgroup Overview: Use $query->hasResult() instead of $query->count() refs #9632 --- .../views/scripts/list/hostgroups.phtml | 70 ++++++++++--------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/hostgroups.phtml b/modules/monitoring/application/views/scripts/list/hostgroups.phtml index f1a3e2004..27527591c 100644 --- a/modules/monitoring/application/views/scripts/list/hostgroups.phtml +++ b/modules/monitoring/application/views/scripts/list/hostgroups.phtml @@ -13,11 +13,10 @@ if (! $this->compact): ?>
translate('No hostgroups found matching the filter') . '
'; - return; -} -?> +$firstRow = true; +foreach ($hostgroups as $h): ?> + + @@ -28,32 +27,35 @@ if (count($hostgroups) === 0) { - hosts_down_unhandled) { - $handled = false; - $state = Host::STATE_DOWN; - $lastStateChange = $h->hosts_down_last_state_change_unhandled; - } elseif ($h->hosts_unreachable_unhandled) { - $handled = false; - $state = Host::STATE_UNREACHABLE; - $lastStateChange = $h->hosts_unreachable_last_state_change_unhandled; - } else { - $handled = true; - if ($h->hosts_down_handled) { - $state = Host::STATE_DOWN; - $lastStateChange = $h->hosts_down_last_state_change_handled; - } elseif ($h->hosts_unreachable_handled) { - $state = Host::STATE_UNREACHABLE; - $lastStateChange = $h->hosts_unreachable_last_state_change_handled; - } elseif ($h->hosts_up) { - $state = Host::STATE_UP; - $lastStateChange = $h->hosts_up_last_state_change; - } else { - $state = Host::STATE_PENDING; - $lastStateChange = $h->hosts_pending_last_state_change; - } - } - ?> + +hosts_down_unhandled) { + $handled = false; + $state = Host::STATE_DOWN; + $lastStateChange = $h->hosts_down_last_state_change_unhandled; +} elseif ($h->hosts_unreachable_unhandled) { + $handled = false; + $state = Host::STATE_UNREACHABLE; + $lastStateChange = $h->hosts_unreachable_last_state_change_unhandled; +} else { + $handled = true; + if ($h->hosts_down_handled) { + $state = Host::STATE_DOWN; + $lastStateChange = $h->hosts_down_last_state_change_handled; + } elseif ($h->hosts_unreachable_handled) { + $state = Host::STATE_UNREACHABLE; + $lastStateChange = $h->hosts_unreachable_last_state_change_handled; + } elseif ($h->hosts_up) { + $state = Host::STATE_UP; + $lastStateChange = $h->hosts_up_last_state_change; + } else { + $state = Host::STATE_PENDING; + $lastStateChange = $h->hosts_pending_last_state_change; + } +} + +?> @@ -461,7 +463,11 @@ if (count($hostgroups) === 0) { - + +hasResult()): ?>
translate('Last Problem'); ?>translate('Service States'); ?>
+ + translate('No hostgroups found matching the filter'); ?> + From c0b82eff945816f2b311a4be20b7172985e7ce65 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 3 Aug 2015 15:18:40 +0200 Subject: [PATCH 04/18] Servicegroup Overview: Use $query->hasResult() instead of $query->count() refs #9632 --- .../views/scripts/list/servicegroups.phtml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/servicegroups.phtml b/modules/monitoring/application/views/scripts/list/servicegroups.phtml index fc336aca5..41e52b833 100644 --- a/modules/monitoring/application/views/scripts/list/servicegroups.phtml +++ b/modules/monitoring/application/views/scripts/list/servicegroups.phtml @@ -10,11 +10,10 @@
translate('No servicegroups found matching the filter') . '
'; - return; -} -?> +$firstRow = true; +foreach ($servicegroups as $s): ?> + + @@ -23,7 +22,7 @@ if (count($servicegroups) === 0) { - +services_critical_last_state_change_unhandled): ?> - + +hasResult()): ?>
translate('Last Problem'); ?>translate('Service States'); ?>
@@ -298,7 +297,11 @@ if (count($servicegroups) === 0) {
+ + translate('No servicegroups found matching the filter'); ?> + From e1b3c4281825b9697830429bc19cd0b7647b6497 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 3 Aug 2015 15:22:14 +0200 Subject: [PATCH 05/18] Host Overview: Use $query->hasResult() instead of $query->count() refs #9632 --- .../application/views/scripts/list/hosts.phtml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/hosts.phtml b/modules/monitoring/application/views/scripts/list/hosts.phtml index b697c8f6a..4ff367fd8 100644 --- a/modules/monitoring/application/views/scripts/list/hosts.phtml +++ b/modules/monitoring/application/views/scripts/list/hosts.phtml @@ -15,14 +15,6 @@ if (! $this->compact): ?>
-translate('No hosts found matching the filter') . '
'; - return; -} -?> -
+hasResult()): ?> + translate('No hosts found matching the filter'); ?> + From 028342adfe6e5d289289fe39a70b606b6499f13d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 3 Aug 2015 15:24:10 +0200 Subject: [PATCH 06/18] Services Overview: Use $query->hasResult() instead of $query->count() refs #9632 --- .../application/views/scripts/list/services.phtml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/services.phtml b/modules/monitoring/application/views/scripts/list/services.phtml index 887757537..d5f68bbe5 100644 --- a/modules/monitoring/application/views/scripts/list/services.phtml +++ b/modules/monitoring/application/views/scripts/list/services.phtml @@ -18,13 +18,6 @@ if (! $this->compact): ?>
-translate('No services found matching the filter') . '
'; - return; -} -?> " @@ -91,4 +84,7 @@ if (count($services) === 0) {
+hasResult()): ?> + translate('No services found matching the filter'); ?> + From 29fd849ccaf74c7f9c2c0512bab10bbbbae3faca Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 3 Aug 2015 15:35:07 +0200 Subject: [PATCH 07/18] Contact Overview: Use $query->hasResult() instead of $query->count() refs #9632 --- .../application/views/scripts/list/contacts.phtml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/contacts.phtml b/modules/monitoring/application/views/scripts/list/contacts.phtml index 78910cead..6775fb480 100644 --- a/modules/monitoring/application/views/scripts/list/contacts.phtml +++ b/modules/monitoring/application/views/scripts/list/contacts.phtml @@ -8,14 +8,7 @@
-translate('No contacts found matching the filter') . '
'; - return; -} -?> - +
img('/static/gravatar', array('email' => $contact->contact_email)); ?> qlink( @@ -59,4 +52,7 @@ if (count($contacts) === 0) { if (true): /* The following piece of HTML MUST be nested in
+ hasResult()): ?> + translate('No contacts found matching the filter'); ?> +
From 6f0b51ed8fbf894ae2a94e251f07cb61fd02e812 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 3 Aug 2015 15:35:17 +0200 Subject: [PATCH 08/18] Notification Overview: Use $query->hasResult() instead of $query->count() refs #9632 --- .../application/views/scripts/list/notifications.phtml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/notifications.phtml b/modules/monitoring/application/views/scripts/list/notifications.phtml index 06a9e80a0..877a810c6 100644 --- a/modules/monitoring/application/views/scripts/list/notifications.phtml +++ b/modules/monitoring/application/views/scripts/list/notifications.phtml @@ -12,13 +12,6 @@ if (! $this->compact): ?>
-translate('No notifications found matching the filter') . '
'; - return; -} -?>
+hasResult()): ?> + translate('No notifications found matching the filter'); ?> + From d9539b2ad1773bbbb4a842096ad7f0673c290f87 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 3 Aug 2015 15:45:54 +0200 Subject: [PATCH 09/18] Downtime Overview: Use $query->hasResult() instead of $query->count() refs #9632 --- .../application/views/scripts/list/downtimes.phtml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/downtimes.phtml b/modules/monitoring/application/views/scripts/list/downtimes.phtml index af6c0d290..a2feafa52 100644 --- a/modules/monitoring/application/views/scripts/list/downtimes.phtml +++ b/modules/monitoring/application/views/scripts/list/downtimes.phtml @@ -16,14 +16,6 @@ if (! $this->compact): ?>
-translate('No downtimes found matching the filter,' - . ' maybe the downtime already expired.') . '
'; - return; -} -?>
+hasResult()): ?> + translate('No downtimes found matching the filter, maybe the downtime already expired.'); ?> + From 57e0ce1b530d69d83254ff733345f2f27f07a54c Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 3 Aug 2015 15:49:12 +0200 Subject: [PATCH 10/18] Comment Overview: Use $query->hasResult() instead of $query->count() refs #9632 --- .../application/views/scripts/list/comments.phtml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/comments.phtml b/modules/monitoring/application/views/scripts/list/comments.phtml index 00f2aeefc..ba05fb115 100644 --- a/modules/monitoring/application/views/scripts/list/comments.phtml +++ b/modules/monitoring/application/views/scripts/list/comments.phtml @@ -12,13 +12,6 @@
-translate('No comments found matching the filter') . '
'; - return; -} -?>
+hasResult()): ?> + translate('No comments found matching the filter'); ?> + From f03b9e57699cbe187749ec45007299889e9a1a64 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 3 Aug 2015 16:06:21 +0200 Subject: [PATCH 11/18] Eventgrid: Use $query->hasResult() instead of $query->count() * and do not use fetchAll() * and do not use view->filter = Filter::fromQuerystring((string) $this->params); $query->applyFilter($this->view->filter); $this->applyRestriction('monitoring/filter/objects', $query); - $this->view->summary = $query->getQuery()->fetchAll(); + $this->view->summary = $query; $this->view->column = $form->getValue('state'); // $this->view->orientationBox = $orientationBox; $this->view->orientation = $orientation; diff --git a/modules/monitoring/application/views/scripts/list/eventgrid.phtml b/modules/monitoring/application/views/scripts/list/eventgrid.phtml index 20016f9f4..37024b841 100644 --- a/modules/monitoring/application/views/scripts/list/eventgrid.phtml +++ b/modules/monitoring/application/views/scripts/list/eventgrid.phtml @@ -15,11 +15,6 @@ if (! $this->compact): ?>
translate('No state changes in the selected time period.') . '
'; - return; -} - $settings = array( 'cnt_up' => array( 'tooltip' => $this->translate('%d hosts ok on %s'), @@ -60,14 +55,6 @@ $settings = array( ) ); -$from = intval($form->getValue('from', strtotime('3 months ago'))); -$to = intval($form->getValue('to', time())); - -// don't display more than ten years, or else this will get really slow -if ($to - $from > 315360000) { - $from = $to - 315360000; -} - $data = array(); foreach ($summary as $entry) { $day = $entry->day; @@ -90,6 +77,19 @@ foreach ($summary as $entry) { ); } +if (! $summary->hasResult()) { + echo $this->translate('No state changes in the selected time period.') . ''; + return; +} + +$from = intval($form->getValue('from', strtotime('3 months ago'))); +$to = intval($form->getValue('to', time())); + +// don't display more than ten years, or else this will get really slow +if ($to - $from > 315360000) { + $from = $to - 315360000; +} + $f = new DateTime(); $f->setTimestamp($from); $t = new DateTime(); @@ -117,11 +117,11 @@ for ($i = 0; $i < $diff->days; $i += $step) { } ?>
- $grid) { ?> + $grid): ?>
orientation === 'horizontal' ? '
' : '' ?>
- +
From 8a5b5390da9f39d9a67bc01b849826025a9b874f Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 3 Aug 2015 16:09:42 +0200 Subject: [PATCH 12/18] Event Overview: Use $query->hasResult() instead of $query->count() refs #9632 --- .../application/views/scripts/list/eventhistory.phtml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/eventhistory.phtml b/modules/monitoring/application/views/scripts/list/eventhistory.phtml index ab9cb2331..ca44df469 100644 --- a/modules/monitoring/application/views/scripts/list/eventhistory.phtml +++ b/modules/monitoring/application/views/scripts/list/eventhistory.phtml @@ -12,12 +12,6 @@ if (! $this->compact): ?>
-translate('No history events found matching the filter') . '
'; - return; -} -?> @@ -96,4 +90,7 @@ if (count($history) === 0) {
+hasResult()): ?> + translate('No history events found matching the filter'); ?> + From 7388db32416114a67f214f2cf0c1bd01ae8e045b Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 3 Aug 2015 16:18:37 +0200 Subject: [PATCH 13/18] Groups: Use $query->hasResult() intead of $query->count() refs #9632 --- application/views/scripts/group/list.phtml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/application/views/scripts/group/list.phtml b/application/views/scripts/group/list.phtml index 1f693f152..8c8a8a2a0 100644 --- a/application/views/scripts/group/list.phtml +++ b/application/views/scripts/group/list.phtml @@ -26,7 +26,10 @@ if (! isset($backend)) { $reducible = $this->hasPermission('config/authentication/groups/remove') && $backend instanceof Reducible; } -if (count($groups) > 0): ?> +$firstRow = true; +foreach ($groups as $group): ?> + + @@ -37,7 +40,7 @@ if (count($groups) > 0): ?> - + - + +hasResult()): ?>
qlink($group->group_name, 'group/show', array( 'backend' => $backend->getName(), @@ -62,7 +65,8 @@ if (count($groups) > 0): ?>
From d78f69368cad2c06cd5cb6393276c4c3723ee406 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 3 Aug 2015 16:19:00 +0200 Subject: [PATCH 14/18] Users: Use $query->hasResult() instead of $query->count() refs #9632 --- application/views/scripts/user/list.phtml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/application/views/scripts/user/list.phtml b/application/views/scripts/user/list.phtml index 3430f7f4b..5d8d7b017 100644 --- a/application/views/scripts/user/list.phtml +++ b/application/views/scripts/user/list.phtml @@ -26,7 +26,10 @@ if (! isset($backend)) { $reducible = $this->hasPermission('config/authentication/users/remove') && $backend instanceof Reducible; } -if (count($users) > 0): ?> +$firstRow = true; +foreach ($users as $user): ?> + + @@ -37,7 +40,7 @@ if (count($users) > 0): ?> - + - + +hasResult()): ?>
qlink($user->user_name, 'user/show', array( 'backend' => $backend->getName(), @@ -62,7 +65,8 @@ if (count($users) > 0): ?>
From 3b36009122aa10e9f405848db6f249465c0424e0 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 3 Aug 2015 16:28:25 +0200 Subject: [PATCH 15/18] Group: Use $query->hasResult() instead of $query->count() refs #9632 --- application/views/scripts/group/show.phtml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/application/views/scripts/group/show.phtml b/application/views/scripts/group/show.phtml index ed5c747d5..725f22a27 100644 --- a/application/views/scripts/group/show.phtml +++ b/application/views/scripts/group/show.phtml @@ -49,7 +49,12 @@ if ($this->hasPermission('config/authentication/groups/edit') && $backend instan
- 0): ?> + + + @@ -60,7 +65,7 @@ if ($this->hasPermission('config/authentication/groups/edit') && $backend instan - + @@ -69,7 +74,8 @@ if ($this->hasPermission('config/authentication/groups/edit') && $backend instan - + +hasResult()): ?>
escape($member->user_name); ?>
From 7bd8b4b19a6e4157f885a8c12db2b9caa79c4397 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 3 Aug 2015 16:28:43 +0200 Subject: [PATCH 16/18] User: Use $query->hasResult() instead of $query->count() refs #9632 --- application/views/scripts/user/show.phtml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/application/views/scripts/user/show.phtml b/application/views/scripts/user/show.phtml index b592bd64c..a5b9850e1 100644 --- a/application/views/scripts/user/show.phtml +++ b/application/views/scripts/user/show.phtml @@ -52,7 +52,12 @@ if ($this->hasPermission('config/authentication/users/edit') && $backend instanc
- 0): ?> + + + @@ -61,7 +66,7 @@ if ($this->hasPermission('config/authentication/users/edit') && $backend instanc - + - + +hasResult()): ?>
hasPermission('config/authentication/groups/show') && $membership->backend instanceof Selectable): ?> @@ -86,7 +91,8 @@ if ($this->hasPermission('config/authentication/users/edit') && $backend instanc
From 54590bfaf175c4736db605c4bf7c3e18da4d4f14 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 3 Aug 2015 16:34:50 +0200 Subject: [PATCH 17/18] Host History: Use $query->hasResult() instead of $query->count() refs #9632 --- .../views/scripts/host/history.phtml | 41 ++++++++----------- 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/modules/monitoring/application/views/scripts/host/history.phtml b/modules/monitoring/application/views/scripts/host/history.phtml index 36d43ee95..cd030f263 100644 --- a/modules/monitoring/application/views/scripts/host/history.phtml +++ b/modules/monitoring/application/views/scripts/host/history.phtml @@ -2,6 +2,19 @@ use Icinga\Module\Monitoring\Object\Host; 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; if (! $this->compact): ?> @@ -16,29 +29,6 @@ if (! $this->compact): ?>
-translate('No history events found matching the filter') . '
'; - return; -} -?> - -qlink( - $contact, - 'monitoring/show/contact', - array('contact_name' => $contact), - array('title' => sprintf($view->translate('Show detailed information about %s'), $contact)) - ); - } - return '[' . implode(', ', $links) . ']'; -} -?> - @@ -152,7 +142,10 @@ $output = $this->tickets ? preg_replace_callback( - +
+hasResult()): ?> + translate('No history events found matching the filter'); ?> + From 2de761d8ec34913733e72706a6d217833bece005 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 3 Aug 2015 16:35:17 +0200 Subject: [PATCH 18/18] Service History: Use $query->hasResult() instead of $query->count() refs #9632 --- .../views/scripts/service/history.phtml | 41 ++++++++----------- 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/modules/monitoring/application/views/scripts/service/history.phtml b/modules/monitoring/application/views/scripts/service/history.phtml index ac443c370..98e9bb408 100644 --- a/modules/monitoring/application/views/scripts/service/history.phtml +++ b/modules/monitoring/application/views/scripts/service/history.phtml @@ -1,6 +1,19 @@ 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; if (! $this->compact): ?> @@ -15,29 +28,6 @@ if (! $this->compact): ?>
-translate('No history events found matching the filter') . '
'; - return; -} -?> - -qlink( - $contact, - 'monitoring/show/contact', - array('contact_name' => $contact), - array('title' => sprintf($view->translate('Show detailed information about %s'), $contact)) - ); - } - return '[' . implode(', ', $links) . ']'; -} -?> - @@ -134,7 +124,10 @@ $output = $this->tickets ? preg_replace_callback( - +
+hasResult()): ?> + translate('No history events found matching the filter'); ?> + \ No newline at end of file