From 26bc56e9df306cea1e1937720d07c1dc5b6f519b Mon Sep 17 00:00:00 2001 From: Eric Lippmann <eric.lippmann@netways.de> Date: Mon, 29 Dec 2014 12:19:37 +0100 Subject: [PATCH] monitoring: Fix the link to hosts in downtime when multiple hosts are selected --- .../monitoring/application/controllers/HostsController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/application/controllers/HostsController.php b/modules/monitoring/application/controllers/HostsController.php index 8fe431ca2..09957a4a0 100644 --- a/modules/monitoring/application/controllers/HostsController.php +++ b/modules/monitoring/application/controllers/HostsController.php @@ -75,6 +75,7 @@ class Monitoring_HostsController extends Controller $unhandledFilterExpressions = array(); $acknowledgedObjects = array(); $objectsInDowntime = array(); + $downtimeFilterExpressions = array(); $hostStates = array( Host::getStateText(Host::STATE_UP) => 0, Host::getStateText(Host::STATE_DOWN) => 0, @@ -92,6 +93,7 @@ class Monitoring_HostsController extends Controller } if ((bool) $host->in_downtime === true) { $objectsInDowntime[] = $host; + $downtimeFilterExpressions[] = Filter::where('downtime_host', $host->getName()); } ++$hostStates[$host::getStateText($host->state)]; } @@ -117,8 +119,8 @@ class Monitoring_HostsController extends Controller ->setQueryString($unhandledFilterQueryString); $this->view->acknowledgedObjects = $acknowledgedObjects; $this->view->objectsInDowntime = $objectsInDowntime; - $this->view->inDowntimeLink = Url::fromRequest() - ->setPath('monitoring/list/downtimes'); + $this->view->inDowntimeLink = Url::fromPath('monitoring/list/downtimes') + ->setQueryString(Filter::matchAny($downtimeFilterExpressions)->toQueryString()); $this->view->havingCommentsLink = Url::fromRequest() ->setPath('monitoring/list/comments'); $this->view->hostStatesPieChart = $this->createPieChart(