From 59c3ade25727f2bc95379b283a7beb383cb7b510 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Mar 2008 22:07:15 +0000 Subject: [PATCH] New: Add patch for pagination on contacts list --- htdocs/contact/index.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/htdocs/contact/index.php b/htdocs/contact/index.php index 5e064c3400f..4dc47657106 100644 --- a/htdocs/contact/index.php +++ b/htdocs/contact/index.php @@ -1,7 +1,7 @@ - * Copyright (C) 2003 �ric Seigne - * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2003 Eric Seigne + * Copyright (C) 2004-2008 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -146,6 +146,13 @@ if ($socid) { $sql .= " AND s.rowid = ".$socid; } +// Count total nb of records +$nbtotalofrecords = 0; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) +{ + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); +} if($_GET["view"] == "recent") { @@ -168,7 +175,7 @@ if ($result) $num = $db->num_rows($result); $i = 0; - print_barre_liste($titre ,$page, "index.php", '&begin='.$begin.'&view='.$_GET["view"].'&userid='.$_GET["userid"], $sortfield, $sortorder,'',$num); + print_barre_liste($titre ,$page, "index.php", '&begin='.$begin.'&view='.$_GET["view"].'&userid='.$_GET["userid"], $sortfield, $sortorder,'',$num,$nbtotalofrecords); print '
'; print ''; @@ -316,7 +323,7 @@ if ($result) $i++; } - if ($num > $limit) print_barre_liste($titre ,$page, "index.php", '&begin='.$begin.'&view='.$_GET["view"].'&userid='.$_GET["userid"], $sortfield, $sortorder,'',$num); + if ($num > $limit) print_barre_liste($titre ,$page, "index.php", '&begin='.$begin.'&view='.$_GET["view"].'&userid='.$_GET["userid"], $sortfield, $sortorder,'',$num,$nbtotalofrecords); print "";