From 207dc1df5528cf74dea92f82930645bf1da30d6f Mon Sep 17 00:00:00 2001 From: MOREAU FRANCK Date: Tue, 8 Jun 2021 12:34:26 +0200 Subject: [PATCH] Adding hooks on product stat in order to allow to expand stat on other modules --- htdocs/core/lib/product.lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 9825b2dac2c..a63871689b4 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -362,7 +362,7 @@ function show_stats_for_company($product, $socid) { global $conf, $langs, $user, $db; $form = new Form($db); - + $hookmanager->initHooks(array('productstats')); $nblines = 0; print ''; @@ -558,6 +558,10 @@ function show_stats_for_company($product, $socid) print ''; print ''; } + $reshook = $hookmanager->executeHooks('addmoreproductstat', $parameters, $product); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + + print $hookmanager->resPrint; return $nblines++; }