8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha [% END %] › Self checkout </title>
10 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
11 <meta name="generator" content="Koha [% Version | html %]" /> <!-- leave this for stats -->
12 [% IF ( Koha.Preference('OpacFavicon') ) %]
13 <link rel="shortcut icon" href="[% Koha.Preference('OpacFavicon') | url %]" type="image/x-icon" />
15 <link rel="shortcut icon" href="[% interface | html %]/[% theme | html %]/images/favicon.ico" type="image/x-icon" />
17 [% Asset.css("lib/font-awesome/css/font-awesome.min.css") | $raw %]
19 [% Asset.css("lib/jquery/jquery-ui-rtl-1.12.1.min.css") | $raw %]
20 [% Asset.css("css/sco-rtl.css") | $raw %]
22 [% Asset.css("lib/jquery/jquery-ui-1.12.1.css") | $raw %]
23 [% Asset.css("css/sco.css") | $raw %]
25 [% IF ( Koha.Preference('OPACUserCSS') ) %]<style>[% Koha.Preference('OPACUserCSS') | $raw %]</style>[% END %]
26 [% IF ( Koha.Preference('SCOUserCSS') ) %]<style>[% Koha.Preference('SCOUserCSS') | $raw %]</style>[% END %]
28 function _(s) { return s } // dummy function for gettext
30 [% Asset.js("lib/modernizr.min.js") | $raw %]
32 <body id="sco_main" class="sco" onload="dofocus();" onunload="mungeHistory();">
33 [% INCLUDE 'masthead-sco.inc' %]
36 <div class="container-fluid">
38 [% IF ( display_patron_image ) %]
39 <div class="col-10 order-first order-md-first order-lg-2">
41 <div class="col order-first order-md-first order-lg-2">
44 <div id="masthead"><h1>[% LibraryName | html %] Self checkout system</h1></div>
46 [% IF ( impossible ) %]<!-- We tried to issue, but failed. -->
47 <div class="alert alert-warning">
48 <span class="sco-alert-warning noissue"></span>
49 <h3>Item cannot be checked out.</h3>
50 <p>Sorry, this item cannot be checked out at this station.</p>
52 <p>Title: <em>[% title | html %]</em> </p>
56 [% IF ( circ_error_UNKNOWN_BARCODE ) %]
57 The system does not recognize this barcode.
58 [% ELSIF ( circ_error_max_loans_allowed ) %]
59 You have checked out too many items and can't check out any more.
60 [% ELSIF ( circ_error_ISSUED_TO_ANOTHER ) %]
61 This item is checked out to someone else.
62 [% ELSIF ( circ_error_NO_MORE_RENEWALS ) %]
63 You cannot renew this item again.
64 [% ELSIF ( circ_error_NOT_FOR_LOAN ) %]
65 This item is not for loan.
66 [% ELSIF ( circ_error_DEBT ) %]
67 You owe the library [% DEBT | $Price %] and cannot check out.
68 [% ELSIF ( circ_error_WTHDRAWN ) %]
69 This item has been withdrawn from the collection.
70 [% ELSIF ( circ_error_RESTRICTED ) %]
71 This item is restricted.
72 [% ELSIF ( circ_error_RESERVED ) %]
73 This item is on hold for another patron.
74 [% ELSIF ( circ_error_ITEMNOTSAMEBRANCH ) %]
75 This item belongs to another branch.
76 [% ELSIF ( circ_error_EXPIRED ) %]
77 Your account has expired.
78 [% ELSIF ( circ_error_DEBARRED ) %]
79 Your account has been suspended.
80 [% ELSIF ( circ_error_CARD_LOST ) %]
81 This card has been declared lost.
82 [% ELSIF ( circ_error_GNA ) %]
83 Your contact information seems to be incomplete.
84 [% ELSIF ( circ_error_INVALID_DATE ) %]
85 Due date is not valid.
86 [% ELSIF ( circ_error_ADDITIONAL_MATERIALS ) %]
87 Item must be checked out at a circulation desk.
89 Please see a member of the library staff.
92 [% IF ( returnitem && Koha.Preference('SCOAllowCheckin') ) %]
93 <form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
94 <input type="hidden" name="op" value="returnbook" />
95 <input type="hidden" name="patronid" value="[% patronid | html %]" />
96 <input type="hidden" name="barcode" value="[% barcode | html %]" />
97 <input type="hidden" name="newissues" value="[% newissues | html %]" />
98 <button type="submit" name="returnbook" class="btn btn-primary"><i class="fa fa-undo" aria-hidden="true"></i> Return this item</button>
102 <form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
103 <input type="hidden" name="op" value="" />
104 <input type="hidden" name="patronid" value="[% patronid | html %]" />
105 <input type="hidden" name="barcode" value="[% barcode | html %]" />
106 <input type="hidden" name="newissues" value="[% newissues | html %]" />
107 <input type="submit" name= "confirm" value="Return to account summary" class="btn btn-info back focus" />
109 </div> <!-- / .alert -->
110 [% END # / IF ( impossible %]
112 [% IF ( confirm ) %]<!-- We need to confirm the issue.. -->
113 <div class="alert alert-warning"><h3>Please confirm the checkout:</h3>
114 <span class="sco-alert-warning confirm"></span>
115 [% IF ( confirm_renew_issue ) %]
116 <p>This item is already checked out to you.</p>
119 [% IF ( renew && Koha.Preference('SCOAllowCheckin') ) %]
120 <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
121 <input type="hidden" name="op" value="returnbook" />
122 <input type="hidden" name="patronid" value="[% patronid | html %]" />
123 <input type="hidden" name="barcode" value="[% barcode | html %]" />
124 <input type="hidden" name="confirmed" value="" />
125 <input type="hidden" name="newissues" value="[% newissues | html %]" />
126 <button type="submit" name="returnbook" class="btn btn-primary"><i class="fa fa-undo" aria-hidden="true"></i> Return this item</button>
130 [% UNLESS ( renew ) %]
131 <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
132 <input type="hidden" name="op" value="renew" />
133 <input type="hidden" name="patronid" value="[% patronid | html %]" />
134 <input type="hidden" name="barcode" value="[% barcode | html %]" />
135 <input type="hidden" name="confirmed" value="1" />
136 <input type="hidden" name="newissues" value="[% newissues | html %]" />
137 <button type="submit" name="confirm" class="btn btn-primary"><i class="fa fa-refresh" aria-hidden="true"></i> Renew item</button>
140 <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
141 <input type="hidden" name="op" value="renew" />
142 <input type="hidden" name="patronid" value="[% patronid | html %]" />
143 <input type="hidden" name="barcode" value="[% barcode | html %]" />
144 <input type="hidden" name="confirmed" value="1" />
145 <input type="hidden" name="newissues" value="[% newissues | html %]" />
146 <button type="submit" class="btn btn-primary"><i class="fa fa-refresh" aria-hidden="true"></i> Renew item</button>
150 <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
151 <input type="hidden" name="op" value="" />
152 <input type="hidden" name="patronid" value="[% patronid | html %]" />
153 <input type="hidden" name="newissues" value="[% newissues | html %]" />
154 <button type="submit" class="btn btn-primary"><i class="fa fa-cancel" aria-hidden="true"></i> Cancel</button>
157 [% END # / IF confirm %]
159 [% IF ( nopermission ) %]
160 <!-- This is what is displayed if user doesn't have permission -->
161 <div class="alert alert-warning">
162 <span class="sco-alert-warning nopermission"></span>
163 <h3>Access denied</h3>
164 <p>Sorry, this self-checkout station has lost authentication. Please contact the administrator to resolve this problem.</p>
168 [% IF ( different_ip ) %]
169 <!-- This is what is displayed if user doesn't have permission -->
170 <div class="alert alert-warning">
171 <span class="sco-alert-warning sessionlost"></span>
172 <h3>Session lost</h3>
173 <p>You are accessing self-checkout from a different IP address! please log in again.</p>
177 [% IF ( invalid_username_or_password ) %]
178 <!-- This is what is displayed if user doesn't have permission -->
179 <div class="alert alert-warning">
180 <span class="sco-alert-warning notfound"></span>
181 <h3>Record not found</h3>
182 <p>Your userid was not found in the database. Please try again.</p>
187 <span class="sco-alert-success issue"></span>
188 <div class="alert alert-info">
189 <p>Item checked out</p>
191 [% ELSIF ( renewed ) %]
192 <span class="sco-alert-success renew"></span>
193 <div class="alert alert-info">
196 [% ELSIF ( returned == 0 ) %]
197 <span class="sco-alert-warning return"></span>
198 <div class="alert alert-info">
199 <p>Item not checked in: please see circulation staff for assistance</p>
201 [% ELSIF ( returned == 1 ) %]
202 <span class="sco-alert-success return"></span>
203 <div class="alert alert-info">
204 <p>Item checked in</p>
209 [% UNLESS ( hide_main ) %]
211 [% IF ( patronid ) %]
212 [% IF ( validuser ) %]
213 <div class="alert alert-info">You are logged in as [% borrowername | html %].</div>
214 [% INCLUDE 'opac-note.inc' %]
215 [% IF patron_has_hold_fee %]
216 <div class="alert alert-warning">A hold fee was charged to your account for collecting this item.</div>
221 <div class="alert alert-warning">
223 <p>The userid <strong>[% patronid | html %]</strong> was not found in the database. Please try again.</p>
226 [% END # / IF patronid %]
228 [% IF ( validuser ) %]
229 <div id="newcheckout" class="sco_entry">
230 <form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sco/sco-main.pl" onsubmit="return checkout_confirm('[% patronid | html %]');">
232 [% IF ( Koha.Preference('SCOAllowCheckin') ) %]
233 Check out, return, or renew an item:
235 Check out or renew an item:
240 <label for="barcode">Scan a new item or enter its barcode:</label>
243 <input id="barcode" name="barcode" size="20" type="text" class="focus form-control" autocomplete="off" />
245 <div class="col-auto">
246 <button type="submit" class="btn btn-primary">Submit</button>
248 <div class="col ml-auto">
249 <button type="button" id="logout_form" class="btn btn-info"><i class="fa fa-check" aria-hidden="true"></i> Finish</button>
250 <input type="hidden" name="op" value="checkout" />
251 <input type="hidden" name="patronid" value="[% patronid | html %]" />
252 <input type="hidden" name="newissues" value="[% newissues | html %]" />
254 </div> <!-- /.row -->
255 </form> <!-- /#scan_form -->
256 </div> <!-- / #newcheckout -->
257 </div> <!-- / .span12/12 -->
258 [% IF ( display_patron_image ) %]
259 <div class="col-lg-2">
260 <img src="/cgi-bin/koha/sco/sco-patron-image.pl?borrowernumber=[% borrowernumber | uri %]&csrf_token=[% csrf_token | uri %]" alt="" />
263 </div> <!-- / .row -->
264 </div> <!-- / .container-fluid -->
266 <div class="container-fluid">
268 <div class="col order-first order-md-first order-lg-2">
269 <ul class="nav nav-tabs" role="tablist">
270 <li class="nav-item" role="presentation">
271 <a class="nav-link active" href="#checkouts-tab" id="checkouts" aria-controls="home" aria-selected="true" data-toggle="tab">Checkouts ([% issues_count | html %])</a>
273 <li class="nav-item" role="presentation">
274 <a class="nav-link" href="#holds-tab" id="holds" aria-controls="home" aria-selected="false" data-toggle="tab">
275 [% IF waiting_holds_count %]
276 <i class="fa fa-exclamation" aria-hidden="true"></i>
278 Holds ([% HOLDS.count | html %])
281 <li class="nav-item" role="presentation">
282 <a class="nav-link" href="#account-tab" id="account" aria-controls="home" aria-selected="false" data-toggle="tab">Charges ([% total | $Price %])</a>
285 <div class="tab-content">
286 <div id="checkouts-tab" class="tab-pane show active" aria-labelledby="checkouts">
287 <div id="borrowerdetails">
288 [% IF ( issues_count ) %]
289 <table id="loanTable" class="table table-bordered table-striped">
290 <caption>Checkouts for [% borrowername | html %] <span class="count">([% issues_count | html %] total)</span></caption>
291 <!-- ISSUES TABLE ROWS -->
294 <th class="noshow">Checked out on</th>
295 <th class="anti-the">Title</th>
297 <th class="title-string">Due</th>
298 <th class="nosort">Renew</th>
299 [% UNLESS ( nofines ) %]
305 [% FOREACH ISSUE IN ISSUES %]
307 <td>[% ISSUE.issuedate | html %]</td>
309 [% UNLESS ( noitemlinks ) %]
310 <a href="/cgi-bin/koha/opac-detail.pl?bib=[% ISSUE. biblionumber | uri %]">[% ISSUE.title | html %]</a>
312 <strong>[% ISSUE.title | html %]</strong>
314 [% IF ( newissues.match(ISSUE.barcode)) %]
315 <span class="label label-info">NEW</span>
317 <span class="item-details">[% ISSUE.author | html %]</span>
318 ([% ISSUE.barcode | html %])
320 <td>[% ISSUE.itemcallnumber | html %]</td>
321 [% IF ( ISSUE.overdue ) %]
322 <td class="overdue"><span title="[% ISSUE.date_due | html %]">[% ISSUE.date_due | $KohaDates as_due_date => 1 %]</span></td>
324 <td><span title="[% ISSUE.date_due | html %]">[% ISSUE.date_due | $KohaDates as_due_date => 1 %]</span></td>
327 <form action="/cgi-bin/koha/sco/sco-main.pl" method="post">
328 <input type="hidden" name="patronid" value="[% patronid | html %]" />
329 <input type="hidden" name="barcode" value="[% ISSUE.barcode | html %]" />
330 <input type="hidden" name="newissues" value="[% newissues | html %]" />
331 [% IF ISSUE.can_be_renewed %]
332 <input type="hidden" name="op" value="renew" />
333 <input type="hidden" name="confirmed" value="1" />
334 [% UNLESS ( ISSUE.renew ) %]
335 <input type="submit" value="Renew item" name="confirm " class="btn btn-primary btn-sm renew" />
337 <input type="submit" value="Renew item" class="btn btn-primary btn-sm renew" />
340 [% IF ISSUE.renew_error == 'auto_renew' OR ISSUE.renew_error == 'auto_too_soon' %]
341 <span>This item has been scheduled for automatic renewal and cannot be renewed</span>
342 [% ELSIF ISSUE.renew_error == 'onsite_checkout' %]
343 <span>This is a on-site checkout, it cannot be renewed.</span>
344 [% ELSIF ISSUE.renew_error == 'too_unseen' %]
345 <span>You have renewed this item the maximum number of consecutive times without it being seen by the library.</span>
347 <span>No renewals allowed</span>
349 [% IF Koha.Preference('SCOAllowCheckin') %]
350 <input type="submit" value="Check in item" name="confirm" class="btn btn-info btn-sm return" />
351 <input type="hidden" name="op" value="returnbook" />
352 <input type="hidden" name="confirmed" value="" />
357 [% UNLESS ( nofines ) %]
359 [% IF ( ISSUE.charges ) %]Yes[% ELSE %]No[% END %]
363 [% END # / FOREACH ISSUE %]
367 <h3>You currently have nothing checked out.</h3>
368 [% END # / IF issues_count %]
369 </div> <!-- / #borrowerdetails -->
371 <div id="holds-tab" class="tab-pane" role="tabpanel" aria-labelledby="holds">
372 [% IF HOLDS.count > 0 %]
373 [% PROCESS 'holds-table.inc' HOLDS = HOLDS, SuspendHoldsOpac = SuspendHoldsOpac, showpriority = showpriority, AutoResumeSuspendedHolds = AutoResumeSuspendedHolds, onlyinfo = 'true' %]
375 <h3>You currently have no pending holds.</h3>
378 <div id="account-tab" class="tab-pane" role="tabpanel" aria-labelledby="account">
379 [% PROCESS 'account-table.inc' %]
382 [% ELSE # IF validuser %]
383 <div class="sco_entry" >
384 <form id="mainform" action="/cgi-bin/koha/sco/sco-main.pl" name="mainform" method="post">
386 [% IF ( Koha.Preference('SelfCheckoutByLogin') ) %]
387 <legend>Log in to your account</legend>
388 <label for="patronlogin">Login:</label>
389 <input type="text" id="patronlogin" class="focus noEnterSubmit" size="20" name="patronlogin" />
390 <label for="patronpw">Password:</label>
391 <input type="password" id="patronpw" size="20" name="patronpw" />
392 <fieldset class="action">
393 <button type="submit" class="btn btn-primary">Log in</button>
396 <div class="form-row">
397 <div class="col-auto">
398 <label for="patronid">Please enter your card number:</label>
401 <input type="text" id="patronid" class="form-control focus" size="20" name="patronid" autocomplete="off" />
403 <div class="col-auto">
404 <button type="submit" class="btn btn-primary">Submit</button>
406 </div> <!-- /.form-row -->
409 [% FOREACH INPUT IN INPUTS %]
410 <input type="hidden" name="[% INPUT.name | html %]" value="[% INPUT.value | html %]">
412 <input type="hidden" name="op" value="login" />
415 </div> <!-- / .sco_entry -->
416 [% END # / IF validuser %]
417 [% END # / UNLESS ( hide_main %]
418 [% IF ( Koha.Preference('SCOMainUserBlock' ) ) %]<div id="scomainuserblock">[% Koha.Preference('SCOMainUserBlock' ) | $raw %]</div>[% END %]
419 </div> <!-- / .span12 -->
420 </div> <!-- / .row -->
421 </div> <!-- / .container-fluid -->
422 </div> <!-- / .main -->
423 <span id="audio-alert"></span>
425 [% INCLUDE 'opac-bottom.inc' %]
426 [% BLOCK jsinclude %]
427 [% INCLUDE 'datatables.inc' %]
429 function mungeHistory() {
430 // prevent back button from allowing form resubmission
431 if (history && history.pushState) {
432 history.replaceState(null, document.title, window.location.href);
436 function sco_init() {
437 mainTimeout = setTimeout(function() {
438 location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout';
439 }, [% SelfCheckTimeout | html %]);
441 function dofocus() { // named function req'd for body onload event by some FF and IE7 security models
442 // alert("dofocus called");
443 $(".focus:last").select();
445 var slip_re = /slip/;
446 function printx_window(print_type) {
447 var handler = print_type.match(slip_re) ? "printslip" : "moremember";
451 function checkout_confirm(patronid) {
452 var barcode = $("#barcode").val();
453 // alert("checkout_confirm('" + patronid + "') called for barcode '" + barcode + "'");
454 if (! barcode) { dofocus(); return false; } // no barcode
455 if (barcode == "__KOHA_NEW_CIRC__") { // magic barcode
456 window.location.href='/cgi-bin/koha/sco/sco-main.pl?op=logout';
461 [% IF Koha.Preference('AudioAlerts') %]
462 var AUDIO_ALERTS = JSON.parse( "[% To.json(AudioAlerts.AudioAlerts) | $raw %]" );
463 $( document ).ready(function() {
464 if ( AUDIO_ALERTS ) {
465 for ( var k in AUDIO_ALERTS ) {
466 var alert = AUDIO_ALERTS[k];
467 if ( $( alert.selector ).length ) {
468 playSound( alert.sound );
474 function playSound( sound ) {
475 if ( ( sound.indexOf('http://') == 0 || sound.indexOf('https://') == 0 ) ) {
476 document.getElementById("audio-alert").innerHTML = '<audio src="' + sound + '" autoplay="autoplay" autobuffer="autobuffer"></audio>';
482 $(document).ready(function() {
484 [% IF ( patronid ) %]sco_init();[% END %]
485 $("#loanTable").dataTable($.extend(true, {}, dataTablesDefaults, {
488 { "targets": [ "nosort" ], "sortable": false, "searchable": false },
489 { "targets": [ "noshow" ], "visible": false, "searchable": false },
490 { "type": "anti-the", "targets" : [ "anti-the" ] },
491 { "type": "title-string", "targets" : [ "title-string" ] }
495 $("#logout_form").on("click", function(e){
497 clearTimeout(mainTimeout);
498 [% IF Koha.Preference('SelfCheckReceiptPrompt') %]
499 var confirmStart = Date.now();
500 confirmModal("", _("Would you like to print a receipt?"), _("Print receipt and end session"), _("End session"), function(result) {
501 if ( result && (Date.now() - confirmStart) < [% SelfCheckTimeout | html %] ) {
502 var win = window.open("/cgi-bin/koha/sco/printslip.pl?borrowernumber=[% borrowernumber | html %]&print=qslip");
503 location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout';
505 location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout';
509 location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout';
518 [% IF ( Koha.Preference('SCOUserJS') ) %]<script>[% Koha.Preference('SCOUserJS') | $raw %]</script>[% END %]