From 2126b8c3411fc220eec756dbf898a6d0819eaf7b Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 7 Oct 2014 13:21:28 +0200 Subject: [PATCH] monitoring: Fix link to an object's contact in the detail views --- .../scripts/show/components/contacts.phtml | 4 +- .../Backend/Ido/Query/ContactgroupQuery.php | 54 +++++++++---------- .../library/Monitoring/DataView/Contact.php | 1 + .../Monitoring/DataView/Contactgroup.php | 2 + 4 files changed, 32 insertions(+), 29 deletions(-) diff --git a/modules/monitoring/application/views/scripts/show/components/contacts.phtml b/modules/monitoring/application/views/scripts/show/components/contacts.phtml index 550c87e12..5cb0a1d51 100644 --- a/modules/monitoring/application/views/scripts/show/components/contacts.phtml +++ b/modules/monitoring/application/views/scripts/show/components/contacts.phtml @@ -5,7 +5,7 @@ if (! empty($object->contacts)) { $list = array(); foreach ($object->contacts as $contact) { $list[] = $this->qlink($contact->contact_alias, 'monitoring/show/contact', array( - 'contact_name' => $contact->contact_name + 'contact' => $contact->contact_name )); } @@ -24,7 +24,7 @@ if (! empty($object->contactgroups)) { $list[] = $this->qlink( $contactgroup->contactgroup_alias, 'monitoring/list/contactgroups', - array('contactgroup_name' => $contactgroup->contactgroup_name) + array('contactgroup' => $contactgroup->contactgroup_name) ); } diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php index aef50ebdb..346f2458a 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php @@ -8,39 +8,39 @@ class ContactgroupQuery extends IdoQuery { protected $columnMap = array( 'contactgroups' => array( - 'contactgroup_name' => 'cgo.name1 COLLATE latin1_general_ci', - 'contactgroup_alias' => 'cg.alias', + 'contactgroup' => 'cgo.name1 COLLATE latin1_general_ci', + 'contactgroup_name' => 'cgo.name1 COLLATE latin1_general_ci', + 'contactgroup_alias' => 'cg.alias', ), 'contacts' => array( - 'contact_name' => 'co.name1 COLLATE latin1_general_ci', - 'contact_alias' => 'c.alias', - 'contact_email' => 'c.email_address', - 'contact_pager' => 'c.pager_address', - 'contact_has_host_notfications' => 'c.host_notifications_enabled', - 'contact_has_service_notfications' => 'c.service_notifications_enabled', - 'contact_can_submit_commands' => 'c.can_submit_commands', - 'contact_notify_service_recovery' => 'c.notify_service_recovery', - 'contact_notify_service_warning' => 'c.notify_service_warning', - 'contact_notify_service_critical' => 'c.notify_service_critical', - 'contact_notify_service_unknown' => 'c.notify_service_unknown', - 'contact_notify_service_flapping' => 'c.notify_service_flapping', - 'contact_notify_service_downtime' => 'c.notify_service_recovery', - 'contact_notify_host_recovery' => 'c.notify_host_recovery', - 'contact_notify_host_down' => 'c.notify_host_down', - 'contact_notify_host_unreachable' => 'c.notify_host_unreachable', - 'contact_notify_host_flapping' => 'c.notify_host_flapping', - 'contact_notify_host_downtime' => 'c.notify_host_downtime', + 'contact' => 'co.name1 COLLATE latin1_general_ci', + 'contact_name' => 'co.name1 COLLATE latin1_general_ci', + 'contact_alias' => 'c.alias', + 'contact_email' => 'c.email_address', + 'contact_pager' => 'c.pager_address', + 'contact_has_host_notfications' => 'c.host_notifications_enabled', + 'contact_has_service_notfications' => 'c.service_notifications_enabled', + 'contact_can_submit_commands' => 'c.can_submit_commands', + 'contact_notify_service_recovery' => 'c.notify_service_recovery', + 'contact_notify_service_warning' => 'c.notify_service_warning', + 'contact_notify_service_critical' => 'c.notify_service_critical', + 'contact_notify_service_unknown' => 'c.notify_service_unknown', + 'contact_notify_service_flapping' => 'c.notify_service_flapping', + 'contact_notify_service_downtime' => 'c.notify_service_recovery', + 'contact_notify_host_recovery' => 'c.notify_host_recovery', + 'contact_notify_host_down' => 'c.notify_host_down', + 'contact_notify_host_unreachable' => 'c.notify_host_unreachable', + 'contact_notify_host_flapping' => 'c.notify_host_flapping', + 'contact_notify_host_downtime' => 'c.notify_host_downtime', ), 'hosts' => array( - 'host_object_id' => 'ho.object_id', - 'host_name' => 'ho.name1', - 'host' => 'ho.name1' + 'host' => 'ho.name1', + 'host_name' => 'ho.name1' ), 'services' => array( - 'service_object_id' => 'so.object_id', - 'service_host_name' => 'so.name1 COLLATE latin1_general_ci', - 'service' => 'so.name2 COLLATE latin1_general_ci', - 'service_description' => 'so.name2 COLLATE latin1_general_ci', + 'service' => 'so.name2 COLLATE latin1_general_ci', + 'service_description' => 'so.name2 COLLATE latin1_general_ci', + 'service_host_name' => 'so.name1 COLLATE latin1_general_ci' ) ); diff --git a/modules/monitoring/library/Monitoring/DataView/Contact.php b/modules/monitoring/library/Monitoring/DataView/Contact.php index 9f78a3b6a..27639b0c6 100644 --- a/modules/monitoring/library/Monitoring/DataView/Contact.php +++ b/modules/monitoring/library/Monitoring/DataView/Contact.php @@ -18,6 +18,7 @@ class Contact extends DataView public function getColumns() { return array( + 'contact', 'contact_name', 'contact_alias', 'contact_email', diff --git a/modules/monitoring/library/Monitoring/DataView/Contactgroup.php b/modules/monitoring/library/Monitoring/DataView/Contactgroup.php index 870a5407b..7dd7a1cd4 100644 --- a/modules/monitoring/library/Monitoring/DataView/Contactgroup.php +++ b/modules/monitoring/library/Monitoring/DataView/Contactgroup.php @@ -18,7 +18,9 @@ class Contactgroup extends DataView public function getColumns() { return array( + 'contact', 'contact_name', + 'contactgroup', 'contactgroup_name', 'contactgroup_alias', 'host',