Merge pull request #17850 from moreauftheobald/Develop_hook_on_product_stat

Adding hooks on product stat in order to allow to expand stat on othe…
This commit is contained in:
Laurent Destailleur 2021-06-11 19:33:37 +02:00 committed by GitHub
commit 04a500f516
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -360,9 +360,10 @@ function product_lot_admin_prepare_head()
*/ */
function show_stats_for_company($product, $socid) function show_stats_for_company($product, $socid)
{ {
global $conf, $langs, $user, $db; global $conf, $langs, $user, $db, $hookmanager;
$form = new Form($db);
$form = new Form($db);
$nblines = 0; $nblines = 0;
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -558,6 +559,12 @@ function show_stats_for_company($product, $socid)
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
$parameters = array('socid'=>$socid);
$reshook = $hookmanager->executeHooks('addMoreProductStat', $parameters, $product, $nblines); // 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++; return $nblines++;
} }