diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a1597171fd5..98a83f441f6 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -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++; } } diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 86d002f55cb..6cd0d6761b8 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -25,7 +25,7 @@ * \ingroup core * \brief Fichier de la classe de stockage de la config courante * \remarks La config est stockee dans le fichier conf/conf.php - * \version $Id$ + * \version $Id: conf.class.php,v 1.59 2011/07/01 23:06:06 eldy Exp $ */ @@ -153,7 +153,7 @@ class Conf $modulename = strtolower($reg[1]); $this->login_method_modules[] = DOL_DOCUMENT_ROOT.'/'.$modulename.'/inc/login/'; } - // If this is constant for hook activated by a module + // If this is constant for hook activated by a module. Value is list of hooked tabs separated with : elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_HOOKS$/i',$key,$reg)) { $modulename = strtolower($reg[1]);