Fix: Fix tons of bugs after change for new way to declare modules

features
This commit is contained in:
Laurent Destailleur 2012-03-01 00:03:16 +01:00
parent e0f7637bb3
commit badc6d0f45
5 changed files with 190 additions and 109 deletions

View File

@ -63,6 +63,7 @@ class Conf
public $sms_engine_modules = array(); public $sms_engine_modules = array();
public $barcode_modules = array(); public $barcode_modules = array();
public $substitutions_modules = array(); public $substitutions_modules = array();
public $societe_modules = array();
var $logbuffer = array(); var $logbuffer = array();
@ -164,9 +165,8 @@ class Conf
if (! is_array($this->$varname)) { $this->$varname = array(); } if (! is_array($this->$varname)) { $this->$varname = array(); }
$arrValue = @unserialize($value); $arrValue = @unserialize($value);
if (is_array($arrValue) && ! empty($arrValue)) $value = $arrValue; if (is_array($arrValue) && ! empty($arrValue)) $value = $arrValue;
else if ($partname == 'barcode') $value = '/'.$modulename.'/core/modules/'.$partname.'/'; else if (in_array($partname,array('login','menus','triggers'))) $value = '/'.$modulename.'/core/'.$partname.'/';
else if ($partname == 'models') $value = $modulename.'/'; else if ($value == 1) $value = '/'.$modulename.'/core/modules/'.$partname.'/';
else $value = ($value == 1 ? '/'.$modulename.'/core/'.$partname.'/' : $value);
$this->$varname = array_merge($this->$varname, array($modulename => $value)); $this->$varname = array_merge($this->$varname, array($modulename => $value));
} }
// If this is a module constant (must be at end) // If this is a module constant (must be at end)

View File

