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

This commit is contained in:
Laurent Destailleur 2018-10-24 13:31:31 +02:00
commit 277655b911
2 changed files with 9 additions and 2 deletions

View File

@ -893,6 +893,7 @@ class Contact extends CommonObject
$sql.=" FROM ".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as tc";
$sql.=" WHERE ec.fk_c_type_contact = tc.rowid";
$sql.=" AND fk_socpeople = ". $this->id;
$sql.=" AND tc.source = 'external'";
$sql.=" GROUP BY tc.element";
dol_syslog(get_class($this)."::load_ref_elements", LOG_DEBUG);

View File

@ -3503,13 +3503,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>';