From 5f19ec1b2e5d02325268da114ca903f5d140bf80 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:13:22 +0200 Subject: [PATCH] list/downtimes: Ensure dashboard compliance refs #7876 --- .../controllers/ListController.php | 8 +++-- .../views/scripts/list/downtimes.phtml | 32 ++++++++----------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index e69c9034f..f1f758e9c 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -250,8 +250,10 @@ class Monitoring_ListController extends Controller if ($url = $this->hasBetterUrl()) { return $this->redirectNow($url); } + $this->addTitleTab('downtimes', $this->translate('Downtimes'), $this->translate('List downtimes')); $this->setAutorefreshInterval(12); + $query = $this->backend->select()->from('downtime', array( 'id' => 'downtime_internal_id', 'objecttype' => 'downtime_objecttype', @@ -273,9 +275,11 @@ class Monitoring_ListController extends Controller 'host_display_name', 'service_display_name' )); - $this->filterQuery($query); + $this->view->downtimes = $query->paginate(); + $this->setupLimitControl(); + $this->setupPaginationControl($this->view->downtimes); $this->setupSortControl(array( 'downtime_is_in_effect' => $this->translate('Is In Effect'), 'host_display_name' => $this->translate('Host'), @@ -289,8 +293,6 @@ class Monitoring_ListController extends Controller 'downtime_duration' => $this->translate('Duration') )); - $this->view->downtimes = $query->paginate(); - if ($this->Auth()->hasPermission('monitoring/command/downtime/delete')) { $this->view->delDowntimeForm = new DeleteDowntimeCommandForm(); } diff --git a/modules/monitoring/application/views/scripts/list/downtimes.phtml b/modules/monitoring/application/views/scripts/list/downtimes.phtml index 2387e9487..b279d4063 100644 --- a/modules/monitoring/application/views/scripts/list/downtimes.phtml +++ b/modules/monitoring/application/views/scripts/list/downtimes.phtml @@ -1,30 +1,24 @@ - -compact): ?> +if (! $this->compact): ?>
- tabs->render($this); ?> -
- translate('Sort by'); ?> sortControl->render($this); ?> - filterEditor): ?> - filterPreview ?> - -
- widget('limiter', array('url' => $this->url, 'max' => $downtimes->count())); ?> - paginationControl($downtimes, null, null, array('preserve' => $this->preserve)); ?> + tabs; ?> + sortBox; ?> + limiter; ?> + paginator; ?> + filterEditor; ?>
-
-filterEditor ?> - - translate('No active downtimes'); ?> -
- +translate('No downtimes found matching the filter') . ''; + return; +} +?>