From fd5d35e1a5e6aa9179c36079cc50af76d319a65d Mon Sep 17 00:00:00 2001 From: Pascal Corpet Date: Tue, 1 Feb 2005 16:09:50 +0000 Subject: [PATCH] bug 270 : affichage des infos publiques dans la recherche publique git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-423 --- include/search.classes.inc.php | 24 ++++++++++++++++++++---- templates/include/minifiche.tpl | 3 +-- templates/include/minifiche_pvt.tpl | 10 +++++++--- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/include/search.classes.inc.php b/include/search.classes.inc.php index d8f5e7e..f6e41f7 100644 --- a/include/search.classes.inc.php +++ b/include/search.classes.inc.php @@ -26,7 +26,7 @@ require_once("xorg.misc.inc.php"); $globals->search->result_fields = ' u.user_id, u.promo, u.matricule, u.matricule_ax, if(u.epouse=\'\', u.nom, u.epouse) AS NomSortKey, - u.epouse,u.date,q.profile_web AS web,q.profile_mobile AS mobile, + u.epouse,u.date, u.deces!=0 AS dcd,u.deces, u.perms IN (\'admin\',\'user\') AS inscrit, u.perms != \'pending\' AS wasinscrit, @@ -34,9 +34,25 @@ $globals->search->result_fields = ' a.alias AS forlife, ad0.text AS app0text, ad0.url AS app0url, ai0.type AS app0type, ad1.text AS app1text, ad1.url AS app1url, ai1.type AS app1type, - e.entreprise, es.label AS secteur, ef.fonction_fr AS fonction, - IF(n.nat=\'\',n.pays,n.nat) AS nat, n.a2 AS iso3166, - adr.ville, gp.pays, gr.name AS region,'; + es.label AS secteur, ef.fonction_fr AS fonction, + IF(n.nat=\'\',n.pays,n.nat) AS nat, n.a2 AS iso3166,'; +// hide private information if not logged +if (logged()) + $globals->search->result_fields .=' + q.profile_web AS web, + q.profile_mobile AS mobile, + q.profile_freetext AS freetext, + adr.ville, gp.pays, gr.name AS region, + e.entreprise,'; +else + $globals->search->result_fields .=" + IF(q.profile_web_pub='public', q.profile_web, '') AS web, + IF(q.profile_mobile_pub='public', q.profile_mobile, '') AS mobile, + IF(q.profile_freetext_pub='public', q.profile_freetext, '') AS freetext, + IF(adr.pub='public', adr.ville, '') AS ville, + IF(adr.pub='public', gp.pays, '') AS pays, + IF(adr.pub='public', gr.name, '') AS region, + IF(e.pub='public', e.entreprise, '') AS entreprise,"; $globals->search->result_where_statement = ' LEFT JOIN applis_ins AS ai0 ON (u.user_id = ai0.uid AND ai0.ordre = 0) LEFT JOIN applis_def AS ad0 ON (ad0.id = ai0.aid) diff --git a/templates/include/minifiche.tpl b/templates/include/minifiche.tpl index 069c98b..b6702ab 100644 --- a/templates/include/minifiche.tpl +++ b/templates/include/minifiche.tpl @@ -48,8 +48,7 @@ {/if} {/min_auth} - {min_auth level="cookie"}{include file="include/minifiche_pvt.tpl"}{/min_auth} - {only_public}
{/only_public} + {include file="include/minifiche_pvt.tpl"} {if !$c.inscrit || $c.dcd}{/if} diff --git a/templates/include/minifiche_pvt.tpl b/templates/include/minifiche_pvt.tpl index e01717e..35048b0 100644 --- a/templates/include/minifiche_pvt.tpl +++ b/templates/include/minifiche_pvt.tpl @@ -20,6 +20,7 @@ {if !$c.wasinscrit} + {min_auth level="cookie"} {if !$c.dcd}
{if $show_action eq ajouter} @@ -37,8 +38,10 @@ {/perms}
{/if} + {/min_auth}
{else} + {min_auth level="cookie"}
{* *}Afficher la fiche @@ -54,8 +57,9 @@ *}AX {/perms}
+ {/min_auth}
- {if $c.web || $c.mobile || $c.pays || $c.ville || $c.region || $c.entreprise || $c.libre} + {if $c.web || $c.mobile || $c.pays || $c.ville || $c.region || $c.entreprise || $c.freetext} {if $c.web} @@ -84,10 +88,10 @@ {/if} - {if $c.libre} + {if $c.freetext} - + {/if}
Commentaire:{$c.libre|nl2br}{$c.freetext|nl2br}
-- 2.1.4