From a386cf5e89e00af31a868896fe8548bce3499380 Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 27 Jul 2021 09:09:42 +0200 Subject: [PATCH 1/2] add hook product stat --- htdocs/product/stats/card.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index e899cee797f..de6b96332b6 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -58,6 +58,9 @@ $fieldvalue = (!empty($id) ? $id : $ref); $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); $result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('productstatscard', 'globalcard')); + $tmp = dol_getdate(dol_now()); $currentyear = $tmp['year']; if (empty($search_year)) $search_year = $currentyear; From d2dc2bfde2568c9ce3853b3afd3d1b1d9e820b4e Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 27 Jul 2021 09:13:50 +0200 Subject: [PATCH 2/2] add hook product composition --- htdocs/product/composition/card.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 8459fa3e479..4bbcb7d6e27 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -50,6 +50,9 @@ $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); $result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('productcompositioncard', 'globalcard')); + $object = new Product($db); $objectid = 0; if ($id > 0 || !empty($ref))