DirectorObjectForm: object vars > command vars

This commit is contained in:
Thomas Gelf 2016-02-28 16:29:25 +01:00
parent 11e5ef0362
commit 25a599cc53
1 changed files with 12 additions and 0 deletions

View File

@ -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);