Lines 36-41
my $report_annotation = $query->param('annotated');
Link Here
|
36 |
my $report_rec = get_saved_report( $report_name ? { 'name' => $report_name } : { 'id' => $report_id } ); |
36 |
my $report_rec = get_saved_report( $report_name ? { 'name' => $report_name } : { 'id' => $report_id } ); |
37 |
if (!$report_rec) { die "There is no such report.\n"; } |
37 |
if (!$report_rec) { die "There is no such report.\n"; } |
38 |
|
38 |
|
|
|
39 |
my @sql_params = $query->param('sql_params'); |
40 |
|
39 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
41 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
40 |
{ |
42 |
{ |
41 |
template_name => "intranet-main.tt", |
43 |
template_name => "intranet-main.tt", |
Lines 50-63
my $cache = Koha::Cache->get_instance();
Link Here
|
50 |
my $cache_active = $cache->is_cache_active; |
52 |
my $cache_active = $cache->is_cache_active; |
51 |
my ($cache_key, $json_text); |
53 |
my ($cache_key, $json_text); |
52 |
if ($cache_active) { |
54 |
if ($cache_active) { |
53 |
$cache_key = "intranet:report:".($report_name ? "name:$report_name" : "id:$report_id"); |
55 |
$cache_key = "intranet:report:".($report_name ? "name:$report_name" : "id:$report_id") |
|
|
56 |
. join( '-', @sql_params ); |
54 |
$json_text = $cache->get_from_cache($cache_key); |
57 |
$json_text = $cache->get_from_cache($cache_key); |
55 |
} |
58 |
} |
56 |
|
59 |
|
57 |
unless ($json_text) { |
60 |
unless ($json_text) { |
58 |
my $offset = 0; |
61 |
my $offset = 0; |
59 |
my $limit = C4::Context->preference("SvcMaxReportRows") || 10; |
62 |
my $limit = C4::Context->preference("SvcMaxReportRows") || 10; |
60 |
my ( $sth, $errors ) = execute_query( $report_rec->{savedsql}, $offset, $limit ); |
63 |
my $sql = $report_rec->{savedsql}; |
|
|
64 |
|
65 |
# convert SQL parameters to placeholders |
66 |
$sql =~ s/(<<.*?>>)/\?/g; |
67 |
|
68 |
my ( $sth, $errors ) = execute_query( $sql, $offset, $limit, \@sql_params ); |
61 |
if ($sth) { |
69 |
if ($sth) { |
62 |
my $lines; |
70 |
my $lines; |
63 |
if ($report_annotation) { |
71 |
if ($report_annotation) { |
64 |
- |
|
|