From: x2000habouzit Date: Thu, 18 Nov 2004 15:17:40 +0000 (+0000) Subject: much clearer handling of disabled and dead pple for the search+contact X-Git-Tag: xorg/old~888 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=d6c7b4efa96bf87706c9731bca99766264ac43e1;p=platal.git much clearer handling of disabled and dead pple for the search+contact --- diff --git a/htdocs/advanced_search.php b/htdocs/advanced_search.php index e7e087a..313cb4c 100644 --- a/htdocs/advanced_search.php +++ b/htdocs/advanced_search.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: advanced_search.php,v 1.30 2004-11-13 14:16:15 x2000habouzit Exp $ + $Id: advanced_search.php,v 1.31 2004-11-18 15:17:40 x2000habouzit Exp $ ***************************************************************************/ require("auto.prepend.inc.php"); @@ -106,7 +106,6 @@ else { $where = $fields->get_where_statement(); $sql = 'SELECT SQL_CALC_FOUND_ROWS DISTINCT u.matricule,u.matricule_ax,u.user_id, - perms!=\'non-inscrit\' AS inscrit, u.nom, u.prenom, u.promo, diff --git a/htdocs/carnet/mescontacts.php b/htdocs/carnet/mescontacts.php index e9a486a..7fa912a 100644 --- a/htdocs/carnet/mescontacts.php +++ b/htdocs/carnet/mescontacts.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: mescontacts.php,v 1.2 2004-11-13 14:16:17 x2000habouzit Exp $ + $Id: mescontacts.php,v 1.3 2004-11-18 15:17:41 x2000habouzit Exp $ ***************************************************************************/ require("auto.prepend.inc.php"); @@ -86,6 +86,8 @@ if(isset($_GET['trombi'])) { } else { $sql = "SELECT contact AS id, a.*, l.alias AS forlife, + 1 AS inscrit, + a.perms != 'non-inscrit' AS wasinscrit, a.deces != 0 AS dcd, a.deces, a.matricule_ax, FIND_IN_SET('femme', a.flags) AS sexe, e.entreprise, es.label AS secteur, ef.fonction_fr AS fonction, IF(n.nat='',n.pays,n.nat) AS nat, n.a2 AS iso3166, diff --git a/htdocs/search.php b/htdocs/search.php index d1512ad..a2f2cfb 100644 --- a/htdocs/search.php +++ b/htdocs/search.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: search.php,v 1.49 2004-11-13 14:16:16 x2000habouzit Exp $ + $Id: search.php,v 1.50 2004-11-18 15:17:40 x2000habouzit Exp $ ***************************************************************************/ require("auto.prepend.inc.php"); @@ -48,7 +48,6 @@ if (array_key_exists('quick', $_REQUEST)) { $sql = 'SELECT SQL_CALC_FOUND_ROWS DISTINCT r.matricule,u.matricule_ax,u.user_id, - u.perms!="non-inscrit" AS inscrit, UPPER(IF(u.nom!="",u.nom,u.nom_ini)) AS nom, IF(u.prenom!="",u.prenom,u.prenom_ini) AS prenom, u.promo AS promo, diff --git a/include/search.classes.inc.php b/include/search.classes.inc.php index 8ba1676..15b84dc 100644 --- a/include/search.classes.inc.php +++ b/include/search.classes.inc.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: search.classes.inc.php,v 1.35 2004-11-13 13:19:38 x2000habouzit Exp $ + $Id: search.classes.inc.php,v 1.36 2004-11-18 15:17:41 x2000habouzit Exp $ ***************************************************************************/ require_once("xorg.misc.inc.php"); @@ -30,6 +30,8 @@ $globals->search_result_fields = ' if(u.epouse=\'\', u.nom, u.epouse) AS NomSortKey, u.epouse,u.date,u.web,u.mobile, u.deces!=0 AS dcd,u.deces, + u.perms IN (\'admin\',\'user\') AS inscrit, + u.perms != \'non-inscrit\' AS wasinscrit, FIND_IN_SET(\'femme\', u.flags) AS sexe, ad0.text AS app0text, ad0.url AS app0url, ai0.type AS app0type, ad1.text AS app1text, ad1.url AS app1url, ai1.type AS app1type, diff --git a/templates/carnet/mescontacts.tpl b/templates/carnet/mescontacts.tpl index 1065483..4027bbb 100644 --- a/templates/carnet/mescontacts.tpl +++ b/templates/carnet/mescontacts.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: mescontacts.tpl,v 1.3 2004-11-17 22:03:56 x2000habouzit Exp $ + $Id: mescontacts.tpl,v 1.4 2004-11-18 15:17:42 x2000habouzit Exp $ ***************************************************************************} @@ -74,7 +74,7 @@ Pour afficher le trombi de tes contacts : [vue sous
{foreach item=contact from=$contacts} -{include file=include/minifiche.tpl c=$contact show_action="retirer" inscrit=1} +{include file=include/minifiche.tpl c=$contact show_action="retirer"} {/foreach}
diff --git a/templates/include/minifiche.tpl b/templates/include/minifiche.tpl index b792057..4f66ef0 100644 --- a/templates/include/minifiche.tpl +++ b/templates/include/minifiche.tpl @@ -17,22 +17,22 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: minifiche.tpl,v 1.17 2004-11-17 15:22:14 x2000habouzit Exp $ + $Id: minifiche.tpl,v 1.18 2004-11-18 15:17:42 x2000habouzit Exp $ ***************************************************************************} -{if !$inscrit || $c.dcd}
{/if} -
+{if !$c.inscrit || $c.dcd}
{/if} +
{if $c.sexe}•{/if} {min_auth level="cookie"} - {if !$c.dcd && $inscrit} + {if !$c.dcd && $c.inscrit} {/if} {/min_auth} {if $c.epouse}{$c.epouse} {$c.prenom}
(née {$c.nom}){else}{$c.nom} {$c.prenom}{/if} {min_auth level="cookie"} - {if !$c.dcd && $inscrit} + {if !$c.dcd && $c.inscrit}
{/if} {/min_auth} @@ -41,26 +41,18 @@ {if $c.iso3166} {$c.nat}  {/if} - (X {$c.promo}{if $c.app0text}, - {applis_fmt type=$c.app0type text=$c.app0text url=$c.app0url} - {/if}{if $c.app1text}, - {applis_fmt type=$c.app1type text=$c.app1text url=$c.app1url} - {/if}) + (X {$c.promo}{if $c.app0text}, {applis_fmt type=$c.app0type text=$c.app0text url=$c.app0url} + {/if}{if $c.app1text}, {applis_fmt type=$c.app1type text=$c.app1text url=$c.app1url}{/if}) {if $c.dcd}décédé{if $c.sexe}e{/if} le {$c.deces|date_format:"%d %B %Y"}{/if} {min_auth level="cookie"} - {if !$c.dcd && !$inscrit} - clique ici si tu connais son adresse email ! - + {if !$c.dcd && !$c.inscrit} + clique ici si tu connais son adresse email ! {/if} {/min_auth}
- {min_auth level="cookie"} - {include file="include/minifiche_pvt.tpl"} - {/min_auth} - {only_public} -
- {/only_public} + {min_auth level="cookie"}{include file="include/minifiche_pvt.tpl"}{/min_auth} + {only_public}
{/only_public}
-{if !$inscrit || $c.dcd}
{/if} +{if !$c.inscrit || $c.dcd}
{/if} {* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/include/minifiche_pvt.tpl b/templates/include/minifiche_pvt.tpl index 25fa2f1..33c33c8 100644 --- a/templates/include/minifiche_pvt.tpl +++ b/templates/include/minifiche_pvt.tpl @@ -17,26 +17,23 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: minifiche_pvt.tpl,v 1.15 2004-11-13 15:56:37 x2000habouzit Exp $ + $Id: minifiche_pvt.tpl,v 1.16 2004-11-18 15:17:42 x2000habouzit Exp $ ***************************************************************************} -{if !$inscrit} +{if !$c.wasinscrit} {if !$c.dcd}
{if $show_action eq ajouter} {* - *}Ajouter à la liste de mes surveillances{* - *} + *}Ajouter à la liste de mes surveillances {else} {* - *}Retirer de la liste de mes surveillances{* - *} + *}Retirer de la liste de mes surveillances {/if} {perms level='admin'} {* - *}AX{* - *} + *}AX {/perms}
{/if} @@ -44,25 +41,18 @@ {else}
{* - *}Afficher la fiche{* - *} + *}Afficher la fiche {* - *}Afficher la carte de visite{* - *} + *}Afficher la carte de visite {* *}{if $show_action eq {* - *} - {if $c.dcd neq 1} + title="{if $show_action eq "ajouter"}Ajouter à mes{else}Retirer de mes{/if} contacts" /> {perms level='admin'} {* - *}admin{* - *} + *}admin {* - *}AX{* - *} + *}AX {/perms} - {/if}
{if $c.web || $c.mobile || $c.pays || $c.ville || $c.region || $c.entreprise || $c.libre} diff --git a/templates/search.tpl b/templates/search.tpl index 6c072fe..e22358c 100644 --- a/templates/search.tpl +++ b/templates/search.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: search.tpl,v 1.29 2004-11-17 15:22:13 x2000habouzit Exp $ + $Id: search.tpl,v 1.30 2004-11-18 15:17:42 x2000habouzit Exp $ ***************************************************************************} {dynamic} @@ -41,7 +41,7 @@ {else} {assign var="show_action" value="ajouter"} {/if} - {include file=include/minifiche.tpl c=$resultats[resultat] show_action=$show_action inscrit=$resultats[resultat].inscrit} + {include file=include/minifiche.tpl c=$resultats[resultat] show_action=$show_action} {/section} {/capture} {$smarty.capture.list|smarty:nodefaults}