[icinga-checkins] icinga.org: icingaweb2-module-director/master: DirectorObjectForm: object vars > command vars

git at icinga.org git at icinga.org
Sun Feb 28 17:12:40 CET 2016


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

Author: Thomas Gelf <thomas at gelf.net>
Date:   Sun Feb 28 16:29:25 2016 +0100

DirectorObjectForm: object vars > command vars

---

 library/Director/Web/Form/DirectorObjectForm.php |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/library/Director/Web/Form/DirectorObjectForm.php b/library/Director/Web/Form/DirectorObjectForm.php
index d035569..52552b4 100644
--- a/library/Director/Web/Form/DirectorObjectForm.php
+++ b/library/Director/Web/Form/DirectorObjectForm.php
@@ -327,6 +327,18 @@ abstract class DirectorObjectForm extends QuickForm
                 $inheritedValue = null;
                 $inheritFrom = false;
             }
+
+            // Command vars are overridden at object level:
+            if (property_exists($inherits, $varname)) {
+                $inheritedValue = $inherits->$varname;
+                $inheritFrom = $origins->$varname;
+                if ($inheritFrom === $object->object_name) {
+                    $inherited = false;
+                } else {
+                    $inherited = true;
+                }
+            }
+
             $this->addCommandField($field, $value, $inheritedValue, $inheritFrom);
             if ($inheritedValue !== null) {
                 $this->getElement('var_' . $field->varname)->setRequired(false);



More information about the icinga-checkins mailing list