Fix: Fix bad fix of SOCIETE_CODEFOURNISSEUR_ADDON

This commit is contained in:
Laurent Destailleur 2013-04-11 20:32:09 +02:00
parent 9a812b799d
commit 4876aee493
4 changed files with 12 additions and 17 deletions

View File

@ -331,8 +331,6 @@ class Conf
// societe // societe
if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) $this->global->SOCIETE_CODECLIENT_ADDON="mod_codeclient_leopard"; if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) $this->global->SOCIETE_CODECLIENT_ADDON="mod_codeclient_leopard";
// Unused constant and for avoid problem with multicompany sharing
//if (empty($this->global->SOCIETE_CODEFOURNISSEUR_ADDON)) $this->global->SOCIETE_CODEFOURNISSEUR_ADDON=$this->global->SOCIETE_CODECLIENT_ADDON;
if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) $this->global->SOCIETE_CODECOMPTA_ADDON="mod_codecompta_panicum"; if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) $this->global->SOCIETE_CODECOMPTA_ADDON="mod_codecompta_panicum";
// Security // Security

View File

@ -460,8 +460,7 @@ abstract class ActionsCardCommon
$this->tpl['supplier_enabled'] = 1; $this->tpl['supplier_enabled'] = 1;
// Load object modCodeFournisseur // Load object modCodeFournisseur
$module=$conf->global->SOCIETE_CODEFOURNISSEUR_ADDON; $module=$conf->global->SOCIETE_CODECLIENT_ADDON;
if (! $module) $module=$conf->global->SOCIETE_CODECLIENT_ADDON;
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php')
{ {
$module = substr($module, 0, dol_strlen($module)-4); $module = substr($module, 0, dol_strlen($module)-4);

View File

@ -1769,15 +1769,15 @@ class Societe extends CommonObject
function get_codefournisseur($objsoc=0,$type=1) function get_codefournisseur($objsoc=0,$type=1)
{ {
global $conf; global $conf;
if (! empty($conf->global->SOCIETE_CODEFOURNISSEUR_ADDON)) if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON))
{ {
$dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']); $dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']);
foreach ($dirsociete as $dirroot) foreach ($dirsociete as $dirroot)
{ {
$res=dol_include_once($dirroot.$conf->global->SOCIETE_CODEFOURNISSEUR_ADDON.'.php'); $res=dol_include_once($dirroot.$conf->global->SOCIETE_CODECLIENT_ADDON.'.php');
if ($res) break; if ($res) break;
} }
$var = $conf->global->SOCIETE_CODEFOURNISSEUR_ADDON; $var = $conf->global->SOCIETE_CODECLIENT_ADDON;
$mod = new $var; $mod = new $var;
$this->code_fournisseur = $mod->getNextValue($objsoc,$type); $this->code_fournisseur = $mod->getNextValue($objsoc,$type);
@ -1829,16 +1829,16 @@ class Societe extends CommonObject
function codefournisseur_modifiable() function codefournisseur_modifiable()
{ {
global $conf; global $conf;
if (! empty($conf->global->SOCIETE_CODEFOURNISSEUR_ADDON)) if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON))
{ {
$dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']); $dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']);
foreach ($dirsociete as $dirroot) foreach ($dirsociete as $dirroot)
{ {
$res=dol_include_once($dirroot.$conf->global->SOCIETE_CODEFOURNISSEUR_ADDON.'.php'); $res=dol_include_once($dirroot.$conf->global->SOCIETE_CODECLIENT_ADDON.'.php');
if ($res) break; if ($res) break;
} }
$var = $conf->global->SOCIETE_CODEFOURNISSEUR_ADDON; $var = $conf->global->SOCIETE_CODECLIENT_ADDON;
$mod = new $var; $mod = new $var;
@ -1902,16 +1902,16 @@ class Societe extends CommonObject
function check_codefournisseur() function check_codefournisseur()
{ {
global $conf; global $conf;
if (! empty($conf->global->SOCIETE_CODEFOURNISSEUR_ADDON)) if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON))
{ {
$dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']); $dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']);
foreach ($dirsociete as $dirroot) foreach ($dirsociete as $dirroot)
{ {
$res=dol_include_once($dirroot.$conf->global->SOCIETE_CODEFOURNISSEUR_ADDON.'.php'); $res=dol_include_once($dirroot.$conf->global->SOCIETE_CODECLIENT_ADDON.'.php');
if ($res) break; if ($res) break;
} }
$var = $conf->global->SOCIETE_CODEFOURNISSEUR_ADDON; $var = $conf->global->SOCIETE_CODECLIENT_ADDON;
$mod = new $var; $mod = new $var;

View File

@ -561,8 +561,7 @@ else
if ($res) break; if ($res) break;
} }
$modCodeClient = new $module; $modCodeClient = new $module;
$module=$conf->global->SOCIETE_CODEFOURNISSEUR_ADDON; $module=$conf->global->SOCIETE_CODECLIENT_ADDON;
if (! $module) $module=$conf->global->SOCIETE_CODECLIENT_ADDON;
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php')
{ {
$module = substr($module, 0, dol_strlen($module)-4); $module = substr($module, 0, dol_strlen($module)-4);
@ -1038,8 +1037,7 @@ else
{ {
$prefixCustomerIsUsed = $modCodeClient->verif_prefixIsUsed(); $prefixCustomerIsUsed = $modCodeClient->verif_prefixIsUsed();
} }
$module=$conf->global->SOCIETE_CODEFOURNISSEUR_ADDON; $module=$conf->global->SOCIETE_CODECLIENT_ADDON;
if (! $module) $module=$conf->global->SOCIETE_CODECLIENT_ADDON;
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php')
{ {
$module = substr($module, 0, dol_strlen($module)-4); $module = substr($module, 0, dol_strlen($module)-4);