From 54ed2d0119005cfdd2e9641622be6a475fd07db0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Dec 2019 12:09:27 +0100 Subject: [PATCH] Fix hooks --- htdocs/ticket/list.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 670ed740b5f..5c29e8212a4 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -74,8 +74,8 @@ $pagenext = $page + 1; $object = new Ticket($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->ticket->dir_output.'/temp/massgeneration/'.$user->id; -if ($socid > 0) $hookmanager->initHooks(array('thirdpartyticket')); -elseif ($project > 0) $hookmanager->initHooks(array('projectticket')); +if ($socid > 0) $hookmanager->initHooks(array('thirdpartyticket')); +elseif ($projectid > 0) $hookmanager->initHooks(array('projectticket')); else $hookmanager->initHooks(array('ticketlist')); // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -149,6 +149,8 @@ if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; } if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; } $parameters = array(); +if ($socid > 0) $parameters['socid'] = $socid; +if ($projectid > 0) $parameters['projectid'] = $projectid; $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');