Bugzilla – Attachment 56004 Details for
Bug 14715
Results per page setting for catalog search in staff client and OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14715: syspref for results per page options
Bug-14715-syspref-for-results-per-page-options.patch (text/plain), 2.62 KB, created by
Aleisha Amohia
on 2016-10-04 03:38:47 UTC
(
hide
)
Description:
Bug 14715: syspref for results per page options
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2016-10-04 03:38:47 UTC
Size:
2.62 KB
patch
obsolete
>From be030d444b93f269cde9c1c8ffccc3859a4f585a Mon Sep 17 00:00:00 2001 >From: Martin Stenberg <martin@xinxidi.net> >Date: Mon, 21 Sep 2015 18:45:52 +0200 >Subject: [PATCH] Bug 14715: syspref for results per page options > >Remove the "all" option. > >Add syspref [OPAC]numSearchResultsPerPage for specifying options for numbers of >results per page including [OPAC]numSearchResults. >--- > catalogue/search.pl | 9 ++++++++- > opac/opac-search.pl | 7 +++++++ > 2 files changed, 15 insertions(+), 1 deletion(-) > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 11261c2..3bd3d52 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -151,7 +151,7 @@ use URI::Escape; > use POSIX qw(ceil floor); > use C4::Branch; # GetBranches > use C4::Search::History; >- >+use String::Random; > use Koha::LibraryCategories; > use Koha::Virtualshelves; > use Koha::SearchEngine::Search; >@@ -465,6 +465,13 @@ for (my $ii = 0; $ii < @operands; ++$ii) > # Params that can only have one value > my $scan = $params->{'scan'}; > my $count = C4::Context->preference('numSearchResults') || 20; >+my @results_per_page_options = grep /^\d+$/, >+ map {s/\s+//g;$_;} >+ split /,/, C4::Context->preference('numSearchResultsPerPage'); >+push(@results_per_page_options, $count); >+@results_per_page_options = do { my %seen; grep { !$seen{$_}++ } @results_per_page_options }; >+@results_per_page_options = sort {$a <=> $b} @results_per_page_options; >+ > my $results_per_page = $params->{'results_per_page'} || $cgi->cookie("results_per_page") || $count; > my $page = $cgi->param('page') || 1; > my $offset = $results_per_page != 'all' ? ($page-1)*$results_per_page : 0; >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 358915b..b4f26ec 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -523,6 +523,13 @@ if ($params->{'limit-yr'}) { > my $scan = $params->{'scan'}; > my $count = C4::Context->preference('OPACnumSearchResults') || 20; > my $countRSS = C4::Context->preference('numSearchRSSResults') || 50; >+my @results_per_page_options = grep /^\d+$/, >+ map {s/\s+//g;$_;} >+ split /,/, C4::Context->preference('OPACnumSearchResultsPerPage'); >+push(@results_per_page_options, $count); >+@results_per_page_options = do { my %seen; grep { !$seen{$_}++ } @results_per_page_options }; >+@results_per_page_options = sort {$a <=> $b} @results_per_page_options; >+ > my $results_per_page = $params->{'results_per_page'} || $cgi->cookie("results_per_page") || $count; > my $page = $cgi->param('page') || 1; > my $offset = $results_per_page != 'all' ? ($page-1)*$results_per_page : 0; >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14715
:
41949
|
42003
|
42742
|
42743
|
56002
|
56003
|
56004
|
56005
|
56575
|
56576
|
56577
|
56610
|
56611
|
56612
|
57870
|
61721
|
64250
|
67912
|
67913
|
68000
|
68001
|
68305
|
68327
|
75938
|
75939
|
75940
|
75941
|
78230
|
78298
|
78299
|
78300
|
78301
|
78302
|
79796
|
79797
|
79988
|
81203
|
88097
|
88102
|
88103
|
88104
|
88105
|
88106
|
88107
|
88108
|
88109
|
88126
|
88195
|
88831
|
88832
|
88833
|
88834
|
88835
|
88836
|
88837
|
88838
|
88839
|
95038
|
97004
|
98365
|
99607
|
99677
|
99684
|
99685
|
101775
|
101776
|
101777
|
101778