DirectorObjectForm: support dbResourceName

fixes #2064
This commit is contained in:
Thomas Gelf 2020-01-17 12:09:33 +01:00
parent 7432516fa0
commit 81ad26fcab
1 changed files with 7 additions and 1 deletions

View File

@ -3,6 +3,7 @@
namespace Icinga\Module\Director\Web\Form;
use Exception;
use gipfl\IcingaWeb2\Url;
use Icinga\Authentication\Auth;
use Icinga\Module\Director\Db;
use Icinga\Module\Director\Data\Db\DbObject;
@ -670,9 +671,14 @@ abstract class DirectorObjectForm extends DirectorForm
$object = $this->object();
if ($object instanceof IcingaObject) {
$params = $object->getUrlParams();
$url = Url::fromPath($this->getAction());
if ($url->hasParam('dbResourceName')) {
$params['dbResourceName'] = $url->getParam('dbResourceName');
}
$this->setSuccessUrl(
'director/' . strtolower($this->getObjectShortClassName()),
$object->getUrlParams()
$params
);
} elseif ($object->hasProperty('id')) {
$this->setSuccessUrl($this->getSuccessUrl()->with('id', $object->getProperty('id')));