Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt
Owen Leonard 1d6e4be845 Bug 29482: Replace the term branch with library
This patch replaces the word "branch" with the word "library" in the
self-checkout template, as per terminology guidelines.

To test, apply the patch and go to Administration -> System preferences.

- Set the "IndependentBranches" preference to "Yes."
- Log into the self checkout system using a staff user with permission
  to do self-checkout but not superlibrarian status.
- Try to check out an item which belongs to a library that's different
  to the one you're logged in with.
- You should see a message, "Item cannot be checked out," including the
  text "This item belongs to another library."

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-31 21:55:40 -10:00

536 lines
34 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE Koha %]
[% USE KohaDates %]
[% USE AudioAlerts %]
[% USE To %]
[% USE Price %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Self checkout &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha [% END %]</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/font-awesome/css/font-awesome.min.css") | $raw %]
[% IF ( bidi ) %]
[% Asset.css("lib/jquery/jquery-ui-rtl-1.12.1.min.css") | $raw %]
[% Asset.css("css/sco-rtl.css") | $raw %]
[% ELSE %]
[% Asset.css("lib/jquery/jquery-ui-1.12.1.css") | $raw %]
[% Asset.css("css/sco.css") | $raw %]
[% END %]
[% IF ( Koha.Preference('OPACUserCSS') ) %]<style>[% Koha.Preference('OPACUserCSS') | $raw %]</style>[% END %]
[% IF ( Koha.Preference('SCOUserCSS') ) %]<style>[% Koha.Preference('SCOUserCSS') | $raw %]</style>[% END %]
<script>
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("lib/modernizr.min.js") | $raw %]
</head>
<body id="sco_main" class="sco" onload="dofocus();" onunload="mungeHistory();">
[% INCLUDE 'masthead-sco.inc' %]
<div class="main">
<div class="container-fluid">
<div class="row">
[% IF ( display_patron_image ) %]
<div class="col-10 order-first order-md-first order-lg-2">
[% ELSE %]
<div class="col order-first order-md-first order-lg-2">
[% END %]
<div id="masthead"><h1>[% LibraryName | html %] Self checkout system</h1></div>
[% IF ( 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 ( title ) %]
<p>Title: <em>[% title | html %]</em> </p>
[% END %]
<p>
[% IF ( circ_error_UNKNOWN_BARCODE ) %]
<span id="ce_unknown_barcode">The system does not recognize this barcode.</span>
[% ELSIF ( circ_error_max_loans_allowed ) %]
<span id="ce_max_loans_allowed">You have checked out too many items and can't check out any more.</span>
[% ELSIF ( circ_error_ISSUED_TO_ANOTHER ) %]
<span id="ce_issued_to_another">This item is checked out to someone else.</span>
[% ELSIF ( circ_error_NO_MORE_RENEWALS ) %]
<span id="ce_no_more_renewals">You cannot renew this item again.</span>
[% ELSIF ( circ_error_NOT_FOR_LOAN ) %]
<span id="ce_not_for_loan">This item is not for loan.</span>
[% ELSIF ( circ_error_DEBT ) %]
<span id="ce_too_much_debt">You owe the library [% DEBT | $Price %] and cannot check out.</span>
[% ELSIF ( circ_error_WTHDRAWN ) %]
<span id="ce_wthdrawn">This item has been withdrawn from the collection.</span>
[% ELSIF ( circ_error_RESTRICTED ) %]
<span id="ce_restricted">This item is restricted.</span>
[% ELSIF ( circ_error_RESERVED ) %]
<span id="ce_reserved">This item is on hold for another patron.</span>
[% ELSIF ( circ_error_ITEMNOTSAMEBRANCH ) %]
<span id="ce_itemnotsamebranch">This item belongs to another library.</span>
[% ELSIF ( circ_error_EXPIRED ) %]
<span id="ce_expired">Your account has expired.</span>
[% ELSIF ( circ_error_DEBARRED ) %]
<span id="ce_debarred">Your account has been suspended.</span>
[% ELSIF ( circ_error_CARD_LOST ) %]
<span id="ce_card_lost">This library card has been declared lost.</span>
[% ELSIF ( circ_error_GNA ) %]
<span id="ce_gna">Your contact information seems to be incomplete.</span>
[% ELSIF ( circ_error_INVALID_DATE ) %]
<span id="ce_invalid_date">Due date is not valid.</span>
[% ELSIF ( 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 ( returnitem && Koha.Preference('SCOAllowCheckin') ) %]
<form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
<legend class="sr-only">Return</legend>
<input type="hidden" name="op" value="returnbook" />
<input type="hidden" name="patronid" value="[% patronid | html %]" />
<input type="hidden" name="barcode" value="[% barcode | 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="post">
<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="[% barcode | 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 # / IF ( impossible %]
[% IF ( 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 ( confirm_renew_issue ) %]
<p>This item is already checked out to you.</p>
[% END %]
[% IF ( renew && Koha.Preference('SCOAllowCheckin') ) %]
<form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
<legend class="sr-only">Return</legend>
<input type="hidden" name="op" value="returnbook" />
<input type="hidden" name="patronid" value="[% patronid | html %]" />
<input type="hidden" name="barcode" value="[% barcode | 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 ( renew ) %]
<form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
<legend class="sr-only">Renew</legend>
<input type="hidden" name="op" value="renew" />
<input type="hidden" name="patronid" value="[% patronid | html %]" />
<input type="hidden" name="barcode" value="[% barcode | 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 fa-refresh" aria-hidden="true"></i> Renew item</button>
</form>
[% ELSE %]
<form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
<legend class="sr-only">Renew</legend>
<input type="hidden" name="op" value="renew" />
<input type="hidden" name="patronid" value="[% patronid | html %]" />
<input type="hidden" name="barcode" value="[% barcode | 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 fa-refresh" aria-hidden="true"></i> Renew item</button>
</form>
[% END %]
<form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
<legend class="sr-only">Cancel</legend>
<input type="hidden" name="op" value="" />
<input type="hidden" name="patronid" value="[% patronid | 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 # / IF 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 ) %]
<span class="sco-alert-success issue"></span>
<div class="alert alert-info">
<p>Item checked out</p>
</div>
[% ELSIF ( renewed ) %]
<span class="sco-alert-success renew"></span>
<div class="alert alert-info">
<p>Item 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</p>
</div>
[% END %]
[% UNLESS ( hide_main ) %]
[% IF ( patronid ) %]
[% IF ( validuser ) %]
<div class="alert alert-info">You are logged in as [% borrowername | html %].</div>
[% INCLUDE 'opac-note.inc' %]
[% IF patron_has_hold_fee %]
<div class="alert alert-warning">A hold fee was charged to your account for collecting this item.</div>
[% END %]
[% END %]
[% IF ( nouser ) %]
<div class="alert alert-warning">
<h3>Sorry</h3>
<p>The userid <strong>[% patronid | html %]</strong> was not found in the database. Please try again.</p>
</div>
[% END %]
[% END # / IF patronid %]
[% IF ( validuser ) %]
<div id="newcheckout" class="sco_entry">
<form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sco/sco-main.pl" onsubmit="return checkout_confirm('[% patronid | html %]');">
<legend><h2>
[% IF ( Koha.Preference('SCOAllowCheckin') ) %]
Check out, return, or renew an item:
[% ELSE %]
Check out or renew an item:
[% END %]
</h2></legend>
<div class="row">
<div class="col">
<label for="barcode">Scan a new item or enter its barcode:</label>
</div>
<div class="col-3">
<input id="barcode" name="barcode" size="20" type="text" class="focus form-control" autocomplete="off" />
</div>
<div class="col-auto">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
<div class="col ml-auto">
<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="checkout" />
<input type="hidden" name="patronid" value="[% patronid | 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?borrowernumber=[% borrowernumber | uri %]&csrf_token=[% csrf_token | uri %]" 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">
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active" href="#checkouts-tab" id="checkouts" aria-controls="home" aria-selected="true" data-toggle="tab">Checkouts ([% issues_count | html %])</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" href="#holds-tab" id="holds" aria-controls="home" aria-selected="false" data-toggle="tab">
[% IF waiting_holds_count %]
<i class="fa fa-exclamation" aria-hidden="true"></i>
[% END %]
Holds ([% HOLDS.count | html %])
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" href="#account-tab" id="account" aria-controls="home" aria-selected="false" data-toggle="tab">Charges ([% total | $Price %])</a>
</li>
</ul>
<div class="tab-content">
<div id="checkouts-tab" class="tab-pane show active" aria-labelledby="checkouts">
<div id="borrowerdetails">
[% IF ( issues_count ) %]
<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="anti-the">Title</th>
<th>Call number</th>
<th>Due</th>
<th class="nosort">Renew</th>
[% UNLESS ( nofines ) %]
<th>Fines</th>
[% END %]
</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="label label-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">
<legend class="sr-only">Issue renews</legend>
<input type="hidden" name="patronid" value="[% patronid | 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="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 == 'auto_renew' OR ISSUE.renew_error == 'auto_too_soon' %]
<span>This item has been scheduled for automatic renewal and cannot be renewed</span>
[% ELSIF 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>
[% ELSE %]
<span>No renewals allowed</span>
[% END %]
[% IF Koha.Preference('SCOAllowCheckin') %]
<input type="submit" value="Check in item" name="confirm" class="btn btn-info btn-sm return" />
<input type="hidden" name="op" value="returnbook" />
<input type="hidden" name="confirmed" value="" />
[% END %]
[% END %]
</form>
</td>
[% UNLESS ( nofines ) %]
<td>
[% IF ( ISSUE.charges ) %]Yes[% ELSE %]No[% END %]
</td>
[% END %]
</tr>
[% END # / FOREACH ISSUE %]
</tbody>
</table>
[% ELSE %]
<h3>You currently have nothing checked out.</h3>
[% END # / IF issues_count %]
</div> <!-- / #borrowerdetails -->
</div>
<div id="holds-tab" class="tab-pane" role="tabpanel" aria-labelledby="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 %]
</div>
<div id="account-tab" class="tab-pane" role="tabpanel" aria-labelledby="account">
[% PROCESS 'account-table.inc' %]
</div>
</div>
[% ELSE # IF validuser %]
<div class="sco_entry" >
<form id="mainform" action="/cgi-bin/koha/sco/sco-main.pl" name="mainform" method="post">
<fieldset>
[% IF ( Koha.Preference('SelfCheckoutByLogin') ) %]
<legend>Log in to your account</legend>
<label for="patronlogin">Login:</label>
<input type="text" id="patronlogin" class="focus noEnterSubmit" size="20" name="patronlogin" />
<label for="patronpw">Password:</label>
<input type="password" id="patronpw" size="20" name="patronpw" />
<fieldset class="action">
<button type="submit" class="btn btn-primary">Log in</button>
</fieldset>
[% ELSE %]
<div class="form-row">
<div class="col-auto">
<label for="patronid">Please enter your card number:</label>
</div>
<div class="col-3">
<input type="text" id="patronid" class="form-control focus" size="20" name="patronid" autocomplete="off" />
</div>
<div class="col-auto">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div> <!-- /.form-row -->
[% END %]
[% FOREACH INPUT IN INPUTS %]
<input type="hidden" name="[% INPUT.name | html %]" value="[% INPUT.value | html %]">
[% END %]
<input type="hidden" name="op" value="login" />
</fieldset>
</form>
</div> <!-- / .sco_entry -->
[% END # / IF validuser %]
[% END # / UNLESS ( hide_main %]
[% IF ( Koha.Preference('SCOMainUserBlock' ) ) %]<div id="scomainuserblock">[% Koha.Preference('SCOMainUserBlock' ) | $raw %]</div>[% END %]
</div> <!-- / .span12 -->
</div> <!-- / .row -->
</div> <!-- / .container-fluid -->
</div> <!-- / .main -->
<span id="audio-alert"></span>
[% INCLUDE 'opac-bottom.inc' %]
[% BLOCK jsinclude %]
[% INCLUDE 'datatables.inc' %]
<script>
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';
}, [% SelfCheckTimeout | html %]);
}
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;
}
[% IF Koha.Preference('AudioAlerts') %]
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 ) ) {
document.getElementById("audio-alert").innerHTML = '<audio src="' + sound + '" autoplay="autoplay" autobuffer="autobuffer"></audio>';
}
}
[% END %]
$(document).ready(function() {
dofocus();
[% IF ( patronid ) %]sco_init();[% END %]
$("#loanTable").dataTable($.extend(true, {}, dataTablesDefaults, {
"dom": "t",
"order": [ 0 ],
"columnDefs": [
{ "targets": [ "nosort" ], "sortable": false, "searchable": false },
{ "targets": [ "noshow" ], "visible": false, "searchable": false },
{ "type": "anti-the", "targets" : [ "anti-the" ] }
]
}));
$("#logout_form").on("click", function(e){
e.preventDefault(e);
clearTimeout(mainTimeout);
[% IF Koha.Preference('SelfCheckReceiptPrompt') %]
var confirmStart = Date.now();
confirmModal("", _("Would you like to print a receipt?"), _("Print receipt and end session"), _("End session"), function(result) {
if ( result && (Date.now() - confirmStart) < [% SelfCheckTimeout | html %] ) {
var win = window.open("/cgi-bin/koha/sco/printslip.pl?borrowernumber=[% borrowernumber | html %]&amp;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';
[% END %]
return true;
});
});
</script>
[% IF ( Koha.Preference('SCOUserJS') ) %]<script>[% Koha.Preference('SCOUserJS') | $raw %]</script>[% END %]
[% END %]