View | Details | Raw Unified | Return to bug 11491
Collapse All | Expand All

(-)a/opac/svc/report (-1 / +5 lines)
Lines 30-35 use Koha::Cache; Link Here
30
my $query  = CGI->new();
30
my $query  = CGI->new();
31
my $report_id = $query->param('id');
31
my $report_id = $query->param('id');
32
my $report_name = $query->param('name');
32
my $report_name = $query->param('name');
33
my $report_header = $query->param('header');
33
34
34
my $report_rec = get_saved_report( $report_name ? { 'name' => $report_name } : { 'id' => $report_id } );
35
my $report_rec = get_saved_report( $report_name ? { 'name' => $report_name } : { 'id' => $report_id } );
35
die "Sorry this report is not public\n" unless $report_rec->{public};
36
die "Sorry this report is not public\n" unless $report_rec->{public};
Lines 48-54 unless ($json_text) { Link Here
48
    my $limit  = C4::Context->preference("SvcMaxReportRows") || 10;
49
    my $limit  = C4::Context->preference("SvcMaxReportRows") || 10;
49
    my ( $sth, $errors ) = execute_query( $report_rec->{savedsql}, $offset, $limit );
50
    my ( $sth, $errors ) = execute_query( $report_rec->{savedsql}, $offset, $limit );
50
    if ($sth) {
51
    if ($sth) {
52
        my $header = $sth->{NAME};
51
        my $lines     = $sth->fetchall_arrayref;
53
        my $lines     = $sth->fetchall_arrayref;
54
        if ($report_header) {
55
            unshift @{$lines}, [ @{$header} ];
56
        }
52
        $json_text = to_json($lines);
57
        $json_text = to_json($lines);
53
58
54
        if ($cache_active) {
59
        if ($cache_active) {
55
- 

Return to bug 11491