X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fxnetevents.php;h=21d8435eafaab998348fbcfcf6c14ad6d1f087f1;hb=358c62cdb9e3f993e5968674dcb220b0babf473c;hp=10d7259077488b337becfee6a678a0649861cd8e;hpb=d0edeb70f254ed642b59c7c3636b7802266bcfe4;p=platal.git diff --git a/modules/xnetevents.php b/modules/xnetevents.php index 10d7259..21d8435 100644 --- a/modules/xnetevents.php +++ b/modules/xnetevents.php @@ -183,9 +183,18 @@ class XnetEventsModule extends PLModule $page->changeTpl('xnetevents/subscribe.tpl'); $evt = get_event_detail($eid); - if (!$evt) { + if (is_null($evt)) { return PL_NOT_FOUND; } + 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 demande d\'inscripton.'); + } if (!$evt['inscr_open']) { $page->kill('Les inscriptions pour cet événement sont closes'); @@ -259,6 +268,7 @@ class XnetEventsModule extends PLModule $total += $nb; } if ($updated !== false) { + $page->trigSuccess('Ton inscription à l\'événement a été mise à jour avec succès.'); subscribe_lists_event($total, S::i('uid'), $evt); } $page->assign('event', get_event_detail($eid)); @@ -443,7 +453,7 @@ class XnetEventsModule extends PLModule // request for a new payment if (Post::v('paiement_id') == -1 && $money_defaut >= 0) { require_once 'validations.inc.php'; - $p = new PayReq(S::v('uid'), + $p = new PayReq(S::user(), Post::v('intitule')." - ".$globals->asso('nom'), Post::v('site'), $money_defaut, Post::v('confirmation'), 0, 999, @@ -643,19 +653,19 @@ class XnetEventsModule extends PLModule 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; + } $page->assign('links', $links); }