Merge pull request #9207 from atm-florian/dev_showadressinthirdpartylistoption
NEW: Add option to display thirdparty adress in combolist
This commit is contained in:
commit
948bb47040
@ -1087,8 +1087,18 @@ class Form
|
||||
|
||||
// On recherche les societes
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.client, s.fournisseur, s.code_client, s.code_fournisseur";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX ."societe as s";
|
||||
|
||||
if ($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST) {
|
||||
$sql .= " ,s.address, s.zip, s.town";
|
||||
$sql .= " , dictp.code as country_code";
|
||||
}
|
||||
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX ."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " )";
|
||||
if ($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST) {
|
||||
$sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."c_country as dictp ON dictp.rowid=s.fk_pays";
|
||||
}
|
||||
$sql.= " WHERE s.entity IN (".getEntity('societe').")";
|
||||
if (! empty($user->socid)) $sql.= " AND s.rowid = ".$user->socid;
|
||||
if ($filter) $sql.= " AND (".$filter.")";
|
||||
@ -1177,6 +1187,13 @@ class Form
|
||||
if ($obj->client || $obj->fournisseur) $label.=')';
|
||||
}
|
||||
|
||||
if ($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST) {
|
||||
$label.='-'.$obj->address.'-'. $obj->zip.' '. $obj->town;
|
||||
if (!empty($obj->country_code)) {
|
||||
$label.= ' '. $langs->trans('Country'.$obj->country_code);
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($outputmode))
|
||||
{
|
||||
if (in_array($obj->rowid,$selected))
|
||||
|
||||
@ -1179,6 +1179,7 @@ BrowserIsKO=You are using the %s web browser. This browser is known to be a bad
|
||||
XDebugInstalled=XDebug is loaded.
|
||||
XCacheInstalled=XCache is loaded.
|
||||
AddRefInList=Display Customer/Supplier ref. info list (select list or combobox) and most of hyperlink.<br>Third Parties will appear with a name format of "CC12345 - SC45678 - The Big Company corp." instead of "The Big Company corp".
|
||||
AddAdressInList=Display Customer/Supplier adress info list (select list or combobox)<br>Third Parties will appear with a name format of "The Big Company corp. - 21 jump street 123456 Big town - USA" instead of "The Big Company corp".
|
||||
AskForPreferredShippingMethod=Ask for preferred sending method for Third Parties.
|
||||
FieldEdition=Edition of field %s
|
||||
FillThisOnlyIfRequired=Example: +2 (fill only if timezone offset problems are experienced)
|
||||
|
||||
@ -182,6 +182,21 @@ if ($action=="setaddrefinlist") {
|
||||
}
|
||||
}
|
||||
|
||||
//Activate Set adress in list
|
||||
if ($action=="setaddadressinlist") {
|
||||
$val = GETPOST('value','int');
|
||||
$res = dolibarr_set_const($db, "COMPANY_SHOW_ADDRESS_SELECTLIST", $val,'yesno',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
//Activate Ask For Preferred Shipping Method
|
||||
if ($action=="setaskforshippingmet") {
|
||||
$setaskforshippingmet = GETPOST('value','int');
|
||||
@ -769,6 +784,24 @@ else
|
||||
print '</a></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="80%">'.$langs->trans("AddAdressInList").'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td align="center">';
|
||||
if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST))
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setaddadressinlist&value=0">';
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setaddadressinlist&value=1">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
}
|
||||
print '</a></td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user