From f8e6befe35771ceeec75e091c5b5e274029b29e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Dec 2021 16:47:11 +0100 Subject: [PATCH] Fix link on user --- htdocs/supplier_proposal/list.php | 14 +++++++++++--- htdocs/user/class/user.class.php | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index a64ac94b169..4c92387a613 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -302,7 +302,7 @@ $sql .= " p.rowid as project_id, p.ref as project_ref,"; if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " sc.fk_soc, sc.fk_user,"; } -$sql .= " u.firstname, u.lastname, u.photo, u.login"; +$sql .= " u.firstname, u.lastname, u.photo, u.login, u.statut as status, u.admin, u.employee, u.email as uemail"; // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { @@ -1092,12 +1092,20 @@ if ($resql) { $userstatic->id = $obj->fk_user_author; $userstatic->login = $obj->login; + $userstatic->status = $obj->status; + $userstatic->lastname = $obj->name; + $userstatic->firstname = $obj->firstname; + $userstatic->photo = $obj->photo; + $userstatic->admin = $obj->admin; + $userstatic->ref = $obj->fk_user_author; + $userstatic->employee = $obj->employee; + $userstatic->email = $obj->uemail; // Author if (!empty($arrayfields['u.login']['checked'])) { print ''; - if ($userstatic->id) { - print $userstatic->getLoginUrl(1); + if ($userstatic->id > 0) { + print $userstatic->getNomUrl(-1, '', 0, 0, 24, 1, 'login', '', 1); } else { print ' '; } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 467a572193e..d5fc9c8ece2 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2797,7 +2797,7 @@ class User extends CommonObject */ public function getLibStatut($mode = 0) { - return $this->LibStatut($this->statut, $mode); + return $this->LibStatut(isset($this->statut) ? $this->statut : $this->status, $mode); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps