From ee582b7106e0eb583eaa55d5981f9ffd23304b4c Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 14 Jul 2017 11:36:25 +0200 Subject: [PATCH] ObjectsController: fix 'add' link for apply rules --- library/Director/Web/Controller/ObjectsController.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/library/Director/Web/Controller/ObjectsController.php b/library/Director/Web/Controller/ObjectsController.php index 8227a327..f2c172a4 100644 --- a/library/Director/Web/Controller/ObjectsController.php +++ b/library/Director/Web/Controller/ObjectsController.php @@ -116,22 +116,27 @@ abstract class ObjectsController extends ActionController public function applyrulesAction() { + $type = $this->getType(); + $tType = $this->translate(ucfirst($type)); $this ->assertApplyRulePermission() ->addObjectsTabs() ->addTitle( $this->translate('All your %s Apply Rules'), - $this->translate(ucfirst($this->getType())) + $tType ); $this->actions()/*->add( $this->getBackToDashboardLink() )*/->add( Link::create( $this->translate('Add'), - 'director/service/add', + "director/$type/add", ['type' => 'apply_rule'], [ - 'title' => $this->translate('Create a new Service Apply Rule'), + 'title' => sprintf( + $this->translate('Create a new %s Apply Rule'), + $tType + ), 'class' => 'icon-plus', 'data-base-target' => '_next' ]