From 076d4322999f4029e1fcd1257c872fe23fbdd336 Mon Sep 17 00:00:00 2001 From: "Pierre Habouzit (MadCoder" Date: Thu, 21 Apr 2005 15:49:38 +0000 Subject: [PATCH] annuaire.php git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-583 --- htdocs.net/groupe/annuaire.php | 45 +++++++++++++++++++ templates/xnet/groupe/annuaire.tpl | 89 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 134 insertions(+) create mode 100644 htdocs.net/groupe/annuaire.php create mode 100644 templates/xnet/groupe/annuaire.tpl diff --git a/htdocs.net/groupe/annuaire.php b/htdocs.net/groupe/annuaire.php new file mode 100644 index 0000000..9299760 --- /dev/null +++ b/htdocs.net/groupe/annuaire.php @@ -0,0 +1,45 @@ +setType($globals->asso('cat')); +$page->assign('asso', $globals->asso()); +$page->assign('admin', may_update()); +$page->useMenu(); + +$tri = (Env::get('order') == 'alpha' ? 'promo, nom, prenom' : 'nom, prenom, promo'); +$res = $globals->xdb->iterRow( + 'SELECT SUBSTRING(IF(m.origine="X",u.nom,m.nom), 1, 1), COUNT(IF(m.origine="X",u.nom,m.nom)) + FROM groupex.membres AS m + LEFT JOIN auth_user_md5 AS u ON ( u.user_id = m.uid ) + WHERE asso_id = {?} + GROUP BY SUBSTRING(IF(m.origine="X",u.nom,m.nom), 1, 1)', $globals->asso('id')); +$alphabet = array(); +$nb_tot = 0; +while (list($char, $nb) = $res->next()) { + $alphabet[ord($char)] = $char; + $nb_tot += $nb; +} +$page->assign('alphabet', $alphabet); +$page->assign('nb_tot', $nb_tot); + +$ini = Env::has('initiale') ? 'AND IF(m.origine="X",u.nom,m.nom) LIKE "'.addslashes(Env::get('initiale')).'%"' : ''; + +$ann = $globals->xdb->iterator( + "SELECT IF(m.origine='X',IF(u.nom_usage, u.nom_usage, u.nom) ,m.nom) AS nom, + IF(m.origine='X',u.prenom,m.prenom) AS prenom, + IF(m.origine='X',u.promo,'extérieur') AS promo, + IF(m.origine='X',a.alias,m.email) AS email, + IF(m.origine='X',FIND_IN_SET('femme', u.flags),0) AS femme, + m.perms='admin' AS admin, + m.origine='X' AS x + FROM groupex.membres AS m + LEFT JOIN auth_user_md5 AS u ON ( u.user_id = m.uid ) + LEFT JOIN aliases AS a ON ( a.id = m.uid AND a.type='a_vie' ) + WHERE m.asso_id = {?} $ini + ORDER BY $tri", $globals->asso('id')); +$page->assign('ann', $ann); + +$page->run(); + +?> diff --git a/templates/xnet/groupe/annuaire.tpl b/templates/xnet/groupe/annuaire.tpl new file mode 100644 index 0000000..ce0186f --- /dev/null +++ b/templates/xnet/groupe/annuaire.tpl @@ -0,0 +1,89 @@ +{*************************************************************************** + * Copyright (C) 2003-2004 Polytechnique.org * + * http://opensource.polytechnique.org/ * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + ***************************************************************************} + +

{$asso.nom} : Annuaire du groupe

+ +

+Le groupe {$asso.nom} compte {$nb_tot} membres. +

+ +

+Les membres extérieurs du groupe sont intégrés à cette liste, et repérés par l'inscription 'extérieur' dans la colonne promotion. +

+ +{if $admin} +

+Fonctionnalités visibles uniquement par les administrateurs : +

+ +{/if} + +

+Choisis une initiale pour restreindre la liste aux membres dont le nom commence par cette lettre. Tu +peux aussi afficher toute la liste. +

+ +

+{foreach from=$alphabet item=c} +[{$c}] +{/foreach} +

+ + + + + + + + + {if $admin} + + + + + {/if} + + {iterate from=$ann item=m} + + + + + {if $admin} + + + + + {/if} + + {/iterate} +
prénom et nompromotionfiche X.org / carte / lui écrireadminéditer un profildésinscrire
{if $m.femme}•{/if}{$m.prenom} {$m.nom}{$m.promo} + {if $m.x} + [fiche] + [vcard] + mail + {else} + mail + {/if} + {if $m.admin}×{else} {/if}Edition du profilSuppression de {$m.prenom} {$m.nom}
+ +{* vim:set et sw=2 sts=2 sws=2: *} -- 2.1.4