diff --git a/modules/monitoring/application/controllers/DowntimeController.php b/modules/monitoring/application/controllers/DowntimeController.php index 37f466807..26a88ae3b 100644 --- a/modules/monitoring/application/controllers/DowntimeController.php +++ b/modules/monitoring/application/controllers/DowntimeController.php @@ -54,6 +54,10 @@ class Monitoring_DowntimeController extends Controller 'service_display_name' ))->where('downtime_internal_id', $downtimeId)->getQuery()->fetchRow(); + if (false === $this->downtime) { + throw new Zend_Controller_Action_Exception($this->translate('Downtime not found')); + } + if (isset($this->downtime->service_description)) { $this->isService = true; } else { @@ -76,9 +80,6 @@ class Monitoring_DowntimeController extends Controller public function showAction() { - if (false === $this->downtime) { - return; - } $this->view->downtime = $this->downtime; $this->view->isService = $this->isService; $this->view->stateName = isset($this->downtime->service_description) ? diff --git a/modules/monitoring/application/controllers/DowntimesController.php b/modules/monitoring/application/controllers/DowntimesController.php index eec408110..fe4e9f5bb 100644 --- a/modules/monitoring/application/controllers/DowntimesController.php +++ b/modules/monitoring/application/controllers/DowntimesController.php @@ -58,6 +58,12 @@ class Monitoring_DowntimesController extends Controller 'host_display_name', 'service_display_name' ))->addFilter($this->filter)->getQuery()->fetchAll(); + if (false === $this->downtimes) { + throw new Zend_Controller_Action_Exception( + $this->translate('Downtime not found') + ); + } + $this->getTabs() ->add( 'downtimes', diff --git a/modules/monitoring/application/views/scripts/downtime/show.phtml b/modules/monitoring/application/views/scripts/downtime/show.phtml index ade9495b0..6ecc11a7b 100644 --- a/modules/monitoring/application/views/scripts/downtime/show.phtml +++ b/modules/monitoring/application/views/scripts/downtime/show.phtml @@ -1,13 +1,7 @@ -