Lines 25-34
Link Here
|
25 |
[% SET SelfCheckInMainUserBlock = AdditionalContents.get( location => "SelfCheckInMainUserBlock", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] |
25 |
[% SET SelfCheckInMainUserBlock = AdditionalContents.get( location => "SelfCheckInMainUserBlock", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] |
26 |
[% INCLUDE 'doc-head-open.inc' %] |
26 |
[% INCLUDE 'doc-head-open.inc' %] |
27 |
[% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %] |
27 |
[% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %] |
28 |
<title>Self check-in › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha [% END %]</title> |
28 |
<title>Self check-in › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha[% END %]</title> |
29 |
|
29 |
|
30 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
30 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
31 |
<meta name="generator" content="Koha" /> <!-- leave this for stats --> |
31 |
<meta name="generator" content="Koha" /> |
|
|
32 |
<!-- leave this for stats --> |
32 |
|
33 |
|
33 |
[% IF ( Koha.Preference('OpacFavicon') ) %] |
34 |
[% IF ( Koha.Preference('OpacFavicon') ) %] |
34 |
<link rel="shortcut icon" href="[% Koha.Preference('OpacFavicon') | url %]" type="image/x-icon" /> |
35 |
<link rel="shortcut icon" href="[% Koha.Preference('OpacFavicon') | url %]" type="image/x-icon" /> |
Lines 43-58
Link Here
|
43 |
[% ELSE %] |
44 |
[% ELSE %] |
44 |
[% Asset.css("css/sco.css") | $raw %] |
45 |
[% Asset.css("css/sco.css") | $raw %] |
45 |
[% END %] |
46 |
[% END %] |
46 |
[% IF ( Koha.Preference('OPACUserCSS') ) %]<style>[% Koha.Preference('OPACUserCSS') | $raw %]</style>[% END %] |
47 |
[% IF ( Koha.Preference('OPACUserCSS') ) %] |
|
|
48 |
<!-- prettier-ignore-start --> |
49 |
<style>[% Koha.Preference('OPACUserCSS') | $raw %]</style> |
50 |
<!-- prettier-ignore-end --> |
51 |
[% END %] |
47 |
[% IF Branches.GetBranchSpecificCSS( Branches.GetLoggedInBranchcode() || default_branch) %] |
52 |
[% IF Branches.GetBranchSpecificCSS( Branches.GetLoggedInBranchcode() || default_branch) %] |
|
|
53 |
<!-- prettier-ignore-start --> |
48 |
<style> |
54 |
<style> |
49 |
[% Branches.GetBranchSpecificCSS( Branches.GetLoggedInBranchcode() || default_branch) | $raw %] |
55 |
[% Branches.GetBranchSpecificCSS( Branches.GetLoggedInBranchcode() || default_branch) | $raw %] |
50 |
</style> |
56 |
</style> |
|
|
57 |
<!-- prettier-ignore-end --> |
58 |
[% END %] |
59 |
[% IF ( Koha.Preference('SelfCheckInUserCSS') ) %] |
60 |
<!-- prettier-ignore-start --> |
61 |
<style>[% Koha.Preference('SelfCheckInUserCSS') | $raw %]</style> |
62 |
<!-- prettier-ignore-end --> |
51 |
[% END %] |
63 |
[% END %] |
52 |
[% IF ( Koha.Preference('SelfCheckInUserCSS') ) %]<style>[% Koha.Preference('SelfCheckInUserCSS') | $raw %]</style>[% END %] |
|
|
53 |
<script> |
64 |
<script> |
54 |
var Koha = {}; |
65 |
var Koha = {}; |
55 |
function _(s) { return s } // dummy function for gettext |
66 |
function _(s) { |
|
|
67 |
return s; |
68 |
} // dummy function for gettext |
56 |
</script> |
69 |
</script> |
57 |
[% IF lang && lang != 'en' %] |
70 |
[% IF lang && lang != 'en' %] |
58 |
[% Asset.js(lang _ '/js/locale_data.js') | $raw %] |
71 |
[% Asset.js(lang _ '/js/locale_data.js') | $raw %] |
Lines 61-178
Link Here
|
61 |
[% Asset.js('js/i18n.js') | $raw %] |
74 |
[% Asset.js('js/i18n.js') | $raw %] |
62 |
</head> |
75 |
</head> |
63 |
<body id="sci_main" class="sci"> |
76 |
<body id="sci_main" class="sci"> |
64 |
[% INCLUDE 'masthead-sci.inc' %] |
77 |
[% INCLUDE 'masthead-sci.inc' %] |
65 |
|
78 |
|
66 |
<div class="main"> |
79 |
<div class="main"> |
67 |
<div class="container-fluid"> |
80 |
<div class="container-fluid"> |
68 |
<div class="row"> |
81 |
<div class="row"> |
69 |
<div class="col order-first order-md-first order-lg-2"> |
82 |
<div class="col order-first order-md-first order-lg-2"> |
70 |
<div id="masthead"> |
83 |
<div id="masthead"> |
71 |
<h1>[% LibraryName | html %] Self check-in</h1> |
84 |
<h1>[% LibraryName | html %] Self check-in</h1> |
|
|
85 |
</div> |
86 |
|
87 |
[% IF ( nopermission ) %] |
88 |
[%# This is what is displayed if user doesn't have permission %] |
89 |
<div class="alert alert-warning"> |
90 |
<h2>Access denied</h2> |
91 |
<p>Sorry, this self check-in station has lost authentication. Please contact the administrator to resolve this problem.</p> |
72 |
</div> |
92 |
</div> |
73 |
|
93 |
[% ELSIF ( different_ip ) %] |
74 |
[% IF ( nopermission ) %] |
94 |
[%# This is what is displayed if user doesn't have permission %] |
75 |
[%# This is what is displayed if user doesn't have permission %] |
95 |
<div class="alert alert-warning"> |
76 |
<div class="alert alert-warning"> |
96 |
<h2>Session lost</h2> |
77 |
<h2>Access denied</h2> |
97 |
<p>You are accessing self check-in from a different IP address! Please log in again.</p> |
78 |
<p>Sorry, this self check-in station has lost authentication. Please contact the administrator to resolve this problem.</p> |
98 |
</div> |
79 |
</div> |
99 |
[% ELSIF ( checkins ) %] |
80 |
[% ELSIF ( different_ip ) %] |
100 |
[%# We have results from a check-in attempt %] |
81 |
[%# This is what is displayed if user doesn't have permission %] |
101 |
<div id="checkins" class="sci_results_list"> |
82 |
<div class="alert alert-warning"> |
102 |
[% IF ( success && success.size > 0 || errors && errors.size > 0 ) %] |
83 |
<h2>Session lost</h2> |
103 |
<table id="sci_bcheckins_table" class="table table-bordered table-striped dataTable no-footer"> |
84 |
<p>You are accessing self check-in from a different IP address! Please log in again.</p> |
104 |
<caption><h2>Results</h2></caption> |
85 |
</div> |
105 |
<thead> |
86 |
[% ELSIF ( checkins ) %] |
106 |
<th>Barcode</th> |
87 |
[%# We have results from a check-in attempt %] |
107 |
<th>Status</th> |
88 |
<div id="checkins" class="sci_results_list"> |
108 |
</thead> |
89 |
[% IF ( success && success.size > 0 || errors && errors.size > 0 ) %] |
109 |
<tbody> |
90 |
<table id="sci_bcheckins_table" class="table table-bordered table-striped dataTable no-footer"> |
110 |
[% FOREACH success_line IN success %] |
91 |
<caption><h2>Results</h2></caption> |
111 |
<tr> |
92 |
<thead> |
112 |
<td>[% success_line.barcode | html %]</td> |
93 |
<th>Barcode</th> |
113 |
<td>Checked in</td> |
94 |
<th>Status</th> |
114 |
</tr> |
95 |
</thead> |
115 |
[% END %] |
96 |
<tbody> |
116 |
[% FOREACH error IN errors %] |
97 |
[% FOREACH success_line IN success %] |
117 |
<tr> |
98 |
<tr> |
118 |
<td>[% error.barcode | html %]</td> |
99 |
<td>[% success_line.barcode | html %]</td> |
119 |
<td>Not checked in [% PROCESS error_message messages=error.messages %]</td> |
100 |
<td>Checked in</td> |
120 |
</tr> |
101 |
</tr> |
121 |
[% END %] |
102 |
[% END %] |
122 |
</tbody> |
103 |
[% FOREACH error IN errors %] |
123 |
</table> |
104 |
<tr> |
124 |
<div> |
105 |
<td>[% error.barcode | html %]</td> |
125 |
<a href="/cgi-bin/koha/sci/sci-main.pl" id="sci_finish_button" class="btn btn-primary" role="button"><i class="fa fa-check" aria-hidden="true"></i> Finish</a> |
106 |
<td>Not checked in [% PROCESS error_message messages=error.messages %]</td> |
126 |
</div> |
107 |
</tr> |
127 |
[% ELSE %] |
108 |
[% END %] |
128 |
<div class="alert alert-warning"> |
109 |
</tbody> |
129 |
<p>Your request included no check-ins.</p> |
110 |
</table> |
130 |
</div> |
111 |
<div> |
131 |
[% END %] |
112 |
<a href="/cgi-bin/koha/sci/sci-main.pl" id="sci_finish_button" class="btn btn-primary" role="button"><i class="fa fa-check" aria-hidden="true"></i> Finish</a> |
132 |
</div> |
113 |
</div> |
133 |
[% ELSE %] |
114 |
[% ELSE %] |
134 |
[%# Prompt for barcodes %] |
115 |
<div class="alert alert-warning"> |
135 |
<div id="new_checkins" class="sci_entry"> |
116 |
<p>Your request included no check-ins.</p> |
136 |
<form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sci/sci-main.pl"> |
|
|
137 |
[% INCLUDE 'csrf-token.inc' %] |
138 |
<legend class="sr-only">Scan</legend> |
139 |
<div class="row"> |
140 |
<div class="col-auto"> |
141 |
<label for="barcode_input">Scan the item or enter its barcode:</label> |
117 |
</div> |
142 |
</div> |
118 |
[% END %] |
143 |
<div class="col-4"> |
119 |
</div> |
144 |
<input id="barcode_input" name="barcode_input" size="20" type="text" class="focus form-control" autocomplete="off" /> |
120 |
[% ELSE %] |
145 |
</div> |
121 |
[%# Prompt for barcodes %] |
146 |
<div class="col-auto"> |
122 |
<div id="new_checkins" class="sci_entry"> |
147 |
<button id="sci_append_button" type="submit" class="btn btn-primary"> Submit </button> |
123 |
<form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sci/sci-main.pl"> |
148 |
</div> |
124 |
[% INCLUDE 'csrf-token.inc' %] |
149 |
</div> |
125 |
<legend class="sr-only">Scan</legend> |
150 |
<!-- /.row --> |
126 |
<div class="row"> |
151 |
<div class="row"> |
127 |
<div class="col-auto"> |
152 |
<div class="col"> |
128 |
<label for="barcode_input">Scan the item or enter its barcode:</label> |
153 |
<div class="sci_input_append"> |
129 |
</div> |
154 |
<table id="sci_barcodes_table" class="table table-bordered table-striped dataTable no-footer" style="display: none;"> |
130 |
<div class="col-4"> |
155 |
<caption class="sr-only">Barcodes</caption> |
131 |
<input id="barcode_input" name="barcode_input" size="20" type="text" class="focus form-control" autocomplete="off" /> |
156 |
<thead> |
|
|
157 |
<th class="barcodes_column">Barcode</th> |
158 |
</thead> |
159 |
<tbody> </tbody> |
160 |
</table> |
161 |
<!-- /#sci_barcodes_table --> |
132 |
</div> |
162 |
</div> |
133 |
<div class="col-auto"> |
163 |
<!-- .sci_input_append --> |
134 |
<button id="sci_append_button" type="submit" class="btn btn-primary"> |
164 |
<input type="hidden" name="op" value="cud-check_in" /> |
135 |
Submit |
165 |
<div id="button_bar"> |
136 |
</button> |
166 |
<button id="sci_checkin_button" type="submit" class="btn btn-primary" style="display: none;"> <i class="fa fa-check-square" aria-hidden="true"></i> <span>Check in</span> </button> |
|
|
167 |
<a href="/cgi-bin/koha/sci/sci-main.pl" class="btn btn-danger" role="button" style="display: none;" id="sci_refresh_button"> <i class="fa fa-times" aria-hidden="true"></i> <span>Cancel</span> </a> |
137 |
</div> |
168 |
</div> |
138 |
</div> <!-- /.row --> |
169 |
<!-- /#button_bar --> |
139 |
<div class="row"> |
170 |
</div> |
140 |
<div class="col"> |
171 |
<!-- /.col --> |
141 |
<div class="sci_input_append"> |
172 |
</div> |
142 |
<table id="sci_barcodes_table" class="table table-bordered table-striped dataTable no-footer" style="display: none;"> |
173 |
<!-- /.row --> |
143 |
<caption class="sr-only">Barcodes</caption> |
174 |
</form> |
144 |
<thead> |
175 |
<!-- /#scan_form --> |
145 |
<th class="barcodes_column">Barcode</th> |
176 |
</div> |
146 |
</thead> |
177 |
<!-- / #new_checkins --> |
147 |
<tbody> |
178 |
[% END # /IF ( nopermission ) %] |
148 |
</tbody> |
|
|
149 |
</table> <!-- /#sci_barcodes_table --> |
150 |
</div> <!-- .sci_input_append --> |
151 |
<input type="hidden" name="op" value="cud-check_in" /> |
152 |
<div id="button_bar"> |
153 |
<button id="sci_checkin_button" type="submit" class="btn btn-primary" style="display: none;"> |
154 |
<i class="fa fa-check-square" aria-hidden="true"></i> <span>Check in</span> |
155 |
</button> |
156 |
<a href="/cgi-bin/koha/sci/sci-main.pl" class="btn btn-danger" role="button" style="display: none;" id="sci_refresh_button"> |
157 |
<i class="fa fa-times" aria-hidden="true"></i> <span>Cancel</span> |
158 |
</a> |
159 |
</div> <!-- /#button_bar --> |
160 |
</div> <!-- /.col --> |
161 |
</div> <!-- /.row --> |
162 |
</form> <!-- /#scan_form --> |
163 |
</div> <!-- / #new_checkins --> |
164 |
[% END # /IF ( nopermission ) %] |
165 |
|
166 |
[% IF ( SelfCheckInMainUserBlock ) %] |
167 |
<div id="scimainuserblock"> |
168 |
[% PROCESS koha_news_block news => SelfCheckInMainUserBlock %] |
169 |
</div> |
170 |
[% END %] |
171 |
</div> <!-- / #masthead --> |
172 |
</div> <!-- / .row --> |
173 |
</div> <!-- / .container-fluid --> |
174 |
|
179 |
|
175 |
</div> <!-- / .main --> |
180 |
[% IF ( SelfCheckInMainUserBlock ) %] |
|
|
181 |
<div id="scimainuserblock"> [% PROCESS koha_news_block news => SelfCheckInMainUserBlock %] </div> |
182 |
[% END %] |
183 |
</div> |
184 |
<!-- / #masthead --> |
185 |
</div> |
186 |
<!-- / .row --> |
187 |
</div> |
188 |
<!-- / .container-fluid --> |
189 |
</div> |
190 |
<!-- / .main --> |
176 |
|
191 |
|
177 |
[% # Help modal %] |
192 |
[% # Help modal %] |
178 |
<div id="helpModal" class="modal" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel" aria-hidden="true"> |
193 |
<div id="helpModal" class="modal" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel" aria-hidden="true"> |
Lines 181-187
Link Here
|
181 |
<div class="modal-header"> |
196 |
<div class="modal-header"> |
182 |
<h1 class="modal-title" id="helpModalLabel">Self check-in help</h1> |
197 |
<h1 class="modal-title" id="helpModalLabel">Self check-in help</h1> |
183 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> |
198 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> |
184 |
</div> <!-- /.modal-header --> |
199 |
</div> |
|
|
200 |
<!-- /.modal-header --> |
185 |
<div class="modal-body"> |
201 |
<div class="modal-body"> |
186 |
<ul> |
202 |
<ul> |
187 |
<li>Scan each item or enter its barcode. A list with the entered barcodes will be displayed.</li> |
203 |
<li>Scan each item or enter its barcode. A list with the entered barcodes will be displayed.</li> |
Lines 190-326
Link Here
|
190 |
<li>The 'Finish' button is presented to start over.</li> |
206 |
<li>The 'Finish' button is presented to start over.</li> |
191 |
<li>At any step, clicking the 'Cancel' button will erase the scanned barcodes and start over.</li> |
207 |
<li>At any step, clicking the 'Cancel' button will erase the scanned barcodes and start over.</li> |
192 |
</ul> |
208 |
</ul> |
193 |
</div> <!-- /.modal-body --> |
209 |
</div> |
|
|
210 |
<!-- /.modal-body --> |
194 |
<div class="modal-footer"> |
211 |
<div class="modal-footer"> |
195 |
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">Close</button> |
212 |
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">Close</button> |
196 |
</div> |
213 |
</div> |
197 |
</div> <!-- /.modal-content --> |
214 |
</div> |
198 |
</div> <!-- /.modal-dialog --> |
215 |
<!-- /.modal-content --> |
199 |
</div> <!-- /#helpModal --> |
216 |
</div> |
|
|
217 |
<!-- /.modal-dialog --> |
218 |
</div> |
219 |
<!-- /#helpModal --> |
200 |
|
220 |
|
201 |
</body> |
221 |
</body> |
202 |
|
222 |
|
203 |
[% INCLUDE 'opac-bottom.inc' %] |
223 |
[% INCLUDE 'opac-bottom.inc' %] |
204 |
[% BLOCK jsinclude %] |
224 |
[% BLOCK jsinclude %] |
205 |
[% Asset.js('js/timeout.js') | $raw %] |
225 |
[% Asset.js('js/timeout.js') | $raw %] |
206 |
<script> |
226 |
<script> |
207 |
|
|
|
208 |
function mungeHistory() { |
227 |
function mungeHistory() { |
209 |
// prevent back button from allowing form resubmission |
228 |
// prevent back button from allowing form resubmission |
210 |
if (history && history.pushState) { |
229 |
if (history && history.pushState) { |
211 |
history.replaceState(null, document.title, window.location.href); |
230 |
history.replaceState(null, document.title, window.location.href); |
212 |
} |
231 |
} |
213 |
} |
232 |
} |
214 |
|
233 |
|
215 |
function dofocus() { |
234 |
function dofocus() { |
216 |
$(".focus:last").select(); |
235 |
$(".focus:last").select(); |
217 |
} |
236 |
} |
|
|
237 |
|
238 |
var barcodes = []; |
239 |
|
240 |
$( window ).on( "load", function() { |
241 |
dofocus(); |
242 |
}); |
243 |
|
244 |
$( window ).on( "unload", function() { |
245 |
mungeHistory(); |
246 |
}); |
247 |
|
248 |
$(document).ready(function() { |
249 |
// Barcodes scanning table initially hidden |
250 |
$("#sci_barcodes_table").hide(); |
251 |
|
252 |
// Control the 'append' button behaviour |
253 |
$("#sci_append_button").on('click', function(e) { |
254 |
// Make sure the form is not submitted by the button |
255 |
e.preventDefault(); |
256 |
|
257 |
var barcode = $('#barcode_input').val().trim(); // Trim whitespace from input |
258 |
|
259 |
if (barcode !== "") { |
260 |
// Properly escape the barcode value by using .text() for display |
261 |
var barcodeHtml = $('<tr style="font-size: initial;"><td></td></tr>'); |
262 |
barcodeHtml.find('td').text(barcode).append( |
263 |
$('<input>').attr({ |
264 |
type: 'hidden', |
265 |
name: 'barcode', |
266 |
value: barcode |
267 |
}) |
268 |
); |
269 |
|
270 |
$('#sci_barcodes_table tbody').append(barcodeHtml); |
271 |
|
272 |
// Make sure the table is now displayed |
273 |
$("#sci_barcodes_table").show(); |
274 |
$('#sci_checkin_button').show(); |
275 |
$('#sci_refresh_button').show(); |
276 |
login_timeout(); |
277 |
|
278 |
// Add barcode to the array |
279 |
barcodes.push(barcode); |
280 |
} |
281 |
|
282 |
// Clear the input and reset the focus |
283 |
$('#barcode_input').val(''); |
284 |
dofocus(); |
285 |
}); |
218 |
|
286 |
|
219 |
var barcodes = []; |
287 |
$(".helpModal-trigger").on("click", function(e) { |
|
|
288 |
e.preventDefault(); |
289 |
$("#helpModal").modal("show"); |
290 |
}); |
220 |
|
291 |
|
221 |
$( window ).on( "load", function() { |
292 |
// Set focus at the beginning |
222 |
dofocus(); |
293 |
dofocus(); |
223 |
}); |
294 |
}); |
224 |
|
295 |
|
225 |
$( window ).on( "unload", function() { |
296 |
document.addEventListener("DOMContentLoaded",function(){ |
226 |
mungeHistory(); |
297 |
if ( document.querySelector('#sci_finish_button,#sci_append_button') ){ |
227 |
}); |
298 |
login_timeout(); |
228 |
|
299 |
} |
229 |
$(document).ready(function() { |
|
|
230 |
// Barcodes scanning table initially hidden |
231 |
$("#sci_barcodes_table").hide(); |
232 |
|
233 |
// Control the 'append' button behaviour |
234 |
$("#sci_append_button").on('click', function(e) { |
235 |
// Make sure the form is not submitted by the button |
236 |
e.preventDefault(); |
237 |
|
238 |
var barcode = $('#barcode_input').val().trim(); // Trim whitespace from input |
239 |
|
240 |
if (barcode !== "") { |
241 |
// Properly escape the barcode value by using .text() for display |
242 |
var barcodeHtml = $('<tr style="font-size: initial;"><td></td></tr>'); |
243 |
barcodeHtml.find('td').text(barcode).append( |
244 |
$('<input>').attr({ |
245 |
type: 'hidden', |
246 |
name: 'barcode', |
247 |
value: barcode |
248 |
}) |
249 |
); |
250 |
|
251 |
$('#sci_barcodes_table tbody').append(barcodeHtml); |
252 |
|
253 |
// Make sure the table is now displayed |
254 |
$("#sci_barcodes_table").show(); |
255 |
$('#sci_checkin_button').show(); |
256 |
$('#sci_refresh_button').show(); |
257 |
login_timeout(); |
258 |
|
259 |
// Add barcode to the array |
260 |
barcodes.push(barcode); |
261 |
} |
262 |
|
263 |
// Clear the input and reset the focus |
264 |
$('#barcode_input').val(''); |
265 |
dofocus(); |
266 |
}); |
267 |
|
268 |
$(".helpModal-trigger").on("click", function(e) { |
269 |
e.preventDefault(); |
270 |
$("#helpModal").modal("show"); |
271 |
}); |
272 |
|
273 |
// Set focus at the beginning |
274 |
dofocus(); |
275 |
}); |
276 |
|
277 |
document.addEventListener("DOMContentLoaded",function(){ |
278 |
if ( document.querySelector('#sci_finish_button,#sci_append_button') ){ |
279 |
login_timeout(); |
280 |
} |
281 |
}); |
282 |
function login_timeout(){ |
283 |
//NOTE: There can only be 1 sci_login_timer at a time |
284 |
if ( ! window.sci_login_timer ){ |
285 |
const idleTimeout = "[% Koha.Preference('SelfCheckInTimeOut') || 120 | html %]"; |
286 |
const home_href = "/cgi-bin/koha/sci/sci-main.pl"; |
287 |
const sci_timer = new sc_timer({ |
288 |
"idle_timeout": idleTimeout, |
289 |
"redirect_url": home_href |
290 |
}); |
300 |
}); |
291 |
window.sci_login_timer = sci_timer; |
301 |
function login_timeout(){ |
292 |
sci_timer.start_timer(); |
302 |
//NOTE: There can only be 1 sci_login_timer at a time |
293 |
} |
303 |
if ( ! window.sci_login_timer ){ |
294 |
} |
304 |
const idleTimeout = "[% Koha.Preference('SelfCheckInTimeOut') || 120 | html %]"; |
295 |
|
305 |
const home_href = "/cgi-bin/koha/sci/sci-main.pl"; |
296 |
function checkBarcodeInput() { |
306 |
const sci_timer = new sc_timer({ |
297 |
var inputField = document.getElementById("barcode_input"); |
307 |
"idle_timeout": idleTimeout, |
298 |
var button = document.getElementById("sci_append_button"); |
308 |
"redirect_url": home_href |
299 |
|
309 |
}); |
300 |
if (inputField.value.trim() === "") { |
310 |
window.sci_login_timer = sci_timer; |
301 |
button.disabled = true; |
311 |
sci_timer.start_timer(); |
302 |
} else { |
312 |
} |
303 |
button.disabled = false; |
|
|
304 |
} |
313 |
} |
305 |
} |
|
|
306 |
|
307 |
checkBarcodeInput(); |
308 |
|
309 |
document.getElementById("barcode_input").addEventListener("input", checkBarcodeInput); |
310 |
|
311 |
document.getElementById("sci_append_button").addEventListener("click", function() { |
312 |
setTimeout(checkBarcodeInput, 10); |
313 |
}); |
314 |
|
315 |
|
316 |
|
314 |
|
|
|
315 |
function checkBarcodeInput() { |
316 |
var inputField = document.getElementById("barcode_input"); |
317 |
var button = document.getElementById("sci_append_button"); |
317 |
|
318 |
|
|
|
319 |
if (inputField.value.trim() === "") { |
320 |
button.disabled = true; |
321 |
} else { |
322 |
button.disabled = false; |
323 |
} |
324 |
} |
318 |
|
325 |
|
|
|
326 |
checkBarcodeInput(); |
319 |
|
327 |
|
|
|
328 |
document.getElementById("barcode_input").addEventListener("input", checkBarcodeInput); |
320 |
|
329 |
|
|
|
330 |
document.getElementById("sci_append_button").addEventListener("click", function() { |
331 |
setTimeout(checkBarcodeInput, 10); |
332 |
}); |
321 |
</script> |
333 |
</script> |
322 |
|
|
|
323 |
[% IF ( Koha.Preference('SelfCheckInUserJS') ) %] |
334 |
[% IF ( Koha.Preference('SelfCheckInUserJS') ) %] |
324 |
<script>[% Koha.Preference('SelfCheckInUserJS') | $raw %]</script> |
335 |
<script> |
|
|
336 |
[% Koha.Preference('SelfCheckInUserJS') | $raw %] |
337 |
</script> |
325 |
[% END %] |
338 |
[% END %] |
326 |
[% END %] |
339 |
[% END %] |
327 |
- |
|
|