From 4761671fc8f40024f0f334b3a5611b7b8a710e26 Mon Sep 17 00:00:00 2001 From: simicar29 <53998265+simicar29@users.noreply.github.com> Date: Fri, 24 Jan 2020 09:41:22 +0100 Subject: [PATCH 1/3] Add Hook doPreMassActions Add Hook doPreMassActions to allow dedicated form display for custom mass actions --- htdocs/core/tpl/massactions_pre.tpl.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index a0c627ac049..bc040e1274d 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -166,3 +166,13 @@ if ($massaction == 'presend') dol_fiche_end(); } +// Allow Pre-Mass-Action hook (eg for confirmation dialog) +$parameters['toselect']=$toselect; +$parameters['uploaddir']=$uploaddir; + +$reshook=$hookmanager->executeHooks('doPreMassActions',$parameters, $object, $action); +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} else { + print $hookmanager->resPrint; +} From cfa67b6a5d259624b9fbddaef58887fbe8982384 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 24 Jan 2020 08:47:11 +0000 Subject: [PATCH 2/3] Fixing style errors. --- htdocs/core/tpl/massactions_pre.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index bc040e1274d..6949c76680f 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -170,7 +170,7 @@ if ($massaction == 'presend') $parameters['toselect']=$toselect; $parameters['uploaddir']=$uploaddir; -$reshook=$hookmanager->executeHooks('doPreMassActions',$parameters, $object, $action); +$reshook=$hookmanager->executeHooks('doPreMassActions', $parameters, $object, $action); if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } else { From 02f8faeeac5d2edfc277c822c3f4132091c1b6ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Jan 2020 22:32:37 +0100 Subject: [PATCH 3/3] Update massactions_pre.tpl.php --- htdocs/core/tpl/massactions_pre.tpl.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 6949c76680f..fcff59cb21a 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -167,8 +167,10 @@ if ($massaction == 'presend') dol_fiche_end(); } // Allow Pre-Mass-Action hook (eg for confirmation dialog) -$parameters['toselect']=$toselect; -$parameters['uploaddir']=$uploaddir; +$parameters = array( + 'toselect' => $toselect, + 'uploaddir' => $uploaddir +); $reshook=$hookmanager->executeHooks('doPreMassActions', $parameters, $object, $action); if ($reshook < 0) {