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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc (+17 lines)
Lines 63-68 Link Here
63
                    <i class="fa fa-play"></i> Run report
63
                    <i class="fa fa-play"></i> Run report
64
                </a>
64
                </a>
65
            </div>
65
            </div>
66
            [% IF templates.count %]
67
            <div class="btn-group">
68
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true"
69
                    aria-expanded="false">
70
                    <i class="fa fa-code"></i> Run with template <span class="caret"></span>
71
                </button>
72
                <ul class="dropdown-menu">
73
                    [% FOREACH t IN templates %]
74
                        <li>
75
                            <a id="runreport" class="btn btn-default" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id | html %]&amp;phase=Run%20this%20report&amp;template=[% t.id | html %]">
76
                                [% t.name | html %]
77
                            </a>
78
                        </li>
79
                    [% END %]
80
                </ul>
81
            </div>
82
            [% END %]
66
            <div class="btn-group">
83
            <div class="btn-group">
67
                <a class="btn btn-default" href="/cgi-bin/koha/tools/scheduler.pl?id=[% id | html %]">
84
                <a class="btn btn-default" href="/cgi-bin/koha/tools/scheduler.pl?id=[% id | html %]">
68
                    <i class="fa-solid fa-clock"></i> Schedule
85
                    <i class="fa-solid fa-clock"></i> Schedule
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt (-1 / +3 lines)
Lines 887-893 Link Here
887
                    </form>
887
                    </form>
888
                [% END # /IF ( enter_params ) %]
888
                [% END # /IF ( enter_params ) %]
889
889
890
                [% IF ( execute ) %]
890
                [% IF processed_notice %]
891
                    [% processed_notice | $raw %]
892
                [% ELSIF ( execute ) %]
891
                    <h1>[% name | html %] <span class="report_heading_id"><span class="report_label">Report ID:</span> <span class="report_number">[% id | html %]</span></span></h1>
893
                    <h1>[% name | html %] <span class="report_heading_id"><span class="report_label">Report ID:</span> <span class="report_number">[% id | html %]</span></span></h1>
892
                    <div class="page-section">
894
                    <div class="page-section">
893
                        [% IF ( notes ) %]
895
                        [% IF ( notes ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt (+7 lines)
Lines 158-163 Link Here
158
                                <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=serial">Serials (new issue)</a></li>
158
                                <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=serial">Serials (new issue)</a></li>
159
                                <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=suggestions">Suggestions</a></li>
159
                                <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=suggestions">Suggestions</a></li>
160
                                <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=pos">Point of sale</a></li>
160
                                <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=pos">Point of sale</a></li>
161
                                <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=report">Report</a></li>
161
                            </ul>
162
                            </ul>
162
                        </div>
163
                        </div>
163
                    </div> <!-- /#toolbar -->
164
                    </div> <!-- /#toolbar -->
Lines 215-220 Link Here
215
                                                    [% CASE 'serial' %]<span>Serials (new issue)</span>
216
                                                    [% CASE 'serial' %]<span>Serials (new issue)</span>
216
                                                    [% CASE 'suggestions' %]<span>Suggestions</span>
217
                                                    [% CASE 'suggestions' %]<span>Suggestions</span>
217
                                                    [% CASE 'pos' %]<span>Point of sale</span>
218
                                                    [% CASE 'pos' %]<span>Point of sale</span>
219
                                                    [% CASE 'report' %]<span>Report</span>
218
                                                    [% CASE %]<span>[% lette.module | html %]</span>
220
                                                    [% CASE %]<span>[% lette.module | html %]</span>
219
                                                [% END %]
221
                                                [% END %]
220
                                            </td>
222
                                            </td>
Lines 391-396 Link Here
391
                                        [% ELSE %]
393
                                        [% ELSE %]
392
                                            <option value="pos">Point of sale</option>
394
                                            <option value="pos">Point of sale</option>
393
                                        [% END %]
395
                                        [% END %]
396
                                        [% IF ( module == "report" ) %]
397
                                            <option value="report" selected="selected">Report</option>
398
                                        [% ELSE %]
399
                                            <option value="report">Report</option>
400
                                        [% END %]
394
                                    </select>
401
                                    </select>
395
                                </li>
402
                                </li>
396
                                <li>
403
                                <li>
(-)a/reports/guided_reports.pl (-1 / +13 lines)
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('&amp;sql_params=', $url, map { URI::Escape::uri_escape_utf8($_) } @sql_params);
877
                    $url = join('&amp;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 = process_tt( $notice_template->content, { data => $data, report_id => $report_id } );
885
                    $template->param( processed_notice => $notice_rendered );
886
                }
887
875
                $template->param(
888
                $template->param(
876
                    'results'        => \@rows,
889
                    'results'        => \@rows,
877
                    'allresults'     => \@allrows,
890
                    'allresults'     => \@allrows,
878
- 

Return to bug 34136