DirectorObjectForm: redirect to newly created objects

This commit is contained in:
Thomas Gelf 2015-10-15 23:47:05 +02:00
parent eea642bd1c
commit 988eb4bf77

View File

@ -365,7 +365,14 @@ abstract class DirectorObjectForm extends QuickForm
{
$object = $this->object();
if ($object->hasBeenModified()) {
if (! $object->hasBeenLoadedFromDb()) {
if ($object instanceof IcingaObject) {
$this->setSuccessUrl(
'director/' . strtolower($this->getObjectName()),
array('name' => $object->object_name)
);
}
}
$msg = sprintf(
$object->hasBeenLoadedFromDb()
? $this->translate('The %s has successfully been stored')