mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-26 03:09:11 +02:00
Fix editing of custom variables for multi-selected objects
This commit is contained in:
parent
42a47d6139
commit
b18cf4f80d
@ -51,6 +51,7 @@ class IcingaMultiEditForm extends DirectorObjectForm
|
|||||||
$loader = new IcingaObjectFieldLoader($object);
|
$loader = new IcingaObjectFieldLoader($object);
|
||||||
$loader->prepareElements($this);
|
$loader->prepareElements($this);
|
||||||
$loader->addFieldsToForm($this);
|
$loader->addFieldsToForm($this);
|
||||||
|
$this->varNameMap = $loader->getNameMap();
|
||||||
|
|
||||||
if ($form = $this->relatedForm) {
|
if ($form = $this->relatedForm) {
|
||||||
if ($form instanceof DirectorObjectForm) {
|
if ($form instanceof DirectorObjectForm) {
|
||||||
@ -237,10 +238,6 @@ class IcingaMultiEditForm extends DirectorObjectForm
|
|||||||
$this->removeElement($key);
|
$this->removeElement($key);
|
||||||
$label = $element->getLabel();
|
$label = $element->getLabel();
|
||||||
|
|
||||||
if ($this->isCustomVar($key)) {
|
|
||||||
$this->varNameMap[$key] = $label;
|
|
||||||
}
|
|
||||||
|
|
||||||
$group = $this->getDisplayGroupForElement($element);
|
$group = $this->getDisplayGroupForElement($element);
|
||||||
$description = $element->getDescription();
|
$description = $element->getDescription();
|
||||||
|
|
||||||
|
@ -60,6 +60,16 @@ class IcingaObjectFieldLoader
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get element names to variable names map (Example: ['elName' => 'varName'])
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getNameMap(): array
|
||||||
|
{
|
||||||
|
return $this->nameMap;
|
||||||
|
}
|
||||||
|
|
||||||
public function loadFieldsForMultipleObjects($objects)
|
public function loadFieldsForMultipleObjects($objects)
|
||||||
{
|
{
|
||||||
$fields = array();
|
$fields = array();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user