From ab628338c2ecfc6a9ab3dc40be0f8659322565c4 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 25 Aug 2015 16:32:15 +0200 Subject: [PATCH] ContactgroupQuery: Add query column `instance_name' refs #9943 --- .../Backend/Ido/Query/ContactgroupQuery.php | 15 +++++++++++++++ .../library/Monitoring/DataView/Contactgroup.php | 1 + 2 files changed, 16 insertions(+) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php index 83934d811..fe552894c 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php @@ -17,6 +17,9 @@ class ContactgroupQuery extends IdoQuery * {@inheritdoc} */ protected $columnMap = array( + 'instances' => array( + 'instance_name' => 'i.instance_name' + ), 'contactgroups' => array( 'contactgroup' => 'cgo.name1 COLLATE latin1_general_ci', 'contactgroup_name' => 'cgo.name1', @@ -187,6 +190,18 @@ class ContactgroupQuery extends IdoQuery ); } + /** + * Join instances + */ + protected function joinInstances() + { + $this->select->join( + array('i' => $this->prefix . 'instances'), + 'i.instance_id = cg.instance_id', + array() + ); + } + /** * {@inheritdoc} */ diff --git a/modules/monitoring/library/Monitoring/DataView/Contactgroup.php b/modules/monitoring/library/Monitoring/DataView/Contactgroup.php index fa1c9b863..994879c59 100644 --- a/modules/monitoring/library/Monitoring/DataView/Contactgroup.php +++ b/modules/monitoring/library/Monitoring/DataView/Contactgroup.php @@ -11,6 +11,7 @@ class Contactgroup extends DataView public function getColumns() { return array( + 'instance_name', 'contactgroup_name', 'contactgroup_alias', 'contact_object_id',