Lines 523-529
elsif ( $phase eq 'Save Report' ) {
Link Here
|
523 |
|
523 |
|
524 |
elsif ($phase eq 'Run this report'){ |
524 |
elsif ($phase eq 'Run this report'){ |
525 |
# execute a saved report |
525 |
# execute a saved report |
526 |
my $limit = 20; # page size. # TODO: move to DB or syspref? |
526 |
my $limit = $input->param('limit') || 20; |
527 |
my $offset = 0; |
527 |
my $offset = 0; |
528 |
my $report_id = $input->param('reports'); |
528 |
my $report_id = $input->param('reports'); |
529 |
my @sql_params = $input->param('sql_params'); |
529 |
my @sql_params = $input->param('sql_params'); |
Lines 532-537
elsif ($phase eq 'Run this report'){
Link Here
|
532 |
$offset = ($input->param('page') - 1) * $limit; |
532 |
$offset = ($input->param('page') - 1) * $limit; |
533 |
} |
533 |
} |
534 |
|
534 |
|
|
|
535 |
$template->param( |
536 |
'limit' => $limit, |
537 |
'report_id' => $report_id, |
538 |
); |
539 |
|
535 |
my ( $sql, $type, $name, $notes ); |
540 |
my ( $sql, $type, $name, $notes ); |
536 |
if (my $report = get_saved_report($report_id)) { |
541 |
if (my $report = get_saved_report($report_id)) { |
537 |
$sql = $report->{savedsql}; |
542 |
$sql = $report->{savedsql}; |
Lines 654-660
elsif ($phase eq 'Run this report'){
Link Here
|
654 |
} |
659 |
} |
655 |
|
660 |
|
656 |
my $totpages = int($total/$limit) + (($total % $limit) > 0 ? 1 : 0); |
661 |
my $totpages = int($total/$limit) + (($total % $limit) > 0 ? 1 : 0); |
657 |
my $url = "/cgi-bin/koha/reports/guided_reports.pl?reports=$report_id&phase=Run%20this%20report"; |
662 |
my $url = "/cgi-bin/koha/reports/guided_reports.pl?reports=$report_id&phase=Run%20this%20report&limit=$limit"; |
658 |
if (@sql_params) { |
663 |
if (@sql_params) { |
659 |
$url = join('&sql_params=', $url, map { URI::Escape::uri_escape($_) } @sql_params); |
664 |
$url = join('&sql_params=', $url, map { URI::Escape::uri_escape($_) } @sql_params); |
660 |
} |
665 |
} |
661 |
- |
|
|