mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 15:54:03 +02:00
parent
8ec494c962
commit
4f42da49a8
@ -125,7 +125,6 @@ class ServicenotificationQuery extends IdoQuery
|
|||||||
protected function joinHistory()
|
protected function joinHistory()
|
||||||
{
|
{
|
||||||
$this->requireVirtualTable('contactnotifications');
|
$this->requireVirtualTable('contactnotifications');
|
||||||
$this->group(array('sn.notification_id', 'so.name2', 'so.name1'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -143,7 +142,6 @@ class ServicenotificationQuery extends IdoQuery
|
|||||||
'cno.object_id = cn.contact_object_id',
|
'cno.object_id = cn.contact_object_id',
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
$this->group(array('cn.contactnotification_id', 'so.name2', 'so.name1'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -177,10 +175,6 @@ class ServicenotificationQuery extends IdoQuery
|
|||||||
'hgo.object_id = hg.hostgroup_object_id AND hgo.is_active = 1 AND hgo.objecttype_id = 3',
|
'hgo.object_id = hg.hostgroup_object_id AND hgo.is_active = 1 AND hgo.objecttype_id = 3',
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (! $this->hasJoinedVirtualTable('contactnotifications') && !$this->hasJoinedVirtualTable('history')) {
|
|
||||||
$this->group(array('sn.notification_id', 'so.name2', 'so.name1'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -214,10 +208,6 @@ class ServicenotificationQuery extends IdoQuery
|
|||||||
'sgo.object_id = sg.servicegroup_object_id AND sgo.is_active = 1 AND sgo.objecttype_id = 4',
|
'sgo.object_id = sg.servicegroup_object_id AND sgo.is_active = 1 AND sgo.objecttype_id = 4',
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (! $this->hasJoinedVirtualTable('contactnotifications') && !$this->hasJoinedVirtualTable('history')) {
|
|
||||||
$this->group(array('sn.notification_id', 'so.name2', 'so.name1'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -231,4 +221,40 @@ class ServicenotificationQuery extends IdoQuery
|
|||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getGroup()
|
||||||
|
{
|
||||||
|
$group = array();
|
||||||
|
if (
|
||||||
|
$this->hasJoinedVirtualTable('history')
|
||||||
|
|| $this->hasJoinedVirtualTable('hostgroups')
|
||||||
|
|| $this->hasJoinedVirtualTable('servicegroups')
|
||||||
|
) {
|
||||||
|
$group = array('sn.notification_id', 'so.object_id');
|
||||||
|
if ($this->hasJoinedVirtualTable('contactnotifications') && !$this->hasJoinedVirtualTable('history')) {
|
||||||
|
$group[] = 'cno.object_id';
|
||||||
|
}
|
||||||
|
} elseif ($this->hasJoinedVirtualTable('contactnotifications')) {
|
||||||
|
$group = array('sn.notification_id', 'cno.object_id', 'so.object_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($group)) {
|
||||||
|
if ($this->hasJoinedVirtualTable('hosts')) {
|
||||||
|
$group[] = 'h.host_id';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->hasJoinedVirtualTable('services')) {
|
||||||
|
$group[] = 's.service_id';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->hasJoinedVirtualTable('acknowledgements')) {
|
||||||
|
$group[] = 'a.acknowledgement_id';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $group;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user