From 0b83fb4339dad9962c59867cb7a5dc38abf95794 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 30 Dec 2010 12:49:13 -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 --- 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.7.3