From 3418a535ae7d74d383a9d7baefae1de07cda6f58 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Sun, 3 Sep 2017 09:23:52 +0200 Subject: [PATCH] CommandArguments: redirection after submission... ...and add 'back' link --- application/controllers/CommandController.php | 4 +++- application/forms/IcingaCommandArgumentForm.php | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/application/controllers/CommandController.php b/application/controllers/CommandController.php index 8d5c2a0d..0b302af7 100644 --- a/application/controllers/CommandController.php +++ b/application/controllers/CommandController.php @@ -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(); diff --git a/application/forms/IcingaCommandArgumentForm.php b/application/forms/IcingaCommandArgumentForm.php index 78b558f7..2b1c4be8 100644 --- a/application/forms/IcingaCommandArgumentForm.php +++ b/application/forms/IcingaCommandArgumentForm.php @@ -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);