2
0
forked from Wavyzz/dolibarr

New: Make some changes to allow usage of alternative

$dolibarr_main_url_root variables.
Can now use several alternative path. Fix several bugs with all code.
This commit is contained in:
Laurent Destailleur
2013-07-07 03:26:51 +02:00
parent 9be6dd8b17
commit 7b5e0678db
22 changed files with 165 additions and 141 deletions

View File

@@ -129,36 +129,39 @@ class Commande extends CommonOrder
global $db, $langs, $conf;
$langs->load("order");
$dir = DOL_DOCUMENT_ROOT . "/core/modules/commande";
if (! empty($conf->global->COMMANDE_ADDON))
{
$file = $conf->global->COMMANDE_ADDON.".php";
$mybool=false;
// Chargement de la classe de numerotation
$file = $conf->global->COMMANDE_ADDON.".php";
$classname = $conf->global->COMMANDE_ADDON;
$result=include_once $dir.'/'.$file;
if ($result)
{
$obj = new $classname();
$numref = "";
$numref = $obj->getNextValue($soc,$this);
// Include file with class
foreach ($conf->file->dol_document_root as $dirroot)
{
$dir = $dirroot."/core/modules/commande/";
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
}
if ( $numref != "")
{
return $numref;
}
else
{
dol_print_error($db,get_class($this)."::getNextNumRef ".$obj->error);
return "";
}
if (! $mybool)
{
dol_print_error('',"Failed to include file ".$file);
return '';
}
$obj = new $classname();
$numref = "";
$numref = $obj->getNextValue($soc,$this);
if ($numref != "")
{
return $numref;
}
else
{
print $langs->trans("Error")." ".$langs->trans("Error_COMMANDE_ADDON_NotDefined");
return "";
{
dol_print_error($db,get_class($this)."::getNextNumRef ".$obj->error);
return "";
}
}
else