From cd5bd7dca7db6a980e6d3223aa5f43e0e1742acc Mon Sep 17 00:00:00 2001 From: Pascal Corpet Date: Sat, 28 Jun 2008 15:15:59 +0200 Subject: [PATCH] use of display_name instead of prenom nom --- htdocs/css/default.css | 4 ++++ include/user.func.inc.php | 4 +++- include/userset.inc.php | 44 +++++++++++++++++++++-------------- templates/include/minifiche.tpl | 4 ++-- templates/include/plview.referent.tpl | 2 +- templates/include/plview.trombi.tpl | 2 +- templates/include/trombi.tpl | 2 +- templates/profile/general.tpl | 2 +- templates/profile/profile.tpl | 2 +- 9 files changed, 40 insertions(+), 26 deletions(-) diff --git a/htdocs/css/default.css b/htdocs/css/default.css index fa87cf7..b4bb322 100644 --- a/htdocs/css/default.css +++ b/htdocs/css/default.css @@ -107,6 +107,10 @@ p { background: inherit; } +.hinted { + border-bottom: 1px dashed black; +} + input.error, textarea.error { background-color: #faa; } diff --git a/include/user.func.inc.php b/include/user.func.inc.php index a12be69..bdf4602 100644 --- a/include/user.func.inc.php +++ b/include/user.func.inc.php @@ -398,7 +398,8 @@ function &get_user_details($login, $from_uid = '', $view = 'private') s.text AS section, p.x, p.y, p.pub AS photo_pub, u.matricule_ax, m.expertise != '' AS is_referent, - (COUNT(e.email) > 0 OR FIND_IN_SET('googleapps', u.mail_storage) > 0) AS actif + (COUNT(e.email) > 0 OR FIND_IN_SET('googleapps', u.mail_storage) > 0) AS actif, + nd.display AS name_display, nd.tooltip AS name_tooltip FROM auth_user_md5 AS u INNER JOIN auth_user_quick AS q USING(user_id) INNER JOIN aliases AS a ON (u.user_id=a.id AND a.type='a_vie') @@ -409,6 +410,7 @@ function &get_user_details($login, $from_uid = '', $view = 'private') LEFT JOIN photo AS p ON (p.uid = u.user_id) LEFT JOIN mentor AS m ON (m.uid = u.user_id) LEFT JOIN emails AS e ON (e.uid = u.user_id AND e.flags='active') + INNER JOIN profile_names_display AS nd ON (nd.user_id = u.user_id) WHERE a.alias = {?} GROUP BY u.user_id"; $res = XDB::query($reqsql, $from_uid, $login); diff --git a/include/userset.inc.php b/include/userset.inc.php index cdaf28d..ab8cb89 100644 --- a/include/userset.inc.php +++ b/include/userset.inc.php @@ -164,11 +164,11 @@ class MinificheView extends MultipageView global $globals; $this->entriesPerPage = $globals->search->per_page; if (@$params['with_score']) { - $this->addSortKey('score', array('-score', '-date', '-promo', 'nom', 'prenom'), 'pertinence'); + $this->addSortKey('score', array('-score', '-date', '-promo', 'name_sort'), 'pertinence'); } - $this->addSortKey('name', array('nom', 'prenom'), 'nom'); - $this->addSortKey('promo', array('-promo', 'nom', 'prenom'), 'promotion'); - $this->addSortKey('date_mod', array('-date', '-promo', 'nom', 'prenom'), 'dernière modification'); + $this->addSortKey('name', array('name_sort'), 'nom'); + $this->addSortKey('promo', array('-promo', 'name_sort'), 'promotion'); + $this->addSortKey('date_mod', array('-date', '-promo', 'name_sort'), 'dernière modification'); parent::__construct($set, $data, $params); } @@ -185,8 +185,8 @@ class MinificheView extends MultipageView ad0.text AS app0text, ad0.url AS app0url, ai0.type AS app0type, ad1.text AS app1text, ad1.url AS app1url, ai1.type AS app1type, adr.city, gp.a2, gp.pays AS countrytxt, gr.name AS region, - IF(u.nom_usage<>'',u.nom_usage,u.nom) AS sortkey, - (COUNT(em.email) > 0 OR FIND_IN_SET('googleapps', u.mail_storage) > 0) AS actif" . + (COUNT(em.email) > 0 OR FIND_IN_SET('googleapps', u.mail_storage) > 0) AS actif, + nd.display AS name_display, nd.tooltip AS name_tooltip, nd.sort AS name_sort" . (S::logged() ? ", c.contact AS contact" : ''); } @@ -204,7 +204,8 @@ class MinificheView extends MultipageView AND FIND_IN_SET('active', adr.statut)".(S::logged() ? "" : " AND adr.pub = 'public'").") LEFT JOIN geoloc_pays AS gp ON (adr.country = gp.a2) LEFT JOIN geoloc_region AS gr ON (adr.country = gr.a2 AND adr.region = gr.region) - LEFT JOIN emails AS em ON (em.uid = u.user_id AND em.flags = 'active')" . + LEFT JOIN emails AS em ON (em.uid = u.user_id AND em.flags = 'active') + INNER JOIN profile_names_display AS nd ON (nd.user_id = u.user_id)" . (S::logged() ? "LEFT JOIN contacts AS c On (c.contact = u.user_id AND c.uid = " . S::v('uid') . ")" : ""); @@ -222,17 +223,23 @@ class MentorView extends MultipageView { $this->entriesPerPage = 10; $this->addSortKey('rand', array('RAND(' . S::i('uid') . ')'), 'aléatoirement'); - $this->addSortKey('name', array('nom', 'prenom'), 'nom'); - $this->addSortKey('promo', array('-promo', 'nom', 'prenom'), 'promotion'); - $this->addSortKey('date_mod', array('-date', '-promo', 'nom', 'prenom'), 'dernière modification'); + $this->addSortKey('name', array('name_sort'), 'nom'); + $this->addSortKey('promo', array('-promo', 'name_sort'), 'promotion'); + $this->addSortKey('date_mod', array('-date', '-promo', 'name_sort'), 'dernière modification'); parent::__construct($set, $data, $params); } public function fields() { - return "m.uid, u.prenom, u.nom, u.promo, + return "m.uid, u.promo, a.alias AS bestalias, m.expertise, mp.pid, - ms.secteur, ms.ss_secteur"; + ms.secteur, ms.ss_secteur, + nd.display AS name_display, nd.tooltip AS name_tooltip, nd.sort AS name_sort"; + } + + public function joins() + { + return "INNER JOIN profile_names_display AS nd ON (nd.user_id = u.user_id)"; } public function templateName() @@ -246,23 +253,24 @@ class TrombiView extends MultipageView public function __construct(PlSet &$set, $data, array $params) { $this->entriesPerPage = 24; - $this->order = explode(',', Env::v('order', 'nom,prenom,promo')); + $this->order = explode(',', Env::v('order', 'name_sort')); if (@$params['with_score']) { - $this->addSortKey('score', array('-score', '-watch_last', '-promo', 'nom', 'prenom'), 'pertinence'); + $this->addSortKey('score', array('-score', '-watch_last', '-promo', 'name_sort'), 'pertinence'); } - $this->addSortKey('name', array('nom', 'prenom'), 'nom'); - $this->addSortKey('promo', array('-promo', 'nom', 'prenom'), 'promotion'); + $this->addSortKey('name', array('name_sort'), 'nom'); + $this->addSortKey('promo', array('-promo', 'name_sort'), 'promotion'); parent::__construct($set, $data, $params); } public function fields() { - return "u.user_id, IF(u.nom_usage != '', u.nom_usage, u.nom) AS nom, u.prenom, u.promo, a.alias AS forlife "; + return "u.user_id, nd.display AS name_display, nd.tooltip AS name_tooltip, nd.sort AS name_sort, u.promo, a.alias AS forlife "; } public function joins() { - return "INNER JOIN photo AS p ON (p.uid = u.user_id) "; + return "INNER JOIN photo AS p ON (p.uid = u.user_id) + INNER JOIN profile_names_display AS nd ON (nd.user_id = u.user_id)"; } public function templateName() diff --git a/templates/include/minifiche.tpl b/templates/include/minifiche.tpl index bc6246a..cd4d8e4 100644 --- a/templates/include/minifiche.tpl +++ b/templates/include/minifiche.tpl @@ -26,14 +26,14 @@ {if $smarty.session.auth ge AUTH_COOKIE}
{$c.prenom} {$c.nom} + alt="{$c.name_display}" />
{/if}
{if $c.sexe}•{/if} {if !$c.dcd && ($c.inscrit || $smarty.session.auth eq AUTH_PUBLIC)}{/if} - {if $c.nom_usage}{$c.nom_usage} {$c.prenom}
({$c.nom}){else}{$c.nom} {$c.prenom}{/if} + {$c.name_display} {if !$c.dcd && ($c.inscrit || $smarty.session.auth eq AUTH_PUBLIC)}
{/if}
diff --git a/templates/include/plview.referent.tpl b/templates/include/plview.referent.tpl index 14606ed..481e0f7 100644 --- a/templates/include/plview.referent.tpl +++ b/templates/include/plview.referent.tpl @@ -24,7 +24,7 @@ {iterate from=$set item=p}
- {$p.nom} {$p.prenom} + {$p.name_display}
X{$p.promo} diff --git a/templates/include/plview.trombi.tpl b/templates/include/plview.trombi.tpl index 1015f5f..e97375e 100644 --- a/templates/include/plview.trombi.tpl +++ b/templates/include/plview.trombi.tpl @@ -40,7 +40,7 @@ {/if}
- {$p.prenom} {$p.nom}{if $trombi_with_promo} ({$p.promo}){/if} + {$p.name_display}{if $trombi_with_promo} ({$p.promo}){/if} {if $loop eq "3"} diff --git a/templates/include/trombi.tpl b/templates/include/trombi.tpl index e49bf6f..88a8c83 100644 --- a/templates/include/trombi.tpl +++ b/templates/include/trombi.tpl @@ -37,7 +37,7 @@ {/if}
- {$p.prenom} {$p.nom}{if $trombi_show_promo} ({$p.promo}){/if} + {$p.name_display}{if $trombi_show_promo} ({$p.promo}){/if} {if $loop eq "3"} diff --git a/templates/profile/general.tpl b/templates/profile/general.tpl index ab8b2d7..b85bb41 100644 --- a/templates/profile/general.tpl +++ b/templates/profile/general.tpl @@ -54,7 +54,7 @@ Affichage de ton nom - {if $tooltip_name}{$display_name}{else}{$display_name}{/if} + {if $tooltip_name}{$display_name}{else}{$display_name}{/if} {icon name="page_edit" title="Plus de détail"} diff --git a/templates/profile/profile.tpl b/templates/profile/profile.tpl index 8b8aeee..7c20986 100644 --- a/templates/profile/profile.tpl +++ b/templates/profile/profile.tpl @@ -72,7 +72,7 @@ function chgMainWinLoc(strPage)
{if $x.sexe}•{/if} - {$x.prenom} {if $x.nom_usage eq ""}{$x.nom}{else}{$x.nom_usage} ({$x.nom}){/if} + {$x.name_display} {if $logged} {if $x.nickname} (alias {$x.nickname}){/if} {/if} -- 2.1.4