Bugzilla – Attachment 53806 Details for
Bug 15839
Move the reviews related code to Koha::Reviews
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15839: [QA Follow-up] Paging on opac-showreviews
Bug-15839-QA-Follow-up-Paging-on-opac-showreviews.patch (text/plain), 4.31 KB, created by
Marcel de Rooy
on 2016-07-29 09:45:02 UTC
(
hide
)
Description:
Bug 15839: [QA Follow-up] Paging on opac-showreviews
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2016-07-29 09:45:02 UTC
Size:
4.31 KB
patch
obsolete
>From 10a6eeb94a84a2d70adc6c5fa1471ab94cb1d7be Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 29 Jul 2016 09:27:58 +0200 >Subject: [PATCH] Bug 15839: [QA Follow-up] Paging on opac-showreviews >Content-Type: text/plain; charset=utf-8 > >Paging is kind of messy here. This patch at least improves somewhat. >The page number should be rounded. >The results per page should be passed to the template too. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Tested a number of reviews and played with count parameter in URL. >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt | 8 ++++---- > opac/opac-showreviews.pl | 5 +++-- > 2 files changed, 7 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt >index 464aa21..507c118 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt >@@ -154,21 +154,21 @@ > <div class="pages"> > <!-- Row of numbers corresponding to showreviews result pages --> > [% IF ( previous_page_offset ) %] >- <a class="nav" href="/cgi-bin/koha/opac-showreviews.pl?offset=[% previous_page_offset %]"><< Previous</a> >+ <a class="nav" href="/cgi-bin/koha/opac-showreviews.pl?offset=[% previous_page_offset %]&count=[% results_per_page %]"><< Previous</a> > [% ELSE %] > [% IF ( previous_page_first ) %] >- <a class="nav" href="/cgi-bin/koha/opac-showreviews.pl?offset=0"><< Previous</a> >+ <a class="nav" href="/cgi-bin/koha/opac-showreviews.pl?offset=0&count=[% results_per_page %]"><< Previous</a> > [% END %] > [% END %] > [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %] > [% IF ( PAGE_NUMBER.highlight ) %] > <span class="currentPage">[% PAGE_NUMBER.pg %]</span> > [% ELSE %] >- <a class="nav" href="/cgi-bin/koha/opac-showreviews.pl?offset=[% PAGE_NUMBER.offset %]">[% PAGE_NUMBER.pg %]</a> >+ <a class="nav" href="/cgi-bin/koha/opac-showreviews.pl?offset=[% PAGE_NUMBER.offset %]&count=[% results_per_page %]">[% PAGE_NUMBER.pg %]</a> > [% END %] > [% END %] > [% IF ( next_page_offset ) %] >- <a class="nav" href="/cgi-bin/koha/opac-showreviews.pl?offset=[% next_page_offset %]">Next >></a> >+ <a class="nav" href="/cgi-bin/koha/opac-showreviews.pl?offset=[% next_page_offset %]&count=[% results_per_page %]">Next >></a> > [% END %] > </div> > [% END # / IF PAGE_NUMBERS %] >diff --git a/opac/opac-showreviews.pl b/opac/opac-showreviews.pl >index 995ad70..839a536 100755 >--- a/opac/opac-showreviews.pl >+++ b/opac/opac-showreviews.pl >@@ -30,7 +30,7 @@ use C4::Biblio; > use C4::Members qw/GetMemberDetails/; > use Koha::DateUtils; > use Koha::Reviews; >-use POSIX qw(ceil strftime); >+use POSIX qw(ceil floor strftime); > > my $template_name; > my $query = new CGI; >@@ -38,7 +38,7 @@ my $format = $query->param("format") || ''; > my $count = C4::Context->preference('OPACnumSearchResults') || 20; > my $results_per_page = $query->param('count') || $count; > my $offset = $query->param('offset') || 0; >-my $page = $offset / $results_per_page + 1; >+my $page = floor( $offset / $results_per_page ) + 1; > > if ($format eq "rss") { > $template_name = "opac-showreviews-rss.tt"; >@@ -180,6 +180,7 @@ $template->param(next_page_offset => $next_page_offset) unless $pages eq $curren > > $template->param( > reviews => $reviews, >+ results_per_page => $results_per_page, > ); > > output_html_with_http_headers $query, $cookie, $template->output; >-- >1.7.10.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 15839
:
48166
|
48167
|
48168
|
48169
|
48170
|
48171
|
48172
|
48173
|
48174
|
48175
|
48176
|
48280
|
48281
|
48282
|
48283
|
48284
|
48285
|
48286
|
48287
|
48288
|
48289
|
48290
|
51197
|
51198
|
51199
|
51200
|
51201
|
51202
|
51203
|
51204
|
51205
|
51206
|
51207
|
53794
|
53795
|
53796
|
53797
|
53798
|
53799
|
53800
|
53801
|
53802
|
53803
|
53804
|
53805
| 53806 |
53807