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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt (-13 / +13 lines)
Lines 5-16 Link Here
5
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha [% END %] &rsaquo; Self checkout </title>
5
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha [% END %] &rsaquo; Self checkout </title>
6
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
<meta name="generator" content="Koha [% Version %]" /> <!-- leave this for stats -->
7
<meta name="generator" content="Koha [% Version %]" /> <!-- leave this for stats -->
8
<link rel="shortcut icon" href="[% IF ( OpacFavicon  ) %][% OpacFavicon  %][% ELSE %][% interface %]/[% theme %]/images/favicon.ico[% END %]" type="image/x-icon" />
8
<link rel="shortcut icon" href="[% IF ( Koha.Preference('OpacFavicon') ) %][% Koha.Preference('OpacFavicon') %][% ELSE %][% interface %]/[% theme %]/images/favicon.ico[% END %]" type="image/x-icon" />
9
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/lib/bootstrap/css/bootstrap.min.css" />
9
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/lib/bootstrap/css/bootstrap.min.css" />
10
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/lib/jquery/jquery-ui.css" />
10
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/lib/jquery/jquery-ui.css" />
11
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/sco.css" />
11
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/sco.css" />
12
[% IF ( OPACUserCSS ) %]<style type="text/css">[% OPACUserCSS %]</style>[% END %]
12
[% IF ( Koha.Preference('OPACUserCSS') ) %]<style type="text/css">[% Koha.Preference('OPACUserCSS') %]</style>[% END %]
13
[% IF ( SCOUserCSS ) %]<style type="text/css">[% SCOUserCSS %]</style>[% END %]
13
[% IF ( Koha.Preference('SCOUserCSS') ) %]<style type="text/css">[% Koha.Preference('SCOUserCSS') %]</style>[% END %]
14
<!--[if lt IE 9]>
14
<!--[if lt IE 9]>
15
    <script src="[% interface %]/[% theme %]/lib/respond.min.js"></script>
15
    <script src="[% interface %]/[% theme %]/lib/respond.min.js"></script>
16
<![endif]-->
16
<![endif]-->
Lines 25-31 Link Here
25
    <div class="main">
25
    <div class="main">
26
        <div class="container-fluid">
26
        <div class="container-fluid">
27
            <div class="row-fluid">
27
            <div class="row-fluid">
28
                [% IF ( display_patron_image ) %]
28
                [% IF ( Koha.Preference('ShowPatronImageInWebBasedSelfCheck') ) %]
29
                    <div class="span10">
29
                    <div class="span10">
30
                [% ELSE %]
30
                [% ELSE %]
31
                    <div class="span12">
31
                    <div class="span12">
Lines 76-82 Link Here
76
                                Please see a member of the library staff.
76
                                Please see a member of the library staff.
77
                            </p>
77
                            </p>
78
78
79
                            [% IF ( returnitem && AllowSelfCheckReturns ) %]
79
                            [% IF ( returnitem && Koha.Preference('AllowSelfCheckReturns') ) %]
80
                                <form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
80
                                <form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
81
                                    <input type="hidden" name="op" value="returnbook" />
81
                                    <input type="hidden" name="op" value="returnbook" />
82
                                    <input type="hidden" name="patronid" value="[% patronid %]" />
82
                                    <input type="hidden" name="patronid" value="[% patronid %]" />
Lines 100-106 Link Here
100
                                <p>This item is already checked out to you.</p>
100
                                <p>This item is already checked out to you.</p>
101
                            [% END %]
101
                            [% END %]
102
102
103
                            [% IF ( renew && AllowSelfCheckReturns ) %]
103
                            [% IF ( renew && Koha.Preference('AllowSelfCheckReturns') ) %]
104
                                <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
104
                                <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
105
                                    <input type="hidden" name="op" value="returnbook" />
105
                                    <input type="hidden" name="op" value="returnbook" />
106
                                    <input type="hidden" name="patronid" value="[% patronid %]" />
106
                                    <input type="hidden" name="patronid" value="[% patronid %]" />
Lines 181-187 Link Here
181
                            <div id="newcheckout" class="sco_entry">
181
                            <div id="newcheckout" class="sco_entry">
182
                                <form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sco/sco-main.pl" onsubmit="return checkout_confirm('[% patronid %]');">
182
                                <form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sco/sco-main.pl" onsubmit="return checkout_confirm('[% patronid %]');">
