Merge pull request #10891 from atm-greg/Add_hook_on_replenish

Add hook on replenish
This commit is contained in:
Laurent Destailleur 2019-03-21 18:23:06 +01:00 committed by GitHub
commit f7f20df323
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013-2016 Laurent Destaileur <ely@users.sourceforge.net>
* Copyright (C) 2013-2018 Laurent Destaileur <ely@users.sourceforge.net>
* Copyright (C) 2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2016 ATM Consulting <support@atm-consulting.fr>
@ -43,6 +43,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');
@ -87,6 +90,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
@ -671,6 +677,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>';