<?php
/***************************************************************************
- * Copyright (C) 2003-2006 Polytechnique.org *
+ * Copyright (C) 2003-2007 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
'%grp/events/sub' => $this->make_hook('sub', AUTH_MDP),
'%grp/events/csv' => $this->make_hook('csv', AUTH_MDP),
'%grp/events/ical' => $this->make_hook('ical', AUTH_MDP),
- '%grp/events/edit' => $this->make_hook('edit', AUTH_MDP),
+ '%grp/events/edit' => $this->make_hook('edit', AUTH_MDP, 'groupadmin'),
'%grp/events/admin' => $this->make_hook('admin', AUTH_MDP),
);
}
}
if (!$evt['inscr_open']) {
- $page->kill('Les inscriptions pour cet événement sont closes');
+ $page->kill('Les inscriptions pour cet événement sont closes');
}
if (!$evt['accept_nonmembre'] && !is_member() && !may_update()) {
- $page->kill('Cet événement est fermé aux non-membres du groupe');
+ $page->kill('Cet événement est fermé aux non-membres du groupe');
}
$page->assign('event', $evt);
if (!isset($pers[$j]) || !is_numeric($pers[$j])
|| $pers[$j] < 0)
{
- $page->trig('Tu dois choisir un nombre d\'invités correct !');
+ $page->trig('Tu dois choisir un nombre d\'invités correct !');
return;
}
$subs[$j] = 1 + $pers[$j];
// impossible to unsubscribe if you already paid sthing
if (!array_sum($subs) && $evt['paid'] != 0) {
- $page->trig("Impossible de te désinscrire complètement ".
+ $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 ".
+ "chèque ou par liquide. Contacte un ".
+ "administrateur du groupe si tu es sûr de ".
"ne pas venir");
return;
}
// update actual inscriptions
$updated = false;
$total = 0;
+ $paid = $evt['paid'] ? $evt['paid'] : 0;
foreach ($subs as $j => $nb) {
if ($nb >= 0) {
XDB::execute(
"REPLACE INTO groupex.evenements_participants
VALUES ({?}, {?}, {?}, {?}, {?})",
- $eid, S::v('uid'), $j, $nb, $evt['paid']);
+ $eid, S::v('uid'), $j, $nb, $paid);
$updated = $eid;
} else {
XDB::execute(
return PL_NOT_FOUND;
}
- header('Content-type: text/x-csv; encoding=iso-8859-1');
+ header('Content-type: text/x-csv; encoding=UTF-8');
header('Pragma: ');
header('Cache-Control: ');
new_groupadmin_page('xnetevents/edit.tpl');
- $moments = range(1, 4);
+ $moments = range(1, 4);
+ $error = false;
$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'],
Env::v('short_name', ''));
-
+ if ($short_name != Env::v('short_name')) {
+ $error = true;
+ }
$evt = array(
'eid' => $eid,
'asso_id' => $globals->asso('id'),
WHERE eid = {?} AND item_id = {?}", $eid, $i);
}
}
-
// request for a new payment
if (Post::v('paiement_id') == -1 && $money_defaut >= 0) {
require_once 'validations.inc.php';
Post::v('site'), $money_defaut,
Post::v('confirmation'), 0, 999,
$globals->asso('id'), $eid);
- $p->submit();
+ if ($p->accept()) {
+ $p->submit();
+ } else {
+ $page->assign('paiement_message', Post::v('confirmation'));
+ $page->assign('paiement_site', Post::v('site'));
+ $error = true;
+ }
}
// events with no sub-event: add a sub-event with no name
if ($nb_moments == 0) {
XDB::execute("INSERT INTO groupex.evenements_items
- VALUES ({?}, {?}, '', '', 0)", $eid, 1);
+ VALUES ({?}, {?}, '', '', 0)", $eid, 1);
}
- pl_redirect('events');
+ if (!$error) {
+ pl_redirect('events');
+ }
}
// get a list of all the payment for this asso
PayReq::same_event($eid, $globals->asso('id')));
$stamp = $res->fetchOneCell();
if ($stamp) {
- $evt['paiement_id'] = -2;
+ $evt['paiement_id'] = -2;
$evt['paiement_req'] = $stamp;
}
$page->assign('evt', $evt);
$nbp = intval(($tot-1)/NB_PER_PAGE);
$links = array();
if ($ofs) {
- $links['précédent'] = $ofs-1;
+ $links['précédent'] = $ofs-1;
}
for ($i = 0; $i <= $nbp; $i++) {
$links[(string)($i+1)] = $i;
}
}
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
?>