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 [% INCLUDE 'doc-head-open.inc' %]
24 [% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %]
25 <title>Self check-in › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha [% END %]</title>
27 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
28 <meta name="generator" content="Koha [% Version | html %]" /> <!-- leave this for stats -->
30 [% IF ( Koha.Preference('OpacFavicon') ) %]
31 <link rel="shortcut icon" href="[% Koha.Preference('OpacFavicon') | url %]" type="image/x-icon" />
33 <link rel="shortcut icon" href="[% interface | html %]/[% theme | html %]/images/favicon.ico" type="image/x-icon" />
36 [% Asset.css("lib/jquery/jquery-ui-rtl-1.12.1.min.css") | $raw %]
37 [% Asset.css("css/sco-rtl.css") | $raw %]
39 [% Asset.css("lib/jquery/jquery-ui-1.12.1.css") | $raw %]
40 [% Asset.css("css/sco.css") | $raw %]
42 [% IF ( Koha.Preference('OPACUserCSS') ) %]<style>[% Koha.Preference('OPACUserCSS') | $raw %]</style>[% END %]
43 [% IF ( Koha.Preference('SelfCheckInUserCSS') ) %]<style>[% Koha.Preference('SelfCheckInUserCSS') | $raw %]</style>[% END %]
45 function _(s) { return s } // dummy function for gettext
47 [% Asset.js("lib/modernizr.min.js") | $raw %]
49 <body id="sci_main" class="sci" onload="dofocus();" onunload="mungeHistory();">
50 [% INCLUDE 'masthead-sci.inc' %]
53 <div class="container-fluid">
55 <div class="col order-first order-md-first order-lg-2">
57 <h1>[% LibraryName | html %] Self check-in</h1>
60 [% IF ( nopermission ) %]
61 [%# This is what is displayed if user doesn't have permission %]
62 <div class="alert alert-warning">
63 <h2>Access denied</h2>
64 <p>Sorry, this self check-in station has lost authentication. Please contact the administrator to resolve this problem.</p>
66 [% ELSIF ( different_ip ) %]
67 [%# This is what is displayed if user doesn't have permission %]
68 <div class="alert alert-warning">
70 <p>You are accessing self check-in from a different IP address! Please log in again.</p>
72 [% ELSIF ( checkins ) %]
73 [%# We have results from a check-in attempt %]
74 <div id="checkins" class="sci_results_list">
75 [% IF ( success && success.size > 0 || errors && errors.size > 0 ) %]
76 <table id="sci_bcheckins_table" class="table table-bordered table-striped dataTable no-footer">
77 <caption><h2>Results</h2></caption>
83 [% FOREACH success_line IN success %]
85 <td>[% success_line.barcode | html %]</td>
89 [% FOREACH error IN errors %]
91 <td>[% error.barcode | html %]</td>
92 <td>Not checked in [% PROCESS error_message messages=error.messages %]</td>
98 <form method="post" action="#" id="finish_form">
99 <legend class="sr-only">Finish</legend>
100 <button id="sci_finish_button" type="submit" class="btn btn-primary"><i class="fa fa-check" aria-hidden="true"></i> Finish</button>
104 <div class="alert alert-warning">
105 <p>Your request included no check-ins.</p>
110 [%# Prompt for barcodes %]
111 <div id="new_checkins" class="sci_entry">
112 <form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sci/sci-main.pl">
113 <legend class="sr-only">Scan</legend>
115 <div class="col-auto">
116 <label for="barcode_input">Scan the item or enter its barcode:</label>
119 <input id="barcode_input" name="barcode_input" size="20" type="text" class="focus form-control" autocomplete="off" />
121 <div class="col-auto">
122 <button id="sci_append_button" type="submit" class="btn btn-primary">
126 </div> <!-- /.row -->
129 <div class="sci_input_append">
130 <table id="sci_barcodes_table" class="table table-bordered table-striped dataTable no-footer" style="display: none;">
131 <caption class="sr-only">Barcodes</caption>
133 <th class="barcodes_column">Barcode</th>
137 </table> <!-- /#sci_barcodes_table -->
138 </div> <!-- .sci_input_append -->
139 <input type="hidden" name="op" value="check_in" />
140 <div id="button_bar">
141 <button id="sci_checkin_button" type="submit" class="btn btn-primary" style="display: none;">
142 <i class="fa fa-check-square-o" aria-hidden="true"></i> <span>Check in</span>
144 <a href="/cgi-bin/koha/sci/sci-main.pl" class="btn btn-danger" role="button" style="display: none;" id="sci_refresh_button">
145 <i class="fa fa-times" aria-hidden="true"></i> <span>Cancel</span>
147 </div> <!-- /#button_bar -->
148 </div> <!-- /.col -->
149 </div> <!-- /.row -->
150 </form> <!-- /#scan_form -->
151 </div> <!-- / #new_checkins -->
152 [% END # /IF ( nopermission ) %]
153 </div> <!-- / #masthead -->
154 </div> <!-- / .row -->
155 </div> <!-- / .container-fluid -->
157 [% IF ( Koha.Preference('SelfCheckInMainUserBlock') ) %]
158 <div id="SelfCheckInMainUserBlock">[% Koha.Preference('SelfCheckInMainUserBlock' ) | $raw %]</div>
160 </div> <!-- / .main -->
163 <div id="helpModal" class="modal" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel" aria-hidden="true">
164 <div class="modal-dialog">
165 <div class="modal-content">
166 <div class="modal-header">
167 <h2 id="helpModalLabel">Self check-in help</h2>
168 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close">
169 <span aria-hidden="true">×</span>
171 </div> <!-- /.modal-header -->
172 <div class="modal-body">
174 <li>Scan each item or enter its barcode. A list with the entered barcodes will be displayed.</li>
175 <li>Click the 'Check in' button to confirm.</li>
176 <li>The operation results will be displayed for each entered barcode.</li>
177 <li>The 'Finish' button is presented to start over.</li>
178 <li>At any step, clicking the 'Cancel' button will erase the scanned barcodes and start over.</li>
180 </div> <!-- /.modal-body -->
181 <div class="modal-footer">
182 <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
184 </div> <!-- /.modal-content -->
185 </div> <!-- /.modal-dialog -->
186 </div> <!-- /#helpModal -->
190 [% INCLUDE 'opac-bottom.inc' %]
191 [% BLOCK jsinclude %]
194 function mungeHistory() {
195 // prevent back button from allowing form resubmission
196 if (history && history.pushState) {
197 history.replaceState(null, document.title, window.location.href);
202 $(".focus:last").select();
207 $(document).ready(function() {
208 // Barcodes scanning table initially hidden
209 $("#sci_barcodes_table").hide();
210 // Control de 'append' button behaviour
211 $("#sci_append_button").on('click',function( e ){
212 // Make sure the form is not submitted by the button
214 var barcode = $('#barcode_input').val();
215 //var result = validate_barcode( barcode );
216 $('#sci_barcodes_table tbody').append(
217 '<tr style="font-size: initial;"><td>' +
219 '<input type="hidden" name="barcode" value="' + barcode + '" />' +
221 // Make sure the table is now displayed
222 $("#sci_barcodes_table").show();
223 $('#sci_checkin_button').show();
224 $('#sci_refresh_button').show();
225 barcodes.push(barcode);
226 // clean the input, reset the focus
227 $('#barcode_input').val('');
231 $(".helpModal-trigger").on("click",function(e){
233 $("#helpModal").modal("show");
236 // set focus at the beginning
241 $(document).ready(function () {
242 //Increment the idle time counter every second
243 var idleInterval = setInterval(timerIncrement, 1000);
245 //Zero the idle timer on mouse movement.
246 $(this).mousemove(function (e) {
249 $(this).keypress(function (e) {
254 function timerIncrement() {
255 if ( $("#sci_finish_button").is(":visible") || $("#sci_refresh_button").is(":visible") ) {
256 idleTime = idleTime + 1;
257 idleTimeout = [% refresh_timeout | html %];
258 if (idleTime >= idleTimeout ) {
259 location.href = '/cgi-bin/koha/sci/sci-main.pl';
265 [% IF ( Koha.Preference('SelfCheckInUserJS') ) %]
266 <script>[% Koha.Preference('SelfCheckInUserJS') | $raw %]</script>