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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt (-12 / +12 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 202-208 Link Here
202
                                </div>
202
                                </div>
203
                            </div> <!-- / #newcheckout -->
203
                            </div> <!-- / #newcheckout -->
204
                </div> <!-- / .span12/12 -->
204
                </div> <!-- / .span12/12 -->
205
                [% IF ( display_patron_image ) %]
205
                [% IF ( Koha.Preference('ShowPatronImageInWebBasedSelfCheck') && image_exists ) %]
206
                    <div class="span2">
206
                    <div class="span2">
207
                        <img src="/cgi-bin/koha/sco/sco-patron-image.pl?borrowernumber=[% borrowernumber %]" alt="" />
207
                        <img src="/cgi-bin/koha/sco/sco-patron-image.pl?borrowernumber=[% borrowernumber %]" alt="" />
208
                    </div>
208
                    </div>
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 (-18 / +2 lines)
Lines 75-99 my ($template, $loggedinuser, $cookie) = get_template_and_user({ Link Here
75
    debug => 1,
75
    debug => 1,
76
});
76
});
77
77
78
if (C4::Context->preference('SelfCheckoutByLogin'))
79
{
80
    $template->param(authbylogin  => 1);
81
}
82
83
# Get the self checkout timeout preference, or use 120 seconds as a default
78
# Get the self checkout timeout preference, or use 120 seconds as a default
84
my $selfchecktimeout = 120000;
79
my $selfchecktimeout = 120000;
85
if (C4::Context->preference('SelfCheckTimeout')) { 
80
if (C4::Context->preference('SelfCheckTimeout')) { 
86
    $selfchecktimeout = C4::Context->preference('SelfCheckTimeout') * 1000;
81
    $selfchecktimeout = C4::Context->preference('SelfCheckTimeout') * 1000;
87
}
82
}
88
$template->param(SelfCheckTimeout => $selfchecktimeout);
83
$template->param( SelfCheckTimeout => $selfchecktimeout );
89
84
90
# Checks policy laid out by AllowSelfCheckReturns, defaults to 'on' if preference is undefined
85
# Checks policy laid out by AllowSelfCheckReturns, defaults to 'on' if preference is undefined
91
my $allowselfcheckreturns = 1;
86
my $allowselfcheckreturns = 1;
92
if (defined C4::Context->preference('AllowSelfCheckReturns')) {
87
if (defined C4::Context->preference('AllowSelfCheckReturns')) {
93
    $allowselfcheckreturns = C4::Context->preference('AllowSelfCheckReturns');
88
    $allowselfcheckreturns = C4::Context->preference('AllowSelfCheckReturns');
94
}
89
}
95
$template->param(AllowSelfCheckReturns => $allowselfcheckreturns);
96
97
90
98
my $issuerid = $loggedinuser;
91
my $issuerid = $loggedinuser;
99
my ($op, $patronid, $patronlogin, $patronpw, $barcode, $confirmed) = (
92
my ($op, $patronid, $patronlogin, $patronpw, $barcode, $confirmed) = (
Lines 299-308 if ($borrower->{cardnumber}) { Link Here
299
    );
292
    );
300
    if (C4::Context->preference('ShowPatronImageInWebBasedSelfCheck')) {
293
    if (C4::Context->preference('ShowPatronImageInWebBasedSelfCheck')) {
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( image_exists => 1 ) if $patron_image;
303
            display_patron_image => 1,
304
            cardnumber           => $borrower->{cardnumber},
305
        ) if $patron_image;
306
    }
296
    }
307
} else {
297
} else {
308
    $template->param(
298
    $template->param(
Lines 311-319 if ($borrower->{cardnumber}) { Link Here
311
    );
301
    );
312
}
302
}
313
303
314
$template->param(
315
    SCOUserJS  => C4::Context->preference('SCOUserJS'),
316
    SCOUserCSS => C4::Context->preference('SCOUserCSS'),
317
);
318
319
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
304
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
320
- 

Return to bug 12691