X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fxnetevents.php;h=8702d790b3fe3acbe267186f24981e5eb6b53ed0;hb=03bda5524bd16c5c160a314d42baefe0b3254c62;hp=0523d5e54dd922fc87e52d41de2137cbc49fbdc1;hpb=b3cd1320f091b2df9c8ed5f7b995a3d88c26ecad;p=platal.git diff --git a/modules/xnetevents.php b/modules/xnetevents.php index 0523d5e..8702d79 100644 --- a/modules/xnetevents.php +++ b/modules/xnetevents.php @@ -618,9 +618,9 @@ class XnetEventsModule extends PLModule WHERE p.eid = {?} AND p2.eid IS NULL GROUP BY p.uid', $evt['eid']); - $ofs = Env::i('offset'); - $tot = (Env::v('initiale') ? $tot : $nb_tot); - $nbp = ceil($tot / NB_PER_PAGE); + $ofs = Env::i('offset'); + $tot = (is_null($evt['nb_tot']) ? $evt['nb'] : $evt['nb_tot']); + $nbp = ceil($tot / NB_PER_PAGE); if ($nbp > 1) { $links = array(); if ($ofs) { @@ -629,7 +629,7 @@ class XnetEventsModule extends PLModule for ($i = 1 ; $i <= $nbp; $i++) { $links[(string)$i] = $i - 1; } - if ($ofs < $nbp) { + if ($ofs < $nbp - 1) { $links['suivant'] = $ofs+1; } $page->assign('links', $links); @@ -638,7 +638,7 @@ class XnetEventsModule extends PLModule $page->assign('absents', $absents); $page->assign('participants', get_event_participants($evt, $item_id, UserFilter::sortByName(), - new PLLimit(NB_PER_PAGE), $ofs * NB_PER_PAGE)); + new PLLimit(NB_PER_PAGE, $ofs * NB_PER_PAGE))); } }