6 [% USE AdditionalContents %]
7 [%# Helper template functions %]
8 [% BLOCK error_message %]
9 [% IF messages.BadBarcode %]
10 <span>(Barcode not found on the database, please see library staff for assistance)</span>
11 [% ELSIF messages.Wrongbranch %]
12 <span>(The item cannot be checked in at this library, please see library staff for assistance)</span>
13 [% ELSIF messages.withdrawn %]
14 <span>(Item is withdrawn and check-in blocked by policy, please see library staff for assistance)</span>
15 [% ELSIF messages.NotIssued %]
16 <span>(The book is not currently on loan, please see library staff for assistance)</span>
17 [% ELSIF messages.additional_materials %]
18 <span>(The item cannot be checked in at a self service terminal, please see library staff for assistance)</span>
20 <span>(There was a problem checking in this item, please see library staff for assistance)</span>
23 [% PROCESS 'html_helpers.inc' %]
24 [% SET OpacHeader = AdditionalContents.get( location => "opacheader", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
25 [% INCLUDE 'doc-head-open.inc' %]
26 [% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %]
27 <title>Self check-in › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha [% END %]</title>
29 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
30 <meta name="generator" content="Koha [% Version | html %]" /> <!-- leave this for stats -->
32 [% IF ( Koha.Preference('OpacFavicon') ) %]
33 <link rel="shortcut icon" href="[% Koha.Preference('OpacFavicon') | url %]" type="image/x-icon" />
35 <link rel="shortcut icon" href="[% interface | html %]/[% theme | html %]/images/favicon.ico" type="image/x-icon" />
38 [% Asset.css("lib/jquery/jquery-ui-rtl-1.12.1.min.css") | $raw %]
39 [% Asset.css("css/sco-rtl.css") | $raw %]
41 [% Asset.css("lib/jquery/jquery-ui-1.12.1.css") | $raw %]
42 [% Asset.css("css/sco.css") | $raw %]
44 [% IF ( Koha.Preference('OPACUserCSS') ) %]<style>[% Koha.Preference('OPACUserCSS') | $raw %]</style>[% END %]
45 [% IF ( Koha.Preference('SelfCheckInUserCSS') ) %]<style>[% Koha.Preference('SelfCheckInUserCSS') | $raw %]</style>[% END %]
47 function _(s) { return s } // dummy function for gettext
50 <body id="sci_main" class="sci" onload="dofocus();" onunload="mungeHistory();">
51 [% INCLUDE 'masthead-sci.inc' %]
54 <div class="container-fluid">
56 <div class="col order-first order-md-first order-lg-2">
58 <h1>[% LibraryName | html %] Self check-in</h1>
61 [% IF ( nopermission ) %]
62 [%# This is what is displayed if user doesn't have permission %]
63 <div class="alert alert-warning">
64 <h2>Access denied</h2>
65 <p>Sorry, this self check-in station has lost authentication. Please contact the administrator to resolve this problem.</p>
67 [% ELSIF ( different_ip ) %]
68 [%# This is what is displayed if user doesn't have permission %]
69 <div class="alert alert-warning">
71 <p>You are accessing self check-in from a different IP address! Please log in again.</p>
73 [% ELSIF ( checkins ) %]
74 [%# We have results from a check-in attempt %]
75 <div id="checkins" class="sci_results_list">
76 [% IF ( success && success.size > 0 || errors && errors.size > 0 ) %]
77 <table id="sci_bcheckins_table" class="table table-bordered table-striped dataTable no-footer">
78 <caption><h2>Results</h2></caption>
84 [% FOREACH success_line IN success %]
86 <td>[% success_line.barcode | html %]</td>
90 [% FOREACH error IN errors %]
92 <td>[% error.barcode | html %]</td>
93 <td>Not checked in [% PROCESS error_message messages=error.messages %]</td>
99 <form method="post" action="#" id="finish_form">
100 <legend class="sr-only">Finish</legend>
101 <button id="sci_finish_button" type="submit" class="btn btn-primary"><i class="fa fa-check" aria-hidden="true"></i> Finish</button>
105 <div class="alert alert-warning">
106 <p>Your request included no check-ins.</p>
111 [%# Prompt for barcodes %]
112 <div id="new_checkins" class="sci_entry">
113 <form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sci/sci-main.pl">
114 <legend class="sr-only">Scan</legend>
116 <div class="col-auto">
117 <label for="barcode_input">Scan the item or enter its barcode:</label>
120 <input id="barcode_input" name="barcode_input" size="20" type="text" class="focus form-control" autocomplete="off" />
122 <div class="col-auto">
123 <button id="sci_append_button" type="submit" class="btn btn-primary">
127 </div> <!-- /.row -->
130 <div class="sci_input_append">
131 <table id="sci_barcodes_table" class="table table-bordered table-striped dataTable no-footer" style="display: none;">
132 <caption class="sr-only">Barcodes</caption>
134 <th class="barcodes_column">Barcode</th>
138 </table> <!-- /#sci_barcodes_table -->
139 </div> <!-- .sci_input_append -->
140 <input type="hidden" name="op" value="check_in" />
141 <div id="button_bar">
142 <button id="sci_checkin_button" type="submit" class="btn btn-primary" style="display: none;">
143 <i class="fa fa-check-square-o" aria-hidden="true"></i> <span>Check in</span>
145 <a href="/cgi-bin/koha/sci/sci-main.pl" class="btn btn-danger" role="button" style="display: none;" id="sci_refresh_button">
146 <i class="fa fa-times" aria-hidden="true"></i> <span>Cancel</span>
148 </div> <!-- /#button_bar -->
149 </div> <!-- /.col -->
150 </div> <!-- /.row -->
151 </form> <!-- /#scan_form -->
152 </div> <!-- / #new_checkins -->
153 [% END # /IF ( nopermission ) %]
154 </div> <!-- / #masthead -->
155 </div> <!-- / .row -->
156 </div> <!-- / .container-fluid -->
158 [% IF ( Koha.Preference('SelfCheckInMainUserBlock') ) %]
159 <div id="SelfCheckInMainUserBlock">[% Koha.Preference('SelfCheckInMainUserBlock' ) | $raw %]</div>
161 </div> <!-- / .main -->
164 <div id="helpModal" class="modal" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel" aria-hidden="true">
165 <div class="modal-dialog">
166 <div class="modal-content">
167 <div class="modal-header">
168 <h2 id="helpModalLabel">Self check-in help</h2>
169 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close">
170 <span aria-hidden="true">×</span>
172 </div> <!-- /.modal-header -->
173 <div class="modal-body">
175 <li>Scan each item or enter its barcode. A list with the entered barcodes will be displayed.</li>
176 <li>Click the 'Check in' button to confirm.</li>
177 <li>The operation results will be displayed for each entered barcode.</li>
178 <li>The 'Finish' button is presented to start over.</li>
179 <li>At any step, clicking the 'Cancel' button will erase the scanned barcodes and start over.</li>
181 </div> <!-- /.modal-body -->
182 <div class="modal-footer">
183 <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
185 </div> <!-- /.modal-content -->
186 </div> <!-- /.modal-dialog -->
187 </div> <!-- /#helpModal -->
191 [% INCLUDE 'opac-bottom.inc' %]
192 [% BLOCK jsinclude %]
195 function mungeHistory() {
196 // prevent back button from allowing form resubmission
197 if (history && history.pushState) {
198 history.replaceState(null, document.title, window.location.href);
203 $(".focus:last").select();
208 $(document).ready(function() {
209 // Barcodes scanning table initially hidden
210 $("#sci_barcodes_table").hide();
211 // Control de 'append' button behaviour
212 $("#sci_append_button").on('click',function( e ){
213 // Make sure the form is not submitted by the button
215 var barcode = $('#barcode_input').val();
216 //var result = validate_barcode( barcode );
217 $('#sci_barcodes_table tbody').append(
218 '<tr style="font-size: initial;"><td>' +
220 '<input type="hidden" name="barcode" value="' + barcode + '" />' +
222 // Make sure the table is now displayed
223 $("#sci_barcodes_table").show();
224 $('#sci_checkin_button').show();
225 $('#sci_refresh_button').show();
226 barcodes.push(barcode);
227 // clean the input, reset the focus
228 $('#barcode_input').val('');
232 $(".helpModal-trigger").on("click",function(e){
234 $("#helpModal").modal("show");
237 // set focus at the beginning
242 $(document).ready(function () {
243 //Increment the idle time counter every second
244 var idleInterval = setInterval(timerIncrement, 1000);
246 //Zero the idle timer on mouse movement.
247 $(this).mousemove(function (e) {
250 $(this).keypress(function (e) {
255 function timerIncrement() {
256 if ( $("#sci_finish_button").is(":visible") || $("#sci_refresh_button").is(":visible") ) {
257 idleTime = idleTime + 1;
258 idleTimeout = [% refresh_timeout | html %];
259 if (idleTime >= idleTimeout ) {
260 location.href = '/cgi-bin/koha/sci/sci-main.pl';
266 [% IF ( Koha.Preference('SelfCheckInUserJS') ) %]
267 <script>[% Koha.Preference('SelfCheckInUserJS') | $raw %]</script>