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

(-)a/koha-tmpl/opac-tmpl/prog/en/modules/sco/printslip.tt (+26 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>[% title %]</title>
3
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% themelang %]/includes/favicon.ico[% END %]" type="image/x-icon" />
5
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/print.css" />
6
[% IF stylesheet %]
7
<link rel="stylesheet" type="text/css" href="[% stylesheet %]" />
8
[% END %]
9
10
<script language="javascript">
11
    function printThenClose() {
12
        window.print();
13
        window.close();
14
    }
15
</script>
16
</head>
17
<body id="circ_printslip" class="circ" onload="printThenClose();">
18
<div id="receipt">
19
20
[% IF plain %]
21
<pre>
22
[% slip %]
23
</pre>
24
[% ELSE %]
25
[% slip %]
26
[% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt (+10 lines)
Lines 8-13 Link Here
8
<script type="text/javascript" src="[% yuipath %]/container/container-min.js"></script>
8
<script type="text/javascript" src="[% yuipath %]/container/container-min.js"></script>
9
<script type="text/javascript" src="[% yuipath %]/menu/menu-min.js"></script>
9
<script type="text/javascript" src="[% yuipath %]/menu/menu-min.js"></script>
10
<script type="text/javascript" src="[% themelang %]/lib/jquery/jquery.js"></script>
10
<script type="text/javascript" src="[% themelang %]/lib/jquery/jquery.js"></script>
11
<script type="text/javascript" src="[% themelang %]/lib/jquery/jquery-ui.js"></script>
11
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
12
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
12
<script type="text/javascript">//<![CDATA[
13
<script type="text/javascript">//<![CDATA[
13
function sco_init(valid_session) {
14
function sco_init(valid_session) {
Lines 19-24 function dofocus() { // named function req'd for body onload event by some FF Link Here
19
    // alert("dofocus called");
20
    // alert("dofocus called");
20
    $(".focus:last").select();
21
    $(".focus:last").select();
21
}
22
}
23
var slip_re = /slip/;
24
function printx_window(print_type) {
25
  var handler = print_type.match(slip_re) ? "printslip" : "moremember";
26
27
  return false;
28
}
22
29
23
function checkout_confirm(patronid) {
30
function checkout_confirm(patronid) {
24
    var   barcode = $("#barcode").val();
31
    var   barcode = $("#barcode").val();
Lines 35-40 function checkout_confirm(patronid) { Link Here
35
            this.patronid.value='';
42
            this.patronid.value='';
36
        }
43
        }
37
    }
44
    }
45
    if(confirm("Would you like to print a receipt?")){
46
      window.open("/cgi-bin/koha/sco/printslip.pl?borrowernumber=[% borrowernumber %]&amp;print=qslip");
47
    }
38
    return true;
48
    return true;
39
}
49
}
40
50
(-)a/opac/sco/printslip.pl (+70 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 2 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
19
use strict;
20
use warnings;
21
use CGI;
22
use C4::Context;
23
use C4::Auth qw/:DEFAULT get_session/;
24
use C4::Output;
25
use C4::Members;
26
use C4::Koha;
27
28
#use Smart::Comments;
29
#use Data::Dumper;
30
31
use vars qw($debug);
32
33
BEGIN {
34
	$debug = $ENV{DEBUG} || 0;
35
}
36
37
my $input = new CGI;
38
my $sessionID = $input->cookie("CGISESSID");
39
my $session = get_session($sessionID);
40
41
$debug or $debug = $input->param('debug') || 0;
42
my $print = $input->param('print');
43
my $error = $input->param('error');
44
45
# circ staff who process checkouts but can't edit
46
# patrons still need to be able to print receipts
47
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
48
    {
49
        template_name   => "/sco/printslip.tmpl",
50
        query           => $input,
51
        type            => "opac",
52
        debug           => 1,
53
    }
54
);
55
56
my $borrowernumber = $input->param('borrowernumber');
57
my $branch=C4::Context->userenv->{'branch'};
58
my ($slip, $is_html);
59
if (my $letter = IssueSlip ($session->param('branch') || $branch, $borrowernumber, $print eq "qslip")) {
60
    $slip = $letter->{content};
61
    $is_html = $letter->{is_html};
62
}
63
64
$template->{VARS}->{slip} = $slip;
65
$template->{VARS}->{plain} = !$is_html;
66
$template->{VARS}->{title} = "Print Receipt for $borrowernumber";
67
$template->{VARS}->{stylesheet} = C4::Context->preference("SlipCSS");
68
$template->{VARS}->{error} = $error;
69
70
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/opac/sco/sco-main.pl (-1 / +1 lines)
Lines 236-241 if ($borrower->{cardnumber}) { Link Here
236
        patronlogin => $patronlogin,
236
        patronlogin => $patronlogin,
237
        patronpw => $patronpw,
237
        patronpw => $patronpw,
238
        noitemlinks => 1 ,
238
        noitemlinks => 1 ,
239
	borrowernumber => $borrower->{'borrowernumber'},
239
    );
240
    );
240
    my $inputfocus = ($return_only      == 1) ? 'returnbook' :
241
    my $inputfocus = ($return_only      == 1) ? 'returnbook' :
241
                     ($confirm_required == 1) ? 'confirm'    : 'barcode' ;
242
                     ($confirm_required == 1) ? 'confirm'    : 'barcode' ;
242
- 

Return to bug 8033