<?php
/***************************************************************************
- * Copyright (C) 2003-2007 Polytechnique.org *
+ * Copyright (C) 2003-2008 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
LEFT JOIN groupex.evenements_participants AS ep ON (ep.eid = e.eid AND ep.uid = {?})
WHERE asso_id = {?}
AND archive = " . ($archive ? "1 " : "0 ")
- . (is_member() || may_update() ? "" : " AND accept_nonmembre != 0 ")
. "GROUP BY e.eid
ORDER BY inscr_open DESC, debut DESC", S::v('uid'), $globals->asso('id'));
$evts = array();
+ $undisplayed_events = 0;
while ($e = $evenements->next()) {
+ if (!is_member() && !may_update() && !$e['accept_nonmembre']) {
+ $undisplayed_events ++;
+ continue;
+ }
+
$e['show_participants'] = ($e['show_participants'] && (is_member() || may_update()));
$res = XDB::query(
"SELECT titre, details, montant, ei.item_id, nb, ep.paid
}
$page->assign('evenements', $evts);
+ $page->assign('undisplayed_events', $undisplayed_events);
}
function handler_sub(&$page, $eid = null)
XDB::execute(
"DELETE FROM groupex.evenements_participants
WHERE eid = {?} AND uid = {?} AND item_id = {?}",
- $eid, S::v("uid"), $j);
+ $eid, S::v("uid"), $j);
$updated = $eid;
}
$total += $nb;
$page->assign('admin', $admin);
$page->assign('moments', $evt['moments']);
$page->assign('money', $evt['money']);
+ $page->assign('telepayment', $evt['paiement_id']);
$page->assign('tout', !Env::v('item_id', false));
}
if (Post::v('intitule')) {
require_once dirname(__FILE__).'/xnetevents/xnetevents.inc.php';
- $short_name = event_change_shortname($page, $infos['short_name'],
+ $short_name = event_change_shortname($page, $eid,
+ $infos['short_name'],
Env::v('short_name', ''));
if ($short_name != Env::v('short_name')) {
$error = true;
$nb = max(intval($nb), 0);
XDB::execute("REPLACE INTO groupex.evenements_participants
VALUES ({?}, {?}, {?}, {?}, {?}, {?})",
- $evt['eid'], $member['uid'], $id, $nb, '', $paid);
+ $evt['eid'], $member['uid'], $id, $nb, '', $id == 1 ? $paid : 0);
}
$res = XDB::query("SELECT COUNT(uid) AS cnt, SUM(nb) AS nb
GROUP BY uid",
$member['uid'], $evt['eid']);
$u = $res->fetchOneAssoc();
- $u = $u['cnt'] ? null : $u['nb'];
+ $u = $u['cnt'] ? $u['nb'] : null;
subscribe_lists_event($u, $member['uid'], $evt);
}
$evt = get_event_detail($eid, $item_id);
}
- $page->assign('evt', $evt);
+ $page->assign_by_ref('evt', $evt);
$page->assign('tout', is_null($item_id));
if (count($evt['moments'])) {