ajout d'un recapitulatif des groupes x sur xorg
authorx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Wed, 22 Nov 2006 23:59:14 +0000 (23:59 +0000)
committerx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Wed, 22 Nov 2006 23:59:14 +0000 (23:59 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1141 839d8a87-29fc-0310-9880-83ba4fa771e5

ChangeLog
modules/profile.php
modules/xnet.php
templates/groupesx.tpl [new file with mode: 0644]
templates/skin/common.menu.tpl

index 8ab5ada..aecc361 100644 (file)
--- 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
index 71204b7..66d5c31 100644 (file)
@@ -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)) {
index 5f2564f..e43cd55 100644 (file)
@@ -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 (file)
index 0000000..018a5b4
--- /dev/null
@@ -0,0 +1,52 @@
+{**************************************************************************}\r
+{*                                                                        *}\r
+{*  Copyright (C) 2003-2006 Polytechnique.org                             *}\r
+{*  http://opensource.polytechnique.org/                                  *}\r
+{*                                                                        *}\r
+{*  This program is free software; you can redistribute it and/or modify  *}\r
+{*  it under the terms of the GNU General Public License as published by  *}\r
+{*  the Free Software Foundation; either version 2 of the License, or     *}\r
+{*  (at your option) any later version.                                   *}\r
+{*                                                                        *}\r
+{*  This program is distributed in the hope that it will be useful,       *}\r
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}\r
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}\r
+{*  GNU General Public License for more details.                          *}\r
+{*                                                                        *}\r
+{*  You should have received a copy of the GNU General Public License     *}\r
+{*  along with this program; if not, write to the Free Software           *}\r
+{*  Foundation, Inc.,                                                     *}\r
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}\r
+{*                                                                        *}\r
+{**************************************************************************}\r
+\r
+<h1>Mes groupes X sur Polytechnique.net</h1>\r
+\r
+{foreach from=$assos item="asso"}\r
+<div style="width:48%;float:left" >\r
+<fieldset style="margin:0.6em">\r
+    <legend style="padding:4px"><strong><a href="http://www.polytechnique.net/login/{$asso.diminutif}">{$asso.nom}</a></strong></legend>\r
+    <ul style="padding-top:0px;padding-bottom:0px">\r
+        <li><a href="http://www.polytechnique.net/{$asso.diminutif}/annuaire">annuaire</a></li>\r
+        <li><a href="http://www.polytechnique.net/{$asso.diminutif}/trombi">trombino</a></li>\r
+        <li><a href="http://www.polytechnique.net/{$asso.diminutif}/geoloc">carte</a></li>\r
+        {if $asso.lists}\r
+            <li><a href="http://www.polytechnique.net/{$asso.diminutif}/lists">listes mails</a></li>\r
+        {/if}\r
+        {if $asso.events}\r
+            <li><a href="http://www.polytechnique.net/{$asso.diminutif}/events">{$asso.events} événement{if $asso.events > 1}s{/if}</a></li>\r
+        {/if}\r
+        {if !$asso.lists}\r
+            <li style="display:block">&nbsp;</li>\r
+        {/if}\r
+        {if !$asso.events}\r
+            <li style="display:block">&nbsp;</li>\r
+        {/if}\r
+    </ul>\r
+</fieldset>\r
+</div>\r
+{/foreach}\r
+\r
+<p class="center">\r
+[<a href="http://www.polytechnique.net/login">Tous les groupes X</a>]\r
+</p>\r
index c6a0527..6dcdb58 100644 (file)
@@ -62,9 +62,8 @@
 <div class="menu_title">Communauté X</div>
 <div class="menu_item"><a href="search">Annuaire</a></div>
 <div class="menu_item"><a href="geoloc">Planisphère</a></div>
-<div class="menu_item"><a href="trombi">Trombi promo</a></div>
 <div class="menu_item"><a href="referent/search">Conseil Pro.</a></div>
-<div class="menu_item"><a href="http://www.polytechnique.net/login">Groupes X</a></div>
+<div class="menu_item"><a href="groupes-x">Mes groupes X</a></div>
 
 <div class="menu_title">Informations</div>
 <div class="menu_item"><a href="nl">Lettres mensuelles</a></div>