From a1d792172431297cb927aa3291ef132f372bd168 Mon Sep 17 00:00:00 2001 From: x2001corpet Date: Wed, 22 Nov 2006 23:59:14 +0000 Subject: [PATCH] ajout d'un recapitulatif des groupes x sur xorg git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1141 839d8a87-29fc-0310-9880-83ba4fa771e5 --- ChangeLog | 5 +++- modules/profile.php | 15 ++++++++++++ modules/xnet.php | 5 +++- templates/groupesx.tpl | 52 ++++++++++++++++++++++++++++++++++++++++++ templates/skin/common.menu.tpl | 3 +-- 5 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 templates/groupesx.tpl diff --git a/ChangeLog b/ChangeLog index 8ab5ada..aecc361 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,10 +17,14 @@ New: * Events: - Add author and event id in RSS feed. -FRU + * Profile: + - Add "My groupes" page with direct links to Xnet. -Car + * Xnet: - Add a vcard of all the members of a group. -FRU - Add a full announce system. -FRU - Add a list of the administrators of the group. -FRU + - Url to force login on any page. -Car * Xnet/Events: - Events can be archived. -FRU @@ -62,7 +66,6 @@ Bug/Wish: - #536: Can use login.promo as a valid user identifier. -FRU - #539: Medals and deco need validation from admin. -Car - #540: Profile of unregistered user redirects to marketing. -FRU - - #556: Auto fill promo for trombi -FRU * Xnet: - #511: Migrate ML subscription when changing email of a non-X. -FRU diff --git a/modules/profile.php b/modules/profile.php index 71204b7..66d5c31 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -38,6 +38,7 @@ class ProfileModule extends PLModule 'referent/search' => $this->make_hook('ref_search', AUTH_COOKIE), 'trombi' => $this->make_hook('trombi', AUTH_COOKIE), + 'groupes-x' => $this->make_hook('xnet', AUTH_COOKIE), 'vcard' => $this->make_hook('vcard', AUTH_COOKIE), 'admin/binets' => $this->make_hook('admin_binets', AUTH_MDP, 'admin'), @@ -668,6 +669,20 @@ class ProfileModule extends PLModule } } + function handler_xnet(&$page) + { + $page->changeTpl('groupesx.tpl'); + $page->assign('xorg_title', 'Polytechnique.org - Promo, Groupes X, Binets'); + + $req = XDB::query(' + SELECT m.asso_id, a.nom, diminutif, COUNT(e.eid) AS events, mail_domain AS lists + FROM groupex.membres AS m + INNER JOIN groupex.asso AS a ON(m.asso_id = a.id) + LEFT JOIN groupex.evenements AS e ON(e.asso_id = m.asso_id) + WHERE uid = {?} GROUP BY m.asso_id ORDER BY a.nom', S::i('uid')); + $page->assign('assos', $req->fetchAllAssoc()); + } + function handler_vcard(&$page, $x = null) { if (is_null($x)) { diff --git a/modules/xnet.php b/modules/xnet.php index 5f2564f..e43cd55 100644 --- a/modules/xnet.php +++ b/modules/xnet.php @@ -43,7 +43,10 @@ class XnetModule extends PLModule function handler_login(&$page) { - pl_redirect(''); + $allkeys = func_get_args(); + unset($allkeys[0]); + $url = join('/',$allkeys); + pl_redirect($url); } function handler_exit(&$page) diff --git a/templates/groupesx.tpl b/templates/groupesx.tpl new file mode 100644 index 0000000..018a5b4 --- /dev/null +++ b/templates/groupesx.tpl @@ -0,0 +1,52 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2006 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 *} +{* *} +{**************************************************************************} + +

Mes groupes X sur Polytechnique.net

+ +{foreach from=$assos item="asso"} +
+
+ {$asso.nom} + +
+
+{/foreach} + +

+[Tous les groupes X] +

diff --git a/templates/skin/common.menu.tpl b/templates/skin/common.menu.tpl index c6a0527..6dcdb58 100644 --- a/templates/skin/common.menu.tpl +++ b/templates/skin/common.menu.tpl @@ -62,9 +62,8 @@ - - + -- 2.1.4