From 6f3edba9869a0b4dca55af5904dc9c8c1e8f59e6 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 4 Jun 2020 16:35:54 +0200 Subject: [PATCH] Object custom action question view: add some LSview actions links --- src/includes/routes.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/includes/routes.php b/src/includes/routes.php index ac861ba6..c587f3eb 100644 --- a/src/includes/routes.php +++ b/src/includes/routes.php @@ -1254,6 +1254,24 @@ function handle_LSobject_customAction($request) { LStemplate :: assign('validation_url', "object/$LSobject/".urlencode($dn)."/customAction/".urlencode($customAction)."?valid"); LStemplate :: assign('validation_label', _('Validate')); + // List user available actions for this LSobject + $LSview_actions = array( + array( + 'label' => _('View'), + 'url' => "object/$LSobject/".urlencode($dn), + 'action' => 'view' + ), + ); + + if (LSsession :: canEdit($LSobject, $dn)) { + $LSview_actions[] = array( + 'label' => _('Modify'), + 'url' => "object/$LSobject/".urlencode($dn)."/modify", + 'action' => 'modify' + ); + } + LStemplate :: assign('LSview_actions',$LSview_actions); + // Set & display template LSsession :: setTemplate('question.tpl'); LSsession :: displayTemplate();