Skip to content

Commit

Permalink
Fix : when using several field for label into sellist extrafields tra…
Browse files Browse the repository at this point in the history
…duction is not needed.

Without this, the list display "not defined". The key can't exists because label displayed is build from several field so we show raw data
  • Loading branch information
jfefe committed Jan 9, 2014
1 parent 855487a commit f1d1522
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions htdocs/core/class/extrafields.class.php
Expand Up @@ -753,6 +753,7 @@ function showInputField($key,$value,$moreparam='')
$fields_label = explode('|',$InfoFieldList[1]);
if(is_array($fields_label))
{
$notrans = true;
foreach ($fields_label as $field_toshow)
{
$labeltoshow.= $obj->$field_toshow.' ';
Expand All @@ -778,12 +779,15 @@ function showInputField($key,$value,$moreparam='')
}
else
{
$translabel=$langs->trans($obj->$InfoFieldList[1]);
if ($translabel!=$obj->$InfoFieldList[1]) {
$labeltoshow=dol_trunc($translabel,18);
}
else {
$labeltoshow=dol_trunc($obj->$InfoFieldList[1],18);
if(!$notrans)
{
$translabel=$langs->trans($obj->$InfoFieldList[1]);
if ($translabel!=$obj->$InfoFieldList[1]) {
$labeltoshow=dol_trunc($translabel,18);
}
else {
$labeltoshow=dol_trunc($obj->$InfoFieldList[1],18);
}
}
if (empty($labeltoshow)) $labeltoshow='(not defined)';
if ($value==$obj->rowid)
Expand Down

0 comments on commit f1d1522

Please sign in to comment.