From 1a3c4d52893bcf8daccfa84d079c0f1be59d8f61 Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Wed, 10 Jul 2024 18:57:14 +0200 Subject: [PATCH] Add doActions on ticket stats (#30336) --- htdocs/ticket/stats/index.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/ticket/stats/index.php b/htdocs/ticket/stats/index.php index 2849fb1a0ce..721f4f30b12 100644 --- a/htdocs/ticket/stats/index.php +++ b/htdocs/ticket/stats/index.php @@ -31,6 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $WIDTH = DolGraph::getDefaultGraphSizeForStats('width'); $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); +$hookmanager->initHooks(array('ticketstats', 'globalcard')); + if (!$user->hasRight('ticket', 'read')) { accessforbidden(); } @@ -45,6 +47,12 @@ if ($user->socid > 0) { $socid = $user->socid; } +$parameters = array(); +$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'); +} + $nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ? GETPOSTINT('year') : $nowyear; $startyear = $year - (!getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, getDolGlobalInt('MAIN_STATS_GRAPHS_SHOW_N_YEARS'))));