Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0

This commit is contained in:
Laurent Destailleur 2018-10-24 13:31:04 +02:00
commit f44162715e

View File

@ -3388,13 +3388,19 @@ class Form
while($res = $this->db->fetch_object($resql))
{
$unitLabel = $res->label;
if (! empty($langs->tab_translate['unit'.$res->code])) // check if Translation is available before
{
$unitLabel = $langs->trans('unit'.$res->code)!=$res->label?$langs->trans('unit'.$res->code):$res->label;
}
if ($selected == $res->rowid)
{
$return.='<option value="'.$res->rowid.'" selected>'.($langs->trans('unit'.$res->code)!=$res->label?$langs->trans('unit'.$res->code):$res->label).'</option>';
$return.='<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>';
}
else
{
$return.='<option value="'.$res->rowid.'">'.($langs->trans('unit'.$res->code)!=$res->label?$langs->trans('unit'.$res->code):$res->label).'</option>';
$return.='<option value="'.$res->rowid.'">'.$unitLabel.'</option>';
}
}
$return.='</select>';