From 4dda0b1ba0f1f40bc3d6a9fe9d9f53e2b45956c9 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 29 Dec 2010 17:04:45 -0500 Subject: [PATCH] Fix for Bug 5560 - pagination option for lists 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 Signed-off-by: Chris Cormack --- C4/VirtualShelves/Page.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm index 80d8f3c227..1ce360e995 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 ); -- 2.39.5