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 271-277 Link Here
271
                                                            [% ELSE %]
271
                                                            [% ELSE %]
272
                                                                <span>No renewals allowed</span>
272
                                                                <span>No renewals allowed</span>
273
                                                            [% END %]
273
                                                            [% END %]
274
                                                            [% IF AllowSelfCheckReturns %]
274
                                                            [% IF Koha.Preference('AllowSelfCheckReturns') %]
275
                                                                <input type="submit" value="Check in item" name="confirm" class="btn return" />
275
                                                                <input type="submit" value="Check in item" name="confirm" class="btn return" />
276
                                                                <input type="hidden" name="op" value="returnbook" />
276
                                                                <input type="hidden" name="op" value="returnbook" />
277
                                                                <input type="hidden" name="confirmed" value=""  />
277
                                                                <input type="hidden" name="confirmed" value=""  />
Lines 296-302 Link Here
296
                            <div class="sco_entry" >
296
                            <div class="sco_entry" >
297
                                <form id="mainform" action="/cgi-bin/koha/sco/sco-main.pl" name="mainform" method="post">
297
                                <form id="mainform" action="/cgi-bin/koha/sco/sco-main.pl" name="mainform" method="post">
298
                                    <fieldset class="checkout brief">
298
                                    <fieldset class="checkout brief">
299
                                        [% IF ( authbylogin ) %]
299
                                        [% IF ( Koha.Preference('SelfCheckoutByLogin') ) %]
300
                                            <legend>Log in to your account</legend>
300
                                            <legend>Log in to your account</legend>
301
                                            <label for="patronlogin">Login:</label>
301
                                            <label for="patronlogin">Login:</label>
302
                                            <input type="text" id="patronlogin" class="focus" size="20" name="patronlogin" />
302
                                            <input type="text" id="patronlogin" class="focus" size="20" name="patronlogin" />
Lines 311-317 Link Here
311
                                                <input type="text" id="patronid" class="focus" size="20" name="patronid" autocomplete="off" />
311
                                                <input type="text" id="patronid" class="focus" size="20" name="patronid" autocomplete="off" />
312
                                                <button type="submit" class="btn">Submit</button>
312
                                                <button type="submit" class="btn">Submit</button>
313
                                            </div>
313
                                            </div>
314
                                        [% END # / IF authbylogin %]
314
                                        [% END %]
315
315
316
                                        [% FOREACH INPUT IN INPUTS %]
316
                                        [% FOREACH INPUT IN INPUTS %]
317
                                            <input type="hidden" name="[% INPUT.name |html %]" value="[% INPUT.value |html %]">
317
                                            <input type="hidden" name="[% INPUT.name |html %]" value="[% INPUT.value |html %]">
Lines 420-424 Link Here
420
    //]]>
420
    //]]>
421
    </script>
421
    </script>
422
422
423
    [% IF ( SCOUserJS ) %]<script type="text/javascript">[% SCOUserJS %]</script>[% END %]
423
    [% IF ( Koha.Preference('SCOUserJS') ) %]<script type="text/javascript">[% Koha.Preference('SCOUserJS') %]</script>[% END %]
424
[% END %]
424
[% 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 301-307 if ($borrower->{cardnumber}) { Link Here
301
        my $patron_image = Koha::Patron::Images->find($borrower->{borrowernumber});
294
        my $patron_image = Koha::Patron::Images->find($borrower->{borrowernumber});
302
        $template->param(
295
        $template->param(
303
            display_patron_image => 1,
296
            display_patron_image => 1,
304
            cardnumber           => $borrower->{cardnumber},
305
            csrf_token           => Koha::Token->new->generate_csrf( { session_id => scalar $query->cookie('CGISESSID') . $borrower->{cardnumber}, id => $borrower->{userid}} ),
297
            csrf_token           => Koha::Token->new->generate_csrf( { session_id => scalar $query->cookie('CGISESSID') . $borrower->{cardnumber}, id => $borrower->{userid}} ),
306
        ) if $patron_image;
298
        ) if $patron_image;
307
    }
299
    }
Lines 312-320 if ($borrower->{cardnumber}) { Link Here
312
    );
304
    );
313
}
305
}
314
306
315
$template->param(
316
    SCOUserJS  => C4::Context->preference('SCOUserJS'),
317
    SCOUserCSS => C4::Context->preference('SCOUserCSS'),
318
);
319
320
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
307
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
321
- 

Return to bug 12691