759 lines
47 KiB
Plaintext
759 lines
47 KiB
Plaintext
[% USE raw %]
|
|
[% USE Asset %]
|
|
[% USE Koha %]
|
|
[% USE KohaDates %]
|
|
[% USE AudioAlerts %]
|
|
[% USE To %]
|
|
[% USE Price %]
|
|
[% USE AdditionalContents %]
|
|
[% USE Branches %]
|
|
[% SET SCOMainUserBlock = AdditionalContents.get( location => "SCOMainUserBlock", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
|
|
[% PROCESS 'html_helpers.inc' %]
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title
|
|
>[% FILTER collapse %]
|
|
[% t("Self checkout") | html %]
|
|
› [% PROCESS 'library_name_title' %]
|
|
[% END %]</title
|
|
>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="generator" content="Koha" />
|
|
<!-- leave this for stats -->
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
[% 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/fontawesome/css/fontawesome.min.css") | $raw %]
|
|
[% Asset.css("lib/fontawesome/css/brands.min.css") | $raw %]
|
|
[% Asset.css("lib/fontawesome/css/solid.min.css") | $raw %]
|
|
[% IF ( bidi ) %]
|
|
[% Asset.css("css/sco-rtl.css") | $raw %]
|
|
[% ELSE %]
|
|
[% Asset.css("css/sco.css") | $raw %]
|
|
[% END %]
|
|
[% IF ( Koha.Preference('OPACUserCSS') ) %]
|
|
<!-- prettier-ignore-start -->
|
|
<style nonce="[% Koha.CSPNonce | $raw %]">[% Koha.Preference('OPACUserCSS') | $raw %]</style>
|
|
<!-- prettier-ignore-end -->
|
|
[% END %]
|
|
[% IF Branches.GetBranchSpecificCSS( Branches.GetLoggedInBranchcode() || default_branch) %]
|
|
<!-- prettier-ignore-start -->
|
|
<style nonce="[% Koha.CSPNonce | $raw %]">
|
|
[% Branches.GetBranchSpecificCSS( Branches.GetLoggedInBranchcode() || default_branch) | $raw %]
|
|
</style>
|
|
<!-- prettier-ignore-end -->
|
|
[% END %]
|
|
[% IF ( Koha.Preference('SCOUserCSS') ) %]
|
|
<!-- prettier-ignore-start -->
|
|
<style nonce="[% Koha.CSPNonce | $raw %]">[% Koha.Preference('SCOUserCSS') | $raw %]</style>
|
|
<!-- prettier-ignore-end -->
|
|
[% END %]
|
|
<script nonce="[% Koha.CSPNonce | $raw %]">
|
|
var Koha = {};
|
|
function _(s) {
|
|
return s;
|
|
} // dummy function for gettext
|
|
</script>
|
|
[% IF lang && lang != 'en' %]
|
|
[% Asset.js(lang _ '/js/locale_data.js') | $raw %]
|
|
[% END %]
|
|
[% Asset.js('js/Gettext.js') | $raw %]
|
|
[% Asset.js('js/i18n.js') | $raw %]
|
|
[% Asset.js('js/stores.js') | $raw %]
|
|
</head>
|
|
<body id="sco_main" class="sco">
|
|
<div id="wrapper">
|
|
[% INCLUDE 'masthead-sco.inc' %]
|
|
|
|
<main class="main">
|
|
[% IF ( display_patron_image ) %]
|
|
[% SET main_div_class = 'col-10 order-first order-md-first order-lg-2' %]
|
|
[% ELSE %]
|
|
[% SET main_div_class = 'col order-first order-md-first order-lg-2' %]
|
|
[% END %]
|
|
|
|
[% UNLESS ( hide_main ) %]
|
|
[% IF ( validuser ) %]
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="[% main_div_class | html %]">
|
|
<div id="masthead"><h1>[% LibraryName | html %] Self-checkout system</h1></div>
|
|
|
|
[% PROCESS display_errors %]
|
|
|
|
<div class="alert alert-info">You are logged in as [% borrowername | html %].</div>
|
|
[% INCLUDE 'opac-note.inc' sco="true" %]
|
|
[% IF patron_has_hold_fee %]
|
|
<div class="alert alert-warning">A hold fee was charged to your account for collecting this item.</div>
|
|
[% END %]
|
|
|
|
<div id="newcheckout" class="sco_entry">
|
|
<form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sco/sco-main.pl">
|
|
[% INCLUDE 'csrf-token.inc' %]
|
|
<legend
|
|
><h2>
|
|
[% IF ( Koha.Preference('SCOAllowCheckin') ) %]
|
|
<span>Check out, return, or renew an item:</span>
|
|
[% ELSE %]
|
|
<span>Check out or renew an item:</span>
|
|
[% END %]
|
|
</h2></legend
|
|
>
|
|
<div class="row mb-1">
|
|
<div class="col">
|
|
<label for="barcode">Scan a new item or enter its barcode[% IF batch_checkouts_allowed %](or for <b>multiple checkouts only,</b> enter a barcode list, one barcode per line)[% END %]:</label>
|
|
</div>
|
|
</div>
|
|
<div class="row mb-1">
|
|
<div class="col-12 col-lg-4">
|
|
[% IF batch_checkouts_allowed %]
|
|
<textarea id="barcode" name="barcode" rows="10" cols="30" class="focus form-control"></textarea>
|
|
[% ELSE %]
|
|
<input id="barcode" name="barcode" size="20" type="text" class="focus form-control" autocomplete="off" />
|
|
[% END %]
|
|
</div>
|
|
</div>
|
|
<div class="row mb-1">
|
|
<div class="col">
|
|
<button type="submit" class="btn btn-primary">Submit</button>
|
|
<button type="button" id="logout_form" class="btn btn-info"><i class="fa fa-check" aria-hidden="true"></i> Finish</button>
|
|
<input type="hidden" name="op" value="cud-checkout" />
|
|
<input type="hidden" name="patronid" value="[% patronid | html %]" />
|
|
<input type="hidden" name="load_checkouts" value="[% load_checkouts | html %]" />
|
|
<input type="hidden" name="newissues" value="[% newissues | html %]" />
|
|
</div>
|
|
</div>
|
|
<!-- /.row -->
|
|
</form>
|
|
<!-- /#scan_form -->
|
|
</div>
|
|
<!-- / #newcheckout -->
|
|
</div>
|
|
<!-- / .span12/12 -->
|
|
[% IF ( display_patron_image ) %]
|
|
<div class="col-lg-2">
|
|
<img src="/cgi-bin/koha/sco/sco-patron-image.pl" alt="" />
|
|
</div>
|
|
[% END %]
|
|
</div>
|
|
<!-- / .row -->
|
|
</div>
|
|
<!-- / .container-fluid -->
|
|
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col order-first order-md-first order-lg-2">
|
|
[% WRAPPER tabs %]
|
|
[% WRAPPER tabs_nav %]
|
|
[% WRAPPER tab_item tabname= "checkouts" bt_active= 1 %]
|
|
<span>Checkouts ([% issues_count | html %])</span>
|
|
[% END %]
|
|
[% WRAPPER tab_item tabname= "holds" %]
|
|
[% IF waiting_holds_count %]
|
|
<i class="fa fa-exclamation-circle" aria-hidden="true"></i>
|
|
[% END %]
|
|
<span>Holds</span> ([% HOLDS.count | html %])
|
|
[% END %]
|
|
[% WRAPPER tab_item tabname= "account" %]
|
|
<span>Charges ([% total | $Price %])</span>
|
|
[% END %]
|
|
[% END # /WRAPPER tabs_nav %]
|
|
|
|
[% WRAPPER tab_panels %]
|
|
[% WRAPPER tab_panel tabname="checkouts" bt_active= 1 %]
|
|
<div id="checkouts-tab" class="tab-pane show active" aria-labelledby="checkouts">
|
|
<div id="borrowerdetails">
|
|
[% IF ( new_issue ) %]
|
|
<div class="lastchecked">
|
|
<p>
|
|
<strong>Checked out: </strong>
|
|
[% new_issue.item.biblio.title | html %] ([% new_issue.item.barcode | html %]).
|
|
[% IF new_issue.item.is_bundle %]
|
|
[% SET bundle_items_count = new_issue.item.bundle_items.count %]
|
|
[% tnx('Bundle of {count} item', 'Bundle of {count} items', bundle_items_count, { count = bundle_items_count }) | html %].
|
|
[% END %]
|
|
Due on [% new_issue.date_due | $KohaDates as_due_date => 1 %]
|
|
</p>
|
|
</div>
|
|
[% END %]
|
|
[% IF ( issues_count ) %]
|
|
[% IF ( Koha.Preference('SCOLoadCheckoutsByDefault') || load_checkouts ) %]
|
|
<table id="loanTable" class="table table-bordered table-striped">
|
|
<caption>Checkouts for [% borrowername | html %] <span class="count">([% issues_count | html %] total)</span></caption>
|
|
<!-- ISSUES TABLE ROWS -->
|
|
<thead>
|
|
<tr>
|
|
<th class="noshow">Checked out on</th>
|
|
<th class="all anti-the">Title</th>
|
|
<th>Call number</th>
|
|
<th class="psort">Due</th>
|
|
<th class="no-sort">Renew</th>
|
|
[% IF Koha.Preference('SCOAllowCheckin') %]
|
|
<th class="no-sort">Check in</th>
|
|
[% END %]
|
|
[% UNLESS ( nofines ) %]
|
|
<th>Fines</th>
|
|
[% END %]
|
|
<th class="dtr-control-col"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
[% FOREACH ISSUE IN ISSUES %]
|
|
<tr>
|
|
<td>[% ISSUE.issuedate | html %]</td>
|
|
<td>
|
|
[% UNLESS ( noitemlinks ) %]
|
|
<a href="/cgi-bin/koha/opac-detail.pl?bib=[% ISSUE. biblionumber | uri %]">[% ISSUE.title | html %]</a>
|
|
[% ELSE %]
|
|
<strong>[% ISSUE.title | html %]</strong>
|
|
[% END %]
|
|
[% IF ( newissues.match(ISSUE.barcode)) %]
|
|
<span class="badge text-bg-info">NEW</span>
|
|
[% END %]
|
|
<span class="item-details">[% ISSUE.author | html %]</span>
|
|
([% ISSUE.barcode | html %])
|
|
</td>
|
|
<td>[% ISSUE.itemcallnumber | html %]</td>
|
|
[% IF ( ISSUE.overdue ) %]
|
|
<td class="overdue" data-order="[% ISSUE.date_due | html %]"> [% ISSUE.date_due | $KohaDates as_due_date => 1 %] </td>
|
|
[% ELSE %]
|
|
<td data-order="[% ISSUE.date_due | html %]"> [% ISSUE.date_due | $KohaDates as_due_date => 1 %] </td>
|
|
[% END %]
|
|
<td>
|
|
<form action="/cgi-bin/koha/sco/sco-main.pl" method="post">
|
|
[% INCLUDE 'csrf-token.inc' %]
|
|
<legend class="sr-only">Issue renews</legend>
|
|
<input type="hidden" name="patronid" value="[% patronid | html %]" />
|
|
<input type="hidden" name="load_checkouts" value="[% load_checkouts | html %]" />
|
|
<input type="hidden" name="barcode" value="[% ISSUE.barcode | html %]" />
|
|
<input type="hidden" name="newissues" value="[% newissues | html %]" />
|
|
[% IF ISSUE.can_be_renewed %]
|
|
<input type="hidden" name="op" value="cud-renew" />
|
|
<input type="hidden" name="confirmed" value="1" />
|
|
[% UNLESS ( ISSUE.renew ) %]
|
|
<input type="submit" value="Renew item" name="confirm " class="btn btn-primary btn-sm renew" />
|
|
[% ELSE %]
|
|
<input type="submit" value="Renew item" class="btn btn-primary btn-sm renew" />
|
|
[% END %]
|
|
[% ELSE %]
|
|
[% IF ISSUE.renew_error == 'onsite_checkout' %]
|
|
<span>This is a on-site checkout, it cannot be renewed.</span>
|
|
[% ELSIF ISSUE.renew_error == 'too_unseen' %]
|
|
<span>You have renewed this item the maximum number of consecutive times without it being seen by the library.</span>
|
|
[% ELSIF ISSUE.renew_error == 'too_soon' %]
|
|
<span>This item cannot yet be renewed.</span>
|
|
[% ELSE %]
|
|
<span>No renewals allowed</span>
|
|
[% END %]
|
|
[% END %]
|
|
[% IF ISSUE.auto_renew %]
|
|
<br /><span>This item is scheduled for automatic renewal</span>
|
|
[% END %]
|
|
</form>
|
|
</td>
|
|
[% IF Koha.Preference('SCOAllowCheckin') %]
|
|
<td>
|
|
<form action="/cgi-bin/koha/sco/sco-main.pl" method="post">
|
|
[% INCLUDE 'csrf-token.inc' %]
|
|
<legend class="sr-only">Issue renews</legend>
|
|
<input type="hidden" name="patronid" value="[% patronid | html %]" />
|
|
<input type="hidden" name="load_checkouts" value="[% load_checkouts | html %]" />
|
|
<input type="hidden" name="barcode" value="[% ISSUE.barcode | html %]" />
|
|
<input type="submit" value="Check in item" name="confirm" class="btn btn-info btn-sm return" />
|
|
<input type="hidden" name="op" value="cud-returnbook" />
|
|
<input type="hidden" name="confirmed" value="" />
|
|
</form>
|
|
</td>
|
|
[% END %]
|
|
[% UNLESS ( nofines ) %]
|
|
<td> [% IF ( ISSUE.charges ) %]Yes[% ELSE %]No[% END %] </td>
|
|
[% END %]
|
|
<td></td>
|
|
</tr>
|
|
[% END # / FOREACH ISSUE %]
|
|
</tbody>
|
|
</table>
|
|
[% ELSE %]
|
|
<a class="btn btn-secondary" href="?load_checkouts=1#scan_form"><i class="fa fa-book" aria-hidden="true"></i> Show your checkouts</a>
|
|
[% END # / IF ( Koha.preference('SCOLoadCheckoutsByDefault') || load_checkouts ) %]
|
|
[% ELSE %]
|
|
<h3>You currently have nothing checked out.</h3>
|
|
[% END # / IF issues_count %]
|
|
</div>
|
|
<!-- / #borrowerdetails -->
|
|
</div>
|
|
[% END # /tab_panel %]
|
|
[% WRAPPER tab_panel tabname="holds" %]
|
|
[% IF HOLDS.count > 0 %]
|
|
[% PROCESS 'holds-table.inc' HOLDS = HOLDS, SuspendHoldsOpac = SuspendHoldsOpac, showpriority = showpriority, AutoResumeSuspendedHolds = AutoResumeSuspendedHolds, onlyinfo = 'true' %]
|
|
[% ELSE %]
|
|
<h3>You currently have no pending holds.</h3>
|
|
[% END %]
|
|
[% END # /tab_panel %]
|
|
[% WRAPPER tab_panel tabname="account" %]
|
|
[% PROCESS 'account-table.inc' %]
|
|
[% END # /tab_panel %]
|
|
[% END # /WRAPPER tab_panels %]
|
|
[% END # /WRAPPER tabs %]
|
|
|
|
[% IF ( SCOMainUserBlock ) %]
|
|
<div id="scomainuserblock"> [% PROCESS koha_news_block news => SCOMainUserBlock %] </div>
|
|
[% END %]
|
|
</div>
|
|
<!-- / .span12 -->
|
|
</div>
|
|
<!-- / .row -->
|
|
</div>
|
|
<!-- / .container-fluid -->
|
|
[% ELSE # IF validuser %]
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="[% main_div_class | html %]">
|
|
<div id="masthead"><h1>[% LibraryName | html %] Self-checkout system</h1></div>
|
|
|
|
[% PROCESS display_errors %]
|
|
|
|
[% IF patronid && nouser %]
|
|
<div class="alert alert-warning">
|
|
<p
|
|
>You entered an incorrect username or password. Please try again! But note that passwords are case sensitive.
|
|
[% IF Koha.Preference('FailedLoginAttempts') %]
|
|
Your account will be locked after a fixed number of failed login attempts.
|
|
[% END %]
|
|
Please contact a library staff member if you continue to have problems.</p
|
|
>
|
|
</div>
|
|
[% END %]
|
|
|
|
<div class="sco_entry">
|
|
<form id="mainform" action="/cgi-bin/koha/sco/sco-main.pl" name="mainform" method="post">
|
|
[% INCLUDE 'csrf-token.inc' %]
|
|
<fieldset>
|
|
<legend>Log in to your account</legend>
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
[% IF ( Koha.Preference('SelfCheckoutByLogin') ) %]
|
|
<div class="row">
|
|
<div class="col-md-12"> [% PROCESS login_label for="patronlogin" %] </div>
|
|
<div class="col-md-12">
|
|
<input type="text" id="patronlogin" class="form-control focus noEnterSubmit" size="20" name="patronlogin" autocomplete="off" />
|
|
</div>
|
|
<div class="col-md-12">
|
|
<label for="patronpw">Password:</label>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<input type="password" id="patronpw" class="form-control" size="20" name="patronpw" autocomplete="off" />
|
|
</div>
|
|
<div class="col-md-12">
|
|
<button type="submit" class="btn btn-primary">Log in</button>
|
|
</div>
|
|
</div>
|
|
<!-- /.row -->
|
|
[% ELSE %]
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<label for="patronid">Please enter your card number:</label>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<input type="text" id="patronid" class="form-control focus" size="20" name="patronid" autocomplete="off" />
|
|
</div>
|
|
<div class="col-md-12">
|
|
<button type="submit" class="btn btn-primary">Submit</button>
|
|
</div>
|
|
</div>
|
|
<!-- /.row -->
|
|
[% END %]
|
|
</div>
|
|
<!-- /.col-md-6 -->
|
|
</div>
|
|
<!-- /.row -->
|
|
[% FOREACH INPUT IN INPUTS %]
|
|
<input type="hidden" name="[% INPUT.name | html %]" value="[% INPUT.value | html %]" />
|
|
[% END %]
|
|
<input type="hidden" name="login_op" value="cud-login" />
|
|
</fieldset>
|
|
</form>
|
|
<!-- /#mainform -->
|
|
</div>
|
|
<!-- / .sco_entry -->
|
|
[% IF ( SCOMainUserBlock ) %]
|
|
<div id="scomainuserblock"> [% PROCESS koha_news_block news => SCOMainUserBlock %] </div>
|
|
[% END %]
|
|
</div>
|
|
<!-- / .span12 -->
|
|
</div>
|
|
<!-- / .row -->
|
|
</div>
|
|
<!-- / .container-fluid -->
|
|
[% END # / IF validuser %]
|
|
[% ELSE # / UNLESS ( hide_main %]
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="[% main_div_class | html %]">
|
|
<div id="masthead"><h1>[% LibraryName | html %] Self-checkout system</h1></div>
|
|
|
|
[% PROCESS display_errors %]
|
|
|
|
[% IF ( SCOMainUserBlock ) %]
|
|
<div id="scomainuserblock"> [% PROCESS koha_news_block news => SCOMainUserBlock %] </div>
|
|
[% END %]
|
|
</div>
|
|
<!-- / .span12 -->
|
|
</div>
|
|
<!-- / .row -->
|
|
</div>
|
|
<!-- / .container-fluid -->
|
|
[% END # / UNLESS ( hide_main %]
|
|
</main>
|
|
<!-- / .main -->
|
|
<span id="audio-alert"></span>
|
|
|
|
[% INCLUDE 'opac-bottom.inc' %]
|
|
[% BLOCK jsinclude %]
|
|
[% INCLUDE 'datatables.inc' %]
|
|
<script nonce="[% Koha.CSPNonce | $raw %]">
|
|
addPrefs({
|
|
OPACTableColExpandedByDefault: [% Koha.Preference('OPACTableColExpandedByDefault') ? 1 : 0 | html %],
|
|
SelfCheckTimeout: "[% Koha.Preference('SelfCheckTimeout') | html %]",
|
|
SelfCheckReceiptPrompt: [% Koha.Preference('SelfCheckReceiptPrompt') ? 1 : 0 | html %],
|
|
});
|
|
const logged_in_user_cardnumber = "[% patronid | html %]";
|
|
</script>
|
|
[% IF Koha.Preference('AudioAlerts') %]
|
|
<script nonce="[% Koha.CSPNonce | $raw %]">
|
|
var AUDIO_ALERTS = JSON.parse( "[% To.json(AudioAlerts.AudioAlerts) | $raw %]" );
|
|
$( document ).ready(function() {
|
|
if ( AUDIO_ALERTS ) {
|
|
for ( var k in AUDIO_ALERTS ) {
|
|
var alert = AUDIO_ALERTS[k];
|
|
if ( $( alert.selector ).length ) {
|
|
playSound( alert.sound );
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
});
|
|
function playSound( sound ) {
|
|
if (!(sound.indexOf("http://") === 0 || sound.indexOf("https://") === 0)) {
|
|
sound = '[% interface | html %]' + '/bootstrap/sound/' + sound;
|
|
}
|
|
document.getElementById("audio-alert").innerHTML = '<audio src="' + sound + '" autoplay="autoplay" autobuffer="autobuffer"></audio>';
|
|
}
|
|
</script>
|
|
[% END %]
|
|
<script nonce="[% Koha.CSPNonce | $raw %]">
|
|
function mungeHistory() {
|
|
// prevent back button from allowing form resubmission
|
|
if (history && history.pushState) {
|
|
history.replaceState(null, document.title, window.location.href);
|
|
}
|
|
}
|
|
var mainTimeout;
|
|
function sco_init() {
|
|
mainTimeout = setTimeout(function () {
|
|
location.href = "/cgi-bin/koha/sco/sco-main.pl?op=logout";
|
|
}, prefs.SelfCheckTimeout);
|
|
}
|
|
function dofocus() {
|
|
// named function req'd for body onload event by some FF and IE7 security models
|
|
// alert("dofocus called");
|
|
$(".focus:last").select();
|
|
}
|
|
var slip_re = /slip/;
|
|
function printx_window(print_type) {
|
|
var handler = print_type.match(slip_re) ? "printslip" : "moremember";
|
|
|
|
return false;
|
|
}
|
|
function checkout_confirm(patronid) {
|
|
var barcode = $("#barcode").val();
|
|
// alert("checkout_confirm('" + patronid + "') called for barcode '" + barcode + "'");
|
|
if (!barcode) {
|
|
dofocus();
|
|
return false;
|
|
} // no barcode
|
|
if (barcode == "__KOHA_NEW_CIRC__") {
|
|
// magic barcode
|
|
window.location.href = "/cgi-bin/koha/sco/sco-main.pl?op=logout";
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
$(window).on("load", function () {
|
|
dofocus();
|
|
});
|
|
|
|
$(window).on("unload", function () {
|
|
mungeHistory();
|
|
});
|
|
|
|
$(document).ready(function () {
|
|
dofocus();
|
|
if (logged_in_user_cardnumber) {
|
|
sco_init();
|
|
}
|
|
|
|
var responsive_display = prefs.OPACTableColExpandedByDefault ? DataTable.Responsive.display.childRowImmediate : DataTable.Responsive.display.childRow;
|
|
var dTables = $("#loanTable, #holdst, #finestable");
|
|
dTables.each(function () {
|
|
var thIndex = $(this).find("th.psort").index();
|
|
$(this).kohaTable({
|
|
order: [[thIndex, "asc"]],
|
|
dom: '<"top"<"table_entries"><"table_controls"f>>t<"clear">',
|
|
columnDefs: [
|
|
{ targets: ["noshow"], visible: false, searchable: false },
|
|
{ visible: false, targets: ["hidden"] },
|
|
{ className: "dtr-control", orderable: false, targets: -1 },
|
|
],
|
|
language: {
|
|
search: "_INPUT_",
|
|
searchPlaceholder: _("Search"),
|
|
},
|
|
responsive: {
|
|
details: {
|
|
display: responsive_display,
|
|
type: "column",
|
|
target: -1,
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
$('a[data-bs-toggle="tab"]').on("shown.bs.tab", function (event) {
|
|
dTables.DataTable().responsive.recalc();
|
|
});
|
|
|
|
$("#logout_form").on("click", function (e) {
|
|
e.preventDefault(e);
|
|
clearTimeout(mainTimeout);
|
|
if (prefs.SelfCheckReceiptPrompt) {
|
|
confirmModal("", _("Would you like to print a receipt?"), _("Print receipt and end session"), _("End session"), function (result) {
|
|
if (result) {
|
|
var win = window.open("/cgi-bin/koha/sco/printslip.pl?print=qslip");
|
|
location.href = "/cgi-bin/koha/sco/sco-main.pl?op=logout";
|
|
} else {
|
|
location.href = "/cgi-bin/koha/sco/sco-main.pl?op=logout";
|
|
}
|
|
});
|
|
} else {
|
|
location.href = "/cgi-bin/koha/sco/sco-main.pl?op=logout";
|
|
}
|
|
|
|
return true;
|
|
});
|
|
|
|
$("#scan_form").on("submit", function () {
|
|
return checkout_confirm(logged_in_user_cardnumber);
|
|
});
|
|
});
|
|
</script>
|
|
[% Asset.js("js/holds.js") | $raw %]
|
|
[% IF ( Koha.Preference('SCOUserJS') ) %]
|
|
<script nonce="[% Koha.CSPNonce | $raw %]">
|
|
[% Koha.Preference('SCOUserJS') | $raw %]
|
|
</script>
|
|
[% END %]
|
|
[% END %]
|
|
|
|
[% BLOCK display_errors %]
|
|
[% FOREACH item IN impossible %]
|
|
<!-- We tried to issue, but failed. -->
|
|
<div class="alert alert-warning">
|
|
<span class="sco-alert-warning noissue"></span>
|
|
<h2>Item cannot be checked out.</h2>
|
|
<p>Sorry, this item cannot be checked out at this station.</p>
|
|
[% IF ( item.title ) %]
|
|
<p>Title: <em>[% item.title | html %]</em> </p>
|
|
[% END %]
|
|
|
|
<p>
|
|
[% IF ( item.circ_error_UNKNOWN_BARCODE ) %]
|
|
<span id="ce_unknown_barcode">The system does not recognize this barcode.</span>
|
|
[% ELSIF ( item.circ_error_max_loans_allowed ) %]
|
|
<span id="ce_max_loans_allowed">You have reached the maximum limit of items checked out.</span>
|
|
[% ELSIF ( item.circ_error_ISSUED_TO_ANOTHER ) %]
|
|
<span id="ce_issued_to_another">This item is checked out to someone else.</span>
|
|
[% ELSIF ( item.circ_error_NO_MORE_RENEWALS ) %]
|
|
<span id="ce_no_more_renewals">You cannot renew this item again.</span>
|
|
[% ELSIF ( item.circ_error_NOT_FOR_LOAN ) %]
|
|
<span id="ce_not_for_loan">This item is not for loan.</span>
|
|
[% ELSIF ( item.circ_error_DEBT ) %]
|
|
<span id="ce_too_much_debt">You owe the library [% item.DEBT | $Price with_symbol => 1 %] and cannot check out.</span>
|
|
[% ELSIF ( item.circ_error_WTHDRAWN ) %]
|
|
<span id="ce_wthdrawn">This item has been withdrawn from the collection.</span>
|
|
[% ELSIF ( item.circ_error_RESTRICTED ) %]
|
|
<span id="ce_restricted">This item is restricted.</span>
|
|
[% ELSIF ( item.circ_error_RESERVED ) %]
|
|
<span id="ce_reserved">This item is on hold for another patron.</span>
|
|
[% ELSIF ( item.circ_error_ITEMNOTSAMEBRANCH ) %]
|
|
<span id="ce_itemnotsamebranch">This item belongs to another library.</span>
|
|
[% ELSIF ( item.circ_error_EXPIRED ) %]
|
|
<span id="ce_expired">Your account has expired.</span>
|
|
[% ELSIF ( item.circ_error_DEBARRED ) %]
|
|
<span id="ce_debarred">Your account has been suspended.</span>
|
|
[% ELSIF ( item.circ_error_CARD_LOST ) %]
|
|
<span id="ce_card_lost">This library card has been declared lost.</span>
|
|
[% ELSIF ( item.circ_error_GNA ) %]
|
|
<span id="ce_gna">Your contact information seems to be incomplete.</span>
|
|
[% ELSIF ( item.circ_error_INVALID_DATE ) %]
|
|
<span id="ce_invalid_date">Due date is not valid.</span>
|
|
[% ELSIF ( item.circ_error_ADDITIONAL_MATERIALS ) %]
|
|
<span id="ce_addtional_materials">Item must be checked out at a circulation desk.</span>
|
|
[% END %]
|
|
<span id="ce_see_staff">Please see a member of the library staff.</span>
|
|
</p>
|
|
|
|
[% IF ( item.returnitem && Koha.Preference('SCOAllowCheckin') ) %]
|
|
<form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
|
|
[% INCLUDE 'csrf-token.inc' %]
|
|
<legend class="sr-only">Return</legend>
|
|
<input type="hidden" name="op" value="cud-returnbook" />
|
|
<input type="hidden" name="patronid" value="[% patronid | html %]" />
|
|
<input type="hidden" name="barcode" value="[% item.barcode | html %]" />
|
|
<input type="hidden" name="load_checkouts" value="[% load_checkouts | html %]" />
|
|
<input type="hidden" name="newissues" value="[% newissues | html %]" />
|
|
<button type="submit" name="returnbook" class="btn btn-primary"><i class="fa fa-undo" aria-hidden="true"></i> Return this item</button>
|
|
</form>
|
|
[% END %]
|
|
|
|
<form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="get">
|
|
<legend class="sr-only">Error</legend>
|
|
<input type="hidden" name="op" value="" />
|
|
<input type="hidden" name="patronid" value="[% patronid | html %]" />
|
|
<input type="hidden" name="barcode" value="[% item.barcode | html %]" />
|
|
<input type="hidden" name="load_checkouts" value="[% load_checkouts | html %]" />
|
|
<input type="hidden" name="newissues" value="[% newissues | html %]" />
|
|
<input type="submit" name="confirm" value="Return to account summary" class="btn btn-info back focus" />
|
|
</form>
|
|
</div>
|
|
<!-- / .alert -->
|
|
[% END # / FOREACH impossible %]
|
|
|
|
[% FOREACH c IN confirm %]
|
|
<!-- We need to confirm the issue.. -->
|
|
<div class="alert alert-warning"
|
|
><h2>Please confirm the checkout:</h2>
|
|
<span class="sco-alert-warning confirm"></span>
|
|
[% IF ( c.confirm_renew_issue ) %]
|
|
<p>This item is already checked out to you: <b>[% c.confirm | html %]</b> <i>([% c.barcode | html %])</i></p>
|
|
[% END %]
|
|
|
|
[% IF ( c.renew && Koha.Preference('SCOAllowCheckin') ) %]
|
|
<form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
|
|
[% INCLUDE 'csrf-token.inc' %]
|
|
<legend class="sr-only">Return</legend>
|
|
<input type="hidden" name="op" value="cud-returnbook" />
|
|
<input type="hidden" name="patronid" value="[% patronid | html %]" />
|
|
<input type="hidden" name="barcode" value="[% c.barcode | html %]" />
|
|
<input type="hidden" name="load_checkouts" value="[% load_checkouts | html %]" />
|
|
<input type="hidden" name="confirmed" value="" />
|
|
<input type="hidden" name="newissues" value="[% newissues | html %]" />
|
|
<button type="submit" name="returnbook" class="btn btn-primary"><i class="fa fa-undo" aria-hidden="true"></i> Return this item</button>
|
|
</form>
|
|
[% END %]
|
|
|
|
[% UNLESS ( c.renew ) %]
|
|
<form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
|
|
[% INCLUDE 'csrf-token.inc' %]
|
|
<legend class="sr-only">Renew</legend>
|
|
<input type="hidden" name="op" value="cud-renew" />
|
|
<input type="hidden" name="patronid" value="[% patronid | html %]" />
|
|
<input type="hidden" name="barcode" value="[% c.barcode | html %]" />
|
|
<input type="hidden" name="load_checkouts" value="[% load_checkouts | html %]" />
|
|
<input type="hidden" name="confirmed" value="1" />
|
|
<input type="hidden" name="newissues" value="[% newissues | html %]" />
|
|
<button type="submit" name="confirm" class="btn btn-primary"><i class="fa-solid fa-rotate" aria-hidden="true"></i> Renew item</button>
|
|
</form>
|
|
[% ELSE %]
|
|
<form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
|
|
[% INCLUDE 'csrf-token.inc' %]
|
|
<legend class="sr-only">Renew</legend>
|
|
<input type="hidden" name="op" value="cud-renew" />
|
|
<input type="hidden" name="patronid" value="[% patronid | html %]" />
|
|
<input type="hidden" name="barcode" value="[% c.barcode | html %]" />
|
|
<input type="hidden" name="load_checkouts" value="[% load_checkouts | html %]" />
|
|
<input type="hidden" name="confirmed" value="1" />
|
|
<input type="hidden" name="newissues" value="[% newissues | html %]" />
|
|
<button type="submit" class="btn btn-primary"><i class="fa-solid fa-rotate" aria-hidden="true"></i> Renew item</button>
|
|
</form>
|
|
[% END %]
|
|
|
|
<form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="get">
|
|
<legend class="sr-only">Cancel</legend>
|
|
<input type="hidden" name="op" value="" />
|
|
<input type="hidden" name="patronid" value="[% patronid | html %]" />
|
|
<input type="hidden" name="load_checkouts" value="[% load_checkouts | html %]" />
|
|
<input type="hidden" name="newissues" value="[% newissues | html %]" />
|
|
<button type="submit" class="btn btn-primary"><i class="fa fa-cancel" aria-hidden="true"></i> Cancel</button>
|
|
</form>
|
|
</div>
|
|
[% END # / FOREACH confirm %]
|
|
|
|
[% IF ( nopermission ) %]
|
|
<!-- This is what is displayed if user doesn't have permission -->
|
|
<div class="alert alert-warning">
|
|
<span class="sco-alert-warning nopermission"></span>
|
|
<h2>Access denied</h2>
|
|
<p>Sorry, this self-checkout station has lost authentication. Please contact the administrator to resolve this problem.</p>
|
|
</div>
|
|
[% END %]
|
|
|
|
[% IF ( different_ip ) %]
|
|
<!-- This is what is displayed if user doesn't have permission -->
|
|
<div class="alert alert-warning">
|
|
<span class="sco-alert-warning sessionlost"></span>
|
|
<h2>Session lost</h2>
|
|
<p>You are accessing self-checkout from a different IP address! please log in again.</p>
|
|
</div>
|
|
[% END %]
|
|
|
|
[% IF ( invalid_username_or_password ) %]
|
|
<!-- This is what is displayed if user doesn't have permission -->
|
|
<div class="alert alert-warning">
|
|
<span class="sco-alert-warning notfound"></span>
|
|
<h2>Record not found</h2>
|
|
<p>Your userid was not found in the database. Please try again.</p>
|
|
</div>
|
|
[% END %]
|
|
|
|
[% IF ( issued ) %]
|
|
[% IF batch_checkouts_allowed %]
|
|
[% FOREACH barcode IN newissues.split(',') %]
|
|
<span class="sco-alert-success issue"></span>
|
|
<div class="alert alert-info">
|
|
<p>Item checked out <i>([% barcode | html %])</i></p>
|
|
</div>
|
|
[% END %]
|
|
[% ELSE %]
|
|
<span class="sco-alert-success issue"></span>
|
|
<div class="alert alert-info">
|
|
<p>Item checked out <i>([% newissues.split(',').last | html %])</i></p>
|
|
</div>
|
|
[% END %]
|
|
[% ELSIF ( renewed ) %]
|
|
<span class="sco-alert-success renew"></span>
|
|
<div class="alert alert-info">
|
|
<p>Item renewed <i>([% barcode | html %])</i></p>
|
|
</div>
|
|
[% ELSIF ( renewed == 0) %]
|
|
<span class="sco-alert-warning renew"></span>
|
|
<div class="alert alert-info">
|
|
<p>Item not renewed</p>
|
|
</div>
|
|
[% ELSIF ( returned == 0 ) %]
|
|
<span class="sco-alert-warning return"></span>
|
|
<div class="alert alert-info">
|
|
<p>Item not checked in: please see circulation staff for assistance</p>
|
|
</div>
|
|
[% ELSIF ( returned == 1 ) %]
|
|
<span class="sco-alert-success return"></span>
|
|
<div class="alert alert-info">
|
|
<p>Item checked in <i>([% barcode | html %])</i></p>
|
|
</div>
|
|
[% END %]
|
|
[% END %]
|
|
</div>
|