Fix translation of default value for contacts

This commit is contained in:
Laurent Destailleur 2021-02-22 15:51:00 +01:00
parent 45fda63a20
commit c010cab47e
3 changed files with 13 additions and 4 deletions

View File

@ -843,7 +843,7 @@ else
print '<tr><td>'.$langs->trans("ContactByDefaultFor").'</td>';
print '<td colspan="3">';
$contactType = $object->listeTypeContacts('external', '', 1);
print $form->multiselectarray('roles', $contactType);
print $form->multiselectarray('roles', $contactType, array(), 0, 0, 'minwidth500');
print '</td></tr>';
}

View File

@ -1356,6 +1356,8 @@ abstract class CommonObject
if ($resql) {
$num = $this->db->num_rows($resql);
if ($num > 0) {
$langs->loadLangs(array("propal", "orders", "bills", "suppliers", "contracts", "supplier_proposal"));
while ($obj = $this->db->fetch_object($resql)) {
$modulename = $obj->element;
if (strpos($obj->element, 'project') !== false) {
@ -1371,11 +1373,15 @@ abstract class CommonObject
}
if ($conf->{$modulename}->enabled) {
$libelle_element = $langs->trans('ContactDefault_'.$obj->element);
$transkey = "TypeContact_".$obj->element."_".$source."_".$obj->code;
$tmpelement = $obj->element;
$transkey = "TypeContact_".$tmpelement."_".$source."_".$obj->code;
$libelle_type = ($langs->trans($transkey) != $transkey ? $langs->trans($transkey) : $obj->libelle);
if (empty($option))
if (empty($option)) {
$tab[$obj->rowid] = $libelle_element.' - '.$libelle_type;
else $tab[$obj->rowid] = $libelle_element.' - '.$libelle_type;
}
else {
$tab[$obj->rowid] = $libelle_element.' - '.$libelle_type;
}
}
}
}

View File

@ -52,3 +52,6 @@ SupplierProposalsToClose=Vendor proposals to close
SupplierProposalsToProcess=Vendor proposals to process
LastSupplierProposals=Latest %s price requests
AllPriceRequests=All requests
TypeContact_supplier_proposal_external_SHIPPING=Vendor contact for delivery
TypeContact_supplier_proposal_external_BILLING=Vendor contact for billing
TypeContact_supplier_proposal_external_SERVICE=Representative following-up proposal