FIX the extrafields separator was not translated

This commit is contained in:
Laurent Destailleur 2018-04-13 10:48:29 +02:00
parent 768b9d3d1e
commit 78fcbe9633
3 changed files with 10 additions and 5 deletions

View File

@ -5996,7 +5996,7 @@ abstract class CommonObject
if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate')
{ {
$out .= $extrafields->showSeparator($key); $out .= $extrafields->showSeparator($key, $this);
} }
else else
{ {

View File

@ -1743,11 +1743,16 @@ class ExtraFields
* Return HTML string to print separator extrafield * Return HTML string to print separator extrafield
* *
* @param string $key Key of attribute * @param string $key Key of attribute
* @return string * @param string $object Object
* @return string HTML code with line for separator
*/ */
function showSeparator($key) function showSeparator($key, $object)
{ {
$out = '<tr class="trextrafieldseparator trextrafieldseparator'.$key.'"><td colspan="4"><strong>'.$this->attribute_label[$key].'</strong></td></tr>'; global $langs;
$out = '<tr class="trextrafieldseparator trextrafieldseparator'.$key.'"><td colspan="2"><strong>';
$out.= $langs->trans($this->attributes[$object->table_element]['label'][$key]);
$out.= '</strong></td></tr>';
return $out; return $out;
} }

View File

@ -80,7 +80,7 @@ if (empty($reshook) && ! empty($extrafields->attributes[$object->table_element][
} }
if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate') if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate')
{ {
print $extrafields->showSeparator($key); print $extrafields->showSeparator($key, $object);
} }
else else
{ {