From 0b8d7f329e9abee5bb842e1164f5caf4e2f8a452 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Aug 2020 17:17:22 +0200 Subject: [PATCH] FIX added information on user list not visible with multiselect --- htdocs/core/class/html.form.class.php | 35 ++++++++++++--------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c8a38dd0ea6..22da5ba9e8e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1753,43 +1753,39 @@ class Form $out .= $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength); // Complete name with more info - $moreinfo = 0; + $moreinfo = ''; if (!empty($conf->global->MAIN_SHOW_LOGIN)) { - $out .= ($moreinfo ? ' - ' : ' (').$obj->login; - $moreinfo++; + $moreinfo .= ($moreinfo ? ' - ' : ' (').$obj->login; } if ($showstatus >= 0) { if ($obj->statut == 1 && $showstatus == 1) { - $out .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled'); - $moreinfo++; + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled'); } if ($obj->statut == 0) { - $out .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled'); - $moreinfo++; + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled'); } } if (!empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && !$user->entity) { if (!$obj->entity) { - $out .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities"); - $moreinfo++; + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities"); } else { - $out .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); - $moreinfo++; + $moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); } } - $out .= ($moreinfo ? ')' : ''); + $moreinfo .= ($moreinfo ? ')' : ''); if ($disableline && $disableline != '1') { - $out .= ' - '.$disableline; // This is text from $enableonlytext parameter + $moreinfo .= ' - '.$disableline; // This is text from $enableonlytext parameter } + $out .= $moreinfo; $out .= ''; - $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength); + $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo; $i++; } @@ -6378,7 +6374,7 @@ class Form * @param string $htmlname Name of select * @param array $array Array with key+value * @param array $selected Array with key+value preselected - * @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value" + * @param int $key_in_label 1 to show key like in "[key] value" * @param int $value_as_key 1 to use value as key * @param string $morecss Add more css style * @param int $translate Translate and encode value @@ -6404,7 +6400,7 @@ class Form // Add code for jquery to use multiselect if (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) { - $out .= "\n".' + $out .= "\n".'