From 78a6937c221c207b2ac01394c7314f80131b2e5b Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 22 Jan 2015 14:33:09 +0100 Subject: [PATCH] Drop Zend_View_Helper_MonitoringState It's not required anymore... finally. --- .../views/helpers/MonitoringState.php | 108 ------------------ .../views/scripts/alertsummary/index.phtml | 3 - .../views/scripts/list/contacts.phtml | 4 - .../views/scripts/list/hosts.phtml | 2 - .../views/scripts/list/services.phtml | 3 - 5 files changed, 120 deletions(-) delete mode 100644 modules/monitoring/application/views/helpers/MonitoringState.php diff --git a/modules/monitoring/application/views/helpers/MonitoringState.php b/modules/monitoring/application/views/helpers/MonitoringState.php deleted file mode 100644 index 13bd93ea7..000000000 --- a/modules/monitoring/application/views/helpers/MonitoringState.php +++ /dev/null @@ -1,108 +0,0 @@ - 'pending', null => 'pending'); - private $hoststates = array('up', 'down', 'unreachable', 99 => 'pending', null => 'pending'); - - /** - * @deprecated Not used anywhere. - */ - public function monitoringState($object, $type = 'service') - { - if ($type === 'service') { - return $this->servicestates[$object->service_state]; - } elseif ($type === 'host') { - return $this->hoststates[$object->host_state]; - } - } - - /** - * @deprecated Not used anywhere. - */ - public function monitoringStateById($id, $type = 'service') - { - if ($type === 'service') { - return $this->servicestates[$id]; - } elseif ($type === 'host') { - return $this->hoststates[$id]; - } - } - - /** - * @deprecated Monitoring colors are clustered. - */ - public function getServiceStateColors() - { - return array('#44bb77', '#FFCC66', '#FF5566', '#E066FF', '#77AAFF'); - } - - /** - * @deprecated Monitoring colors are clustered. - */ - public function getHostStateColors() - { - return array('#44bb77', '#FF5566', '#E066FF', '#77AAFF'); - } - - /** - * @deprecated The service object must know about it's possible states. - */ - public function getServiceStateNames() - { - return array_values($this->servicestates); - } - - /** - * @deprecated The host object must know about it's possible states. - */ - public function getHostStateNames() - { - return array_values($this->hoststates); - } - - /** - * @deprecated Not used anywhere. - */ - public function getStateFlags($object, $type = 'service') - { - $state_classes = array(); - if ($type === 'host') { - $state_classes[] = $this->monitoringState($object, "host"); - if ($object->host_acknowledged || $object->host_in_downtime) { - $state_classes[] = 'handled'; - } - if ($object->host_last_state_change > (time() - 600)) { - $state_classes[] = 'new'; - } - } else { - $state_classes[] = $this->monitoringState($object, "service"); - if ($object->service_acknowledged || $object->service_in_downtime) { - $state_classes[] = 'handled'; - } - if ($object->service_last_state_change > (time() - 600)) { - $state_classes[] = 'new'; - } - } - - return $state_classes; - } - - /** - * @deprecated Not used anywhere. - */ - public function getStateTitle($object, $type) - { - return sprintf( - '%s %s %s', - $this->view->translate(strtoupper($this->monitoringState($object, $type))), - $this->view->translate('since'), - date('Y-m-d H:i:s', $object->{$type.'_last_state_change'}) - ); - } -} diff --git a/modules/monitoring/application/views/scripts/alertsummary/index.phtml b/modules/monitoring/application/views/scripts/alertsummary/index.phtml index 624b942b3..dbfff6433 100644 --- a/modules/monitoring/application/views/scripts/alertsummary/index.phtml +++ b/modules/monitoring/application/views/scripts/alertsummary/index.phtml @@ -1,6 +1,3 @@ -getHelper('MonitoringState'); -?>
tabs ?>
diff --git a/modules/monitoring/application/views/scripts/list/contacts.phtml b/modules/monitoring/application/views/scripts/list/contacts.phtml index f6face461..d8d2a2e72 100644 --- a/modules/monitoring/application/views/scripts/list/contacts.phtml +++ b/modules/monitoring/application/views/scripts/list/contacts.phtml @@ -1,7 +1,3 @@ -getHelper('MonitoringState'); -$contactHelper = $this->getHelper('ContactFlags'); -?>
tabs ?>
diff --git a/modules/monitoring/application/views/scripts/list/hosts.phtml b/modules/monitoring/application/views/scripts/list/hosts.phtml index 4afc14731..00e357aa5 100644 --- a/modules/monitoring/application/views/scripts/list/hosts.phtml +++ b/modules/monitoring/application/views/scripts/list/hosts.phtml @@ -1,8 +1,6 @@ getHelper('MonitoringState'); - if ($this->compact): ?>
diff --git a/modules/monitoring/application/views/scripts/list/services.phtml b/modules/monitoring/application/views/scripts/list/services.phtml index 962d22bda..0e211dfa5 100644 --- a/modules/monitoring/application/views/scripts/list/services.phtml +++ b/modules/monitoring/application/views/scripts/list/services.phtml @@ -1,9 +1,6 @@ getHelper('MonitoringState'); $selfUrl = 'monitoring/list/services';