From 4876aee493f7682599a13e783daee97d5a465fd6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Apr 2013 20:32:09 +0200 Subject: [PATCH] Fix: Fix bad fix of SOCIETE_CODEFOURNISSEUR_ADDON --- htdocs/core/class/conf.class.php | 2 -- .../canvas/actions_card_common.class.php | 3 +-- htdocs/societe/class/societe.class.php | 18 +++++++++--------- htdocs/societe/soc.php | 6 ++---- 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 06510e28199..c4f65889fbe 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -331,8 +331,6 @@ class Conf // societe 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"; // Security diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 317299965b7..6b9f213b6c9 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -460,8 +460,7 @@ abstract class ActionsCardCommon $this->tpl['supplier_enabled'] = 1; // Load object modCodeFournisseur - $module=$conf->global->SOCIETE_CODEFOURNISSEUR_ADDON; - if (! $module) $module=$conf->global->SOCIETE_CODECLIENT_ADDON; + $module=$conf->global->SOCIETE_CODECLIENT_ADDON; if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { $module = substr($module, 0, dol_strlen($module)-4); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index da5927128ae..d6666495a14 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1769,15 +1769,15 @@ class Societe extends CommonObject function get_codefournisseur($objsoc=0,$type=1) { 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']); 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; } - $var = $conf->global->SOCIETE_CODEFOURNISSEUR_ADDON; + $var = $conf->global->SOCIETE_CODECLIENT_ADDON; $mod = new $var; $this->code_fournisseur = $mod->getNextValue($objsoc,$type); @@ -1829,16 +1829,16 @@ class Societe extends CommonObject function codefournisseur_modifiable() { 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']); 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; } - $var = $conf->global->SOCIETE_CODEFOURNISSEUR_ADDON; + $var = $conf->global->SOCIETE_CODECLIENT_ADDON; $mod = new $var; @@ -1902,16 +1902,16 @@ class Societe extends CommonObject function check_codefournisseur() { 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']); 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; } - $var = $conf->global->SOCIETE_CODEFOURNISSEUR_ADDON; + $var = $conf->global->SOCIETE_CODECLIENT_ADDON; $mod = new $var; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 0ee8d7d0f8c..ae6867be12d 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -561,8 +561,7 @@ else if ($res) break; } $modCodeClient = new $module; - $module=$conf->global->SOCIETE_CODEFOURNISSEUR_ADDON; - if (! $module) $module=$conf->global->SOCIETE_CODECLIENT_ADDON; + $module=$conf->global->SOCIETE_CODECLIENT_ADDON; if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { $module = substr($module, 0, dol_strlen($module)-4); @@ -1038,8 +1037,7 @@ else { $prefixCustomerIsUsed = $modCodeClient->verif_prefixIsUsed(); } - $module=$conf->global->SOCIETE_CODEFOURNISSEUR_ADDON; - if (! $module) $module=$conf->global->SOCIETE_CODECLIENT_ADDON; + $module=$conf->global->SOCIETE_CODECLIENT_ADDON; if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { $module = substr($module, 0, dol_strlen($module)-4);