[Koha-patches] [PATCH] [SIGNED-OFF] Fix for Bug 5560 - pagination option for lists

Nicole Engard nengard at bywatersolutions.com
Wed Dec 29 23:04:45 CET 2010


From: Owen Leonard <oleonard at myacpl.org>

This patch doesn't enable per-list pagination options,
but makes OPAC and staff client list display obey
the OPACnumSearchResults and numSearchResults system
preferences instead

Signed-off-by: Nicole Engard <nengard at bywatersolutions.com>
---
 C4/VirtualShelves/Page.pm |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm
index 80d8f3c..1ce360e 100644
--- a/C4/VirtualShelves/Page.pm
+++ b/C4/VirtualShelves/Page.pm
@@ -62,11 +62,11 @@ sub shelfpage ($$$$$) {
     my $displaymode = ( $query->param('display')  ? $query->param('display')  : 'publicshelves' );
     my ( $shelflimit, $shelfoffset, $shelveslimit, $shelvesoffset );
 
-    # FIXME: These limits should not be hardcoded...
-    $shelflimit    = 20;                        # Limits number of items returned for a given query
-    $shelfoffset   = ( $itemoff - 1 ) * 20;     # Sets the offset to begin retrieving items at
-    $shelveslimit  = 20;                        # Limits number of shelves returned for a given query (row_count)
-    $shelvesoffset = ( $shelfoff - 1 ) * 20;    # Sets the offset to begin retrieving shelves at (offset)
+    $shelflimit = ( $type eq 'opac' ? C4::Context->preference('OPACnumSearchResults') : C4::Context->preference('numSearchResults') );
+    $shelflimit = $shelflimit || 20;
+    $shelfoffset   = ( $itemoff - 1 ) * $shelflimit;     # Sets the offset to begin retrieving items at
+    $shelveslimit  = $shelflimit;                        # Limits number of shelves returned for a given query (row_count)
+    $shelvesoffset = ( $shelfoff - 1 ) * $shelflimit;    # Sets the offset to begin retrieving shelves at (offset)
                                                 # getting the Shelves list
     my $category = ( ( $displaymode eq 'privateshelves' ) ? 1 : 2 );
     my ( $shelflist, $totshelves ) = GetShelves( $category, $shelveslimit, $shelvesoffset, $loggedinuser );
-- 
1.5.6.5



More information about the Koha-patches mailing list