[icinga-checkins] icinga.org: icingaweb2-module-director/feature/service-set-12891: DirectorObjectForm: Allow form to select if imports are required

git at icinga.org git at icinga.org
Fri Oct 14 15:44:43 CEST 2016


Module: icingaweb2-module-director
Branch: feature/service-set-12891
Commit: cc6183125832b47c8d7d4775e616d6c9212ee89b
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=cc6183125832b47c8d7d4775e616d6c9212ee89b

Author: Markus Frosch <markus.frosch at icinga.com>
Date:   Thu Oct 13 16:37:49 2016 +0200

DirectorObjectForm: Allow form to select if imports are required

refs #12920

---

 library/Director/Web/Form/DirectorObjectForm.php |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/library/Director/Web/Form/DirectorObjectForm.php b/library/Director/Web/Form/DirectorObjectForm.php
index d6478d6..c627507 100644
--- a/library/Director/Web/Form/DirectorObjectForm.php
+++ b/library/Director/Web/Form/DirectorObjectForm.php
@@ -14,6 +14,7 @@ abstract class DirectorObjectForm extends QuickForm
 {
     protected $db;
 
+    /** @var IcingaObject */
     protected $object;
 
     protected $objectName;
@@ -1144,7 +1145,7 @@ abstract class DirectorObjectForm extends QuickForm
         return $this;
     }
 
-    protected function addImportsElement()
+    protected function addImportsElement($required = null)
     {
         $enum = $this->enumAllowedTemplates();
         if (empty($enum)) {
@@ -1158,7 +1159,7 @@ abstract class DirectorObjectForm extends QuickForm
                 . ' matters when importing properties from multiple templates: last one'
                 . ' wins'
             ),
-            'required'     => !$this->isTemplate(),
+            'required'     => ($required !== null ? $required : !$this->isTemplate()),
             'multiOptions' => $this->optionallyAddFromEnum($enum),
             'sorted'       => true,
             'class'        => 'autosubmit'



More information about the icinga-checkins mailing list