Merge pull request #11914 from fmarcet/develop

Fix: Load invoices only if showed
This commit is contained in:
Laurent Destailleur
2019-09-27 14:34:16 +02:00
committed by GitHub
4 changed files with 105 additions and 115 deletions

View File

@@ -1277,7 +1277,7 @@ class ExtraFields
// Several field into label (eq table:code|libelle:rowid)
$notrans = false;
$fields_label = explode('|', $InfoFieldList[1]);
if (is_array($fields_label)) {
if (is_array($fields_label) && count($fields_label) > 1) {
$notrans = true;
foreach ($fields_label as $field_toshow) {
$labeltoshow .= $obj->$field_toshow . ' ';
@@ -1291,27 +1291,16 @@ class ExtraFields
if (!$notrans) {
foreach ($fields_label as $field_toshow) {
$translabel = $langs->trans($obj->$field_toshow);
if ($translabel != $obj->$field_toshow) {
$labeltoshow = dol_trunc($translabel, 18) . ' ';
} else {
$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
}
$labeltoshow = dol_trunc($translabel, 18) . ' ';
}
}
$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
} else {
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);
}
$labeltoshow = dol_trunc($translabel, 18);
}
if (empty($labeltoshow)) $labeltoshow = '(not defined)';
if ($value == $obj->rowid) {
$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
}
if (!empty($InfoFieldList[3]) && $parentField) {
$parent = $parentName . ':' . $obj->{$parentField};