CommandArguments: redirection after submission...

...and add 'back' link
This commit is contained in:
Thomas Gelf 2017-09-03 09:23:52 +02:00
parent 4c46f07f2e
commit 3418a535ae
2 changed files with 7 additions and 2 deletions

View File

@ -29,9 +29,11 @@ class CommandController extends ObjectController
$o = $this->object;
$this->tabs()->activate('arguments');
$this->addTitle($this->translate('Command arguments: %s'), $o->getObjectName());
$form = IcingaCommandArgumentForm::load()->setCommandObject($o);
if ($id = $p->shift('argument_id')) {
$this->addBackLink('director/command/arguments', [
'name' => $p->get('name')
]);
$form->loadObject($id);
}
$form->handleRequest();

View File

@ -162,7 +162,10 @@ class IcingaCommandArgumentForm extends DirectorObjectForm
}
$this->setSuccessUrl(
'director/command/arguments',
array('name' => $cmd->getObjectName())
[
'argument_id' => $object->get('id'),
'name' => $cmd->getObjectName()
]
);
$this->redirectOnSuccess($msg);