* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
$res = XDB::query("SELECT asso_id, short_name FROM groupex.evenements
WHERE eid = {?} AND asso_id = {?}",
$res = XDB::query("SELECT asso_id, short_name FROM groupex.evenements
WHERE eid = {?} AND asso_id = {?}",
XDB::execute("DELETE FROM requests
WHERE type = 'paiements' AND data LIKE {?}",
PayReq::same_event($eid, $globals->asso('id')));
XDB::execute("DELETE FROM requests
WHERE type = 'paiements' AND data LIKE {?}",
PayReq::same_event($eid, $globals->asso('id')));
$page->assign('archive', $archive);
$evenements = XDB::iterator(
$page->assign('archive', $archive);
$evenements = XDB::iterator(
- "SELECT e.*, LEFT(10, e.debut) AS debut_day, LEFT(10, e.fin) AS fin_day,
+ "SELECT e.*, LEFT(10, e.debut) AS first_day, LEFT(10, e.fin) AS last_day,
IF(e.deadline_inscription, e.deadline_inscription >= LEFT(NOW(), 10),
1) AS inscr_open, e.deadline_inscription,
u.nom, u.prenom, u.promo, a.alias,
IF(e.deadline_inscription, e.deadline_inscription >= LEFT(NOW(), 10),
1) AS inscr_open, e.deadline_inscription,
u.nom, u.prenom, u.promo, a.alias,
LEFT JOIN groupex.evenements_participants AS ep ON (ep.eid = e.eid AND ep.uid = {?})
WHERE asso_id = {?}
AND archive = " . ($archive ? "1 " : "0 ")
LEFT JOIN groupex.evenements_participants AS ep ON (ep.eid = e.eid AND ep.uid = {?})
WHERE asso_id = {?}
AND archive = " . ($archive ? "1 " : "0 ")
. "GROUP BY e.eid
ORDER BY inscr_open DESC, debut DESC", S::v('uid'), $globals->asso('id'));
$evts = array();
. "GROUP BY e.eid
ORDER BY inscr_open DESC, debut DESC", S::v('uid'), $globals->asso('id'));
$evts = array();
$e['show_participants'] = ($e['show_participants'] && (is_member() || may_update()));
$res = XDB::query(
"SELECT titre, details, montant, ei.item_id, nb, ep.paid
$e['show_participants'] = ($e['show_participants'] && (is_member() || may_update()));
$res = XDB::query(
"SELECT titre, details, montant, ei.item_id, nb, ep.paid
if (Env::has('updated') && $e['eid'] == Env::i('updated')) {
$page->assign('updated', $e);
}
if (Env::has('updated') && $e['eid'] == Env::i('updated')) {
$page->assign('updated', $e);
}
+ if ($evt === false) {
+ global $globals, $platal;
+ $url = $globals->asso('sub_url');
+ if (empty($url)) {
+ $url = $platal->ns . 'subscribe';
+ }
+ $page->kill('Cet événement est reservé aux membres du groupe ' . $globals->asso('nom') .
+ '. Pour devenir membre, rends-toi sur la page de <a href="' . $url . '">demande d\'inscripton</a>.');
+ }
// impossible to unsubscribe if you already paid sthing
if (!array_sum($subs) && $evt['paid'] != 0) {
// impossible to unsubscribe if you already paid sthing
if (!array_sum($subs) && $evt['paid'] != 0) {
- $page->trig("Impossible de te désinscrire complètement ".
- "parce que tu as fait un paiement par ".
- "chèque ou par liquide. Contacte un ".
- "administrateur du groupe si tu es sûr de ".
- "ne pas venir");
+ $page->trigError("Impossible de te désinscrire complètement ".
+ "parce que tu as fait un paiement par ".
+ "chèque ou par liquide. Contacte un ".
+ "administrateur du groupe si tu es sûr de ".
+ "ne pas venir");
XDB::execute(
"DELETE FROM groupex.evenements_participants
WHERE eid = {?} AND uid = {?} AND item_id = {?}",
XDB::execute(
"DELETE FROM groupex.evenements_participants
WHERE eid = {?} AND uid = {?} AND item_id = {?}",
subscribe_lists_event($total, S::i('uid'), $evt);
}
$page->assign('event', get_event_detail($eid));
subscribe_lists_event($total, S::i('uid'), $evt);
}
$page->assign('event', get_event_detail($eid));
$page->assign('moments', $moments);
if (Post::v('intitule')) {
$page->assign('moments', $moments);
if (Post::v('intitule')) {
- require_once dirname(__FILE__).'/xnetevents/xnetevents.inc.php';
- $short_name = event_change_shortname($page, $infos['short_name'],
+ S::assert_xsrf_token();
+
+ $this->load('xnetevents.inc.php');
+ $short_name = event_change_shortname($page, $eid,
+ $infos['short_name'],
Env::v('short_name', ''));
if ($short_name != Env::v('short_name')) {
$error = true;
Env::v('short_name', ''));
if ($short_name != Env::v('short_name')) {
$error = true;
// request for a new payment
if (Post::v('paiement_id') == -1 && $money_defaut >= 0) {
require_once 'validations.inc.php';
// request for a new payment
if (Post::v('paiement_id') == -1 && $money_defaut >= 0) {
require_once 'validations.inc.php';
Post::v('intitule')." - ".$globals->asso('nom'),
Post::v('site'), $money_defaut,
Post::v('confirmation'), 0, 999,
Post::v('intitule')." - ".$globals->asso('nom'),
Post::v('site'), $money_defaut,
Post::v('confirmation'), 0, 999,
GROUP BY uid",
$member['uid'], $evt['eid']);
$u = $res->fetchOneAssoc();
GROUP BY uid",
$member['uid'], $evt['eid']);
$u = $res->fetchOneAssoc();
ORDER BY nom, prenom, promo", $evt['eid']);
$ofs = Env::i('offset');
ORDER BY nom, prenom, promo", $evt['eid']);
$ofs = Env::i('offset');
- $tot = (Env::v('initiale') ? $tot : $nb_tot) - $absents->total();
- $nbp = intval(($tot-1)/NB_PER_PAGE);
- $links = array();
- if ($ofs) {
- $links['précédent'] = $ofs-1;
- }
- for ($i = 0; $i <= $nbp; $i++) {
- $links[(string)($i+1)] = $i;
- }
- if ($ofs < $nbp) {
- $links['suivant'] = $ofs+1;
- }
- if (count($links)>1) {
+ $tot = (Env::v('initiale') ? $tot : $nb_tot);
+ $nbp = ceil($tot / NB_PER_PAGE);
+ if ($nbp > 1) {
+ $links = array();
+ if ($ofs) {
+ $links['précédent'] = $ofs - 1;
+ }
+ for ($i = 1 ; $i <= $nbp; $i++) {
+ $links[(string)$i] = $i - 1;
+ }
+ if ($ofs < $nbp) {
+ $links['suivant'] = $ofs+1;
+ }