Skip to content

Commit

Permalink
Merge pull request #10891 from atm-greg/Add_hook_on_replenish
Browse files Browse the repository at this point in the history
Add hook on replenish
  • Loading branch information
eldy committed Mar 21, 2019
2 parents 89087c6 + 0ee7bef commit f7f20df
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion htdocs/product/stock/replenish.php
@@ -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>
Expand Down Expand Up @@ -43,6 +43,9 @@
}
$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');
Expand Down Expand Up @@ -87,6 +90,9 @@
$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
Expand Down Expand Up @@ -671,6 +677,11 @@
}
$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>';

Expand Down

0 comments on commit f7f20df

Please sign in to comment.