diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 1891cd1b0e8..c54e34e8588 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -73,7 +73,7 @@ if ($action == 'specimen') // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),$conf->commande_modules); + $dirmodels=array_merge(array('/'),$conf->modules_parts['models']); foreach($dirmodels as $reldir) { $file=dol_buildpath($reldir."core/modules/commande/doc/pdf_".$modele.".modules.php",0); @@ -223,6 +223,8 @@ if ($action == 'set_COMMANDE_FREE_TEXT') * View */ +$dirmodels=array_merge(array('/'),$conf->modules_parts['models']); + llxHeader(); $form=new Form($db); @@ -251,8 +253,6 @@ print "\n"; clearstatcache(); -$dirmodels=array_merge(array('/'),$conf->commande_modules); - foreach ($dirmodels as $reldir) { $dir = dol_buildpath($reldir."core/modules/commande/"); @@ -384,8 +384,6 @@ print "\n"; clearstatcache(); -$dirmodels=array_merge(array('/'),$conf->commande_modules); - $var=true; foreach ($dirmodels as $reldir) { diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 5dd173a0706..dc5af7f1cfc 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -72,7 +72,7 @@ if ($action == 'specimen') // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),$conf->facture_modules); + $dirmodels=array_merge(array('/'),$conf->modules_parts['models']); foreach($dirmodels as $reldir) { $file=dol_buildpath($reldir."core/modules/facture/doc/pdf_".$modele.".modules.php",0); @@ -291,7 +291,7 @@ if ($action == 'setforcedate') * View */ -$dirmodels=array_merge(array('/'),$conf->facture_modules); +$dirmodels=array_merge(array('/'),$conf->modules_parts['models']); llxHeader("",$langs->trans("BillsSetup"),'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura'); diff --git a/htdocs/admin/propale.php b/htdocs/admin/propale.php index b85c4a0a289..067936638be 100644 --- a/htdocs/admin/propale.php +++ b/htdocs/admin/propale.php @@ -71,7 +71,7 @@ if ($action == 'specimen') // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),$conf->propale_modules); + $dirmodels=array_merge(array('/'),$conf->modules_parts['models']); foreach($dirmodels as $reldir) { $file=dol_buildpath($reldir."core/modules/propale/doc/pdf_".$modele.".modules.php"); @@ -257,6 +257,8 @@ else if ($action == 'setmod') * Affiche page */ +$dirmodels=array_merge(array('/'),$conf->modules_parts['models']); + llxHeader('',$langs->trans("PropalSetup")); $form=new Form($db); @@ -283,8 +285,6 @@ print ''."\n"; clearstatcache(); -$dirmodels=array_merge(array('/'),$conf->propale_modules); - foreach ($dirmodels as $reldir) { $dir = dol_buildpath($reldir."core/modules/propale/"); @@ -416,8 +416,6 @@ print "\n"; clearstatcache(); -$dirmodels=array_merge(array('/'),$conf->propale_modules); - $var=true; foreach ($dirmodels as $reldir) { diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 8504eced7ed..f8fe5ca70f0 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -52,9 +52,10 @@ class Conf public $smart_menu; public $modules = array(); // List of activated modules - - public $sms_engine_modules = array(); + public $modules_parts = array(); // List of modules parts + // TODO Remove all thoose tabs with one generic + public $sms_engine_modules = array(); public $css_modules = array(); public $tabs_modules = array(); public $triggers_modules = array(); @@ -164,15 +165,16 @@ class Conf { $modulename = strtolower($reg[1]); $partname = strtolower($reg[2]); - $varname = $partname.'_modules'; - if (! is_array($this->$varname)) { $this->$varname = array(); } + $varname = $partname.'_modules'; // TODO deprecated + if (! is_array($this->$varname)) { $this->$varname = array(); } // TODO deprecated + if (! is_array($this->modules_parts[$partname])) { $this->modules_parts[$partname] = array(); } $arrValue = @unserialize($value); if (is_array($arrValue) && ! empty($arrValue)) $value = $arrValue; else if (in_array($partname,array('login','menus','triggers'))) $value = '/'.$modulename.'/core/'.$partname.'/'; - else if (in_array($partname,array('facture','commande','propale'))) $value = '/'.$modulename.'/'; + else if (in_array($partname,array('models','facture','commande','propale'))) $value = '/'.$modulename.'/'; else if ($value == 1) $value = '/'.$modulename.'/core/modules/'.$partname.'/'; - //print 'xxx'.$varname.' '.$value.'
'; - $this->$varname = array_merge($this->$varname, array($modulename => $value)); + $this->$varname = array_merge($this->$varname, array($modulename => $value)); // TODO deprecated + $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $value)); } // If this is a module constant (must be at end) elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)$/i',$key,$reg)) @@ -202,6 +204,7 @@ class Conf $db->free($resql); } //var_dump($this->modules); + //var_dump($this->modules_parts); // Clean some variables if (empty($this->global->MAIN_MENU_STANDARD)) $this->global->MAIN_MENU_STANDARD="eldy_backoffice.php"; diff --git a/htdocs/core/modules/commande/modules_commande.php b/htdocs/core/modules/commande/modules_commande.php index bae7627d343..87c03bfb2e3 100644 --- a/htdocs/core/modules/commande/modules_commande.php +++ b/htdocs/core/modules/commande/modules_commande.php @@ -183,7 +183,7 @@ function commande_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0 // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),$conf->commande_modules); + $dirmodels=array_merge(array('/'),$conf->modules_parts['models']); foreach($dirmodels as $reldir) { foreach(array('doc','pdf') as $prefix) diff --git a/htdocs/core/modules/facture/modules_facture.php b/htdocs/core/modules/facture/modules_facture.php index b600fc127d6..4950e49c2d5 100644 --- a/htdocs/core/modules/facture/modules_facture.php +++ b/htdocs/core/modules/facture/modules_facture.php @@ -181,7 +181,7 @@ function facture_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),$conf->facture_modules); + $dirmodels=array_merge(array('/'),$conf->modules_parts['models']); foreach($dirmodels as $reldir) { foreach(array('doc','pdf') as $prefix) diff --git a/htdocs/core/modules/propale/modules_propale.php b/htdocs/core/modules/propale/modules_propale.php index a144834899d..8e187e26d5e 100644 --- a/htdocs/core/modules/propale/modules_propale.php +++ b/htdocs/core/modules/propale/modules_propale.php @@ -184,7 +184,7 @@ function propale_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),$conf->propale_modules); + $dirmodels=array_merge(array('/'),$conf->modules_parts['models']); foreach($dirmodels as $reldir) { foreach(array('doc','pdf') as $prefix)