Bugzilla – Attachment 76795 Details for
Bug 19502
Result sets limited to 10000
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19502: (follow-up) Pass parameters to avoid making templates depend on search engine
Bug-19502-follow-up-Pass-parameters-to-avoid-makin.patch (text/plain), 5.24 KB, created by
Alex Arnaud
on 2018-07-09 13:32:04 UTC
(
hide
)
Description:
Bug 19502: (follow-up) Pass parameters to avoid making templates depend on search engine
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2018-07-09 13:32:04 UTC
Size:
5.24 KB
patch
obsolete
>From c045c065e53d899b706b7405aa232ebf3f56ade9 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 19 Apr 2018 23:13:49 +0000 >Subject: [PATCH] Bug 19502: (follow-up) Pass parameters to avoid making > templates depend on search engine > >https://bugs.koha-community.org/show_bug.cgi?id=19502 > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> >--- > catalogue/search.pl | 2 ++ > koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/includes/search/page-numbers.inc | 2 +- > opac/opac-search.pl | 1 + > 5 files changed, 6 insertions(+), 3 deletions(-) > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 7e2e300..633200d 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -620,6 +620,7 @@ for (my $i=0;$i<@servers;$i++) { > ## Build the page numbers on the bottom of the page > my @page_numbers; > my $hits_to_paginate = C4::Context->preference('SearchEngine') eq 'Elasticsearch' ? 10000 : $hits; >+ $template->param( hits_to_paginate => $hits_to_paginate ); > # total number of pages there will be > my $pages = ceil($hits_to_paginate / $results_per_page); > my $last_page_offset = ( $pages -1 ) * $results_per_page; >@@ -676,6 +677,7 @@ for (my $i=0;$i<@servers;$i++) { > last_page_offset => $last_page_offset, > previous_page_offset => $previous_page_offset) unless $pages < 2; > $template->param( next_page_offset => $next_page_offset) unless $pages eq $current_page_number; >+ warn "topage $hits_to_paginate"; > } > > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc >index 387d09f..599907e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc >@@ -1,5 +1,5 @@ > [% IF ( PAGE_NUMBERS ) %]<nav><ul class="pagination"> >- [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' %]<h6>10,000 results loaded, refine your search to view other records</h6>[% END %] >+ [% IF hits_to_paginate < total %]<h6>[% hits_to_paginate %] of [% total %] results loaded, refine your search to view other records</h6>[% END %] > [% IF ( previous_page_offset.defined ) %] > <li><a class="nav" href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&sort_by=[% sort_by |url %][% END %]">First</a></li> > <!-- Row of numbers corresponding to search result pages --> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc >index 484fa5c..48789a0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc >@@ -1,6 +1,6 @@ > [% IF ( PAGE_NUMBERS ) %] > <div class="pagination pagination-small noprint"> >- [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' %]<h6>10000 results loaded, refine your search to view other records</h6>[% END %] >+ [% IF hits_to_paginate < total %]<h6>[% hits_to_paginate %] of [% total %] results loaded, refine your search to view other records</h6>[% END %] > <ul> > [% IF ( previous_page_offset.defined ) %] > <li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&sort_by=[% sort_by |html %][% END %]">First</a></li> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/search/page-numbers.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/search/page-numbers.inc >index 807417b..59d84e0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/search/page-numbers.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/search/page-numbers.inc >@@ -1,6 +1,6 @@ > [% IF ( PAGE_NUMBERS ) %] > <div class="pages"> >- [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' %]<h6>10000 results loaded, refine your search to view other records</h6>[% END %] >+ [% IF hits_to_paginate < total %]<h6>[% hits_to_paginate %] of [% total %] results loaded, refine your search to view other records</h6>[% END %] > [% IF ( previous_page ) %] > <a class="nav" href="?[% FOREACH fp IN follower_params %][% fp.var |url %]=[% fp.val |url %]&[% END %]page=[% previous_page |url %]"><< Previous</a> > [% END %] >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 9cfb3fa..18dd155 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -831,6 +831,7 @@ for (my $i=0;$i<@servers;$i++) { > ## Build the page numbers on the bottom of the page > my @page_numbers; > my $hits_to_paginate = C4::Context->preference('SearchEngine') eq 'Elasticsearch' ? 10000 : $hits; >+ $template->param( hits_to_paginate => $hits_to_paginate ); > # total number of pages there will be > my $pages = ceil($hits_to_paginate / $results_per_page); > my $last_page_offset = ( $pages - 1 ) * $results_per_page; >-- >2.7.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 19502
:
73020
|
73024
|
74587
|
75816
|
76371
|
76372
|
76788
|
76789
|
76790
|
76791
|
76792
|
76794
| 76795 |
76796
|
76798
|
76799