monitoring: Remove applying restrictions in the detail area when not necessary

This commit is contained in:
Eric Lippmann 2015-12-22 13:00:25 +01:00
parent 9599b63a55
commit 44dd4653ec
2 changed files with 5 additions and 8 deletions

View File

@ -1,6 +1,6 @@
<?php
if (! empty($object->contacts)) {
if ($object->contacts->hasResult()) {
$list = array();
foreach ($object->contacts as $contact) {
@ -17,10 +17,9 @@ if (! empty($object->contacts)) {
$this->translate('Contacts'),
implode(', ', $list)
);
}
if (! empty($object->contactgroups)) {
if ($object->contactgroups->hasResult()) {
$list = array();
foreach ($object->contactgroups as $contactgroup) {
$list[] = $this->qlink(
@ -36,6 +35,4 @@ if (! empty($object->contactgroups)) {
$this->translate('Contactgroups'),
implode(', ', $list)
);
}

View File

@ -389,7 +389,7 @@ abstract class MonitoredObject implements Filterable
} else {
$contactsGroups->where('host_name', $this->host_name);
}
$this->contactgroups = $contactsGroups->applyFilter($this->getFilter())->getQuery()->fetchAll();
$this->contactgroups = $contactsGroups;
return $this;
}
@ -418,7 +418,7 @@ abstract class MonitoredObject implements Filterable
} else {
$contacts->where('host_name', $this->host_name);
}
$this->contacts = $contacts->applyFilter($this->getFilter())->getQuery()->fetchAll();
$this->contacts = $contacts;
return $this;
}
@ -596,7 +596,7 @@ abstract class MonitoredObject implements Filterable
$eventHistory->where('service_description', $this->service_description);
}
$this->eventhistory = $eventHistory->applyFilter($this->getFilter());
$this->eventhistory = $eventHistory;
return $this;
}