@ -218,6 +218,9 @@ dol_fiche_head($head, 'general', $langs->trans("ThirdParty"), 0, 'company');
dol_htmloutput_mesg($mesg); dol_htmloutput_mesg($mesg);
$dirsociete=array_merge(array('/core/modules/societe/'),$conf->societe_modules);
// Module to manage customer/supplier code // Module to manage customer/supplier code
print_titre($langs->trans("CompanyCodeChecker")); print_titre($langs->trans("CompanyCodeChecker"));
@ -232,9 +235,10 @@ print ' <td align="center" width="60">'.$langs->trans("Infos").'</td>';
print "</tr>\n"; print "</tr>\n";
$var = true; $var = true;
foreach ($conf->file->dol_document_root as $dirroot) foreach ($dirsociete as $dirroot)
{ {
$dir = $dirroot . "/core/modules/societe/"; $dir = dol_buildpath($dirroot,0);
$handle = @opendir($dir); $handle = @opendir($dir);
if (is_resource($handle)) if (is_resource($handle))
{ {
@ -246,7 +250,7 @@ foreach ($conf->file->dol_document_root as $dirroot)
$file = substr($file, 0, dol_strlen($file)-4); $file = substr($file, 0, dol_strlen($file)-4);
try { try {
dol_include_once("/core/modules/societe/".$file.".php"); dol_include_once($dirroot.$file.".php");
} }
catch(Exception $e) catch(Exception $e)
{ {
@ -312,11 +316,11 @@ print '<td align="center" width="80">'.$langs->trans("Status").'</td>';
print '<td align="center" width="60">&nbsp;</td>'; print '<td align="center" width="60">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
$var = true; foreach ($dirsociete as $dirroot)
foreach ($conf->file->dol_document_root as $dirroot)
{ {
$dir = $dirroot . "/core/modules/societe/"; $dir = dol_buildpath($dirroot,0);
$handle = @opendir($dir);
$handle = @opendir($dir);
if (is_resource($handle)) if (is_resource($handle))
{ {
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
@ -325,7 +329,13 @@ foreach ($conf->file->dol_document_root as $dirroot)
{ {
$file = substr($file, 0, dol_strlen($file)-4); $file = substr($file, 0, dol_strlen($file)-4);
dol_include_once("/core/modules/societe/".$file.".php"); try {
dol_include_once($dirroot.$file.".php");
}
catch(Exception $e)
{
dol_syslog($e->getMessage(), LOG_ERR);
}
$modCodeCompta = new $file; $modCodeCompta = new $file;
$var = !$var; $var = !$var;
@ -398,101 +408,104 @@ print '<td align="center" width="80">'.$langs->trans("Status").'</td>';
print '<td align="center" width="60">'.$langs->trans("Infos").'</td>'; print '<td align="center" width="60">'.$langs->trans("Infos").'</td>';
print "</tr>\n"; print "</tr>\n";
$var=true; foreach ($dirsociete as $dirroot)
foreach ($conf->file->dol_document_root as $dirroot)
{ {
$dir = $dirroot . "/core/modules/societe/doc"; $dir = dol_buildpath($dirroot.'doc/',0);
if (is_dir($dir)) $handle=@opendir($dir);
if (is_resource($handle))
{ {
$handle=opendir($dir); while (($file = readdir($handle))!==false)
if (is_resource($handle))
{ {
while (($file = readdir($handle))!==false) if (preg_match('/\.modules\.php$/i',$file))
{ {
if (preg_match('/\.modules\.php$/i',$file)) $name = substr($file, 4, dol_strlen($file) -16);
$classname = substr($file, 0, dol_strlen($file) -12);
try {
dol_include_once($dirroot.'doc/'.$file);
}
catch(Exception $e)
{
dol_syslog($e->getMessage(), LOG_ERR);
}
$module = new $classname($db);
$modulequalified=1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
if ($modulequalified)
{ {
$name = substr($file, 4, dol_strlen($file) -16); $var = !$var;
$classname = substr($file, 0, dol_strlen($file) -12); print '<tr '.$bc[$var].'><td width="100">';
print $module->name;
print "</td><td>\n";
if (method_exists($module,'info')) print $module->info($langs);
else print $module->description;
print '</td>';
require_once($dir.'/'.$file); // Activate / Disable
$module = new $classname($db); if (in_array($name, $def))
$modulequalified=1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
if ($modulequalified)
{ {
$var = !$var; print "<td align=\"center\">\n";
print '<tr '.$bc[$var].'><td width="100">'; //if ($conf->global->COMPANY_ADDON_PDF != "$name")
print $module->name; //{
print "</td><td>\n"; print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
if (method_exists($module,'info')) print $module->info($langs); print img_picto($langs->trans("Enabled"),'switch_on');
else print $module->description; print '</a>';
print '</td>'; //}
//else
// Activate / Disable //{
if (in_array($name, $def)) // print img_picto($langs->trans("Enabled"),'on');
//}
print "</td>";
}
else
{
if (versioncompare($module->phpmin,versionphparray()) > 0)
{ {
print "<td align=\"center\">\n"; print "<td align=\"center\">\n";
//if ($conf->global->COMPANY_ADDON_PDF != "$name") print img_picto(dol_escape_htmltag($langs->trans("ErrorModuleRequirePHPVersion",join('.',$module->phpmin))),'switch_off');
//{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
//}
//else
//{
// print img_picto($langs->trans("Enabled"),'on');
//}
print "</td>"; print "</td>";
} }
else else
{ {
if (versioncompare($module->phpmin,versionphparray()) > 0) print "<td align=\"center\">\n";
{ print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "<td align=\"center\">\n"; print "</td>";
print img_picto(dol_escape_htmltag($langs->trans("ErrorModuleRequirePHPVersion",join('.',$module->phpmin))),'switch_off');
print "</td>";
}
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
} }
// Info
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
if ($modele->type == 'pdf')
{
$htmltooltip.='<br>'.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur;
}
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraft").': '.yn($module->option_draft_watermark,1,1);
print '<td align="center" nowrap="nowrap">';
if ($modele->type == 'pdf')
{
$linkspec='<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
}
else
{
$linkspec=img_object($langs->trans("PreviewNotAvailable"),'generic');
}
print $form->textwithpicto(' &nbsp; '.$linkspec,$htmltooltip,1,0);
print '</td>';
print "</tr>\n";
} }
// Info
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
if ($modele->type == 'pdf')
{
$htmltooltip.='<br>'.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur;
}
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraft").': '.yn($module->option_draft_watermark,1,1);
print '<td align="center" nowrap="nowrap">';
if ($modele->type == 'pdf')
{
$linkspec='<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
}
else
{
$linkspec=img_object($langs->trans("PreviewNotAvailable"),'generic');
}
print $form->textwithpicto(' &nbsp; '.$linkspec,$htmltooltip,1,0);
print '</td>';
print "</tr>\n";
} }
} }
closedir($handle);
} }
closedir($handle);
} }
} }
print '</table>'; print '</table>';

View File

@ -438,7 +438,12 @@ abstract class ActionsCardCommon
{ {
$module = substr($module, 0, dol_strlen($module)-4); $module = substr($module, 0, dol_strlen($module)-4);
} }
require_once(DOL_DOCUMENT_ROOT ."/core/modules/societe/".$module.".php"); $dirsociete=array_merge(array('/core/modules/societe/'),$conf->societe_modules);
foreach ($dirsociete as $dirroot)
{
$res=dol_include_once($dirroot.$module.".php");
if ($res) break;
}
$modCodeClient = new $module; $modCodeClient = new $module;
$this->tpl['auto_customercode'] = $modCodeClient->code_auto; $this->tpl['auto_customercode'] = $modCodeClient->code_auto;
// We verified if the tag prefix is used // We verified if the tag prefix is used
@ -470,7 +475,12 @@ abstract class ActionsCardCommon
{ {
$module = substr($module, 0, dol_strlen($module)-4); $module = substr($module, 0, dol_strlen($module)-4);
} }
require_once(DOL_DOCUMENT_ROOT ."/core/modules/societe/".$module.".php"); $dirsociete=array_merge(array('/core/modules/societe/'),$conf->societe_modules);
foreach ($dirsociete as $dirroot)
{
$res=dol_include_once($dirroot.$module.".php");
if ($res) break;
}
$modCodeFournisseur = new $module; $modCodeFournisseur = new $module;
$this->tpl['auto_suppliercode'] = $modCodeFournisseur->code_auto; $this->tpl['auto_suppliercode'] = $modCodeFournisseur->code_auto;
// We verified if the tag prefix is used // We verified if the tag prefix is used

View File

@ -1658,15 +1658,21 @@ class Societe extends CommonObject
} }
/** /**
* \brief Attribut un code client a partir du module de controle des codes. * Attribut un code client a partir du module de controle des codes.
* \return code_client Code client automatique *
* @return code_client Code client automatique
*/ */
function get_codeclient($objsoc=0,$type=0) function get_codeclient($objsoc=0,$type=0)
{ {
global $conf; global $conf;
if ($conf->global->SOCIETE_CODECLIENT_ADDON) if ($conf->global->SOCIETE_CODECLIENT_ADDON)
{ {
require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/'.$conf->global->SOCIETE_CODECLIENT_ADDON.'.php'; $dirsociete=array_merge(array('/core/modules/societe/'),$conf->societe_modules);
foreach ($dirsociete as $dirroot)
{
$res=dol_include_once($dirroot.$conf->global->SOCIETE_CODECLIENT_ADDON.".php");
if ($res) break;
}
$var = $conf->global->SOCIETE_CODECLIENT_ADDON; $var = $conf->global->SOCIETE_CODECLIENT_ADDON;
$mod = new $var; $mod = new $var;
@ -1678,15 +1684,21 @@ class Societe extends CommonObject
} }
/** /**
* \brief Attribut un code fournisseur a partir du module de controle des codes. * Attribut un code fournisseur a partir du module de controle des codes.
* \return code_fournisseur Code fournisseur automatique *
* @return code_fournisseur Code fournisseur automatique
*/ */
function get_codefournisseur($objsoc=0,$type=1) function get_codefournisseur($objsoc=0,$type=1)
{ {
global $conf; global $conf;
if ($conf->global->SOCIETE_CODEFOURNISSEUR_ADDON) if ($conf->global->SOCIETE_CODEFOURNISSEUR_ADDON)
{ {
require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/'.$conf->global->SOCIETE_CODEFOURNISSEUR_ADDON.'.php'; $dirsociete=array_merge(array('/core/modules/societe/'),$conf->societe_modules);
foreach ($dirsociete as $dirroot)
{
$res=dol_include_once($dirroot.$conf->global->SOCIETE_FOURNISSEUR_ADDON.".php");
if ($res) break;
}
$var = $conf->global->SOCIETE_CODEFOURNISSEUR_ADDON; $var = $conf->global->SOCIETE_CODEFOURNISSEUR_ADDON;
$mod = new $var; $mod = new $var;
@ -1706,7 +1718,12 @@ class Societe extends CommonObject
global $conf; global $conf;
if ($conf->global->SOCIETE_CODECLIENT_ADDON) if ($conf->global->SOCIETE_CODECLIENT_ADDON)
{ {
require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/'.$conf->global->SOCIETE_CODECLIENT_ADDON.'.php'; $dirsociete=array_merge(array('/core/modules/societe/'),$conf->societe_modules);
foreach ($dirsociete as $dirroot)
{
$res=dol_include_once($dirroot.$conf->global->SOCIETE_CODECLIENT_ADDON.".php");
if ($res) break;
}
$var = $conf->global->SOCIETE_CODECLIENT_ADDON; $var = $conf->global->SOCIETE_CODECLIENT_ADDON;
@ -1734,7 +1751,12 @@ class Societe extends CommonObject
global $conf; global $conf;
if ($conf->global->SOCIETE_CODEFOURNISSEUR_ADDON) if ($conf->global->SOCIETE_CODEFOURNISSEUR_ADDON)
{ {
require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/'.$conf->global->SOCIETE_CODEFOURNISSEUR_ADDON.'.php'; $dirsociete=array_merge(array('/core/modules/societe/'),$conf->societe_modules);
foreach ($dirsociete as $dirroot)
{
$res=dol_include_once($dirroot.$conf->global->SOCIETE_CODEFOURNISSEUR_ADDON.".php");
if ($res) break;
}
$var = $conf->global->SOCIETE_CODEFOURNISSEUR_ADDON; $var = $conf->global->SOCIETE_CODEFOURNISSEUR_ADDON;
@ -1766,7 +1788,12 @@ class Societe extends CommonObject
global $conf; global $conf;
if ($conf->global->SOCIETE_CODECLIENT_ADDON) if ($conf->global->SOCIETE_CODECLIENT_ADDON)
{ {
require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/'.$conf->global->SOCIETE_CODECLIENT_ADDON.'.php'; $dirsociete=array_merge(array('/core/modules/societe/'),$conf->societe_modules);
foreach ($dirsociete as $dirroot)
{
$res=dol_include_once($dirroot.$conf->global->SOCIETE_CODECLIENT_ADDON.".php");
if ($res) break;
}
$var = $conf->global->SOCIETE_CODECLIENT_ADDON; $var = $conf->global->SOCIETE_CODECLIENT_ADDON;
@ -1795,7 +1822,12 @@ class Societe extends CommonObject
global $conf; global $conf;
if ($conf->global->SOCIETE_CODEFOURNISSEUR_ADDON) if ($conf->global->SOCIETE_CODEFOURNISSEUR_ADDON)
{ {
require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/'.$conf->global->SOCIETE_CODEFOURNISSEUR_ADDON.'.php'; $dirsociete=array_merge(array('/core/modules/societe/'),$conf->societe_modules);
foreach ($dirsociete as $dirroot)
{
$res=dol_include_once($dirroot.$conf->global->SOCIETE_CODEFOURNISSEUR_ADDON.".php");
if ($res) break;
}
$var = $conf->global->SOCIETE_CODEFOURNISSEUR_ADDON; $var = $conf->global->SOCIETE_CODEFOURNISSEUR_ADDON;
@ -1824,7 +1856,12 @@ class Societe extends CommonObject
if ($conf->global->SOCIETE_CODECOMPTA_ADDON) if ($conf->global->SOCIETE_CODECOMPTA_ADDON)
{ {
require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/'.$conf->global->SOCIETE_CODECOMPTA_ADDON.'.php'; $dirsociete=array_merge(array('/core/modules/societe/'),$conf->societe_modules);
foreach ($dirsociete as $dirroot)
{
$res=dol_include_once($dirroot.$conf->global->SOCIETE_CODECOMPTA_ADDON.".php");
if ($res) break;
}
$var = $conf->global->SOCIETE_CODECOMPTA_ADDON; $var = $conf->global->SOCIETE_CODECOMPTA_ADDON;

View File

@ -499,7 +499,12 @@ else
{ {
$module = substr($module, 0, dol_strlen($module)-4); $module = substr($module, 0, dol_strlen($module)-4);
} }
require_once(DOL_DOCUMENT_ROOT ."/core/modules/societe/".$module.".php"); $dirsociete=array_merge(array('/core/modules/societe/'),$conf->societe_modules);
foreach ($dirsociete as $dirroot)
{
$res=dol_include_once($dirroot.$module.".php");
if ($res) break;
}
$modCodeClient = new $module; $modCodeClient = new $module;
$module=$conf->global->SOCIETE_CODEFOURNISSEUR_ADDON; $module=$conf->global->SOCIETE_CODEFOURNISSEUR_ADDON;
if (! $module) $module=$conf->global->SOCIETE_CODECLIENT_ADDON; if (! $module) $module=$conf->global->SOCIETE_CODECLIENT_ADDON;
@ -507,7 +512,12 @@ else
{ {
$module = substr($module, 0, dol_strlen($module)-4); $module = substr($module, 0, dol_strlen($module)-4);
} }
require_once(DOL_DOCUMENT_ROOT ."/core/modules/societe/".$module.".php"); $dirsociete=array_merge(array('/core/modules/societe/'),$conf->societe_modules);
foreach ($dirsociete as $dirroot)
{
$res=dol_include_once($dirroot.$module.".php");
if ($res) break;
}
$modCodeFournisseur = new $module; $modCodeFournisseur = new $module;
//if ($_GET["type"]=='cp') { $object->client=3; } //if ($_GET["type"]=='cp') { $object->client=3; }
@ -693,10 +703,11 @@ else
// Prospect/Customer // Prospect/Customer
print '<tr><td width="25%"><span class="fieldrequired">'.$langs->trans('ProspectCustomer').'</span></td><td width="25%"><select class="flat" name="client">'; print '<tr><td width="25%"><span class="fieldrequired">'.$langs->trans('ProspectCustomer').'</span></td><td width="25%"><select class="flat" name="client">';
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) print '<option value="2"'.($object->client==2?' selected="selected"':'').'>'.$langs->trans('Prospect').'</option>'; $selected=isset($_POST['client'])?GETPOST('client'):$object->client;
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) print '<option value="3"'.($object->client==3?' selected="selected"':'').'>'.$langs->trans('ProspectCustomer').'</option>'; if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) print '<option value="2"'.($selected==2?' selected="selected"':'').'>'.$langs->trans('Prospect').'</option>';
print '<option value="1"'.($object->client==1?' selected="selected"':'').'>'.$langs->trans('Customer').'</option>'; if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) print '<option value="3"'.($selected==3?' selected="selected"':'').'>'.$langs->trans('ProspectCustomer').'</option>';
print '<option value="0"'.($object->client==0?' selected="selected"':'').'>'.$langs->trans('NorProspectNorCustomer').'</option>'; print '<option value="1"'.($selected==1?' selected="selected"':'').'>'.$langs->trans('Customer').'</option>';
print '<option value="0"'.($selected==0?' selected="selected"':'').'>'.$langs->trans('NorProspectNorCustomer').'</option>';
print '</select></td>'; print '</select></td>';
print '<td width="25%">'.$langs->trans('CustomerCode').'</td><td width="25%">'; print '<td width="25%">'.$langs->trans('CustomerCode').'</td><td width="25%">';
@ -716,7 +727,7 @@ else
// Supplier // Supplier
print '<tr>'; print '<tr>';
print '<td><span class="fieldrequired">'.$langs->trans('Supplier').'</span></td><td>'; print '<td><span class="fieldrequired">'.$langs->trans('Supplier').'</span></td><td>';
print $form->selectyesno("fournisseur",$object->fournisseur,1); print $form->selectyesno("fournisseur",(isset($_POST['fournisseur'])?GETPOST('fournisseur'):$object->fournisseur),1);
print '</td>'; print '</td>';
print '<td>'.$langs->trans('SupplierCode').'</td><td>'; print '<td>'.$langs->trans('SupplierCode').'</td><td>';
print '<table class="nobordernopadding"><tr><td>'; print '<table class="nobordernopadding"><tr><td>';
@ -991,7 +1002,12 @@ else
{ {
$module = substr($module, 0, dol_strlen($module)-4); $module = substr($module, 0, dol_strlen($module)-4);
} }
require_once(DOL_DOCUMENT_ROOT ."/core/modules/societe/".$module.".php"); $dirsociete=array_merge(array('/core/modules/societe/'),$conf->societe_modules);
foreach ($dirsociete as $dirroot)
{
$res=dol_include_once($dirroot.$module.".php");
if ($res) break;
}
$modCodeClient = new $module; $modCodeClient = new $module;
// We verified if the tag prefix is used // We verified if the tag prefix is used
if ($modCodeClient->code_auto) if ($modCodeClient->code_auto)
@ -1004,7 +1020,12 @@ else
{ {
$module = substr($module, 0, dol_strlen($module)-4); $module = substr($module, 0, dol_strlen($module)-4);
} }
require_once(DOL_DOCUMENT_ROOT ."/core/modules/societe/".$module.".php"); $dirsociete=array_merge(array('/core/modules/societe/'),$conf->societe_modules);
foreach ($dirsociete as $dirroot)
{
$res=dol_include_once($dirroot.$module.".php");
if ($res) break;
}
$modCodeFournisseur = new $module; $modCodeFournisseur = new $module;
// On verifie si la balise prefix est utilisee // On verifie si la balise prefix est utilisee
if ($modCodeFournisseur->code_auto) if ($modCodeFournisseur->code_auto)