diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c8a0164ad76..68b5f7966ad 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1726,6 +1726,7 @@ class Form $fullNameMode = 1; //Firstname+lastname } $labeltoshow .= $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength); + if (empty($obj->firstname) && empty($obj->lastname)) $labeltoshow .= $obj->login; // Complete name with more info $moreinfo = ''; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 7606779afe5..f1e5ff9921c 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -430,7 +430,7 @@ class FormOther if ($showempty) $out .= ''; // Get list of users allowed to be viewed - $sql_usr = "SELECT u.rowid, u.lastname, u.firstname, u.statut, u.login"; + $sql_usr = "SELECT u.rowid, u.lastname, u.firstname, u.statut as status, u.login, u.photo, u.gender, u.entity, u.admin"; $sql_usr .= " FROM ".MAIN_DB_PREFIX."user as u"; if (!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) @@ -455,7 +455,7 @@ class FormOther if (empty($user->rights->user->user->lire) && $user->socid) { $sql_usr .= " UNION "; - $sql_usr .= "SELECT u2.rowid, u2.lastname, u2.firstname, u2.statut, u2.login"; + $sql_usr .= "SELECT u2.rowid, u2.lastname, u2.firstname, u2.statut as status, u2.login, u2.photo, u2.gender, u2.entity, u2.admin"; $sql_usr .= " FROM ".MAIN_DB_PREFIX."user as u2, ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) @@ -480,14 +480,37 @@ class FormOther $resql_usr = $this->db->query($sql_usr); if ($resql_usr) { + $userstatic = new User($this->db); + $showstatus = 1; + while ($obj_usr = $this->db->fetch_object($resql_usr)) { + $userstatic->id = $obj_usr->rowid; + $userstatic->lastname = $obj_usr->lastname; + $userstatic->firstname = $obj_usr->firstname; + $userstatic->photo = $obj_usr->photo; + $userstatic->statut = $obj_usr->status; + $userstatic->entity = $obj_usr->entity; + $userstatic->admin = $obj_usr->admin; + + $labeltoshow = dolGetFirstLastname($obj_usr->firstname, $obj_usr->lastname); + if (empty($obj_usr->firstname) && empty($obj_usr->lastname)) $labeltoshow = $obj_usr->login; + $out .= '