Tomas Cohen Arazi
56da3e5705
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
273 lines
13 KiB
Text
273 lines
13 KiB
Text
[%# Includes %]
|
||
[% USE Koha %]
|
||
[% USE KohaDates %]
|
||
[%# Helper template functions %]
|
||
[% BLOCK error_message %]
|
||
[% IF messages.BadBarcode %]
|
||
<span>(Barcode not found on the database)</span>
|
||
[% ELSIF messages.DataCorrupted %]
|
||
<span>(Data corruption detected. Contact your librarian)</span>
|
||
[% ELSIF messages.Wrongbranch %]
|
||
<span>(The item cannot be returned at this library)</span>
|
||
[% ELSIF messages.withdrawn %]
|
||
<span>(Item is withdrawn and check-in blocked by policy. Contact your librarian)</span>
|
||
[% ELSIF messages.NotIssued %]
|
||
<span>(The book is not currently on loan. Contact your librarian)</span>
|
||
[% END %]
|
||
[% END %]
|
||
|
||
[% INCLUDE 'doc-head-open.inc' %]
|
||
|
||
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha [% END %] › Self check-in</title>
|
||
|
||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
<meta name="generator" content="Koha [% Version %]" /> <!-- leave this for stats -->
|
||
|
||
[% IF ( Koha.Preference('OpacFavicon') ) %]
|
||
<link rel="shortcut icon" href="[% Koha.Preference('OpacFavicon') %]" type="image/x-icon" />
|
||
[% ELSE %]
|
||
<link rel="shortcut icon" href="[% interface %]/[% theme %]/images/favicon.ico" type="image/x-icon" />
|
||
[% END %]
|
||
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/lib/bootstrap/css/bootstrap.min.css" />
|
||
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/lib/jquery/jquery-ui.css" />
|
||
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/lib/font-awesome/css/font-awesome.min.css" />
|
||
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/sci.css" />
|
||
[% IF ( Koha.Preference('OPACUserCSS') ) %]<style type="text/css">[% Koha.Preference('OPACUserCSS') %]</style>[% END %]
|
||
[% IF ( Koha.Preference('SelfCheckInUserCSS') ) %]<style type="text/css">[% Koha.Preference('SelfCheckInUserCSS') %]</style>[% END %]
|
||
<!--[if lt IE 9]>
|
||
<script src="[% interface %]/[% theme %]/lib/respond.min.js"></script>
|
||
<![endif]-->
|
||
<script type="text/javascript">
|
||
function _(s) { return s } // dummy function for gettext
|
||
</script>
|
||
<script type="text/javascript" src="[% interface %]/[% theme %]/lib/modernizr.min.js"></script>
|
||
</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 %]/[% theme %]/images/koha-logo-navbar.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="icon help"></i> Help</a></li>
|
||
<li><a id="sci_logout" href="/cgi-bin/koha/sci/sci-main.pl?logout.x=1" class="logout">Logout</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' ) %]
|
||
</div>
|
||
</div>
|
||
</div>
|
||
[% END %]
|
||
|
||
<div class="main">
|
||
<div class="container-fluid">
|
||
<div class="row-fluid">
|
||
<div id="masthead">
|
||
<h1>[% LibraryName %] 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 %]</td><td>Checked in</td></tr>
|
||
[% END %]
|
||
[% FOREACH error IN errors %]
|
||
<tr>
|
||
<td>[% error.barcode %]</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="icon finish"></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' ) %]</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 %]
|
||
[% INCLUDE 'datatables.inc' %]
|
||
<script type="text/javascript">
|
||
|
||
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 stype="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 minute.
|
||
var idleInterval = setInterval(timerIncrement, 1000); // 1 second
|
||
|
||
//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 %];
|
||
if (idleTime >= idleTimeout ) {
|
||
if ( $("#sci_finish_button").is(":visible") ) $("#sci_finish_button").click();
|
||
if ( $("#sci_refresh_button").is(":visible") ) $("#sci_refresh_button").click();
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
[% IF ( Koha.Preference('SelfCheckInUserJS') ) %]<script type="text/javascript">[% Koha.Preference('SelfCheckInUserJS') %]</script>[% END %]
|
||
[% END %]
|