IcingaServiceSet: improve work with imports
This commit is contained in:
parent
1724a78da5
commit
7f34e4bdf3
|
@ -19,6 +19,16 @@ class ServicesetController extends ObjectController
|
||||||
parent::init();
|
parent::init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function loadForm($name)
|
||||||
|
{
|
||||||
|
$form = parent::loadForm($name);
|
||||||
|
if ($name === 'icingaServiceSet' && $this->host) {
|
||||||
|
$form->setHost($this->host);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $form;
|
||||||
|
}
|
||||||
|
|
||||||
protected function loadObject()
|
protected function loadObject()
|
||||||
{
|
{
|
||||||
if ($this->object === null) {
|
if ($this->object === null) {
|
||||||
|
|
|
@ -50,7 +50,7 @@ class IcingaServiceSetTable extends IcingaObjectTable
|
||||||
array('h' => 'icinga_host'),
|
array('h' => 'icinga_host'),
|
||||||
'h.id = sset.host_id',
|
'h.id = sset.host_id',
|
||||||
array()
|
array()
|
||||||
)->order('sset.object_name');
|
)->where('sset.object_type = ?', 'template')->order('sset.object_name');
|
||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,11 @@ class IcingaObjectMultiRelations implements Iterator, Countable, IcingaConfigRen
|
||||||
$this->relatedObjectClass = $relatedObjectClass;
|
$this->relatedObjectClass = $relatedObjectClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getObjects()
|
||||||
|
{
|
||||||
|
return $this->relations;
|
||||||
|
}
|
||||||
|
|
||||||
public function count()
|
public function count()
|
||||||
{
|
{
|
||||||
return count($this->relations);
|
return count($this->relations);
|
||||||
|
|
Loading…
Reference in New Issue