11.0 - Add Hook "SelectWarehouses"
This commit is contained in:
parent
82a8c42441
commit
f518bafda9
@ -237,13 +237,23 @@ class FormProduct
|
|||||||
*/
|
*/
|
||||||
public function selectWarehouses($selected = '', $htmlname = 'idwarehouse', $filterstatus = '', $empty = 0, $disabled = 0, $fk_product = 0, $empty_label = '', $showstock = 0, $forcecombo = 0, $events = array(), $morecss = 'minwidth200', $exclude = '', $showfullpath = 1, $stockMin = false, $orderBy = 'e.ref')
|
public function selectWarehouses($selected = '', $htmlname = 'idwarehouse', $filterstatus = '', $empty = 0, $disabled = 0, $fk_product = 0, $empty_label = '', $showstock = 0, $forcecombo = 0, $events = array(), $morecss = 'minwidth200', $exclude = '', $showfullpath = 1, $stockMin = false, $orderBy = 'e.ref')
|
||||||
{
|
{
|
||||||
global $conf,$langs,$user;
|
global $conf,$langs,$user, $hookmanager;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::selectWarehouses $selected, $htmlname, $filterstatus, $empty, $disabled, $fk_product, $empty_label, $showstock, $forcecombo, $morecss", LOG_DEBUG);
|
dol_syslog(get_class($this)."::selectWarehouses $selected, $htmlname, $filterstatus, $empty, $disabled, $fk_product, $empty_label, $showstock, $forcecombo, $morecss", LOG_DEBUG);
|
||||||
|
|
||||||
$out='';
|
$out='';
|
||||||
if (empty($conf->global->ENTREPOT_EXTRA_STATUS)) $filterstatus = '';
|
if (empty($conf->global->ENTREPOT_EXTRA_STATUS)) $filterstatus = '';
|
||||||
if (!empty($fk_product)) $this->cache_warehouses = array();
|
if (!empty($fk_product)) $this->cache_warehouses = array();
|
||||||
|
if(empty($exclude)) $exclude = array();
|
||||||
|
|
||||||
|
$parameters = array(
|
||||||
|
'exclude' =>& $exclude,
|
||||||
|
'htmlname' =>& $htmlname
|
||||||
|
);
|
||||||
|
|
||||||
|
$reshook = $hookmanager->executeHooks('selectWarehouses', $parameters);
|
||||||
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
$this->loadWarehouses($fk_product, '', $filterstatus, true, $exclude, $stockMin, $orderBy);
|
$this->loadWarehouses($fk_product, '', $filterstatus, true, $exclude, $stockMin, $orderBy);
|
||||||
$nbofwarehouses=count($this->cache_warehouses);
|
$nbofwarehouses=count($this->cache_warehouses);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user