From 7773d12532df5bf8ace47759e403670a4e520950 Mon Sep 17 00:00:00 2001 From: Vincent Zanotti Date: Sun, 12 Oct 2008 05:48:13 +0200 Subject: [PATCH] Migrates the PlSet views to hruid. Signed-off-by: Vincent Zanotti --- include/userset.inc.php | 20 +++++++++----------- templates/gadgets/ig-minifiche.tpl | 12 ++++++------ templates/gadgets/ig-search.tpl | 4 ++-- templates/include/minifiche.tpl | 2 +- templates/include/plview.referent.tpl | 4 ++-- templates/include/plview.trombi.tpl | 24 ++++++++++++------------ 6 files changed, 32 insertions(+), 34 deletions(-) diff --git a/include/userset.inc.php b/include/userset.inc.php index e61507b..1fddfc3 100644 --- a/include/userset.inc.php +++ b/include/userset.inc.php @@ -46,9 +46,7 @@ class UserSet extends PlSet (!empty($GLOBALS['IS_XNET_SITE']) ? 'INNER JOIN groupex.membres AS gxm ON (u.user_id = gxm.uid AND gxm.asso_id = ' . $globals->asso('id') . ') ' : '') - . 'LEFT JOIN auth_user_quick AS q USING (user_id) - LEFT JOIN aliases AS a ON (a.id = u.user_id AND a.type = \'a_vie\') - ' . $joins, + . 'LEFT JOIN auth_user_quick AS q USING (user_id)' . $joins, $where, 'u.user_id'); } @@ -172,8 +170,9 @@ class MinificheView extends MultipageView public function fields() { - return "u.user_id AS id, - u.*, a.alias AS forlife, + global $globals; + return "u.user_id AS id, u.*, + CONCAT(a.alias, '@{$globals->mail->domain}') AS bestemail, u.perms != 'pending' AS inscrit, u.perms != 'pending' AS wasinscrit, u.deces != 0 AS dcd, u.deces, u.matricule_ax, @@ -202,6 +201,7 @@ 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 aliases AS a ON (a.id = u.user_id AND FIND_IN_SET('bestalias', a.flags)) LEFT JOIN emails AS em ON (em.uid = u.user_id AND em.flags = 'active')" . (S::logged() ? "LEFT JOIN contacts AS c On (c.contact = u.user_id AND c.uid = " . S::v('uid') . ")" @@ -245,9 +245,8 @@ class MentorView extends MultipageView public function fields() { - return "m.uid, u.prenom, u.nom, u.promo, - a.alias AS forlife, m.expertise, mp.pid, - ms.secteur, ms.ss_secteur"; + return "m.uid, u.prenom, u.nom, u.promo, u.hruid, + m.expertise, mp.pid, ms.secteur, ms.ss_secteur"; } public function bounds() @@ -289,7 +288,7 @@ class TrombiView extends MultipageView 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, IF(u.nom_usage != '', u.nom_usage, u.nom) AS nom, u.prenom, u.promo, u.hruid "; } public function joins() @@ -433,8 +432,7 @@ class GadgetView implements PlView public function fields() { - return "u.user_id AS id, - u.*, a.alias AS forlife," . + return "u.user_id AS id, u.*," . (S::logged() ? "q.profile_mobile AS mobile, " : "IF(q.profile_mobile_pub = 'public', q.profile_mobile, NULL) as mobile, ") . "u.perms != 'pending' AS inscrit, u.perms != 'pending' AS wasinscrit, diff --git a/templates/gadgets/ig-minifiche.tpl b/templates/gadgets/ig-minifiche.tpl index 6ff4e13..2a403ee 100644 --- a/templates/gadgets/ig-minifiche.tpl +++ b/templates/gadgets/ig-minifiche.tpl @@ -20,13 +20,13 @@ {* *} {**************************************************************************} -{if !$c.inscrit || $c.dcd}
{/if} +{if (!$c.inscrit && $smarty.session.auth ge AUTH_COOKIE) || $c.dcd}
{/if}
{if $c.sexe}•{/if} - {if !$c.dcd && $c.inscrit}{/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} - {if !$c.dcd && $c.inscrit}
{/if} + {if !$c.dcd && ($c.inscrit || $smarty.session.auth eq AUTH_PUBLIC)}{/if}
{if $c.iso3166} @@ -44,13 +44,13 @@ *}{icon name=cross title="Retirer de la liste de mes surveillances"} {/if} {elseif $c.wasinscrit && !$c.dcd} - {* + {* *}{icon name=vcard title="Afficher la carte de visite"} {if $show_action eq ajouter} - {* + {* *}{icon name=add title="Ajouter à mes contacts"} {else} - {* + {* *}{icon name=cross title="Retirer de mes contacts"} {/if} {/if} diff --git a/templates/gadgets/ig-search.tpl b/templates/gadgets/ig-search.tpl index 67fdd83..a1c469c 100644 --- a/templates/gadgets/ig-search.tpl +++ b/templates/gadgets/ig-search.tpl @@ -24,13 +24,13 @@
{$error}
{elseif $set}
-{iterate from=$set item=res} +{foreach from=$set item=res} {if $res.contact} {include file="gadgets/ig-minifiche.tpl" c=$res show_action="retirer"} {else} {include file="gadgets/ig-minifiche.tpl" c=$res show_action="ajouter"} {/if} -{/iterate} +{/foreach}
{$result_count} résultats au total >>> diff --git a/templates/include/minifiche.tpl b/templates/include/minifiche.tpl index 26d428c..9efa2fc 100644 --- a/templates/include/minifiche.tpl +++ b/templates/include/minifiche.tpl @@ -64,7 +64,7 @@ {if !$c.dcd} {* *}{icon name=vcard title="Afficher la carte de visite"} - {* + {* *}{icon name=email title="Envoyer un email"} {if $show_action eq ajouter} {* diff --git a/templates/include/plview.referent.tpl b/templates/include/plview.referent.tpl index 76dce26..ebe8c1f 100644 --- a/templates/include/plview.referent.tpl +++ b/templates/include/plview.referent.tpl @@ -31,9 +31,9 @@
diff --git a/templates/include/plview.trombi.tpl b/templates/include/plview.trombi.tpl index e09cab6..bdedf25 100644 --- a/templates/include/plview.trombi.tpl +++ b/templates/include/plview.trombi.tpl @@ -30,16 +30,16 @@ {if $smarty.section.trombi.index % 3 == 1} - -  [ PHOTO ] + +  [ PHOTO ] {if $trombi_with_admin && hasPerm('admin')} {icon name=wrench title="[admin]"} {/if} - -  [ PHOTO ] + +  [ PHOTO ] {if $trombi_with_admin && hasPerm('admin')} {icon name=wrench title="[admin]"} @@ -47,8 +47,8 @@ {if $set[trombi.index_next]} - -  [ PHOTO ] + +  [ PHOTO ] {if $trombi_with_admin && hasPerm('admin')} {icon name=wrench title="[admin]"} @@ -58,18 +58,18 @@ - + {$set[trombi.index_prev].prenom} {$set[trombi.index_prev].nom}{if $trombi_with_promo} ({$set[trombi.index_prev].promo}){/if} - + {$set[trombi].prenom} {$set[trombi].nom}{if $trombi_with_promo} ({$set[trombi].promo}){/if} {if $set[trombi.index_next]} - + {$set[trombi.index_next].prenom} {$set[trombi.index_next].nom}{if $trombi_with_promo} ({$set[trombi.index_next].promo}){/if} {/if} @@ -78,8 +78,8 @@ {elseif ($smarty.section.trombi.index % 3 == 0) && ($smarty.section.trombi.last)} - -  [ PHOTO ] + +  [ PHOTO ] {if $trombi_with_admin && hasPerm('admin')} {icon name=wrench title="[admin]"} @@ -89,7 +89,7 @@ - + {$set[trombi].prenom} {$set[trombi].nom}{if $trombi_with_promo} ({$set[trombi].promo}){/if} -- 2.1.4