From: Stéphane Jacob Date: Fri, 16 Jul 2010 13:13:35 +0000 (+0200) Subject: Reactivates links for next and previous pages in event administration. X-Git-Tag: xorg/1.0.1~15^2~38 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=6601ea70b98d84572e1c17532d98d18176e18d93;p=platal.git Reactivates links for next and previous pages in event administration. Signed-off-by: Stéphane Jacob --- diff --git a/modules/xnetevents.php b/modules/xnetevents.php index 0523d5e..4db4710 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);