Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/sci/sci-main.tt
Owen Leonard 8b1fb387ac
Bug 14862: Upgrade jQuery from 1.7 to 3.4.1 in OPAC
This patch upgrades jQuery to 3.4.1, jQuery-UI to 1.12.1, and adds the
jQuery-migrate plugin to ensure backwards-compatibility with existing
jQuery plugins and code. An updated of jquery-ui-rtl.css has been
created by converting the new version of jquery-ui.css.

All jQuery assets are now include the version number in the file name
just as we now do in the staff client.

Besides updating file names in the templates, there was only one change
made: opac-results.tt had a typo which has been corrected.

To test, apply the patch and test as many different pages in the OPAC as
possible, including self-checkout and self checkin. Keep the browser
console open and watch for JavaScript errors. All JavaScript-driven
behavior should work correctly. For instance:

 - Tabs
 - Datepickers
 - Select all/none operations
 - Cart and lists popups
 - Search result highlighting

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-07 16:22:04 +01:00

273 lines
13 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[% USE raw %]
[% USE Asset %]
[%# Includes %]
[% USE Koha %]
[% USE KohaDates %]
[%# Helper template functions %]
[% BLOCK error_message %]
[% IF messages.BadBarcode %]
<span>(Barcode not found on the database, please see library staff for assistance)</span>
[% ELSIF messages.Wrongbranch %]
<span>(The item cannot be returned at this library, please see library staff for assistance)</span>
[% ELSIF messages.withdrawn %]
<span>(Item is withdrawn and check-in blocked by policy, please see library staff for assistance)</span>
[% ELSIF messages.NotIssued %]
<span>(The book is not currently on loan, please see library staff for assistance)</span>
[% ELSE %]
<span>(There was a problem returning this item, please see library staff for assistance)</span>
[% END %]
[% END %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha [% END %] &rsaquo; Self check-in</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Koha [% Version | html %]" /> <!-- leave this for stats -->
[% IF ( Koha.Preference('OpacFavicon') ) %]
<link rel="shortcut icon" href="[% Koha.Preference('OpacFavicon') | url %]" type="image/x-icon" />
[% ELSE %]
<link rel="shortcut icon" href="[% interface | html %]/[% theme | html %]/images/favicon.ico" type="image/x-icon" />
[% END %]
[% Asset.css("lib/bootstrap/css/bootstrap.min.css") | $raw %]
[% Asset.css("lib/jquery/jquery-ui-1.12.1.css") | $raw %]
[% Asset.css("lib/font-awesome/css/font-awesome.min.css") | $raw %]
[% Asset.css("css/sco.css") | $raw %]
[% IF ( Koha.Preference('OPACUserCSS') ) %]<style>[% Koha.Preference('OPACUserCSS') | $raw %]</style>[% END %]
[% IF ( Koha.Preference('SelfCheckInUserCSS') ) %]<style>[% Koha.Preference('SelfCheckInUserCSS') | $raw %]</style>[% END %]
<!--[if lt IE 9]>
<script src="[% interface | html %]/[% theme | html %]/lib/respond.min.js"></script>
<![endif]-->
<script>
function _(s) { return s } // dummy function for gettext
</script>
[% Asset.js("lib/modernizr.min.js") | $raw %]
</head>
<body id="sci_main" class="sci" onload="dofocus();" onunload="mungeHistory();">
[% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %]
<div id="wrap">
<div class="navbar navbar-inverse navbar-static-top">
<div class="navbar-inner">
<div class="container-fluid">
<a class="brand" href="/cgi-bin/koha/sci/sci-main.pl"><img src="[% interface | html %]/[% theme | html %]/images/koha-green-logo.png" alt=""></a>
<div id="checkouthelp">
<ul class="nav pull-right">
<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>
<li><a id="sci_logout" href="/cgi-bin/koha/sci/sci-main.pl?logout.x=1" class="logout">Log out</a></li>
</ul>
</div>
[% IF Koha.Preference( 'opaclanguagesdisplay' ) %]
<div id="members">
<ul class="nav pull-right">
[% INCLUDE 'masthead-langmenu.inc' %]
</ul>
</div>
[% END %]
</div> <!-- /.container-fluid -->
</div> <!-- /.navbar-inner -->
</div> <!-- /.navbar -->
[% IF Koha.Preference( 'opacheader' ) %]
<div class="container-fluid">
<div class="row-fluid">
<div id="opacheader">
[% Koha.Preference( 'opacheader' ) | $raw %]
</div>
</div>
</div>
[% END %]
<div class="main">
<div class="container-fluid">
<div class="row-fluid">
<div id="masthead">
<h1>[% LibraryName | html %] Self check-in</h1>
[% IF ( nopermission ) %]
[%# This is what is displayed if user doesn't have permission %]
<div class="alert">
<h3>Access denied</h3>
<p>Sorry, this self check-in station has lost authentication. Please contact the administrator to resolve this problem.</p>
</div>
[% ELSIF ( different_ip ) %]
[%# This is what is displayed if user doesn't have permission %]
<div class="alert">
<h3>Session lost</h3>
<p>You are accessing self check-in from a different IP address! Please log in again.</p>
</div>
[% ELSIF ( checkins ) %]
[%# We have results from a check-in attempt %]
<div id="checkins" class="sci_results_list">
[% IF ( success && success.size > 0 || errors && errors.size > 0 ) %]
<h3>Results</h3>
<table id="sci_bcheckins_table" class="table table-bordered table-striped dataTable no-footer" style="font-size: initial;">
<thead>
<th>Barcode</th>
<th>Status</th>
</thead>
<tbody>
[% FOREACH success_line IN success %]
<tr><td>[% success_line.barcode | html %]</td><td>Checked in</td></tr>
[% END %]
[% FOREACH error IN errors %]
<tr>
<td>[% error.barcode | html %]</td>
<td>Not checked in [% PROCESS error_message messages=error.messages %]</td>
</tr>
[% END %]
</tbody>
</table>
<div>
<form method="post" action="#" id="finish_form">
<button id="sci_finish_button" type="submit" class="btn"><i class="fa fa-check"></i> Finish</button>
</form>
</div>
[% ELSE %]
<div class="alert">
<p>Your request included no check-ins.</p>
</div>
[% END %]
</div>
[% ELSE %]
[%# Prompt for barcodes %]
<div id="new_checkins" class="sci_entry">
<form id="scan_form" name="scan_form"
method="post" action="/cgi-bin/koha/sci/sci-main.pl">
<fieldset>
<div>
<label for="barcode_input">Scan the item or enter its barcode:</label>
<input id="barcode_input" name="barcode_input" size="20" type="text" class="focus" autocomplete="off" />
<button id="sci_append_button" type="submit" class="btn btn-default btn-sm">
<i class="fa fa-plus" aria-hidden="true"></i> <span>Add</span>
</button>
</div>
<div class="sci_input_append">
<table id="sci_barcodes_table" class="table table-bordered table-striped dataTable no-footer" style="display: none; font-size: initial;">
<thead>
<th class="barcodes_column">Barcode</th>
</thead>
<tbody>
</tbody>
</table>
</div>
<input type="hidden" name="op" value="check_in" />
<div id="button_bar">
<button id="sci_checkin_button" type="submit" class="btn btn-default btn-sm" style="display: none;">
<i class="fa fa-check-square-o" aria-hidden="true"></i> <span>Check in</span>
</button>
<a href="/cgi-bin/koha/sci/sci-main.pl" class="btn btn-default btn-sm" role="button" style="display: none;" id="sci_refresh_button">
<i class="fa fa-refresh" aria-hidden="true"></i> <span>Cancel</span>
</a>
</div>
</fieldset>
</form>
</div> <!-- / #new_checkins -->
[% END %]
</div> <!-- / #masthead -->
</div> <!-- / .row-fluid -->
</div> <!-- / .container-fluid -->
[% IF ( Koha.Preference('SelfCheckInMainUserBlock') ) %]
<div id="SelfCheckInMainUserBlock">[% Koha.Preference('SelfCheckInMainUserBlock' ) | $raw %]</div>
[% END %]
</div> <!-- / .main -->
<div id="helpModal" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="helpModalLabel">Self check-in help</h3>
</div>
<div class="modal-body">
<ul>
<li>Scan each item or enter its barcode. A list with the entered barcodes will be displayed.</li>
<li>Click the 'Check in' button to confirm.</li>
<li>The operation results will be displayed for each entered barcode.</li>
<li>The 'Finish' button is presented to start over.</li>
<li>At any step, clicking the 'Cancel' button will erase the scanned barcodes and start over.</li>
</ul>
</div>
</div> <!-- /#helpModal -->
</body>
[% INCLUDE 'opac-bottom.inc' %]
[% BLOCK jsinclude %]
<script>
function mungeHistory() {
// prevent back button from allowing form resubmission
if (history && history.pushState) {
history.replaceState(null, document.title, window.location.href);
}
}
function dofocus() {
$(".focus:last").select();
}
var barcodes = [];
$(document).ready(function() {
// Barcodes scanning table initially hidden
$("#sci_barcodes_table").hide();
// Control de 'append' button behaviour
$("#sci_append_button").on('click',function( e ){
// Make sure the form is not submitted by the button
e.preventDefault();
var barcode = $('#barcode_input').val();
//var result = validate_barcode( barcode );
$('#sci_barcodes_table tbody').append(
'<tr style="font-size: initial;"><td>' +
barcode +
'<input type="hidden" name="barcode" value="' + barcode + '" />' +
'</td></tr>' );
// Make sure the table is now displayed
$("#sci_barcodes_table").show();
$('#sci_checkin_button').show();
$('#sci_refresh_button').show();
barcodes.push(barcode);
// clean the input, reset the focus
$('#barcode_input').val('');
dofocus();
});
$(".helpModal-trigger").on("click",function(e){
e.preventDefault();
$("#helpModal").modal("show");
});
// set focus at the beginning
dofocus();
});
var idleTime = 0;
$(document).ready(function () {
//Increment the idle time counter every second
var idleInterval = setInterval(timerIncrement, 1000);
//Zero the idle timer on mouse movement.
$(this).mousemove(function (e) {
idleTime = 0;
});
$(this).keypress(function (e) {
idleTime = 0;
});
});
function timerIncrement() {
if ( $("#sci_finish_button").is(":visible") || $("#sci_refresh_button").is(":visible") ) {
idleTime = idleTime + 1;
idleTimeout = [% refresh_timeout | html %];
if (idleTime >= idleTimeout ) {
location.href = '/cgi-bin/koha/sci/sci-main.pl';
}
}
}
</script>
[% IF ( Koha.Preference('SelfCheckInUserJS') ) %]<script>[% Koha.Preference('SelfCheckInUserJS') | $raw %]</script>[% END %]
[% END %]