[icinga-checkins] icinga.org: icingaweb2-module-director/master: IcingaUer(Group)Form: allow to specify a zone

git at icinga.org git at icinga.org
Wed Nov 2 18:05:05 CET 2016


Module: icingaweb2-module-director
Branch: master
Commit: 984740db9ac845a94da29a6aed55539cb9be3ba3
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=984740db9ac845a94da29a6aed55539cb9be3ba3

Author: Thomas Gelf <thomas at gelf.net>
Date:   Wed Nov  2 18:04:35 2016 +0100

IcingaUer(Group)Form: allow to specify a zone

fixes #11754

---

 application/forms/IcingaUserForm.php      |   21 +++++++++++++++++++++
 application/forms/IcingaUserGroupForm.php |   18 ++++++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/application/forms/IcingaUserForm.php b/application/forms/IcingaUserForm.php
index 447626a..52aad1a 100644
--- a/application/forms/IcingaUserForm.php
+++ b/application/forms/IcingaUserForm.php
@@ -46,11 +46,32 @@ class IcingaUserForm extends DirectorObjectForm
              ->addDisplayNameElement()
              ->addEnableNotificationsElement()
              ->addDisabledElement()
+             ->addZoneElements()
              ->addEventFilterElements()
              ->groupMainProperties()
              ->setButtons();
     }
 
+    protected function addZoneElements()
+    {
+        if (! $this->isTemplate()) {
+            return $this;
+        }
+
+        $this->addZoneElement();
+        $this->addDisplayGroup(array('zone_id'), 'clustering', array(
+            'decorators' => array(
+                'FormElements',
+                array('HtmlTag', array('tag' => 'dl')),
+                'Fieldset',
+            ),
+            'order' => 80,
+            'legend' => $this->translate('Zone settings')
+        ));
+
+        return $this;
+    }
+
     protected function addEnableNotificationsElement()
     {
         $this->optionalBoolean(
diff --git a/application/forms/IcingaUserGroupForm.php b/application/forms/IcingaUserGroupForm.php
index ff568a8..d98232e 100644
--- a/application/forms/IcingaUserGroupForm.php
+++ b/application/forms/IcingaUserGroupForm.php
@@ -17,7 +17,25 @@ class IcingaUserGroupForm extends DirectorObjectForm
         ));
 
         $this->addGroupDisplayNameElement()
+             ->addZoneElements()
+             ->groupMainProperties()
              ->setButtons();
 
     }
+
+    protected function addZoneElements()
+    {
+        $this->addZoneElement();
+        $this->addDisplayGroup(array('zone_id'), 'clustering', array(
+            'decorators' => array(
+                'FormElements',
+                array('HtmlTag', array('tag' => 'dl')),
+                'Fieldset',
+            ),
+            'order' => 80,
+            'legend' => $this->translate('Zone settings')
+        ));
+
+        return $this;
+    }
 }



More information about the icinga-checkins mailing list