IcingaCommandForm: allow to configure zones

fixes #802
This commit is contained in:
Thomas Gelf 2017-02-17 16:08:57 +01:00
parent 02f9f49c7b
commit 099eca0d0b
2 changed files with 23 additions and 3 deletions

View File

@ -70,10 +70,30 @@ class IcingaCommandForm extends DirectorObjectForm
)
));
$this->addDisabledElement();
$this->addZoneSection();
$this->setButtons();
}
protected function addZoneSection()
{
$this->addZoneElement(true);
$elements = array(
'zone_id',
);
$this->addDisplayGroup($elements, 'clustering', array(
'decorators' => array(
'FormElements',
array('HtmlTag', array('tag' => 'dl')),
'Fieldset',
),
'order' => 80,
'legend' => $this->translate('Zone settings')
));
return $this;
}
protected function enumAllowedTemplates()
{
$object = $this->object();

View File

@ -935,9 +935,9 @@ abstract class DirectorObjectForm extends QuickForm
return ! $this->valueIsEmpty($this->getSentOrObjectValue('object_type'));
}
protected function addZoneElement()
protected function addZoneElement($all = false)
{
if ($this->isTemplate()) {
if ($all || $this->isTemplate()) {
$zones = $this->db->enumZones();
} else {
$zones = $this->db->enumNonglobalZones();