From 80fe9ccc11574947b9f105058d42092d8f5770b8 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 31 Jul 2015 16:59:56 +0200 Subject: [PATCH] Object forms: group check execution elements --- application/forms/IcingaHostForm.php | 2 +- application/forms/IcingaServiceForm.php | 3 +-- .../Director/Web/Form/DirectorObjectForm.php | 21 ++++++++----------- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/application/forms/IcingaHostForm.php b/application/forms/IcingaHostForm.php index 3620512a..e246e9ef 100644 --- a/application/forms/IcingaHostForm.php +++ b/application/forms/IcingaHostForm.php @@ -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(); } diff --git a/application/forms/IcingaServiceForm.php b/application/forms/IcingaServiceForm.php index 954d4944..3f991a15 100644 --- a/application/forms/IcingaServiceForm.php +++ b/application/forms/IcingaServiceForm.php @@ -21,8 +21,7 @@ class IcingaServiceForm extends DirectorObjectForm $this->addImportsElement(); if ($this->isTemplate()) { - $this->addCheckCommandElement() - ->addCheckFlagElements(); + $this->addCheckExecutionElements(); } } } diff --git a/library/Director/Web/Form/DirectorObjectForm.php b/library/Director/Web/Form/DirectorObjectForm.php index 4f90acaa..1ef09a29 100644 --- a/library/Director/Web/Form/DirectorObjectForm.php +++ b/library/Director/Web/Form/DirectorObjectForm.php @@ -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('

Check execution

'); + + $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'),