|
Lines 37-42
use Koha::Libraries;
Link Here
|
| 37 |
use Koha::Patron::Categories; |
37 |
use Koha::Patron::Categories; |
| 38 |
use Koha::SharedContent; |
38 |
use Koha::SharedContent; |
| 39 |
use Koha::Util::OpenDocument qw( generate_ods ); |
39 |
use Koha::Util::OpenDocument qw( generate_ods ); |
|
|
40 |
use Koha::Notice::Templates; |
| 41 |
use Koha::TemplateUtils qw( process_tt ); |
| 40 |
use C4::ClassSource qw( GetClassSources ); |
42 |
use C4::ClassSource qw( GetClassSources ); |
| 41 |
|
43 |
|
| 42 |
=head1 NAME |
44 |
=head1 NAME |
|
Lines 79-84
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
Link Here
|
| 79 |
my $session_id = $input->cookie('CGISESSID'); |
81 |
my $session_id = $input->cookie('CGISESSID'); |
| 80 |
my $session = $session_id ? get_session($session_id) : undef; |
82 |
my $session = $session_id ? get_session($session_id) : undef; |
| 81 |
|
83 |
|
|
|
84 |
$template->param( templates => Koha::Notice::Templates->search({ module => 'report' }) ); |
| 85 |
|
| 82 |
my $filter; |
86 |
my $filter; |
| 83 |
if ( $input->param("filter_set") or $input->param('clear_filters') ) { |
87 |
if ( $input->param("filter_set") or $input->param('clear_filters') ) { |
| 84 |
$filter = {}; |
88 |
$filter = {}; |
|
Lines 671-676
elsif ($phase eq 'Run this report'){
Link Here
|
| 671 |
my $report_id = $input->param('reports'); |
675 |
my $report_id = $input->param('reports'); |
| 672 |
my @sql_params = $input->multi_param('sql_params'); |
676 |
my @sql_params = $input->multi_param('sql_params'); |
| 673 |
my @param_names = $input->multi_param('param_name'); |
677 |
my @param_names = $input->multi_param('param_name'); |
|
|
678 |
my $template_id = $input->param('template'); |
| 674 |
my $want_full_chart = $input->param('want_full_chart') || 0; |
679 |
my $want_full_chart = $input->param('want_full_chart') || 0; |
| 675 |
|
680 |
|
| 676 |
# offset algorithm |
681 |
# offset algorithm |
|
Lines 872-877
elsif ($phase eq 'Run this report'){
Link Here
|
| 872 |
$url = join('&sql_params=', $url, map { URI::Escape::uri_escape_utf8($_) } @sql_params); |
877 |
$url = join('&sql_params=', $url, map { URI::Escape::uri_escape_utf8($_) } @sql_params); |
| 873 |
} |
878 |
} |
| 874 |
|
879 |
|
|
|
880 |
if ($template_id) { |
| 881 |
my $notice_template = Koha::Notice::Templates->find($template_id); |
| 882 |
my ( $sth2, $errors2 ) = execute_query( { sql => $sql, report_id => $report_id } ); |
| 883 |
my $data = $sth2->fetchall_arrayref( {} ); |
| 884 |
my $notice_rendered = |
| 885 |
process_tt( $notice_template->content, { data => $data, report_id => $report_id } ); |
| 886 |
$template->param( processed_notice => $notice_rendered ); |
| 887 |
} |
| 888 |
|
| 875 |
$template->param( |
889 |
$template->param( |
| 876 |
'results' => \@rows, |
890 |
'results' => \@rows, |
| 877 |
'allresults' => \@allrows, |
891 |
'allresults' => \@allrows, |
| 878 |
- |
|
|