From 20b25e656be03a4258316f5ae9b48418ea35288c Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Thu, 23 Apr 2015 12:19:58 +0200 Subject: [PATCH] Show better error message for unknown downtimes refs #8902 --- .../application/controllers/DowntimeController.php | 4 +++- .../application/views/scripts/downtime/show.phtml | 6 ++++++ .../application/views/scripts/list/downtimes.phtml | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/application/controllers/DowntimeController.php b/modules/monitoring/application/controllers/DowntimeController.php index 32c183ba17..37f466807e 100644 --- a/modules/monitoring/application/controllers/DowntimeController.php +++ b/modules/monitoring/application/controllers/DowntimeController.php @@ -76,12 +76,14 @@ public function init() 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) ? Service::getStateText($this->downtime->service_state) : Host::getStateText($this->downtime->host_state); - $this->view->delDowntimeForm = $this->createDelDowntimeForm(); $this->view->listAllLink = Url::fromPath('monitoring/list/downtimes'); $this->view->showHostLink = Url::fromPath('monitoring/host/show') diff --git a/modules/monitoring/application/views/scripts/downtime/show.phtml b/modules/monitoring/application/views/scripts/downtime/show.phtml index 34751cd7c8..ddc91eeeba 100644 --- a/modules/monitoring/application/views/scripts/downtime/show.phtml +++ b/modules/monitoring/application/views/scripts/downtime/show.phtml @@ -1,4 +1,10 @@
+ + translate('No scheduled downtime matching the filter.') ?> +
+ + + compact): ?> tabs; ?> diff --git a/modules/monitoring/application/views/scripts/list/downtimes.phtml b/modules/monitoring/application/views/scripts/list/downtimes.phtml index 2dd62761ea..b21e3c3fbf 100644 --- a/modules/monitoring/application/views/scripts/list/downtimes.phtml +++ b/modules/monitoring/application/views/scripts/list/downtimes.phtml @@ -15,7 +15,8 @@ if (! $this->compact): ?> translate('No downtimes found matching the filter') . ''; + echo $this->translate('No downtimes found matching the filter,' + . ' maybe the downtime already expired.') . ''; return; } ?>