[icinga-checkins] icinga.org: icingaweb2-module-director/feature/nested-apply-rules-12033: IcingaServiceForm: use new assign_filter property

git at icinga.org git at icinga.org
Sun Oct 23 06:25:33 CEST 2016


Module: icingaweb2-module-director
Branch: feature/nested-apply-rules-12033
Commit: 3fbf3e9115b5a8bfc7b6495b17c0fc316c9685ba
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=3fbf3e9115b5a8bfc7b6495b17c0fc316c9685ba

Author: Thomas Gelf <thomas at gelf.net>
Date:   Fri Oct 21 06:56:44 2016 +0000

IcingaServiceForm: use new assign_filter property

---

 application/forms/IcingaServiceForm.php |   27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)

diff --git a/application/forms/IcingaServiceForm.php b/application/forms/IcingaServiceForm.php
index 3d5fe1c..d81795d 100644
--- a/application/forms/IcingaServiceForm.php
+++ b/application/forms/IcingaServiceForm.php
@@ -160,13 +160,28 @@ class IcingaServiceForm extends DirectorObjectForm
         if (!$this->object || !$this->object->isApplyRule()) {
             return $this;
         }
+        $this->addElement('dataFilter', 'assign_filter', array(
+            'columns' => IcingaHost::enumProperties($this->db),
+            'required' => true,
+        ));
+        $el = $this->getElement('assign_filter');
+        $el->setDecorators(array(
+            'ViewHelper',
+            array('HtmlTag', array(
+                'tag' => 'ul',
+                'class' => 'assign-rule required'
+            )),
+        ));
 
-        $sub = $this->loadForm('assignListSub');
-        $sub->setObject($this->getObject());
-        $sub->setup();
-        $sub->setOrder(30);
-
-        $this->addSubForm($sub, 'assignments');
+        $this->addDisplayGroup(array($el), 'assign', array(
+            'decorators' => array(
+                'FormElements',
+                array('HtmlTag', array('tag' => 'dl')),
+                'Fieldset',
+            ),
+            'order'  => 30,
+            'legend' => $this->translate('Assign where')
+        ));
 
         return $this;
     }



More information about the icinga-checkins mailing list