[icinga-checkins] icinga.org: icingaweb2-module-director/feature/assign-for-11976: IcingaServiceForm: remove duplicate code

git at icinga.org git at icinga.org
Sat Oct 22 02:09:15 CEST 2016


Module: icingaweb2-module-director
Branch: feature/assign-for-11976
Commit: a164cd3dadba92595f2d1d46990fbc3d9476c3af
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=a164cd3dadba92595f2d1d46990fbc3d9476c3af

Author: Thomas Gelf <thomas at gelf.net>
Date:   Fri Oct 21 21:22:12 2016 +0000

IcingaServiceForm: remove duplicate code

Elements in this list are optional and may be used in various forms,
so keeping this in the base class is preferrable here

---

 application/forms/IcingaServiceForm.php          |   39 ----------------------
 library/Director/Web/Form/DirectorObjectForm.php |    1 +
 2 files changed, 1 insertion(+), 39 deletions(-)

diff --git a/application/forms/IcingaServiceForm.php b/application/forms/IcingaServiceForm.php
index c2f7105..8e87f23 100644
--- a/application/forms/IcingaServiceForm.php
+++ b/application/forms/IcingaServiceForm.php
@@ -237,45 +237,6 @@ class IcingaServiceForm extends DirectorObjectForm
         return $this;
     }
 
-    protected function groupMainProperties()
-    {
-        $elements = array(
-            'imports',
-            'object_name',
-            'display_name',
-            'host_id',
-            'address',
-            'address6',
-            'groups',
-            'users',
-            'user_groups',
-            'apply_to',
-            'command_id', // Notification
-            'notification_interval',
-            'period_id',
-            'times_begin',
-            'times_end',
-            'email',
-            'pager',
-            'enable_notifications',
-            'create_live',
-            'disabled',
-            'apply_for'
-        );
-
-        $this->addDisplayGroup($elements, 'object_definition', array(
-            'decorators' => array(
-                'FormElements',
-                array('HtmlTag', array('tag' => 'dl')),
-                'Fieldset',
-            ),
-            'order' => 20,
-            'legend' => $this->translate('Main properties')
-        ));
-
-        return $this;
-    }
-
     protected function addApplyForElement()
     {
         if ($this->object->isApplyRule()) {
diff --git a/library/Director/Web/Form/DirectorObjectForm.php b/library/Director/Web/Form/DirectorObjectForm.php
index 613e6fc..aaa81d7 100644
--- a/library/Director/Web/Form/DirectorObjectForm.php
+++ b/library/Director/Web/Form/DirectorObjectForm.php
@@ -311,6 +311,7 @@ abstract class DirectorObjectForm extends QuickForm
             'email',
             'pager',
             'enable_notifications',
+            'apply_for',
             'create_live',
             'disabled',
         );



More information about the icinga-checkins mailing list