From 6601ea70b98d84572e1c17532d98d18176e18d93 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Fri, 16 Jul 2010 15:13:35 +0200 Subject: [PATCH] Reactivates links for next and previous pages in event administration. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- modules/xnetevents.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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); -- 2.1.4