diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatusQuery.php index e4cadaab1..9fb5fb3df 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatusQuery.php @@ -27,6 +27,9 @@ class ServicestatusQuery extends IdoQuery * {@inheritdoc} */ protected $columnMap = array( + 'checktimeperiods' => array( + 'service_check_timeperiod' => 'ctp.alias COLLATE latin1_general_ci' + ), 'hostgroups' => array( 'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci', 'hostgroup_alias' => 'hg.alias COLLATE latin1_general_ci', @@ -277,9 +280,6 @@ class ServicestatusQuery extends IdoQuery 'service_state_type' => 'ss.state_type', 'service_status_update_time' => 'ss.status_update_time', 'service_unhandled' => 'CASE WHEN (ss.problem_has_been_acknowledged + ss.scheduled_downtime_depth + COALESCE(hs.current_state, 0)) = 0 THEN 1 ELSE 0 END' - ), - 'checktimeperiods' => array( - 'service_check_timeperiod' => 'ctp.alias COLLATE latin1_general_ci' ) ); @@ -308,6 +308,18 @@ class ServicestatusQuery extends IdoQuery $this->joinedVirtualTables['services'] = true; } + /** + * Join check time periods + */ + protected function joinChecktimeperiods() + { + $this->select->joinLeft( + array('ctp' => $this->prefix . 'timeperiods'), + 'ctp.timeperiod_object_id = s.check_timeperiod_object_id', + array() + ); + } + /** * Join host groups */ @@ -397,15 +409,6 @@ class ServicestatusQuery extends IdoQuery ); } - protected function joinChecktimeperiods() - { - $this->select->joinLeft( - array('ctp' => $this->prefix . 'timeperiods'), - 'ctp.timeperiod_object_id = s.check_timeperiod_object_id', - array() - ); - } - /** * {@inheritdoc} */