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

(-)a/Koha/Template/Plugin/Notices.pm (+39 lines)
Line 0 Link Here
1
package Koha::Template::Plugin::Notices;
2
3
# Copyright ByWater Solutions 2023
4
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 3 of the License, or
10
# (at your option) any later version.
11
#
12
# Koha is distributed in the hope that it will be useful, but
13
# WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
20
use Modern::Perl;
21
22
use Template::Plugin;
23
use base qw( Template::Plugin );
24
25
use C4::Koha;
26
use C4::Context;
27
use Koha::Notice::Templates;
28
29
sub GetTemplates {
30
    my ( $self, $module ) = @_;
31
    my $params = {};
32
    $params->{module} = $module if $module;
33
34
    my @letters = Koha::Notice::Templates->search($params)->as_list;
35
36
    return \@letters;
37
}
38
39
1;
(-)a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss (-2 / +1 lines)
Lines 2520-2527 td.bundle { Link Here
2520
    }
2520
    }
2521
}
2521
}
2522
2522
2523
#printclearscreen,
2523
.printclearscreen {
2524
#printclearscreenq {
2525
    position: absolute;
2524
    position: absolute;
2526
    right: 43px;
2525
    right: 43px;
2527
    top: 0;
2526
    top: 0;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc (-4 / +9 lines)
Lines 2-7 Link Here
2
[% USE Koha %]
2
[% USE Koha %]
3
[% USE Branches %]
3
[% USE Branches %]
4
[% USE Categories %]
4
[% USE Categories %]
5
[% USE Notices %]
5
[% USE AuthorisedValues %]
6
[% USE AuthorisedValues %]
6
[% USE scalar %]
7
[% USE scalar %]
7
<div id="toolbar" class="btn-toolbar">
8
<div id="toolbar" class="btn-toolbar">
Lines 21-36 Link Here
21
    <div class="btn-group">
22
    <div class="btn-group">
22
        <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-print"></i> Print <span class="caret"></span></button>
23
        <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-print"></i> Print <span class="caret"></span></button>
23
            <ul class="dropdown-menu">
24
            <ul class="dropdown-menu">
24
                <li><a id="printsummary" href="#">Print summary</a></li>
25
                <li><a class="printslip" data-code="printsummary" href="#">Print summary</a></li>
25
                <li><a id="printslip" href="#">Print slip</a></li>
26
                <li><a class="printslip" data-code="issueslip" href="#">Print slip</a></li>
26
                <li><a id="printquickslip" href="#">Print quick slip</a></li>
27
                <li><a class="printslip" data-code="issueqslip" href="#">Print quick slip</a></li>
27
                [% IF patron.account_balance != 0 %]
28
                [% IF patron.account_balance != 0 %]
28
                <li><a id="printfineslip" target="_blank" href="/cgi-bin/koha/members/printnotice.pl?notice=ACCOUNTS_SUMMARY&borrowernumber=[% patron.borrowernumber | uri %]">Print account balance</a></li>
29
                <li><a id="printfineslip" target="_blank" href="/cgi-bin/koha/members/printnotice.pl?notice=ACCOUNTS_SUMMARY&borrowernumber=[% patron.borrowernumber | uri %]">Print account balance</a></li>
29
                [% END %]
30
                [% END %]
30
                [% IF patron.has_overdues %]
31
                [% IF patron.has_overdues %]
31
                    <li><a id="print_overdues" href="#">Print overdues</a></li>
32
                    <li><a id="print_overdues" href="#">Print overdues</a></li>
32
                [% END %]
33
                [% END %]
33
                <li><a id="printcheckinslip" href="#">Print checkin slip</a></li>
34
                <li><a class="printslip" data-code="checkinslip" href="#">Print checkin slip</a></li>
35
		[% FOREACH notice IN Notices.GetTemplates( 'patron_slip' ) %]
36
                     <li><a class="printslip" data-code="[% notice.code %]" href="#">Print [% notice.name %] slip</a></li>
37
		[% END %]
38
34
            </ul>
39
            </ul>
35
    </div>
40
    </div>
36
    [% END %]
41
    [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-2 / +2 lines)
Lines 649-658 Link Here
649
649
650
                                        [% IF Koha.Preference('DisplayClearScreenButton') == 'issueslip' %]
650
                                        [% IF Koha.Preference('DisplayClearScreenButton') == 'issueslip' %]
651
                                            <span id="clearscreen"><a href="/cgi-bin/koha/circ/circulation.pl" title="Clear screen">x</a></span>
651
                                            <span id="clearscreen"><a href="/cgi-bin/koha/circ/circulation.pl" title="Clear screen">x</a></span>
652
                                            <span id="printclearscreen"><a href="#" title="Print slip and clear screen"><i class="fa fa-print"></i></a></span>
652
                                            <span class="printslip printclearscreen" data-clear="true" data-code="issueslip"><a href="#" title="Print slip and clear screen"><i class="fa fa-print"></i></a></span>
653
                                        [% ELSIF Koha.Preference('DisplayClearScreenButton') == 'issueqslip' %]
653
                                        [% ELSIF Koha.Preference('DisplayClearScreenButton') == 'issueqslip' %]
654
                                            <span id="clearscreen"><a href="/cgi-bin/koha/circ/circulation.pl" title="Clear screen">x</a></span>
654
                                            <span id="clearscreen"><a href="/cgi-bin/koha/circ/circulation.pl" title="Clear screen">x</a></span>
655
                                            <span id="printclearscreenq"><a href="#" title="Print quick slip and clear screen"><i class="fa fa-print"></i></a></span>
655
                                            <span class="printslip printclearscreen" data-clear="true" data-code="issueqslip"><a href="#" title="Print quick slip and clear screen"><i class="fa fa-print"></i></a></span>
656
                                        [% END %]
656
                                        [% END %]
657
657
658
                                        [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
658
                                        [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt (-1 / +8 lines)
Lines 176-181 Link Here
176
                                <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=ill">Interlibrary loans</a></li>
176
                                <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=ill">Interlibrary loans</a></li>
177
                                <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=orderacquisition">Order acquisition</a></li>
177
                                <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=orderacquisition">Order acquisition</a></li>
178
                                <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=members">Patrons</a></li>
178
                                <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=members">Patrons</a></li>
179
                                <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=patron_slip">Patrons toolbar (slip)</a></li>
179
                                <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=serial">Serials (new issue)</a></li>
180
                                <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=serial">Serials (new issue)</a></li>
180
                                <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=suggestions">Suggestions</a></li>
181
                                <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=suggestions">Suggestions</a></li>
181
                                <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=pos">Point of sale</a></li>
182
                                <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=pos">Point of sale</a></li>
Lines 232-238 Link Here
232
                                                    [% CASE 'claimissues' %]<span>Claim serial issue</span>
233
                                                    [% CASE 'claimissues' %]<span>Claim serial issue</span>
233
                                                    [% CASE 'reserves' %]<span>Holds</span>
234
                                                    [% CASE 'reserves' %]<span>Holds</span>
234
                                                    [% CASE 'ill' %]<span>Interlibrary loans</span>
235
                                                    [% CASE 'ill' %]<span>Interlibrary loans</span>
235
                                                    [% CASE 'members' %]<span>Patrons</span>
236
						    [% CASE 'members' %]<span>Patrons</span>
237
                                                    [% CASE 'patron_slip' %]<span>Patrons toolbar (slip)</span>
236
                                                    [% CASE 'serial' %]<span>Serials (new issue)</span>
238
                                                    [% CASE 'serial' %]<span>Serials (new issue)</span>
237
                                                    [% CASE 'suggestions' %]<span>Suggestions</span>
239
                                                    [% CASE 'suggestions' %]<span>Suggestions</span>
238
                                                    [% CASE 'pos' %]<span>Point of sale</span>
240
                                                    [% CASE 'pos' %]<span>Point of sale</span>
Lines 391-396 Link Here
391
                                        [% ELSE %]
393
                                        [% ELSE %]
392
                                            <option value="members">Patrons</option>
394
                                            <option value="members">Patrons</option>
393
                                        [% END %]
395
                                        [% END %]
396
                                        [% IF ( module == "patron_slip" ) %]
397
                                            <option value="patron_slip" selected="selected">Patron toolbar (slip)</option>
398
                                        [% ELSE %]
399
                                            <option value="patron_slip">Patron toolbar (slip)</option>
400
                                        [% END %]
394
                                        [% IF ( module == "serial" ) %]
401
                                        [% IF ( module == "serial" ) %]
395
                                            <option value="serial" selected="selected">Serials (new issue)</option>
402
                                            <option value="serial" selected="selected">Serials (new issue)</option>
396
                                        [% ELSE %]
403
                                        [% ELSE %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js (-33 / +14 lines)
Lines 41-78 $(document).ready(function(){ Link Here
41
        $(".btn-group").removeClass("open");
41
        $(".btn-group").removeClass("open");
42
        return false;
42
        return false;
43
    });
43
    });
44
    $("#printsummary").click(function(){
45
        printx_window("page");
46
        $(".btn-group").removeClass("open");
47
        return false;
48
    });
49
    $("#printslip").click(function(){
50
        printx_window("slip");
51
        $(".btn-group").removeClass("open");
52
        return false;
53
    });
54
    $("#printquickslip").click(function(){
55
        printx_window("qslip");
56
        $(".btn-group").removeClass("open");
57
        return false;
58
    });
59
    $("#print_overdues").click(function(){
44
    $("#print_overdues").click(function(){
60
        window.open("/cgi-bin/koha/members/print_overdues.pl?borrowernumber=" + borrowernumber, "printwindow");
45
        window.open("/cgi-bin/koha/members/print_overdues.pl?borrowernumber=" + borrowernumber, "printwindow");
61
        $(".btn-group").removeClass("open");
46
        $(".btn-group").removeClass("open");
62
        return false;
47
        return false;
63
    });
48
    });
64
    $("#printcheckinslip").click(function(){
49
    $(".printslip").click(function(){
65
        printx_window("checkinslip");
50
	let slip_code = $(this).data('code');
66
        $(".btn-group").removeClass("open");
51
	let clear_screen = $(this).data('clear');
67
        return false;
52
	if( slip_code == 'printsummary' ){
68
    });
53
            window.open("/cgi-bin/koha/members/summary-print.pl?borrowernumber=" + borrowernumber, "printwindow");
69
    $("#printclearscreen").click(function(){
54
	} else {
70
        printx_window("slip");
55
            window.open("/cgi-bin/koha/members/printslip.pl?borrowernumber=" + borrowernumber + "&amp;print=" + slip_code, "printwindow");
71
        window.location.replace("/cgi-bin/koha/circ/circulation.pl");
56
	}
72
    });
57
	if( clear_screen ){
73
    $("#printclearscreenq").click(function(){
58
            window.location.replace("/cgi-bin/koha/circ/circulation.pl");
74
        printx_window("qslip");
59
	} else {
75
        window.location.replace("/cgi-bin/koha/circ/circulation.pl");
60
            $(".btn-group").removeClass("open");
61
            return false;
62
	}
76
    });
63
    });
77
    $("#searchtohold").click(function(){
64
    $("#searchtohold").click(function(){
78
        searchToHold();
65
        searchToHold();
Lines 151-162 function confirm_reregistration() { Link Here
151
function export_barcodes() {
138
function export_barcodes() {
152
    window.open('/cgi-bin/koha/members/readingrec.pl?borrowernumber=' + borrowernumber + '&amp;op=export_barcodes');
139
    window.open('/cgi-bin/koha/members/readingrec.pl?borrowernumber=' + borrowernumber + '&amp;op=export_barcodes');
153
}
140
}
154
var slip_re = /slip/;
155
function printx_window(print_type) {
156
    var handler = print_type.match(slip_re) ? "printslip" : "summary-print";
157
    window.open("/cgi-bin/koha/members/" + handler + ".pl?borrowernumber=" + borrowernumber + "&amp;print=" + print_type, "printwindow");
158
    return false;
159
}
160
function searchToHold(){
141
function searchToHold(){
161
    var date = new Date();
142
    var date = new Date();
162
    date.setTime(date.getTime() + (10 * 60 * 1000));
143
    date.setTime(date.getTime() + (10 * 60 * 1000));
(-)a/members/printslip.pl (-8 / +22 lines)
Lines 66-72 my $patron = Koha::Patrons->find( $borrowernumber ); Link Here
66
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
66
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
67
67
68
my $branch=C4::Context->userenv->{'branch'};
68
my $branch=C4::Context->userenv->{'branch'};
69
my ($slip, $is_html);
69
my ($letter, $slip, $is_html);
70
if ( $print eq 'checkinslip' ) {
70
if ( $print eq 'checkinslip' ) {
71
    my $checkinslip_branch = $session->param('branch') ? $session->param('branch') : $branch;
71
    my $checkinslip_branch = $session->param('branch') ? $session->param('branch') : $branch;
72
72
Lines 78-84 if ( $print eq 'checkinslip' ) { Link Here
78
        old_issues => \@issue_ids,
78
        old_issues => \@issue_ids,
79
    );
79
    );
80
80
81
    my $letter = C4::Letters::GetPreparedLetter(
81
    $letter = C4::Letters::GetPreparedLetter(
82
        module      => 'circulation',
82
        module      => 'circulation',
83
        letter_code => 'CHECKINSLIP',
83
        letter_code => 'CHECKINSLIP',
84
        branchcode  => $checkinslip_branch,
84
        branchcode  => $checkinslip_branch,
Lines 91-104 if ( $print eq 'checkinslip' ) { Link Here
91
        message_transport_type => 'print'
91
        message_transport_type => 'print'
92
    );
92
    );
93
93
94
    $slip    = $letter->{content};
94
} elsif ( $print eq 'issueslip' ){
95
    $is_html = $letter->{is_html};
95
    $letter = IssueSlip ($session->param('branch') || $branch, $borrowernumber, 0);
96
96
} elsif ( $print eq 'issueqslip' ){
97
} elsif (my $letter = IssueSlip ($session->param('branch') || $branch, $borrowernumber, $print eq "qslip")) {
97
    $letter = IssueSlip ($session->param('branch') || $branch, $borrowernumber, 1);
98
    $slip = $letter->{content};
98
} else {
99
    $is_html = $letter->{is_html};
99
    $letter = C4::Letters::GetPreparedLetter(
100
        module => 'patron_slip',
101
	letter_code => $print,
102
	branchcode => $branch,
103
	lang => $patron->lang,
104
	tables => {
105
	    branches => $branch,
106
	    borrowers => $borrowernumber
107
        },
108
        message_transport_type => 'print'
109
    );
100
}
110
}
101
111
112
$slip    = $letter->{content};
113
$is_html = $letter->{is_html};
114
115
102
$template->param(
116
$template->param(
103
    slip => $slip,
117
    slip => $slip,
104
    plain => !$is_html,
118
    plain => !$is_html,
(-)a/tools/letter.pl (-1 / +3 lines)
Lines 252-257 sub add_form { Link Here
252
    elsif ($module eq 'claimissues') {
252
    elsif ($module eq 'claimissues') {
253
        push @{$field_selection}, add_fields('aqbooksellers', 'serial', 'subscription', 'biblio', 'biblioitems');
253
        push @{$field_selection}, add_fields('aqbooksellers', 'serial', 'subscription', 'biblio', 'biblioitems');
254
    }
254
    }
255
    elsif ($module eq 'patron_slip') {
256
        push @{$field_selection}, add_fields('borrowers');
257
    }
255
    elsif ($module eq 'serial') {
258
    elsif ($module eq 'serial') {
256
        push @{$field_selection}, add_fields('branches', 'biblio', 'biblioitems', 'borrowers', 'subscription', 'serial');
259
        push @{$field_selection}, add_fields('branches', 'biblio', 'biblioitems', 'borrowers', 'subscription', 'serial');
257
    }
260
    }
258
- 

Return to bug 32986