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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt (-11 / +11 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 184-190 Link Here
184
                            <div id="newcheckout" class="sco_entry">
184
                            <div id="newcheckout" class="sco_entry">
185
                                <form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sco/sco-main.pl" onsubmit="return checkout_confirm('[% patronid %]');">
185
                                <form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sco/sco-main.pl" onsubmit="return checkout_confirm('[% patronid %]');">
186
                                    <fieldset>
186
                                    <fieldset>
187
                                        <legend>Check out[% IF ( AllowSelfCheckReturns ) %], return[% END %] or renew an item: </legend>
187
                                        <legend>Check out[% IF ( Koha.Preference('AllowSelfCheckReturns') ) %], return[% END %] or renew an item: </legend>
188
                                        <div class="input-append">
188
                                        <div class="input-append">
189
                                            <label for="barcode">Scan a new item or enter its barcode:</label>
189
                                            <label for="barcode">Scan a new item or enter its barcode:</label>
190
                                            <input id="barcode" name="barcode" size="20" type="text" class="focus" autocomplete="off" />
190
                                            <input id="barcode" name="barcode" size="20" type="text" class="focus" autocomplete="off" />
Lines 269-275 Link Here
269
                                                            [% ELSE %]
269
                                                            [% ELSE %]
270
                                                                <span>No renewals allowed</span>
270
                                                                <span>No renewals allowed</span>
271
                                                            [% END %]
271
                                                            [% END %]
272
                                                            [% IF AllowSelfCheckReturns %]
272
                                                            [% IF Koha.Preference('AllowSelfCheckReturns') %]
273
                                                                <input type="submit" value="Check in item" name="confirm" class="btn return" />
273
                                                                <input type="submit" value="Check in item" name="confirm" class="btn return" />
274
                                                                <input type="hidden" name="op" value="returnbook" />
274
                                                                <input type="hidden" name="op" value="returnbook" />
275
                                                                <input type="hidden" name="confirmed" value=""  />
275
                                                                <input type="hidden" name="confirmed" value=""  />
Lines 294-300 Link Here
294
                            <div class="sco_entry" >
294
                            <div class="sco_entry" >
295
                                <form id="mainform" action="/cgi-bin/koha/sco/sco-main.pl" name="mainform" method="post">
295
                                <form id="mainform" action="/cgi-bin/koha/sco/sco-main.pl" name="mainform" method="post">
296
                                    <fieldset class="checkout brief">
296
                                    <fieldset class="checkout brief">
297
                                        [% IF ( authbylogin ) %]
297
                                        [% IF ( Koha.Preference('SelfCheckoutByLogin') ) %]
298
                                            <legend>Log in to your account</legend>
298
                                            <legend>Log in to your account</legend>
299
                                            <label for="patronlogin">Login:</label>
299
                                            <label for="patronlogin">Login:</label>
300
                                            <input type="text" id="patronlogin" class="focus" size="20" name="patronlogin" />
300
                                            <input type="text" id="patronlogin" class="focus" size="20" name="patronlogin" />
Lines 309-315 Link Here
309
                                                <input type="text" id="patronid" class="focus" size="20" name="patronid" autocomplete="off" />
309
                                                <input type="text" id="patronid" class="focus" size="20" name="patronid" autocomplete="off" />
310
                                                <button type="submit" class="btn">Submit</button>
310
                                                <button type="submit" class="btn">Submit</button>
311
                                            </div>
311
                                            </div>
312
                                        [% END # / IF authbylogin %]
312
                                        [% END %]
313
313
314
                                        [% FOREACH INPUT IN INPUTS %]
314
                                        [% FOREACH INPUT IN INPUTS %]
315
                                            <input type="hidden" name="[% INPUT.name |html %]" value="[% INPUT.value |html %]">
315
                                            <input type="hidden" name="[% INPUT.name |html %]" value="[% INPUT.value |html %]">
Lines 418-422 Link Here
418
    //]]>
418
    //]]>
419
    </script>
419
    </script>
420
420
421
    [% IF ( SCOUserJS ) %]<script type="text/javascript">[% SCOUserJS %]</script>[% END %]
421
    [% IF ( Koha.Preference('SCOUserJS') ) %]<script type="text/javascript">[% Koha.Preference('SCOUserJS') %]</script>[% END %]
422
[% END %]
422
[% END %]
(-)a/opac/sco/sco-main.pl (-15 / +1 lines)
Lines 76-100 my ($template, $loggedinuser, $cookie) = get_template_and_user({ Link Here
76
    debug => 1,
76
    debug => 1,
77
});
77
});
78
78
79
if (C4::Context->preference('SelfCheckoutByLogin'))
80
{
81
    $template->param(authbylogin  => 1);
82
}
83
84
# Get the self checkout timeout preference, or use 120 seconds as a default
79
# Get the self checkout timeout preference, or use 120 seconds as a default
85
my $selfchecktimeout = 120000;
80
my $selfchecktimeout = 120000;
86
if (C4::Context->preference('SelfCheckTimeout')) { 
81
if (C4::Context->preference('SelfCheckTimeout')) { 
87
    $selfchecktimeout = C4::Context->preference('SelfCheckTimeout') * 1000;
82
    $selfchecktimeout = C4::Context->preference('SelfCheckTimeout') * 1000;
88
}
83
}
89
$template->param(SelfCheckTimeout => $selfchecktimeout);
84
$template->param( SelfCheckTimeout => $selfchecktimeout );
90
85
91
# Checks policy laid out by AllowSelfCheckReturns, defaults to 'on' if preference is undefined
86
# Checks policy laid out by AllowSelfCheckReturns, defaults to 'on' if preference is undefined
92
my $allowselfcheckreturns = 1;
87
my $allowselfcheckreturns = 1;
93
if (defined C4::Context->preference('AllowSelfCheckReturns')) {
88
if (defined C4::Context->preference('AllowSelfCheckReturns')) {
94
    $allowselfcheckreturns = C4::Context->preference('AllowSelfCheckReturns');
89
    $allowselfcheckreturns = C4::Context->preference('AllowSelfCheckReturns');
95
}
90
}
96
$template->param(AllowSelfCheckReturns => $allowselfcheckreturns);
97
98
91
99
my $issuerid = $loggedinuser;
92
my $issuerid = $loggedinuser;
100
my ($op, $patronid, $patronlogin, $patronpw, $barcode, $confirmed) = (
93
my ($op, $patronid, $patronlogin, $patronpw, $barcode, $confirmed) = (
Lines 304-310 if ($borrower) { Link Here
304
        my $patron_image = Koha::Patron::Images->find($borrower->{borrowernumber});
297
        my $patron_image = Koha::Patron::Images->find($borrower->{borrowernumber});
305
        $template->param(
298
        $template->param(
306
            display_patron_image => 1,
299
            display_patron_image => 1,
307
            cardnumber           => $borrower->{cardnumber},
308
            csrf_token           => Koha::Token->new->generate_csrf( { session_id => scalar $query->cookie('CGISESSID') . $borrower->{cardnumber}, id => $borrower->{userid}} ),
300
            csrf_token           => Koha::Token->new->generate_csrf( { session_id => scalar $query->cookie('CGISESSID') . $borrower->{cardnumber}, id => $borrower->{userid}} ),
309
        ) if $patron_image;
301
        ) if $patron_image;
310
    }
302
    }
Lines 315-323 if ($borrower) { Link Here
315
    );
307
    );
316
}
308
}
317
309
318
$template->param(
319
    SCOUserJS  => C4::Context->preference('SCOUserJS'),
320
    SCOUserCSS => C4::Context->preference('SCOUserCSS'),
321
);
322
323
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
310
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
324
- 

Return to bug 12691