Bugzilla – Attachment 15148 Details for
Bug 9417
Allow number of results per page to be selectable for guided reports
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 9417 - Allow number of results per page to be selectable for guided reports
SIGNED-OFF-Bug-9417---Allow-number-of-results-per-.patch (text/plain), 3.62 KB, created by
Owen Leonard
on 2013-02-07 19:48:47 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 9417 - Allow number of results per page to be selectable for guided reports
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2013-02-07 19:48:47 UTC
Size:
3.62 KB
patch
obsolete
>From 9d3cd50be1fda6e4691867c086a70596928833bc Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 16 Jan 2013 06:53:59 -0500 >Subject: [PATCH] [SIGNED-OFF] Bug 9417 - Allow number of results per page to > be selectable for guided reports >Content-Type: text/plain; charset="utf-8" > >This patch adds the ability to select the number of row to show per page while >retaining the default rows per page as 20. > >Test Plan: >1) Apply patch >2) Run a guided report that will have many resultant rows >3) Try the various rows per page options >4) Verify the rows per page selected is retained when paging through results > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../en/modules/reports/guided_reports_start.tt | 20 ++++++++++++++++++++ > reports/guided_reports.pl | 9 +++++++-- > 2 files changed, 27 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >index c055b2b..7f109d9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >@@ -579,6 +579,26 @@ canned reports and writing custom SQL reports.</p> > [% IF ( notes ) %]<p>[% notes %]</p>[% END %] > [% IF ( unlimited_total ) %]<p>Total number of rows matching the (unlimited) query is [% unlimited_total %].</p>[% END %] > <pre id="sql_output">[% sql |html %]</pre> >+ >+<form> >+ <input type="hidden" name="phase" value="Run this report"/> >+ <input type="hidden" name="reports" value="[% report_id %]"/> >+ >+ <label for="limit">Rows per page: </label> >+ <select name="limit"> >+ [% limits = [ 10, 20, 50, 100, 200, 300, 400, 500, 1000 ] %] >+ [% FOREACH l IN limits %] >+ [% IF l == limit %] >+ <option value="[% l %]" selected="selected">[% l %]</option> >+ [% ELSE %] >+ <option value="[% l %]">[% l %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ >+ <input type="submit" value="Update" /> >+</form> >+ > <div class="pages">[% pagination_bar %]</div> > [% UNLESS ( errors ) %] > <table> >diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl >index 631e056..23d85a9 100755 >--- a/reports/guided_reports.pl >+++ b/reports/guided_reports.pl >@@ -523,7 +523,7 @@ elsif ( $phase eq 'Save Report' ) { > > elsif ($phase eq 'Run this report'){ > # execute a saved report >- my $limit = 20; # page size. # TODO: move to DB or syspref? >+ my $limit = $input->param('limit') || 20; > my $offset = 0; > my $report_id = $input->param('reports'); > my @sql_params = $input->param('sql_params'); >@@ -532,6 +532,11 @@ elsif ($phase eq 'Run this report'){ > $offset = ($input->param('page') - 1) * $limit; > } > >+ $template->param( >+ 'limit' => $limit, >+ 'report_id' => $report_id, >+ ); >+ > my ( $sql, $type, $name, $notes ); > if (my $report = get_saved_report($report_id)) { > $sql = $report->{savedsql}; >@@ -654,7 +659,7 @@ elsif ($phase eq 'Run this report'){ > } > > my $totpages = int($total/$limit) + (($total % $limit) > 0 ? 1 : 0); >- my $url = "/cgi-bin/koha/reports/guided_reports.pl?reports=$report_id&phase=Run%20this%20report"; >+ my $url = "/cgi-bin/koha/reports/guided_reports.pl?reports=$report_id&phase=Run%20this%20report&limit=$limit"; > if (@sql_params) { > $url = join('&sql_params=', $url, map { URI::Escape::uri_escape($_) } @sql_params); > } >-- >1.7.9.5
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 9417
:
14671
|
15083
|
15090
|
15148
|
15155