diff --git a/application/controllers/ServicesetController.php b/application/controllers/ServicesetController.php index 2f230f1a..dbafac33 100644 --- a/application/controllers/ServicesetController.php +++ b/application/controllers/ServicesetController.php @@ -19,6 +19,16 @@ class ServicesetController extends ObjectController parent::init(); } + public function loadForm($name) + { + $form = parent::loadForm($name); + if ($name === 'icingaServiceSet' && $this->host) { + $form->setHost($this->host); + } + + return $form; + } + protected function loadObject() { if ($this->object === null) { diff --git a/application/tables/IcingaServiceSetTable.php b/application/tables/IcingaServiceSetTable.php index bd612d56..5a33b7b8 100644 --- a/application/tables/IcingaServiceSetTable.php +++ b/application/tables/IcingaServiceSetTable.php @@ -50,7 +50,7 @@ class IcingaServiceSetTable extends IcingaObjectTable array('h' => 'icinga_host'), 'h.id = sset.host_id', array() - )->order('sset.object_name'); + )->where('sset.object_type = ?', 'template')->order('sset.object_name'); return $query; } diff --git a/library/Director/Objects/IcingaObjectMultiRelations.php b/library/Director/Objects/IcingaObjectMultiRelations.php index 5a5593a6..5413d75a 100644 --- a/library/Director/Objects/IcingaObjectMultiRelations.php +++ b/library/Director/Objects/IcingaObjectMultiRelations.php @@ -40,6 +40,11 @@ class IcingaObjectMultiRelations implements Iterator, Countable, IcingaConfigRen $this->relatedObjectClass = $relatedObjectClass; } + public function getObjects() + { + return $this->relations; + } + public function count() { return count($this->relations);