mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-26 23:34:10 +02:00
ImportsourceController: fix redirect after delete
This commit is contained in:
parent
177982fba3
commit
97e52b231d
@ -84,15 +84,14 @@ class ImportsourceController extends ActionController
|
|||||||
{
|
{
|
||||||
$id = $this->params->get('id');
|
$id = $this->params->get('id');
|
||||||
|
|
||||||
$form = $this->view->form = $this->loadForm('importSource')
|
$form = $this->view->form = $this->loadForm('importSource')->setDb($this->db());
|
||||||
->setSuccessUrl('director/list/importsource')
|
|
||||||
->setDb($this->db());
|
|
||||||
|
|
||||||
if ($id) {
|
if ($id) {
|
||||||
$form->loadObject($id);
|
$form->loadObject($id)->setListUrl('director/list/importsource');
|
||||||
$this->prepareTabs($id)->activate('edit');
|
$this->prepareTabs($id)->activate('edit');
|
||||||
$this->view->title = $this->translate('Edit import source');
|
$this->view->title = $this->translate('Edit import source');
|
||||||
} else {
|
} else {
|
||||||
|
$form->setSuccessUrl('director/list/importsource');
|
||||||
$this->view->title = $this->translate('Add import source');
|
$this->view->title = $this->translate('Add import source');
|
||||||
$this->prepareTabs()->activate('add');
|
$this->prepareTabs()->activate('add');
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,8 @@ abstract class DirectorObjectForm extends QuickForm
|
|||||||
|
|
||||||
protected $resolvedImports = false;
|
protected $resolvedImports = false;
|
||||||
|
|
||||||
|
protected $listUrl;
|
||||||
|
|
||||||
private $allowsExperimental;
|
private $allowsExperimental;
|
||||||
|
|
||||||
private $api;
|
private $api;
|
||||||
@ -625,6 +627,12 @@ abstract class DirectorObjectForm extends QuickForm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setListUrl($url)
|
||||||
|
{
|
||||||
|
$this->listUrl = $url;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function onSuccess()
|
public function onSuccess()
|
||||||
{
|
{
|
||||||
$object = $this->object();
|
$object = $this->object();
|
||||||
@ -854,7 +862,9 @@ abstract class DirectorObjectForm extends QuickForm
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($object instanceof IcingaObject && $object->hasProperty('object_name')) {
|
if ($this->listUrl) {
|
||||||
|
$url = $this->listUrl;
|
||||||
|
} elseif ($object instanceof IcingaObject && $object->hasProperty('object_name')) {
|
||||||
$url = $object->getOnDeleteUrl();
|
$url = $object->getOnDeleteUrl();
|
||||||
} else {
|
} else {
|
||||||
$url = $this->getSuccessUrl()->without(
|
$url = $this->getSuccessUrl()->without(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user