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 issued 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>
345 <span>No renewals allowed</span>
347 [% IF Koha.Preference('SCOAllowCheckin') %]
348 <input type="submit" value="Check in item" name="confirm" class="btn btn-info btn-sm return" />
349 <input type="hidden" name="op" value="returnbook" />
350 <input type="hidden" name="confirmed" value="" />
355 [% UNLESS ( nofines ) %]
357 [% IF ( ISSUE.charges ) %]Yes[% ELSE %]No[% END %]
361 [% END # / FOREACH ISSUE %]
365 <h3>You currently have nothing checked out.</h3>
366 [% END # / IF issues_count %]
367 </div> <!-- / #borrowerdetails -->
369 <div id="holds-tab" class="tab-pane" role="tabpanel" aria-labelledby="holds">
370 [% IF HOLDS.count > 0 %]
371 [% PROCESS 'holds-table.inc' HOLDS = HOLDS, SuspendHoldsOpac = SuspendHoldsOpac, showpriority = showpriority, AutoResumeSuspendedHolds = AutoResumeSuspendedHolds, onlyinfo = 'true' %]
373 <h3>You currently have no pending holds.</h3>
376 <div id="account-tab" class="tab-pane" role="tabpanel" aria-labelledby="account">
377 [% PROCESS 'account-table.inc' %]
380 [% ELSE # IF validuser %]
381 <div class="sco_entry" >
382 <form id="mainform" action="/cgi-bin/koha/sco/sco-main.pl" name="mainform" method="post">
384 [% IF ( Koha.Preference('SelfCheckoutByLogin') ) %]
385 <legend>Log in to your account</legend>
386 <label for="patronlogin">Login:</label>
387 <input type="text" id="patronlogin" class="focus noEnterSubmit" size="20" name="patronlogin" />
388 <label for="patronpw">Password:</label>
389 <input type="password" id="patronpw" size="20" name="patronpw" />
390 <fieldset class="action">
391 <button type="submit" class="btn btn-primary">Log in</button>
394 <div class="form-row">
395 <div class="col-auto">
396 <label for="patronid">Please enter your card number:</label>
399 <input type="text" id="patronid" class="form-control focus" size="20" name="patronid" autocomplete="off" />
401 <div class="col-auto">
402 <button type="submit" class="btn btn-primary">Submit</button>
404 </div> <!-- /.form-row -->
407 [% FOREACH INPUT IN INPUTS %]
408 <input type="hidden" name="[% INPUT.name | html %]" value="[% INPUT.value | html %]">
410 <input type="hidden" name="op" value="login" />
413 </div> <!-- / .sco_entry -->
414 [% END # / IF validuser %]
415 [% END # / UNLESS ( hide_main %]
416 [% IF ( Koha.Preference('SCOMainUserBlock' ) ) %]<div id="scomainuserblock">[% Koha.Preference('SCOMainUserBlock' ) | $raw %]</div>[% END %]
417 </div> <!-- / .span12 -->
418 </div> <!-- / .row -->
419 </div> <!-- / .container-fluid -->
420 </div> <!-- / .main -->
421 <span id="audio-alert"></span>
423 [% INCLUDE 'opac-bottom.inc' %]
424 [% BLOCK jsinclude %]
425 [% INCLUDE 'datatables.inc' %]
427 function mungeHistory() {
428 // prevent back button from allowing form resubmission
429 if (history && history.pushState) {
430 history.replaceState(null, document.title, window.location.href);
434 function sco_init() {
435 mainTimeout = setTimeout(function() {
436 location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout';
437 }, [% SelfCheckTimeout | html %]);
439 function dofocus() { // named function req'd for body onload event by some FF and IE7 security models
440 // alert("dofocus called");
441 $(".focus:last").select();
443 var slip_re = /slip/;
444 function printx_window(print_type) {
445 var handler = print_type.match(slip_re) ? "printslip" : "moremember";
449 function checkout_confirm(patronid) {
450 var barcode = $("#barcode").val();
451 // alert("checkout_confirm('" + patronid + "') called for barcode '" + barcode + "'");
452 if (! barcode) { dofocus(); return false; } // no barcode
453 if (barcode == "__KOHA_NEW_CIRC__") { // magic barcode
454 window.location.href='/cgi-bin/koha/sco/sco-main.pl?op=logout';
459 [% IF Koha.Preference('AudioAlerts') %]
460 var AUDIO_ALERTS = JSON.parse( "[% To.json(AudioAlerts.AudioAlerts) | $raw %]" );
461 $( document ).ready(function() {
462 if ( AUDIO_ALERTS ) {
463 for ( var k in AUDIO_ALERTS ) {
464 var alert = AUDIO_ALERTS[k];
465 if ( $( alert.selector ).length ) {
466 playSound( alert.sound );
472 function playSound( sound ) {
473 if ( ( sound.indexOf('http://') == 0 || sound.indexOf('https://') == 0 ) ) {
474 document.getElementById("audio-alert").innerHTML = '<audio src="' + sound + '" autoplay="autoplay" autobuffer="autobuffer"></audio>';
480 $(document).ready(function() {
482 [% IF ( patronid ) %]sco_init();[% END %]
483 $("#loanTable").dataTable($.extend(true, {}, dataTablesDefaults, {
486 { "targets": [ "nosort" ], "sortable": false, "searchable": false },
487 { "targets": [ "noshow" ], "visible": false, "searchable": false },
488 { "type": "anti-the", "targets" : [ "anti-the" ] },
489 { "type": "title-string", "targets" : [ "title-string" ] }
493 $("#logout_form").on("click", function(e){
495 clearTimeout(mainTimeout);
496 [% IF Koha.Preference('SelfCheckReceiptPrompt') %]
497 var confirmStart = Date.now();
498 confirmModal("", _("Would you like to print a receipt?"), _("Print receipt and end session"), _("End session"), function(result) {
499 if ( result && (Date.now() - confirmStart) < [% SelfCheckTimeout | html %] ) {
500 var win = window.open("/cgi-bin/koha/sco/printslip.pl?borrowernumber=[% borrowernumber | html %]&print=qslip");
501 location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout';
503 location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout';
507 location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout';
516 [% IF ( Koha.Preference('SCOUserJS') ) %]<script>[% Koha.Preference('SCOUserJS') | $raw %]</script>[% END %]