diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 331ab1c3b98..ff31407b5b8 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -800,7 +800,21 @@ class Form while ($i < $num) { $obj = $this->db->fetch_object($resql); - $label=$obj->nom; + + if ($conf->global->SOCIETE_ADD_REF_IN_LIST) { + if (($obj->client) && (!empty($obj->code_client))) { + $label = $obj->code_client. ' - '; + } + if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) { + $label .= $obj->code_fournisseur. ' - '; + } + $label.=' '.$obj->nom; + } + else + { + $label=$obj->nom; + } + if ($showtype) { if ($obj->client || $obj->fournisseur) $label.=' ('; diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index ed07d70ba93..e44ea3400a5 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -124,6 +124,13 @@ class modSociete extends DolibarrModules $this->const[$r][4] = 1; $r++; */ + + $this->const[$r][0] = "SOCIETE_ADD_REF_IN_LIST"; + $this->const[$r][1] = "yesno"; + $this->const[$r][2] = "0"; + $this->const[$r][3] = "Display customer ref into select list"; + $this->const[$r][4] = 0; + $r++; // Boxes $this->boxes = array(); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index e63a8c8ecb4..0cb281fa45b 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1002,6 +1002,7 @@ BrowserIsOK=You are using the web browser %s. This browser is ok for security an BrowserIsKO=You are using the web browser %s. This browser is known to be a bad choice for security, performance and reliability. We recommand you to use Firefox, Chrome, Opera or Safari. XDebugInstalled=XDebug est chargé. XCacheInstalled=XCache is loaded. +AddRefInList=Display customer/supplier ref into list (select list or combobox) and most of hyperlink ##### Module password generation PasswordGenerationStandard=Return a password generated according to internal Dolibarr algorithm: 8 characters containing shared numbers and characters in lowercase. PasswordGenerationNone=Do not suggest any generated password. Password must be type in manually. diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index b8e3c8fe48c..4341d453fba 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1002,6 +1002,7 @@ BrowserIsOK=Vous utilisez le navigateur %s. Ce navigateur est réputé optimisé BrowserIsKO=Vous utilisez le navigateur %s. Ce navigateur est déconseillé pour des raisons de sécurité, performance et qualité des pages restituées. Nous vous recommandons d'utiliser Firefox, Chrome, Opera ou Safari. XDebugInstalled=XDebug est chargé. XCacheInstalled=XCache est chargé. +AddRefInList=Affiché le code client/fournisseur dans les liste (déroulante ou autocomplétion) et dans la pluspart des hyperliens ##### Module password generation PasswordGenerationStandard=Renvoie un mot de passe généré selon l'algorithme interne de Dolibarr : 8 caractères, chiffres et caractères en minuscules mélangés. PasswordGenerationNone=Ne propose pas de mots de passe générés. Le mot de passe est à saisir manuellement. diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index bd73628eec3..98f8e79fd1c 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -211,6 +211,22 @@ if ($action == 'setprofid') } } +//Activate Set ref in list +if ($action=="setaddrefinlist") { + $setaddrefinlist = GETPOST('value','int'); + $res = dolibarr_set_const($db, "SOCIETE_ADD_REF_IN_LIST", $setaddrefinlist,'yesno',0,'',$conf->entity); + if (! $res > 0) $error++; + if (! $error) + { + $mesg = "".$langs->trans("SetupSaved").""; + } + else + { + $mesg = "".$langs->trans("Error").""; + } +} + + //Activate ProfId mandatory if ($action == 'setprofidmandatory') { @@ -717,6 +733,23 @@ else print ''; print ''; +$var=!$var; +print ""; +print ''.$langs->trans("AddRefInList").''; +if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) +{ + print ''; + print img_picto($langs->trans("Activated"),'switch_on'); + print ''; +} +else +{ + print ''; + print img_picto($langs->trans("Disabled"),'switch_off'); + print ''; +} +print ''; + $var=!$var; print '
'; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 9127adc3a8f..c2fd3e1d40b 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1433,6 +1433,16 @@ class Societe extends CommonObject $name=$this->name?$this->name:$this->nom; + if ($conf->global->SOCIETE_ADD_REF_IN_LIST) { + if (($this->client) && (! empty ( $this->code_client ))) { + $code = $this->code_client . ' - '; + } + if (($this->fournisseur) && (! empty ( $this->code_fournisseur ))) { + $code .= $this->code_fournisseur . ' - '; + } + $name =$code.' '.$name; + } + $result=''; $lien=$lienfin='';