[ task #1044 ] Add option to enabled thirdparty number into select

thirdparty list
This commit is contained in:
Florian Henry 2013-08-30 18:18:58 +02:00
parent 8b9b682eaf
commit 9ed5653ae5
6 changed files with 67 additions and 1 deletions

View File

@ -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.=' (';

View File

@ -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();

View File

@ -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.

View File

@ -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.

View File

@ -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 = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
}
else
{
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
}
}
//Activate ProfId mandatory
if ($action == 'setprofidmandatory')
{
@ -717,6 +733,23 @@ else
print '</tr>';
print '</form>';
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td width="80%">'.$langs->trans("AddRefInList").'</td>';
if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST))
{
print '<td align="center" colspan="2"><a href="'.$_SERVER['PHP_SELF'].'?action=setaddrefinlist&value=0">';
print img_picto($langs->trans("Activated"),'switch_on');
print '</a></td>';
}
else
{
print '<td align="center" colspan="2"><a href="'.$_SERVER['PHP_SELF'].'?action=setaddrefinlist&value=1">';
print img_picto($langs->trans("Disabled"),'switch_off');
print '</a></td>';
}
print '</tr>';
$var=!$var;
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';

View File

@ -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='';