Fix: fetch object for hookmanager

This commit is contained in:
Regis Houssin
2012-05-10 19:26:44 +02:00
parent 63ce05b939
commit 8ec51c2a6b
2 changed files with 14 additions and 2 deletions

View File

@@ -58,12 +58,18 @@ $confirm = GETPOST('confirm');
$lineid = GETPOST('lineid');
$mesg = GETPOST('mesg');
$object = new Commande($db);
// Security check
if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'commande',$id,'');
$object = new Commande($db);
// Load object
if ($id > 0 || ! empty($ref))
{
$ret=$object->fetch($id, $ref);
}
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php');
$hookmanager=new HookManager($db);

View File

@@ -81,6 +81,12 @@ $usehm=$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE;
$object=new Facture($db);
// Load object
if ($id > 0 || ! empty($ref))
{
$ret=$object->fetch($id, $ref);
}
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php');
$hookmanager=new HookManager($db);