From f1d1522478e7971a5fcf5f9cc2d725014948f32e Mon Sep 17 00:00:00 2001 From: jfefe Date: Thu, 9 Jan 2014 01:49:59 +0100 Subject: [PATCH] Fix : when using several field for label into sellist extrafields traduction 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 --- htdocs/core/class/extrafields.class.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 39916775507..b68e395580a 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -753,6 +753,7 @@ class ExtraFields $fields_label = explode('|',$InfoFieldList[1]); if(is_array($fields_label)) { + $notrans = true; foreach ($fields_label as $field_toshow) { $labeltoshow.= $obj->$field_toshow.' '; @@ -778,12 +779,15 @@ class ExtraFields } 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)