Owen Leonard
93d130f357
This patch makes a number of follow-up changes, including: - Covert remaining icons to Font Awesome - Convert CSS to SCSS - Move SCSS which is common to both the OPAC and SCI into separate files to be including in each during compilation. - Make minor correction to opac.scss to fix SCSS build warning To test, apply the patch and rebuild the OPAC CSS. Clear your browser cache if necessary. - Enable the self checkin module using using the SelfCheckInModule system preference. - Open the self checkin interface and test the checkin process. Everything should look correct. - After submitting barcodes for checkin, the "Finish" button should show a Font Awesome icon instead of an image icon. - Enable multiple translations and set the OpacLangSelectorMode preference to show the language menu in the footer. - Confirm that the language menu looks correct. - View the regular OPAC to make sure the changes to opac.scss didn't result in unintended changes to the interface. Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
273 lines
13 KiB
Text
273 lines
13 KiB
Text
[% 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 %] › 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.css") | $raw %]
|
||
[% Asset.css("lib/font-awesome/css/font-awesome.min.css") | $raw %]
|
||
[% Asset.css("css/sci.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 %]
|