Merge pull request #8983 from atm-greg/Add_hook_on_replenish

Add hook on replenish
This commit is contained in:
Laurent Destailleur 2018-07-16 10:02:26 +02:00 committed by GitHub
commit 3eac1f410d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,6 +42,9 @@ if ($user->societe_id) {
}
$result=restrictedArea($user,'produit|service');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('stockreplenishlist'));
//checks if a product has been ordered
$action = GETPOST('action','alpha');
@ -86,6 +89,9 @@ if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
$usevirtualstock=0;
if ($mode == 'virtual') $usevirtualstock=1;
$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');
/*
* Actions
@ -669,6 +675,11 @@ while ($i < ($limit ? min($num, $limit) : $num))
}
$i++;
}
$parameters=array('sql'=>$sql);
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</table>';
print '</div>';