From 72449ddef4be0bb5150eebc04c02ef02459b7e3f Mon Sep 17 00:00:00 2001 From: atm-greg Date: Fri, 15 Jun 2018 16:55:23 +0200 Subject: [PATCH 1/3] add hooks on stock replenish --- htdocs/product/stock/replenish.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 5a61e8b2a98..27a60b09257 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -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', 'globalcard')); + //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 @@ -670,6 +676,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 ''; print ''; From 2cdae2ec98d09f15f9c5e18e658d183b82d77085 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Mon, 18 Jun 2018 11:30:38 +0200 Subject: [PATCH 2/3] remove globalcard context --- htdocs/product/stock/replenish.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 27a60b09257..b2386c4b8a1 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -44,7 +44,7 @@ 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', 'globalcard')); +$hookmanager->initHooks(array('stockreplenishlist')); //checks if a product has been ordered From 0ee7befa1943b33ecd7ed506b002b42713df8bb7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Aug 2018 13:27:49 +0200 Subject: [PATCH 3/3] Update replenish.php --- htdocs/product/stock/replenish.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index b2386c4b8a1..7c5189d488b 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2016 Laurent Destaileur + * Copyright (C) 2013-2018 Laurent Destaileur * Copyright (C) 2014 Regis Houssin * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2016 ATM Consulting