mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Added a few columns to Ido\ContactgroupQuery, fixed joins
This commit is contained in:
parent
23235e4513
commit
521ef8cc47
@ -11,11 +11,30 @@ class ContactgroupQuery extends AbstractQuery
|
|||||||
),
|
),
|
||||||
'contacts' => array(
|
'contacts' => array(
|
||||||
'contact_name' => '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(
|
'hosts' => array(
|
||||||
|
'host_object_id' => 'ho.object_id',
|
||||||
'host_name' => 'ho.name1',
|
'host_name' => 'ho.name1',
|
||||||
),
|
),
|
||||||
'services' => array(
|
'services' => array(
|
||||||
|
'service_object_id' => 'so.object_id',
|
||||||
'service_host_name' => 'so.name1 COLLATE latin1_general_ci',
|
'service_host_name' => 'so.name1 COLLATE latin1_general_ci',
|
||||||
'service_description' => 'so.name2 COLLATE latin1_general_ci',
|
'service_description' => 'so.name2 COLLATE latin1_general_ci',
|
||||||
)
|
)
|
||||||
@ -38,7 +57,7 @@ class ContactgroupQuery extends AbstractQuery
|
|||||||
|
|
||||||
protected function joinContacts()
|
protected function joinContacts()
|
||||||
{
|
{
|
||||||
$this->baseQuery->join(
|
$this->baseQuery->distinct()->join(
|
||||||
array('cgm' => $this->prefix . 'contactgroup_members'),
|
array('cgm' => $this->prefix . 'contactgroup_members'),
|
||||||
'cgm.contactgroup_id = cg.contactgroup_id',
|
'cgm.contactgroup_id = cg.contactgroup_id',
|
||||||
array()
|
array()
|
||||||
@ -46,12 +65,16 @@ class ContactgroupQuery extends AbstractQuery
|
|||||||
array('co' => $this->prefix . 'objects'),
|
array('co' => $this->prefix . 'objects'),
|
||||||
'cgm.contact_object_id = co.object_id AND co.is_active = 1',
|
'cgm.contact_object_id = co.object_id AND co.is_active = 1',
|
||||||
array()
|
array()
|
||||||
|
)->join(
|
||||||
|
array('c' => $this->prefix . 'contacts'),
|
||||||
|
'c.contact_object_id = co.object_id',
|
||||||
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function joinHosts()
|
protected function joinHosts()
|
||||||
{
|
{
|
||||||
$this->baseQuery->join(
|
$this->baseQuery->distinct()->join(
|
||||||
array('hcg' => $this->prefix . 'host_contactgroups'),
|
array('hcg' => $this->prefix . 'host_contactgroups'),
|
||||||
'hcg.contactgroup_object_id = cg.contactgroup_object_id',
|
'hcg.contactgroup_object_id = cg.contactgroup_object_id',
|
||||||
array()
|
array()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user