From 0b7f474dd37fbbbeeb0efc2ad54e1c0af75db6d0 Mon Sep 17 00:00:00 2001
From: Anthony Berton <34568357+bb2a@users.noreply.github.com>
Date: Mon, 17 May 2021 18:04:21 +0200
Subject: [PATCH 1/3] look_feel user author in list
---
htdocs/comm/propal/list.php | 10 +++++-----
htdocs/commande/list.php | 7 +++----
htdocs/compta/facture/list.php | 7 +++----
htdocs/projet/list.php | 4 +++-
4 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 43c83117457..7f738f84ebe 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -1705,14 +1705,13 @@ if ($resql) {
}
}
- $userstatic->id = $obj->fk_user_author;
- $userstatic->login = $obj->login;
+ $userstatic->fetch($obj->fk_user_author);
// Author
if (!empty($arrayfields['u.login']['checked'])) {
- print '
';
+ print ' | ';
if ($userstatic->id) {
- print $userstatic->getLoginUrl(1);
+ print $userstatic->getNomUrl(-1);
}
print " | \n";
if (!$i) {
@@ -1744,7 +1743,8 @@ if ($resql) {
$userstatic->entity = $val['entity'];
$userstatic->photo = $val['photo'];
$userstatic->login = $val['login'];
- $userstatic->phone = $val['phone'];
+ $userstatic->user_mobile = $val['user_mobile'];
+ $userstatic->user_mobile = $val['user_mobile'];
$userstatic->job = $val['job'];
$userstatic->gender = $val['gender'];
//print '':
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 3747b2107b2..d14fe1ae460 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -1668,14 +1668,13 @@ if ($resql) {
}
}
- $userstatic->id = $obj->fk_user_author;
- $userstatic->login = $obj->login;
+ $userstatic->fetch($obj->fk_user_author);
// Author
if (!empty($arrayfields['u.login']['checked'])) {
- print '
';
+ print ' | ';
if ($userstatic->id) {
- print $userstatic->getLoginUrl(1);
+ print $userstatic->getNomUrl(-1);
} else {
print ' ';
}
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 14b0383fa8d..e5c08993b9f 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -1880,11 +1880,10 @@ if ($resql) {
// Author
if (!empty($arrayfields['u.login']['checked'])) {
- $userstatic->id = $obj->fk_user_author;
- $userstatic->login = $obj->login;
- print ' | ';
+ $userstatic->fetch($obj->fk_user_author);
+ print ' | ';
if ($userstatic->id) {
- print $userstatic->getLoginUrl(1);
+ print $userstatic->getNomUrl(-1);
} else {
print ' ';
}
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index a9f17f5439b..1edeb0816c2 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -1041,7 +1041,9 @@ while ($i < min($num, $limit)) {
$userstatic->entity = $val['entity'];
$userstatic->photo = $val['photo'];
$userstatic->login = $val['login'];
- $userstatic->phone = $val['phone'];
+ $userstatic->office_phone = $val['office_phone'];
+ $userstatic->office_fax = $val['office_fax'];
+ $userstatic->user_mobile = $val['user_mobile'];
$userstatic->job = $val['job'];
$userstatic->gender = $val['gender'];
print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1, '', 0, 0, 12) : $userstatic->getNomUrl(-2);
From 9dcf2044a96c755a8bb54dfe61163c1703b466b7 Mon Sep 17 00:00:00 2001
From: Anthony Berton <34568357+bb2a@users.noreply.github.com>
Date: Mon, 17 May 2021 18:33:27 +0200
Subject: [PATCH 2/3] Update list.php
---
htdocs/comm/propal/list.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 7f738f84ebe..0f277dad14c 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -1743,7 +1743,8 @@ if ($resql) {
$userstatic->entity = $val['entity'];
$userstatic->photo = $val['photo'];
$userstatic->login = $val['login'];
- $userstatic->user_mobile = $val['user_mobile'];
+ $userstatic->office_phone = $val['office_phone'];
+ $userstatic->office_fax = $val['office_fax'];
$userstatic->user_mobile = $val['user_mobile'];
$userstatic->job = $val['job'];
$userstatic->gender = $val['gender'];
From 6fe9fe330d8a2618801910e7c1f056fee10edfa3 Mon Sep 17 00:00:00 2001
From: Anthony Berton <34568357+bb2a@users.noreply.github.com>
Date: Mon, 17 May 2021 23:54:31 +0200
Subject: [PATCH 3/3] delete fetch
---
htdocs/comm/propal/list.php | 16 ++++++++++++++--
htdocs/commande/list.php | 22 +++++++++++++++++-----
htdocs/compta/facture/list.php | 25 +++++++++++++++++++------
3 files changed, 50 insertions(+), 13 deletions(-)
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index f086616cada..656d15114b9 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -470,7 +470,7 @@ $sql .= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date
$sql .= ' p.note_public, p.note_private,';
$sql .= ' p.fk_cond_reglement,p.fk_mode_reglement,p.fk_shipping_method,p.fk_input_reason,';
$sql .= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
-$sql .= ' u.login';
+$sql .= ' u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender';
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= ", sc.fk_soc, sc.fk_user";
}
@@ -1692,7 +1692,19 @@ if ($resql) {
}
}
- $userstatic->fetch($obj->fk_user_author);
+ $userstatic->id = $obj->fk_user_author;
+ $userstatic->login = $obj->login;
+ $userstatic->lastname = $obj->lastname;
+ $userstatic->firstname = $obj->firstname;
+ $userstatic->email = $obj->email;
+ $userstatic->statut = $obj->statut;
+ $userstatic->entity = $obj->entity;
+ $userstatic->photo = $obj->photo;
+ $userstatic->office_phone = $obj->office_phone;
+ $userstatic->office_fax = $obj->office_fax;
+ $userstatic->user_mobile = $obj->user_mobile;
+ $userstatic->job = $obj->job;
+ $userstatic->gender = $obj->gender;
// Author
if (!empty($arrayfields['u.login']['checked'])) {
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index e441f4e2a57..64d41039e93 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -424,10 +424,10 @@ $sql .= ' c.rowid, c.ref, c.total_ht, c.total_tva, c.total_ttc, c.ref_client, c.
$sql .= ' c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva as multicurrency_total_vat, c.multicurrency_total_ttc,';
$sql .= ' c.date_valid, c.date_commande, c.note_public, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as billed,';
$sql .= ' c.date_creation as date_creation, c.tms as date_update, c.date_cloture as date_cloture,';
-$sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,";
-$sql .= " u.login,";
-$sql .= ' c.fk_cond_reglement,c.fk_mode_reglement,c.fk_shipping_method';
-$sql .= ' ,c.fk_input_reason';
+$sql .= ' p.rowid as project_id, p.ref as project_ref, p.title as project_label,';
+$sql .= ' u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender,';
+$sql .= ' c.fk_cond_reglement,c.fk_mode_reglement,c.fk_shipping_method,';
+$sql .= ' c.fk_input_reason';
if ($search_categ_cus) {
$sql .= ", cc.fk_categorie, cc.fk_soc";
}
@@ -1667,7 +1667,19 @@ if ($resql) {
}
}
- $userstatic->fetch($obj->fk_user_author);
+ $userstatic->id = $obj->fk_user_author;
+ $userstatic->login = $obj->login;
+ $userstatic->lastname = $obj->lastname;
+ $userstatic->firstname = $obj->firstname;
+ $userstatic->email = $obj->email;
+ $userstatic->statut = $obj->statut;
+ $userstatic->entity = $obj->entity;
+ $userstatic->photo = $obj->photo;
+ $userstatic->office_phone = $obj->office_phone;
+ $userstatic->office_fax = $obj->office_fax;
+ $userstatic->user_mobile = $obj->user_mobile;
+ $userstatic->job = $obj->job;
+ $userstatic->gender = $obj->gender;
// Author
if (!empty($arrayfields['u.login']['checked'])) {
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index f60cec54cbb..fa703336a84 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -482,11 +482,11 @@ $sql .= ' f.paye as paye, f.fk_statut, f.close_code,';
$sql .= ' f.datec as date_creation, f.tms as date_update, f.date_closing as date_closing,';
$sql .= ' f.retained_warranty, f.retained_warranty_date_limit, f.situation_final, f.situation_cycle_ref, f.situation_counter,';
$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as name_alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,';
-$sql .= " typent.code as typent_code,";
-$sql .= " state.code_departement as state_code, state.nom as state_name,";
-$sql .= " country.code as country_code,";
-$sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,";
-$sql .= " u.login";
+$sql .= ' typent.code as typent_code,';
+$sql .= ' state.code_departement as state_code, state.nom as state_name,';
+$sql .= ' country.code as country_code,';
+$sql .= ' p.rowid as project_id, p.ref as project_ref, p.title as project_label,';
+$sql .= ' u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender';
// We need dynamount_payed to be able to sort on status (value is surely wrong because we can count several lines several times due to other left join or link with contacts. But what we need is just 0 or > 0)
// TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field.
if (!$sall) {
@@ -1878,9 +1878,22 @@ if ($resql) {
$totalarray['val']['f.total_ttc'] += $obj->total_ttc;
}
+ $userstatic->id = $obj->fk_user_author;
+ $userstatic->login = $obj->login;
+ $userstatic->lastname = $obj->lastname;
+ $userstatic->firstname = $obj->firstname;
+ $userstatic->email = $obj->email;
+ $userstatic->statut = $obj->statut;
+ $userstatic->entity = $obj->entity;
+ $userstatic->photo = $obj->photo;
+ $userstatic->office_phone = $obj->office_phone;
+ $userstatic->office_fax = $obj->office_fax;
+ $userstatic->user_mobile = $obj->user_mobile;
+ $userstatic->job = $obj->job;
+ $userstatic->gender = $obj->gender;
+
// Author
if (!empty($arrayfields['u.login']['checked'])) {
- $userstatic->fetch($obj->fk_user_author);
print ' | ';
if ($userstatic->id) {
print $userstatic->getNomUrl(-1);
|