'%grp/mail' => $this->make_hook('mail', AUTH_MDP),
'%grp/annuaire' => $this->make_hook('annuaire', AUTH_MDP),
'%grp/annuaire/vcard' => $this->make_hook('vcard', AUTH_MDP),
+ '%grp/trombi' => $this->make_hook('trombi', AUTH_MDP),
'%grp/subscribe' => $this->make_hook('subscribe', AUTH_MDP),
'%grp/paiement' => $this->make_hook('paiement', AUTH_MDP),
$page->assign('ann', $ann);
}
+ function handler_trombi(&$page, $num = 1)
+ {
+ global $globals;
+ $page->changeTpl('xnet/groupe/trombi.tpl');
+ $page->setType($globals->asso('cat'));
+ $page->assign('asso', $globals->asso());
+ $page->assign('admin', may_update());
+ $page->assign('urlmainsite', "https://www.polytechnique.org/");
+ $trombi = new Trombi(array($this, '_trombi_getlist'));
+ $trombi->hidePromo();
+ $trombi->setAdmin();
+ $page->assign_by_ref('trombi', $trombi);
+ }
+
+ function _trombi_getlist($offset, $limit)
+ {
+ global $globals;
+ $where = "WHERE m.asso_id= '".addslashes($globals->asso('id'))."'";
+
+ $res = XDB::query(
+ "SELECT COUNT(*)
+ FROM auth_user_md5 AS u
+ RIGHT JOIN photo AS p ON u.user_id=p.uid
+ INNER JOIN groupex.membres AS m ON (m.uid = u.user_id)
+ $where");
+ $pnb = $res->fetchOneCell();
+
+ $res = XDB::query("SELECT promo, user_id, a.alias AS forlife,
+ IF (nom_usage='', u.nom, nom_usage) AS nom, u.prenom
+ FROM photo AS p
+ INNER JOIN auth_user_md5 AS u ON u.user_id=p.uid
+ INNER JOIN aliases AS a ON ( u.user_id=a.id AND a.type='a_vie' )
+ INNER JOIN groupex.membres AS m ON (m.uid = u.user_id)
+ $where
+ ORDER BY promo, u.nom, u.prenom LIMIT {?}, {?}", $offset*$limit, $limit);
+
+ return array($pnb, $res->fetchAllAssoc());
+ }
+
function handler_vcard(&$page, $photos = null)
{
global $globals;
<tr>
{/if}
<td class="center">
- <a href="profile/{$p.forlife}" class="popup2">
- <img src="photo/{$p.forlife}" width="110" alt=" [ PHOTO ] " />
+ <a href="{if $urlmainsite}{$urlmainsite}{/if}profile/{$p.forlife}" class="popup2">
+ <img src="{if $urlmainsite}{$urlmainsite}{/if}photo/{$p.forlife}" width="110" alt=" [ PHOTO ] " />
</a>
- {if $trombi_admin && $smarty.session.perms eq 'admin'}
+ {if $trombi_admin && $smarty.session.perms eq 'admin' && !$urlmainsite}
<a href="admin/trombino/{$p.user_id}">
{icon name=wrench title="[admin]"}</a>
{/if}
<br />
- <a href="profile/{$p.forlife}" class="popup2">
+ <a href="{if $urlmainsite}{$urlmainsite}{/if}profile/{$p.forlife}" class="popup2">
{$p.prenom} {$p.nom}{if $trombi_show_promo} ({$p.promo}){/if}
</a>
</td>
--- /dev/null
+{**************************************************************************}\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>\r
+ Trombinoscope du groupe\r
+</h1>\r
+<p>\r
+{if $trombi}\r
+\r
+{$trombi->show()|smarty:nodefaults}\r
+\r
+{/if}\r
+\r
+{* vim:set et sw=2 sts=2 sws=2: *}\r