Object forms: group check execution elements

This commit is contained in:
Thomas Gelf 2015-07-31 16:59:56 +02:00
parent 1456662023
commit 80fe9ccc11
3 changed files with 11 additions and 15 deletions

View File

@ -43,7 +43,7 @@ class IcingaHostForm extends DirectorObjectForm
'description' => $this->translate('Usually your hosts main IPv6 address')
));
$this->addCheckCommandElement()->addCheckFlagElements();
$this->addCheckExecutionElements();
} else {
$this->getElement('imports')->setRequired();
}

View File

@ -21,8 +21,7 @@ class IcingaServiceForm extends DirectorObjectForm
$this->addImportsElement();
if ($this->isTemplate()) {
$this->addCheckCommandElement()
->addCheckFlagElements();
$this->addCheckExecutionElements();
}
}
}

View File

@ -464,17 +464,6 @@ abstract class DirectorObjectForm extends QuickForm
return $this;
}
protected function addCheckCommandElement()
{
$this->addElement('select', 'check_command_id', array(
'label' => $this->translate('Check command'),
'description' => $this->translate('Check command definition'),
'multiOptions' => $this->optionalEnum($this->db->enumCheckCommands())
));
return $this;
}
protected function addImportsElement()
{
$this->addElement('multiselect', 'imports', array(
@ -487,8 +476,16 @@ abstract class DirectorObjectForm extends QuickForm
return $this;
}
protected function addCheckFlagElements()
protected function addCheckExecutionElements()
{
$this->addHtml('<h3>Check execution</h3>');
$this->addElement('select', 'check_command_id', array(
'label' => $this->translate('Check command'),
'description' => $this->translate('Check command definition'),
'multiOptions' => $this->optionalEnum($this->db->enumCheckCommands())
));
$this->optionalBoolean(
'enable_active_checks',
$this->translate('Execute active checks'),