commit
f527e31b14
|
@ -47,8 +47,14 @@ class IcingaEndpointForm extends DirectorObjectForm
|
||||||
'multiOptions' => $this->optionalEnum($this->db->enumApiUsers())
|
'multiOptions' => $this->optionalEnum($this->db->enumApiUsers())
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->addZoneElement()
|
$this->addZoneElement();
|
||||||
->addImportsElement();
|
|
||||||
|
if ($this->object->hasBeenLoadedFromDb()) {
|
||||||
|
$imports = $this->object->get('imports');
|
||||||
|
if ($imports !== null && count($imports) > 0) {
|
||||||
|
$this->addImportsElement(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->setButtons();
|
$this->setButtons();
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ abstract class DirectorObjectForm extends QuickForm
|
||||||
{
|
{
|
||||||
protected $db;
|
protected $db;
|
||||||
|
|
||||||
|
/** @var IcingaObject */
|
||||||
protected $object;
|
protected $object;
|
||||||
|
|
||||||
protected $objectName;
|
protected $objectName;
|
||||||
|
@ -1151,7 +1152,7 @@ abstract class DirectorObjectForm extends QuickForm
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function addImportsElement()
|
protected function addImportsElement($required = null)
|
||||||
{
|
{
|
||||||
$enum = $this->enumAllowedTemplates();
|
$enum = $this->enumAllowedTemplates();
|
||||||
if (empty($enum)) {
|
if (empty($enum)) {
|
||||||
|
@ -1165,7 +1166,7 @@ abstract class DirectorObjectForm extends QuickForm
|
||||||
. ' matters when importing properties from multiple templates: last one'
|
. ' matters when importing properties from multiple templates: last one'
|
||||||
. ' wins'
|
. ' wins'
|
||||||
),
|
),
|
||||||
'required' => !$this->isTemplate(),
|
'required' => ($required !== null ? $required : !$this->isTemplate()),
|
||||||
'multiOptions' => $this->optionallyAddFromEnum($enum),
|
'multiOptions' => $this->optionallyAddFromEnum($enum),
|
||||||
'sorted' => true,
|
'sorted' => true,
|
||||||
'class' => 'autosubmit'
|
'class' => 'autosubmit'
|
||||||
|
|
Loading…
Reference in New Issue