Commit 22e405ea authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Merge branch '6039-update-the-system-plugin' into '1.4-dev'

Resolve "update the system plugin"

See merge request fusiondirectory/fd-plugins!755
parents feb4e947 7c2c1719
...@@ -113,21 +113,26 @@ class interfacesManagement extends management implements SimpleTab ...@@ -113,21 +113,26 @@ class interfacesManagement extends management implements SimpleTab
} else { } else {
$this->interfaces[$entry->dn] = objects::open($entry->dn, $entry->getTemplatedType()); $this->interfaces[$entry->dn] = objects::open($entry->dn, $entry->getTemplatedType());
} }
$this->interfaces[$entry->dn]->getBaseObject()->base = $this->dn; $this->interfaces[$entry->dn]->getBaseObject()->base = $this->getInterfacesBase();
} }
} }
protected function setUpListing () private function getInterfacesBase (): string
{ {
/* Set baseMode to FALSE */
$this->listing = new managementListing($this, FALSE);
if ($this->dn != 'new') { if ($this->dn != 'new') {
$this->listing->setBase($this->dn); return $this->dn;
} else { } else {
$this->listing->setBase('new,'.$this->parent->getBaseObject()->base); return 'new,'.$this->parent->getBaseObject()->base;
} }
} }
protected function setUpListing ()
{
/* Set baseMode to FALSE */
$this->listing = new managementListing($this, FALSE);
$this->listing->setBase($this->getInterfacesBase());
}
protected function setUpFilter (array $filterElementDefinitions) protected function setUpFilter (array $filterElementDefinitions)
{ {
$this->filter = new interfacesManagementFilter($this, NULL, $filterElementDefinitions); $this->filter = new interfacesManagementFilter($this, NULL, $filterElementDefinitions);
...@@ -258,11 +263,7 @@ class interfacesManagement extends management implements SimpleTab ...@@ -258,11 +263,7 @@ class interfacesManagement extends management implements SimpleTab
function openTabObject ($object) function openTabObject ($object)
{ {
parent::openTabObject($object); parent::openTabObject($object);
if ($this->dn != 'new') { $this->tabObject->getBaseObject()->base = $this->getInterfacesBase();
$this->tabObject->getBaseObject()->base = $this->dn;
} else {
$this->tabObject->getBaseObject()->base = 'new,'.$this->parent->getBaseObject()->base;
}
if ($this->is_template) { if ($this->is_template) {
$this->tabObject->setTemplateMode(''); $this->tabObject->setTemplateMode('');
} }
...@@ -351,7 +352,7 @@ class interfacesManagement extends management implements SimpleTab ...@@ -351,7 +352,7 @@ class interfacesManagement extends management implements SimpleTab
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Saving subobject'); logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Saving subobject');
/* The move was already done if needed by main tab, so we need to update dn of subobjects */ /* The move was already done if needed by main tab, so we need to update dn of subobjects */
$object->dn = str_replace($object->getBaseObject()->base, $this->dn, $object->dn); $object->dn = str_replace($object->getBaseObject()->base, $this->dn, $object->dn);
$object->getBaseObject()->base = $this->dn; $object->getBaseObject()->base = $this->getInterfacesBase();
/* Save subobject and store errors if any */ /* Save subobject and store errors if any */
$errors = array_merge($errors, $object->save()); $errors = array_merge($errors, $object->save());
} }
...@@ -424,7 +425,7 @@ class interfacesManagement extends management implements SimpleTab ...@@ -424,7 +425,7 @@ class interfacesManagement extends management implements SimpleTab
foreach ($entryIterator as $entry) { foreach ($entryIterator as $entry) {
$this->interfaces[$entry->dn] = objects::create($entry->getTemplatedType()); $this->interfaces[$entry->dn] = objects::create($entry->getTemplatedType());
$this->filter->resetFromCache($entry->dn, $this->interfaces[$entry->dn]); $this->filter->resetFromCache($entry->dn, $this->interfaces[$entry->dn]);
$this->interfaces[$entry->dn]->getBaseObject()->base = $this->dn; $this->interfaces[$entry->dn]->getBaseObject()->base = $this->getInterfacesBase();
} }
/* Fill ip/mac fields of main tab */ /* Fill ip/mac fields of main tab */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment