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 = KohaNews.get( location => "opacheader", lang => lang, library => branchcode, blocktitle => 0 ) %]
25 [% INCLUDE 'doc-head-open.inc' %]
26 [% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %]
27 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha [% END %] › Self check-in</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
49 [% Asset.js("lib/modernizr.min.js") | $raw %]
51 <body id="sci_main" class="sci" onload="dofocus();" onunload="mungeHistory();">
52 [% INCLUDE 'masthead-sci.inc' %]
55 <div class="container-fluid">
57 <div class="col order-first order-md-first order-lg-2">
59 <h1>[% LibraryName | html %] Self check-in</h1>
62 [% IF ( nopermission ) %]
63 [%# This is what is displayed if user doesn't have permission %]
64 <div class="alert alert-warning">
65 <h3>Access denied</h3>
66 <p>Sorry, this self check-in station has lost authentication. Please contact the administrator to resolve this problem.</p>
68 [% ELSIF ( different_ip ) %]
69 [%# This is what is displayed if user doesn't have permission %]
70 <div class="alert alert-warning">
72 <p>You are accessing self check-in from a different IP address! Please log in again.</p>
74 [% ELSIF ( checkins ) %]
75 [%# We have results from a check-in attempt %]
76 <div id="checkins" class="sci_results_list">
77 [% IF ( success && success.size > 0 || errors && errors.size > 0 ) %]
79 <table id="sci_bcheckins_table" class="table table-bordered table-striped dataTable no-footer">
85 [% FOREACH success_line IN success %]
87 <td>[% success_line.barcode | html %]</td>
91 [% FOREACH error IN errors %]
93 <td>[% error.barcode | html %]</td>
94 <td>Not checked in [% PROCESS error_message messages=error.messages %]</td>
100 <form method="post" action="#" id="finish_form">
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">
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;">
132 <th class="barcodes_column">Barcode</th>
136 </table> <!-- /#sci_barcodes_table -->
137 </div> <!-- .sci_input_append -->
138 <input type="hidden" name="op" value="check_in" />
139 <div id="button_bar">
140 <button id="sci_checkin_button" type="submit" class="btn btn-primary" style="display: none;">
141 <i class="fa fa-check-square-o" aria-hidden="true"></i> <span>Check in</span>
143 <a href="/cgi-bin/koha/sci/sci-main.pl" class="btn btn-danger" role="button" style="display: none;" id="sci_refresh_button">
144 <i class="fa fa-times" aria-hidden="true"></i> <span>Cancel</span>
146 </div> <!-- /#button_bar -->
147 </div> <!-- /.col -->
148 </div> <!-- /.row -->
149 </form> <!-- /#scan_form -->
150 </div> <!-- / #new_checkins -->
151 [% END # /IF ( nopermission ) %]
152 </div> <!-- / #masthead -->
153 </div> <!-- / .row -->
154 </div> <!-- / .container-fluid -->
156 [% IF ( Koha.Preference('SelfCheckInMainUserBlock') ) %]
157 <div id="SelfCheckInMainUserBlock">[% Koha.Preference('SelfCheckInMainUserBlock' ) | $raw %]</div>
159 </div> <!-- / .main -->
162 <div id="helpModal" class="modal" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel" aria-hidden="true">
163 <div class="modal-dialog">
164 <div class="modal-content">
165 <div class="modal-header">
166 <h3 id="helpModalLabel">Self check-in help</h3>
167 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close">
168 <span aria-hidden="true">×</span>
170 </div> <!-- /.modal-header -->
171 <div class="modal-body">
173 <li>Scan each item or enter its barcode. A list with the entered barcodes will be displayed.</li>
174 <li>Click the 'Check in' button to confirm.</li>
175 <li>The operation results will be displayed for each entered barcode.</li>
176 <li>The 'Finish' button is presented to start over.</li>
177 <li>At any step, clicking the 'Cancel' button will erase the scanned barcodes and start over.</li>
179 </div> <!-- /.modal-body -->
180 <div class="modal-footer">
181 <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
183 </div> <!-- /.modal-content -->
184 </div> <!-- /.modal-dialog -->
185 </div> <!-- /#helpModal -->
189 [% INCLUDE 'opac-bottom.inc' %]
190 [% BLOCK jsinclude %]
193 function mungeHistory() {
194 // prevent back button from allowing form resubmission
195 if (history && history.pushState) {
196 history.replaceState(null, document.title, window.location.href);
201 $(".focus:last").select();
206 $(document).ready(function() {
207 // Barcodes scanning table initially hidden
208 $("#sci_barcodes_table").hide();
209 // Control de 'append' button behaviour
210 $("#sci_append_button").on('click',function( e ){
211 // Make sure the form is not submitted by the button
213 var barcode = $('#barcode_input').val();
214 //var result = validate_barcode( barcode );
215 $('#sci_barcodes_table tbody').append(
216 '<tr style="font-size: initial;"><td>' +
218 '<input type="hidden" name="barcode" value="' + barcode + '" />' +
220 // Make sure the table is now displayed
221 $("#sci_barcodes_table").show();
222 $('#sci_checkin_button').show();
223 $('#sci_refresh_button').show();
224 barcodes.push(barcode);
225 // clean the input, reset the focus
226 $('#barcode_input').val('');
230 $(".helpModal-trigger").on("click",function(e){
232 $("#helpModal").modal("show");
235 // set focus at the beginning
240 $(document).ready(function () {
241 //Increment the idle time counter every second
242 var idleInterval = setInterval(timerIncrement, 1000);
244 //Zero the idle timer on mouse movement.
245 $(this).mousemove(function (e) {
248 $(this).keypress(function (e) {
253 function timerIncrement() {
254 if ( $("#sci_finish_button").is(":visible") || $("#sci_refresh_button").is(":visible") ) {
255 idleTime = idleTime + 1;
256 idleTimeout = [% refresh_timeout | html %];
257 if (idleTime >= idleTimeout ) {
258 location.href = '/cgi-bin/koha/sci/sci-main.pl';
264 [% IF ( Koha.Preference('SelfCheckInUserJS') ) %]
265 <script>[% Koha.Preference('SelfCheckInUserJS') | $raw %]</script>