Fix: label not translated if special lang file used
This commit is contained in:
parent
d404d8be9f
commit
7e79c3a795
@ -747,7 +747,7 @@ class ExtraFields
|
|||||||
$this->attribute_pos[$tab->name]=$tab->pos;
|
$this->attribute_pos[$tab->name]=$tab->pos;
|
||||||
$this->attribute_alwayseditable[$tab->name]=$tab->alwayseditable;
|
$this->attribute_alwayseditable[$tab->name]=$tab->alwayseditable;
|
||||||
$this->attribute_perms[$tab->name]=$tab->perms;
|
$this->attribute_perms[$tab->name]=$tab->perms;
|
||||||
$this->attribute_langfile[$tab->langs]=$tab->langs;
|
$this->attribute_langfile[$tab->name]=$tab->langs;
|
||||||
$this->attribute_list[$tab->name]=$tab->list;
|
$this->attribute_list[$tab->name]=$tab->list;
|
||||||
$this->attribute_hidden[$tab->name]=$tab->ishidden;
|
$this->attribute_hidden[$tab->name]=$tab->ishidden;
|
||||||
$this->attribute_entityid[$tab->name]=$tab->entity;
|
$this->attribute_entityid[$tab->name]=$tab->entity;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2010-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2012-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -61,39 +61,43 @@ print "</tr>\n";
|
|||||||
|
|
||||||
if (count($extrafields->attribute_type))
|
if (count($extrafields->attribute_type))
|
||||||
{
|
{
|
||||||
foreach($extrafields->attribute_type as $key => $value)
|
foreach($extrafields->attribute_type as $key => $value)
|
||||||
{
|
{
|
||||||
|
// Load language if required
|
||||||
|
if (! empty($extrafields->attribute_langfile[$key])) {
|
||||||
|
$langs->load($extrafields->attribute_langfile[$key]);
|
||||||
|
}
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print "<td>".$extrafields->attribute_pos[$key]."</td>\n";
|
print "<td>".$extrafields->attribute_pos[$key]."</td>\n";
|
||||||
print "<td>".$extrafields->attribute_label[$key]."</td>\n";
|
print "<td>".$langs->trans($extrafields->attribute_label[$key])."</td>\n";
|
||||||
print "<td>".$key."</td>\n";
|
print "<td>".$key."</td>\n";
|
||||||
print "<td>".$type2label[$extrafields->attribute_type[$key]]."</td>\n";
|
print "<td>".$type2label[$extrafields->attribute_type[$key]]."</td>\n";
|
||||||
print '<td align="right">'.$extrafields->attribute_size[$key]."</td>\n";
|
print '<td align="right">'.$extrafields->attribute_size[$key]."</td>\n";
|
||||||
print '<td align="center">'.yn($extrafields->attribute_unique[$key])."</td>\n";
|
print '<td align="center">'.yn($extrafields->attribute_unique[$key])."</td>\n";
|
||||||
print '<td>'.dol_trunc($extrafields->attribute_computed[$key], 20)."</td>\n";
|
print '<td>'.dol_trunc($extrafields->attribute_computed[$key], 20)."</td>\n";
|
||||||
print '<td align="center">'.yn($extrafields->attribute_required[$key])."</td>\n";
|
print '<td align="center">'.yn($extrafields->attribute_required[$key])."</td>\n";
|
||||||
print '<td align="center">'.yn($extrafields->attribute_alwayseditable[$key])."</td>\n";
|
print '<td align="center">'.yn($extrafields->attribute_alwayseditable[$key])."</td>\n";
|
||||||
print '<td align="center">'.$extrafields->attribute_list[$key]."</td>\n";
|
print '<td align="center">'.$extrafields->attribute_list[$key]."</td>\n";
|
||||||
if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) print '<td align="center">'.yn($extrafields->attribute_hidden[$key])."</td>\n"; // Add hidden option on not working feature. Why hide if user can't see it.
|
if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) print '<td align="center">'.yn($extrafields->attribute_hidden[$key])."</td>\n"; // Add hidden option on not working feature. Why hide if user can't see it.
|
||||||
if ($conf->multicompany->enabled) {
|
if (! empty($conf->multicompany->enabled)) {
|
||||||
print '<td align="center">'.($extrafields->attribute_entityid[$key]==0?$langs->trans("All"):$extrafields->attribute_entitylabel[$key]).'</td>';
|
print '<td align="center">'.($extrafields->attribute_entityid[$key]==0?$langs->trans("All"):$extrafields->attribute_entitylabel[$key]).'</td>';
|
||||||
}
|
}
|
||||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'">'.img_edit().'</a>';
|
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'">'.img_edit().'</a>';
|
||||||
print " <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=$key\">".img_delete()."</a></td>\n";
|
print " <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=$key\">".img_delete()."</a></td>\n";
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$colspan=9;
|
$colspan=9;
|
||||||
if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) $colspan++;
|
if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) $colspan++;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="opacitymedium" colspan="'.$colspan.'">';
|
print '<td class="opacitymedium" colspan="'.$colspan.'">';
|
||||||
print $langs->trans("None");
|
print $langs->trans("None");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user