2
0
forked from Wavyzz/dolibarr

More comments

This commit is contained in:
Laurent Destailleur
2011-07-01 23:05:39 +00:00
parent 795cb3c899
commit 5c1a13f95e
2 changed files with 12 additions and 9 deletions

View File

@@ -22,7 +22,7 @@
* \file htdocs/core/class/commonobject.class.php
* \ingroup core
* \brief File of parent class of all other business classes (invoices, contracts, proposals, orders, ...)
* \version $Id: commonobject.class.php,v 1.142 2011/07/01 16:58:09 hregis Exp $
* \version $Id: commonobject.class.php,v 1.143 2011/07/01 23:05:39 eldy Exp $
*/
@@ -1287,7 +1287,7 @@ class CommonObject
if ($objecttype == 'delivery') { $classpath = 'livraison/class'; $subelement = 'livraison'; $module = 'livraison_bon'; }
if ($objecttype == 'invoice_supplier') { $classpath = 'fourn/class'; }
if ($objecttype == 'order_supplier') { $classpath = 'fourn/class'; }
if ($objecttype == 'fichinter') { $classpath = 'fichinter/class'; $subelement ='fichinter'; $module ='ficheinter'; }
if ($objecttype == 'fichinter') { $classpath = 'fichinter/class'; $subelement ='fichinter'; $module ='ficheinter'; }
$classfile = strtolower($subelement); $classname = ucfirst($subelement);
if ($objecttype == 'invoice_supplier') { $classfile = 'fournisseur.facture'; $classname='FactureFournisseur'; }
@@ -1431,15 +1431,15 @@ class CommonObject
/**
* Instantiate hooks of thirdparty module
* @param $type Type of hook
* Init array this->hooks with instantiated controler and/or dao
* @param arraytype Array list of hooked tab/features. For example: thirdpartytab, ...
*/
function callHooks($arraytype)
{
global $conf;
if (! is_array($arraytype)) $arraytype=array($arraytype);
$i=0;
foreach($conf->hooks_modules as $module => $hooks)
@@ -1454,13 +1454,15 @@ class CommonObject
$actionfile = 'actions_'.$module.'.class.php';
$daofile = 'dao_'.$module.'.class.php';
$pathroot = '';
$this->hooks[$i]['type']=$type;
// Include actions class (controller)
//print 'include '.$path.$actionfile."\n";
$resaction=dol_include_once($path.$actionfile);
// Include dataservice class (model)
//print 'include '.$path.$daofile."\n";
$resdao=dol_include_once($path.$daofile);
// Instantiate actions class (controller)
@@ -1471,13 +1473,14 @@ class CommonObject
$this->hooks[$i]['modules'][$objModule->module_number] = $objModule;
}
// FIXME storing dao is useless here. It's goal of controller to known which dao to manage
if ($resdao)
{
// Instantiate dataservice class (model)
$modelclassname = 'Dao'.ucfirst($module);
$this->hooks[$i]['modules'][$objModule->module_number]->object = new $modelclassname($this->db);
}
$i++;
}
}