* 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 *
'%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/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'),
$evenements = XDB::iterator(
"SELECT e.*, LEFT(10, e.debut) AS debut_day, LEFT(10, e.fin) AS fin_day,
IF(e.deadline_inscription, e.deadline_inscription >= LEFT(NOW(), 10),
$evenements = XDB::iterator(
"SELECT e.*, LEFT(10, e.debut) AS debut_day, LEFT(10, e.fin) AS fin_day,
IF(e.deadline_inscription, e.deadline_inscription >= LEFT(NOW(), 10),
while ($e = $evenements->next()) {
$e['show_participants'] = ($e['show_participants'] && (is_member() || may_update()));
$res = XDB::query(
while ($e = $evenements->next()) {
$e['show_participants'] = ($e['show_participants'] && (is_member() || may_update()));
$res = XDB::query(
- "SELECT titre, details, montant, ei.item_id, nb
+ "SELECT titre, details, montant, ei.item_id, nb, ep.paid
FROM groupex.evenements_items AS ei
LEFT JOIN groupex.evenements_participants AS ep
ON (ep.eid = ei.eid AND ep.item_id = ei.item_id AND uid = {?})
FROM groupex.evenements_items AS ei
LEFT JOIN groupex.evenements_participants AS ep
ON (ep.eid = ei.eid AND ep.item_id = ei.item_id AND uid = {?})
- if (array_sum($subs) && $evt['paid'] != 0) {
- $page->trig("Impossible de te désinscrire complètement ".
+ if (!array_sum($subs) && $evt['paid'] != 0) {
+ $page->trig("Impossible de te désinscrire complètement ".
foreach ($subs as $j => $nb) {
if ($nb >= 0) {
XDB::execute(
"REPLACE INTO groupex.evenements_participants
VALUES ({?}, {?}, {?}, {?}, {?})",
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);
$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', ''));
$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', ''));
// 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('site'), $money_defaut,
Post::v('confirmation'), 0, 999,
$globals->asso('id'), $eid);
Post::v('site'), $money_defaut,
Post::v('confirmation'), 0, 999,
$globals->asso('id'), $eid);
}
// events with no sub-event: add a sub-event with no name
if ($nb_moments == 0) {
XDB::execute("INSERT INTO groupex.evenements_items
}
// 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);
PayReq::same_event($eid, $globals->asso('id')));
$stamp = $res->fetchOneCell();
if ($stamp) {
PayReq::same_event($eid, $globals->asso('id')));
$stamp = $res->fetchOneCell();
if ($stamp) {
$evt['paiement_req'] = $stamp;
}
$page->assign('evt', $evt);
$evt['paiement_req'] = $stamp;
}
$page->assign('evt', $evt);
foreach ($nbs as $id => $nb) {
$nb = max(intval($nb), 0);
foreach ($nbs as $id => $nb) {
$nb = max(intval($nb), 0);
-
- if ($nb) {
- XDB::execute("REPLACE INTO groupex.evenements_participants
- VALUES ({?}, {?}, {?}, {?}, {?})",
- $evt['eid'], $member['uid'], $id, $nb, $paid);
- }
+ XDB::execute("REPLACE INTO groupex.evenements_participants
+ VALUES ({?}, {?}, {?}, {?}, {?})",
+ $evt['eid'], $member['uid'], $id, $nb, $paid);
$page->assign('evt', $evt);
$page->assign('tout', is_null($item_id));
$page->assign('evt', $evt);
$page->assign('tout', is_null($item_id));