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 returned 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>
18 <span>(There was a problem returning this item, please see library staff for assistance)</span>
21 [% PROCESS 'html_helpers.inc' %]
22 [% SET OpacHeader = KohaNews.get( location => "opacheader", lang => lang, library => branchcode, blocktitle => 0 ) %]
23 [% INCLUDE 'doc-head-open.inc' %]
25 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha [% END %] › Self check-in</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" />
35 [% Asset.css("lib/bootstrap/css/bootstrap.min.css") | $raw %]
36 [% Asset.css("lib/jquery/jquery-ui-1.12.1.css") | $raw %]
37 [% Asset.css("lib/font-awesome/css/font-awesome.min.css") | $raw %]
38 [% Asset.css("css/sco.css") | $raw %]
39 [% IF ( Koha.Preference('OPACUserCSS') ) %]<style>[% Koha.Preference('OPACUserCSS') | $raw %]</style>[% END %]
40 [% IF ( Koha.Preference('SelfCheckInUserCSS') ) %]<style>[% Koha.Preference('SelfCheckInUserCSS') | $raw %]</style>[% END %]
42 <script src="[% interface | html %]/[% theme | html %]/lib/respond.min.js"></script>
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();">
51 [% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %]
53 <div class="navbar navbar-inverse navbar-static-top">
54 <div class="navbar-inner">
55 <div class="container-fluid">
56 <a class="brand" href="/cgi-bin/koha/sci/sci-main.pl"><img src="[% interface | html %]/[% theme | html %]/images/koha-green-logo.png" alt=""></a>
57 <div id="checkouthelp">
58 <ul class="nav pull-right">
59 <li><a href="/cgi-bin/koha/sci/sci-main.pl" class="helpModal-trigger" role="button" data-toggle="modal"><i class="fa fa-info-circle"></i> Help</a></li>
60 <li><a id="sci_logout" href="/cgi-bin/koha/sci/sci-main.pl?logout.x=1" class="logout">Log out</a></li>
64 [% IF Koha.Preference( 'opaclanguagesdisplay' ) %]
66 <ul class="nav pull-right">
67 [% INCLUDE 'masthead-langmenu.inc' %]
72 </div> <!-- /.container-fluid -->
73 </div> <!-- /.navbar-inner -->
74 </div> <!-- /.navbar -->
76 [% IF ( OpacHeader ) %]
77 <div class="container-fluid">
78 <div class="row-fluid">
80 [% PROCESS koha_news_block news => OpacHeader %]
87 <div class="container-fluid">
88 <div class="row-fluid">
90 <h1>[% LibraryName | html %] Self check-in</h1>
91 [% IF ( nopermission ) %]
92 [%# This is what is displayed if user doesn't have permission %]
94 <h3>Access denied</h3>
95 <p>Sorry, this self check-in station has lost authentication. Please contact the administrator to resolve this problem.</p>
97 [% ELSIF ( different_ip ) %]
98 [%# This is what is displayed if user doesn't have permission %]
100 <h3>Session lost</h3>
101 <p>You are accessing self check-in from a different IP address! Please log in again.</p>
103 [% ELSIF ( checkins ) %]
104 [%# We have results from a check-in attempt %]
105 <div id="checkins" class="sci_results_list">
106 [% IF ( success && success.size > 0 || errors && errors.size > 0 ) %]
108 <table id="sci_bcheckins_table" class="table table-bordered table-striped dataTable no-footer" style="font-size: initial;">
114 [% FOREACH success_line IN success %]
115 <tr><td>[% success_line.barcode | html %]</td><td>Checked in</td></tr>
117 [% FOREACH error IN errors %]
119 <td>[% error.barcode | html %]</td>
120 <td>Not checked in [% PROCESS error_message messages=error.messages %]</td>
126 <form method="post" action="#" id="finish_form">
127 <button id="sci_finish_button" type="submit" class="btn"><i class="fa fa-check"></i> Finish</button>
132 <p>Your request included no check-ins.</p>
137 [%# Prompt for barcodes %]
138 <div id="new_checkins" class="sci_entry">
139 <form id="scan_form" name="scan_form"
140 method="post" action="/cgi-bin/koha/sci/sci-main.pl">
143 <label for="barcode_input">Scan the item or enter its barcode:</label>
144 <input id="barcode_input" name="barcode_input" size="20" type="text" class="focus" autocomplete="off" />
145 <button id="sci_append_button" type="submit" class="btn btn-default btn-sm">
146 <i class="fa fa-plus" aria-hidden="true"></i> <span>Add</span>
149 <div class="sci_input_append">
150 <table id="sci_barcodes_table" class="table table-bordered table-striped dataTable no-footer" style="display: none; font-size: initial;">
152 <th class="barcodes_column">Barcode</th>
158 <input type="hidden" name="op" value="check_in" />
159 <div id="button_bar">
160 <button id="sci_checkin_button" type="submit" class="btn btn-default btn-sm" style="display: none;">
161 <i class="fa fa-check-square-o" aria-hidden="true"></i> <span>Check in</span>
163 <a href="/cgi-bin/koha/sci/sci-main.pl" class="btn btn-default btn-sm" role="button" style="display: none;" id="sci_refresh_button">
164 <i class="fa fa-refresh" aria-hidden="true"></i> <span>Cancel</span>
169 </div> <!-- / #new_checkins -->
171 </div> <!-- / #masthead -->
172 </div> <!-- / .row-fluid -->
173 </div> <!-- / .container-fluid -->
175 [% IF ( Koha.Preference('SelfCheckInMainUserBlock') ) %]
176 <div id="SelfCheckInMainUserBlock">[% Koha.Preference('SelfCheckInMainUserBlock' ) | $raw %]</div>
178 </div> <!-- / .main -->
180 <div id="helpModal" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel" aria-hidden="true">
182 <div class="modal-header">
183 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
184 <h3 id="helpModalLabel">Self check-in help</h3>
187 <div class="modal-body">
189 <li>Scan each item or enter its barcode. A list with the entered barcodes will be displayed.</li>
190 <li>Click the 'Check in' button to confirm.</li>
191 <li>The operation results will be displayed for each entered barcode.</li>
192 <li>The 'Finish' button is presented to start over.</li>
193 <li>At any step, clicking the 'Cancel' button will erase the scanned barcodes and start over.</li>
196 </div> <!-- /#helpModal -->
199 [% INCLUDE 'opac-bottom.inc' %]
200 [% BLOCK jsinclude %]
203 function mungeHistory() {
204 // prevent back button from allowing form resubmission
205 if (history && history.pushState) {
206 history.replaceState(null, document.title, window.location.href);
211 $(".focus:last").select();
216 $(document).ready(function() {
217 // Barcodes scanning table initially hidden
218 $("#sci_barcodes_table").hide();
219 // Control de 'append' button behaviour
220 $("#sci_append_button").on('click',function( e ){
221 // Make sure the form is not submitted by the button
223 var barcode = $('#barcode_input').val();
224 //var result = validate_barcode( barcode );
225 $('#sci_barcodes_table tbody').append(
226 '<tr style="font-size: initial;"><td>' +
228 '<input type="hidden" name="barcode" value="' + barcode + '" />' +
230 // Make sure the table is now displayed
231 $("#sci_barcodes_table").show();
232 $('#sci_checkin_button').show();
233 $('#sci_refresh_button').show();
234 barcodes.push(barcode);
235 // clean the input, reset the focus
236 $('#barcode_input').val('');
240 $(".helpModal-trigger").on("click",function(e){
242 $("#helpModal").modal("show");
245 // set focus at the beginning
250 $(document).ready(function () {
251 //Increment the idle time counter every second
252 var idleInterval = setInterval(timerIncrement, 1000);
254 //Zero the idle timer on mouse movement.
255 $(this).mousemove(function (e) {
258 $(this).keypress(function (e) {
263 function timerIncrement() {
264 if ( $("#sci_finish_button").is(":visible") || $("#sci_refresh_button").is(":visible") ) {
265 idleTime = idleTime + 1;
266 idleTimeout = [% refresh_timeout | html %];
267 if (idleTime >= idleTimeout ) {
268 location.href = '/cgi-bin/koha/sci/sci-main.pl';
274 [% IF ( Koha.Preference('SelfCheckInUserJS') ) %]<script>[% Koha.Preference('SelfCheckInUserJS') | $raw %]</script>[% END %]