183
                                    <fieldset>
183
                                    <fieldset>
184
                                        <legend>Check out[% IF ( AllowSelfCheckReturns ) %], return[% END %] or renew an item: </legend>
184
                                        <legend>Check out[% IF ( Koha.Preference('AllowSelfCheckReturns') ) %], return[% END %] or renew an item: </legend>
185
                                        <div class="input-append">
185
                                        <div class="input-append">
186
                                            <label for="barcode">Scan a new item or enter its barcode:</label>
186
                                            <label for="barcode">Scan a new item or enter its barcode:</label>
187
                                            <input id="barcode" name="barcode" size="20" type="text" class="focus" autocomplete="off" />
187
                                            <input id="barcode" name="barcode" size="20" type="text" class="focus" autocomplete="off" />
Lines 199-205 Link Here
199
                                </div>
199
                                </div>
200
                            </div> <!-- / #newcheckout -->
200
                            </div> <!-- / #newcheckout -->
201
                </div> <!-- / .span12/12 -->
201
                </div> <!-- / .span12/12 -->
202
                [% IF ( display_patron_image ) %]
202
                [% IF ( Koha.Preference('ShowPatronImageInWebBasedSelfCheck') ) %]
203
                    <div class="span2">
203
                    <div class="span2">
204
                        <img src="/cgi-bin/koha/sco/sco-patron-image.pl?borrowernumber=[% borrowernumber %]" alt="" />
204
                        <img src="/cgi-bin/koha/sco/sco-patron-image.pl?borrowernumber=[% borrowernumber %]" alt="" />
205
                    </div>
205
                    </div>
Lines 266-272 Link Here
266
                                                            [% ELSE %]
266
                                                            [% ELSE %]
267
                                                                <span>No renewals allowed</span>
267
                                                                <span>No renewals allowed</span>
268
                                                            [% END %]
268
                                                            [% END %]
269
                                                            [% IF AllowSelfCheckReturns %]
269
                                                            [% IF Koha.Preference('AllowSelfCheckReturns') %]
270
                                                                <input type="submit" value="Check in item" name="confirm" class="btn return" />
270
                                                                <input type="submit" value="Check in item" name="confirm" class="btn return" />
271
                                                                <input type="hidden" name="op" value="returnbook" />
271
                                                                <input type="hidden" name="op" value="returnbook" />
272
                                                                <input type="hidden" name="confirmed" value=""  />
272
                                                                <input type="hidden" name="confirmed" value=""  />
Lines 291-297 Link Here
291
                            <div class="sco_entry" >
291
                            <div class="sco_entry" >
292
                                <form id="mainform" action="/cgi-bin/koha/sco/sco-main.pl" name="mainform" method="post">
292
                                <form id="mainform" action="/cgi-bin/koha/sco/sco-main.pl" name="mainform" method="post">
293
                                    <fieldset class="checkout brief">
293
                                    <fieldset class="checkout brief">
294
                                        [% IF ( authbylogin ) %]
294
                                        [% IF ( Koha.Preference('SelfCheckoutByLogin') ) %]
295
                                            <legend>Log in to your account</legend>
295
                                            <legend>Log in to your account</legend>
296
                                            <label for="patronlogin">Login:</label>
296
                                            <label for="patronlogin">Login:</label>
297
                                            <input type="text" id="patronlogin" class="focus" size="20" name="patronlogin" />
297
                                            <input type="text" id="patronlogin" class="focus" size="20" name="patronlogin" />
Lines 306-312 Link Here
306
                                                <input type="text" id="patronid" class="focus" size="20" name="patronid" autocomplete="off" />
306
                                                <input type="text" id="patronid" class="focus" size="20" name="patronid" autocomplete="off" />
307
                                                <button type="submit" class="btn">Submit</button>
307
                                                <button type="submit" class="btn">Submit</button>
308
                                            </div>
308
                                            </div>
