IcingaService: fix redirection for host services
This commit is contained in:
parent
3e016311d6
commit
99302d40f4
|
@ -189,4 +189,13 @@ class IcingaService extends IcingaObject
|
|||
{
|
||||
return $this->getResolvedProperty('check_command_id') !== null;
|
||||
}
|
||||
|
||||
public function getOnDeleteUrl()
|
||||
{
|
||||
if ($this->host_id) {
|
||||
return 'director/host/services?name=' . rawurlencode($this->host);
|
||||
} else {
|
||||
return parent::getOnDeleteUrl();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -752,15 +752,16 @@ abstract class DirectorObjectForm extends QuickForm
|
|||
);
|
||||
}
|
||||
|
||||
if ($object instanceof IcingaObject && $object->hasProperty('object_name')) {
|
||||
$url = $object->getOnDeleteUrl();
|
||||
} else {
|
||||
$url = $this->getSuccessUrl()->without(
|
||||
array('field_id', 'argument_id')
|
||||
);
|
||||
}
|
||||
|
||||
if ($object->delete()) {
|
||||
// fields? $this->setSuccessUrl($this->getSuccessUrl()->without($key));
|
||||
if ($object instanceof IcingaObject && $object->hasProperty('object_name')) {
|
||||
$this->setSuccessUrl('director/' . strtolower($object->getShortTableName()) . 's');
|
||||
} else {
|
||||
$this->setSuccessUrl($this->getSuccessUrl()->without(
|
||||
array('field_id', 'argument_id')
|
||||
));
|
||||
}
|
||||
$this->setSuccessUrl($url);
|
||||
}
|
||||
// TODO: show object name and so
|
||||
$this->redirectOnSuccess($msg);
|
||||
|
|
Loading…
Reference in New Issue