mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-08-14 14:28:10 +02: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
@ -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…
x
Reference in New Issue
Block a user