[% 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>
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');
$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};
}
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);
}