NEW: Translate extrafield's labels

This commit is contained in:
fmarcet 2015-08-18 16:40:03 +02:00
parent 241bf85da2
commit d6b84233ed
2 changed files with 3 additions and 3 deletions

View File

@ -3794,7 +3794,7 @@ abstract class CommonObject
*/
function showOptionals($extrafields, $mode='view', $params=null, $keyprefix='')
{
global $_POST, $conf;
global $_POST, $conf, $langs;
$out = '';
@ -3852,7 +3852,7 @@ abstract class CommonObject
if($extrafields->attribute_required[$key])
$label = '<span class="fieldrequired">'.$label.'</span>';
$out .= '<td>'.$label.'</td>';
$out .= '<td>'.$langs->trans($label).'</td>';
$out .='<td'.($colspan?' colspan="'.$colspan.'"':'').'>';
switch($mode) {

View File

@ -49,7 +49,7 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
print '<table width="100%" class="nobordernopadding"><tr><td';
//var_dump($action);exit;
if ((! empty($action) && ($action == 'create' || $action == 'edit')) && ! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>' . $label . '</td>';
print '>' . $langs->trans($label) . '</td>';
//TODO Improve element and rights detection
//var_dump($user->rights);