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:
commit
04a500f516
@ -360,9 +360,10 @@ function product_lot_admin_prepare_head()
|
||||
*/
|
||||
function show_stats_for_company($product, $socid)
|
||||
{
|
||||
global $conf, $langs, $user, $db;
|
||||
$form = new Form($db);
|
||||
global $conf, $langs, $user, $db, $hookmanager;
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$nblines = 0;
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -558,6 +559,12 @@ function show_stats_for_company($product, $socid)
|
||||
print '</td>';
|
||||
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++;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user