309
                                        [% END # / IF authbylogin %]
309
                                        [% END %]
310
310
311
                                        [% FOREACH INPUT IN INPUTS %]
311
                                        [% FOREACH INPUT IN INPUTS %]
312
                                            <input type="hidden" name="[% INPUT.name |html %]" value="[% INPUT.value |html %]">
312
                                            <input type="hidden" name="[% INPUT.name |html %]" value="[% INPUT.value |html %]">
Lines 340-346 Link Here
340
        function sco_init() {
340
        function sco_init() {
341
            mainTimeout = setTimeout(function() {
341
            mainTimeout = setTimeout(function() {
342
                location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout';
342
                location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout';
343
            }, [% SelfCheckTimeout %]);
343
            }, [% Koha.Preference('SelfCheckTimeout') %]);
344
        }
344
        }
345
        function dofocus() {    // named function req'd for body onload event by some FF and IE7 security models
345
        function dofocus() {    // named function req'd for body onload event by some FF and IE7 security models
346
            // alert("dofocus called");
346
            // alert("dofocus called");
Lines 415-419 Link Here
415
    //]]>
415
    //]]>
416
    </script>
416
    </script>
417
417
418
    [% IF ( SCOUserJS ) %]<script type="text/javascript">[% SCOUserJS %]</script>[% END %]
418
    [% IF ( Koha.Preference('SCOUserJS') ) %]<script type="text/javascript">[% Koha.Preference('SCOUserJS') %]</script>[% END %]
419
[% END %]
419
[% END %]
(-)a/opac/sco/sco-main.pl (-15 lines)
Lines 74-98 my ($template, $loggedinuser, $cookie) = get_template_and_user({ Link Here
74
    debug => 1,
74
    debug => 1,
75
});
75
});
76
76
77
if (C4::Context->preference('SelfCheckoutByLogin'))
78
{
79
    $template->param(authbylogin  => 1);
80
}
81
82
# Get the self checkout timeout preference, or use 120 seconds as a default
77
# Get the self checkout timeout preference, or use 120 seconds as a default
83
my $selfchecktimeout = 120000;
78
my $selfchecktimeout = 120000;
84
if (C4::Context->preference('SelfCheckTimeout')) { 
79
if (C4::Context->preference('SelfCheckTimeout')) { 
85
    $selfchecktimeout = C4::Context->preference('SelfCheckTimeout') * 1000;
80
    $selfchecktimeout = C4::Context->preference('SelfCheckTimeout') * 1000;
86
}
81
}
87
$template->param(SelfCheckTimeout => $selfchecktimeout);
88
82
89
# Checks policy laid out by AllowSelfCheckReturns, defaults to 'on' if preference is undefined
83
# Checks policy laid out by AllowSelfCheckReturns, defaults to 'on' if preference is undefined
90
my $allowselfcheckreturns = 1;
84
my $allowselfcheckreturns = 1;
91
if (defined C4::Context->preference('AllowSelfCheckReturns')) {
85
if (defined C4::Context->preference('AllowSelfCheckReturns')) {
92
    $allowselfcheckreturns = C4::Context->preference('AllowSelfCheckReturns');
86
    $allowselfcheckreturns = C4::Context->preference('AllowSelfCheckReturns');
93
}
87
}
94
$template->param(AllowSelfCheckReturns => $allowselfcheckreturns);
95
96
88
97
my $issuerid = $loggedinuser;
89
my $issuerid = $loggedinuser;
98
my ($op, $patronid, $patronlogin, $patronpw, $barcode, $confirmed) = (
90
my ($op, $patronid, $patronlogin, $patronpw, $barcode, $confirmed) = (
Lines 269-275 if ($borrower->{cardnumber}) { Link Here
269
    if (C4::Context->preference('ShowPatronImageInWebBasedSelfCheck')) {
261
    if (C4::Context->preference('ShowPatronImageInWebBasedSelfCheck')) {
270
        my $patron_image = Koha::Patron::Images->find($borrower->{borrowernumber});
262
        my $patron_image = Koha::Patron::Images->find($borrower->{borrowernumber});
271
        $template->param(
263
        $template->param(
272
            display_patron_image => 1,
273
            cardnumber           => $borrower->{cardnumber},
264
            cardnumber           => $borrower->{cardnumber},
274
        ) if $patron_image;
265
        ) if $patron_image;
275
    }
266
    }
Lines 280-288 if ($borrower->{cardnumber}) { Link Here
280
    );
271
    );
281
}
272
}
282
273
283
$template->param(
284
    SCOUserJS  => C4::Context->preference('SCOUserJS'),
285
    SCOUserCSS => C4::Context->preference('SCOUserCSS'),
286
);
287
288
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
274
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
289
- 

Return to bug 12691