From bf92f9fa85476450e898333293da3c49575f2e0b Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Mon, 29 Dec 2014 12:25:41 +0100 Subject: [PATCH] monitoring: Fix the link to services in downtime when multiple services are selected --- .../application/controllers/ServicesController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/application/controllers/ServicesController.php b/modules/monitoring/application/controllers/ServicesController.php index fdc040d29..4d08622c2 100644 --- a/modules/monitoring/application/controllers/ServicesController.php +++ b/modules/monitoring/application/controllers/ServicesController.php @@ -77,6 +77,7 @@ class Monitoring_ServicesController extends Controller $unhandledFilterExpressions = array(); $acknowledgedObjects = array(); $objectsInDowntime = array(); + $downtimeFilterExpressions = array(); $serviceStates = array( Service::getStateText(Service::STATE_OK) => 0, Service::getStateText(Service::STATE_WARNING) => 0, @@ -105,6 +106,10 @@ class Monitoring_ServicesController extends Controller } if ((bool) $service->in_downtime === true) { $objectsInDowntime[] = $service; + $downtimeFilterExpressions[] = Filter::matchAll( + Filter::where('downtime_host', $service->getHost()->getName()), + Filter::where('downtime_service', $service->getName()) + ); } ++$serviceStates[$service::getStateText($service->state)]; if (! isset($knownHostStates[$service->getHost()->getName()])) { @@ -137,8 +142,8 @@ class Monitoring_ServicesController 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->serviceStatesPieChart = $this->createPieChart(