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 (-2 / +16 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-25 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";
22
26
27
  return false;
28
}
23
function checkout_confirm(patronid) {
29
function checkout_confirm(patronid) {
24
    var   barcode = $("#barcode").val();
30
    var   barcode = $("#barcode").val();
25
    // alert("checkout_confirm('" + patronid + "') called for barcode '" + barcode + "'");
31
    // alert("checkout_confirm('" + patronid + "') called for barcode '" + barcode + "'");
Lines 92-98 $(document).ready(function() { Link Here
92
    });
98
    });
93
});
99
});
94
//]]>
100
//]]>
95
101
$(document).ready(function(){
102
    $("#logout_form input.finish").click(function(){
103
    if(confirm("Would you like to print a receipt?")){
104
        window.open("/cgi-bin/koha/sco/printslip.pl?borrowernumber=[% borrowernumber %]&amp;print=qslip");
105
    }
106
    $(this).parent().attr("action", "/cgi-bin/koha/sco/sco-main.pl?op=logout");
107
    $(this).parent().submit();
108
    });
109
});
96
</script>
110
</script>
97
[% IF ( opacuserjs ) %]<script type="text/javascript">[% opacuserjs %]</script>[% END %]
111
[% IF ( opacuserjs ) %]<script type="text/javascript">[% opacuserjs %]</script>[% END %]
98
112
Lines 227-233 Sorry, this self-checkout station has lost authentication. Please contact the a Link Here
227
	<input type="hidden" name="valid_session" value="1" />
241
	<input type="hidden" name="valid_session" value="1" />
228
	<input type="submit" value="Submit" class="submit" /></fieldset>
242
	<input type="submit" value="Submit" class="submit" /></fieldset>
229
	</form>
243
	</form>
230
	<div><form method="post" action="/cgi-bin/koha/sco/sco-main.pl?op=logout" ><input type="submit" value="Finish" class="finish" /></form></div>
244
    <div><form method="post" action="#" id="logout_form"><input type="submit" value="Finish" class="finish" /></form></div>
231
	</div> <!-- sco_entry --> <!-- newcheckout -->
245
	</div> <!-- sco_entry --> <!-- newcheckout -->
232
  [% IF ( display_patron_image ) %]</div> <!-- /yui-u first -->[% END %]
246
  [% IF ( display_patron_image ) %]</div> <!-- /yui-u first -->[% END %]
233
  [% IF ( display_patron_image ) %]
247
  [% IF ( display_patron_image ) %]
(-)a/opac/sco/printslip.pl (+68 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2012 ByWater Solutions
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
=head1 printslip.pl
21
22
Script to allow SCO patrons to print a receipt for their checkout.
23
24
It is called from sco-main.pl
25
26
=cut
27
28
29
use strict;
30
use warnings;
31
use CGI;
32
use C4::Context;
33
use C4::Auth qw/:DEFAULT get_session/;
34
use C4::Output;
35
use C4::Members;
36
use C4::Koha;
37
38
my $input = new CGI;
39
my $sessionID = $input->cookie("CGISESSID");
40
my $session = get_session($sessionID);
41
42
my $print = $input->param('print');
43
my $error = $input->param('error');
44
45
# patrons still need to be able to print receipts
46
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
47
    {
48
        template_name   => "/sco/printslip.tmpl",
49
        query           => $input,
50
        type            => "opac",
51
    }
52
);
53
54
my $borrowernumber = $input->param('borrowernumber');
55
my $branch=C4::Context->userenv->{'branch'};
56
my ($slip, $is_html);
57
if (my $letter = IssueSlip ($session->param('branch') || $branch, $borrowernumber, $print eq "qslip")) {
58
    $slip = $letter->{content};
59
    $is_html = $letter->{is_html};
60
}
61
62
$template->{VARS}->{slip} = $slip;
63
$template->{VARS}->{plain} = !$is_html;
64
$template->{VARS}->{title} = "Print Receipt for $borrowernumber";
65
$template->{VARS}->{stylesheet} = C4::Context->preference("SlipCSS");
66
$template->{VARS}->{error} = $error;
67
68
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/opac/sco/sco-main.pl (-1 / +1 lines)
Lines 239-244 if ($borrower->{cardnumber}) { Link Here
239
        patronlogin => $patronlogin,
239
        patronlogin => $patronlogin,
240
        patronpw => $patronpw,
240
        patronpw => $patronpw,
241
        noitemlinks => 1 ,
241
        noitemlinks => 1 ,
242
    borrowernumber => $borrower->{'borrowernumber'},
242
    );
243
    );
243
    my $inputfocus = ($return_only      == 1) ? 'returnbook' :
244
    my $inputfocus = ($return_only      == 1) ? 'returnbook' :
244
                     ($confirm_required == 1) ? 'confirm'    : 'barcode' ;
245
                     ($confirm_required == 1) ? 'confirm'    : 'barcode' ;
245
- 

Return to bug 8033