From 42e73b866bad44f291e6e16a9a46f13d2fd3669a Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 21 Aug 2013 00:44:50 +0200 Subject: [PATCH] Slight changes in the ListController... more tbd --- .../controllers/ListController.php | 51 ++++++++++++++++++- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index 515a4f3c4..50e49b0d7 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -162,6 +162,49 @@ class Monitoring_ListController extends ActionController 'host_name' => 'Host Name', 'host_address' => 'Host Address', 'host_last_check' => 'Last Host Check' + )); + + $this->inheritCurrentSortColumn(); + } + + /** + * Display hostgroup list + * + * @TODO Implement hostgroup overview (feature #4184) + */ + public function hostgroupsAction() + { + $this->view->hostgroups = $this->query('hostgroup', array( + 'hostgroup_name', + 'hostgroup_alias', + )); + } + + /** + * Display servicegroup list + * + * @TODO Implement servicegroup overview (feature #4185) + */ + public function servicegroupsAction() + { + $this->view->servicegroups = $this->backend->select() + ->from('servicegroup', array( + 'servicegroup_name', + 'servicegroup_alias', + )); + } + + /** + * Display contactgroups overview + * + * + */ + public function contactgroupsAction() + { + $this->view->contactgroups = $this->query('contactgroup', array( + 'contactgroup_name', + 'contactgroup_alias', +>>>>>>> Slight changes in the ListController... more tbd )); } @@ -244,10 +287,14 @@ class Monitoring_ListController extends ActionController -1, PREG_SPLIT_NO_EMPTY ); - + if (empty($extra)) { + $cols = $columns; + } else { + $cols = array_merge($columns, $extra); + } $this->view->extraColumns = $extra; $query = $this->backend->select() - ->from($view, array_merge($columns, $extra)) + ->from($view, $cols) ->applyRequest($this->_request); $this->handleFormatRequest($query); return $query;