mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2026-06-06 23:32:36 -04:00
IcingaServiceSetForm: redirect to host services...
...when adding a set to a single host fixes #804
This commit is contained in:
parent
099eca0d0b
commit
82e79c810f
2 changed files with 22 additions and 2 deletions
|
|
@ -60,6 +60,18 @@ class IcingaServiceSetForm extends DirectorObjectForm
|
|||
->addAssignmentElements();
|
||||
}
|
||||
|
||||
protected function setObjectSuccessUrl()
|
||||
{
|
||||
if ($this->host) {
|
||||
$this->setSuccessUrl(
|
||||
'director/host/services',
|
||||
array('name' => $this->host->getObjectName())
|
||||
);
|
||||
} else {
|
||||
parent::setObjectSuccessUrl();
|
||||
}
|
||||
}
|
||||
|
||||
protected function setupHost()
|
||||
{
|
||||
$object = $this->object();
|
||||
|
|
|
|||
|
|
@ -496,14 +496,22 @@ abstract class DirectorObjectForm extends QuickForm
|
|||
}
|
||||
$msg = $this->translate('No action taken, object has not been modified');
|
||||
}
|
||||
|
||||
$this->setObjectSuccessUrl();
|
||||
$this->beforeSuccessfulRedirect();
|
||||
$this->redirectOnSuccess($msg);
|
||||
}
|
||||
|
||||
protected function setObjectSuccessUrl()
|
||||
{
|
||||
$object = $this->object();
|
||||
|
||||
if ($object instanceof IcingaObject) {
|
||||
$this->setSuccessUrl(
|
||||
'director/' . strtolower($this->getObjectShortClassName()),
|
||||
$object->getUrlParams()
|
||||
);
|
||||
}
|
||||
$this->beforeSuccessfulRedirect();
|
||||
$this->redirectOnSuccess($msg);
|
||||
}
|
||||
|
||||
protected function beforeSuccessfulRedirect()
|
||||
|
|
|
|||
Loading…
Reference in a new issue