From: Stéphane Jacob Date: Sun, 29 May 2011 20:33:36 +0000 (+0200) Subject: Fixes page count in xnetevent administration. X-Git-Tag: xorg/1.1.2~68 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=e48b1c7608e5d3c833395646715cecfba834f9cc;p=platal.git Fixes page count in xnetevent administration. Signed-off-by: Stéphane Jacob --- diff --git a/modules/xnetevents.php b/modules/xnetevents.php index d2d8390..edee012 100644 --- a/modules/xnetevents.php +++ b/modules/xnetevents.php @@ -630,8 +630,7 @@ class XnetEventsModule extends PLModule GROUP BY p.uid', $evt['eid']); $ofs = Env::i('offset'); - $tot = (is_null($evt['nb_tot']) ? $evt['nb'] : $evt['nb_tot']); - $nbp = ceil($tot / NB_PER_PAGE); + $nbp = ceil($evt['user_count'] / NB_PER_PAGE); if ($nbp > 1) { $links = array(); if ($ofs) { diff --git a/modules/xnetevents/xnetevents.inc.php b/modules/xnetevents/xnetevents.inc.php index aec08cf..c60b938 100644 --- a/modules/xnetevents/xnetevents.inc.php +++ b/modules/xnetevents/xnetevents.inc.php @@ -27,7 +27,7 @@ function get_event_detail($eid, $item_id = false, $asso_id = null) if (is_null($asso_id)) { $asso_id = $globals->asso('id'); } - $evt = XDB::fetchOneAssoc('SELECT SUM(nb) AS nb_tot, COUNT(DISTINCT ep.uid) AS nb, e.*, + $evt = XDB::fetchOneAssoc('SELECT SUM(nb) AS nb_tot, COUNT(DISTINCT ep.uid) AS nb, e.*, SUM(IF(nb > 0, 1, 0)) AS user_count, IF(e.deadline_inscription, e.deadline_inscription >= LEFT(NOW(), 10), 1) AS inscr_open,