DirectorObjectForm: Allow form to select if imports are required

refs #12920
This commit is contained in:
Markus Frosch 2016-10-13 16:37:49 +02:00
parent ad11f89abf
commit cc61831258
1 changed files with 3 additions and 2 deletions

View File

@ -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'