Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt
Martin Renvoize 5cad2946ae Bug 22521: Update UI to use accountlines.status
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-17 16:49:36 +00:00

122 lines
5 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE Koha %]
[% USE KohaDates %]
[% USE AuthorisedValues %]
[% USE Price %]
[% SET ENABLE_OPAC_PAYMENTS = Koha.Preference('EnablePayPalOpacPayments') || plugins %]
[% SET DISPLAY_PAYMENT_BLOCK = 0 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your fines and charges</title>
[% INCLUDE 'doc-head-close.inc' %]
[% BLOCK cssinclude %]
[% Asset.css("css/datatables.css") | $raw %]
[% END %]
</head>
[% INCLUDE 'bodytag.inc' bodyid='opac-account' bodyclass='scrollto' %]
[% INCLUDE 'masthead.inc' %]
<div class="main">
<ul class="breadcrumb">
<li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
<li>[% IF logged_in_user %]<a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>[% END %] <span class="divider">&rsaquo;</span></li>
<li><a href="#">Your fines and charges</a></li>
</ul>
<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
<div id="navigation">
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div>
</div>
<div class="span10">
<div id="useraccount" class="maincontent">
[% IF message %]
<div class="alert alert-info">
[% IF message == 'valid_payment' %]
<p>Your payment of $[% message_value | html %] has been processed successfully!</p>
[% ELSIF message == 'duplicate_payment' %]
<p>A payment with the transaction id '[% message_value | html %]' has already been posted to an account.</p>
<p>Please contact a librarian for details.</p>
[% ELSIF message == 'invalid_payment' %]
<p>The transaction id '[% message_value | html %]' for this payment is invalid.</p>
<p>Please contact a librarian for details.</p>
[% END %]
</div>
[% END %]
[% IF payment_error %]
<div id="error" class="dialog alert">
<p><strong>Error:</strong> there was a problem processing your payment</p>
[% IF payment_error == "PAYPAL_UNABLE_TO_CONNECT" %]
<p>Unable to connect to PayPal.</p>
<p>Please contact a librarian to verify your payment.</p>
[% ELSIF payment_error == "PAYPAL_ERROR_PROCESSING" %]
<p>Unable to verify payment.</p>
<p>Please contact a librarian to verify your payment.</p>
[% END %]
</div>
[% ELSIF payment %]
<div class="alert alert-info">
<p><strong>Payment applied:</strong> your payment of [% payment | html %] has been applied to your account</p>
</div>
[% END %]
[% PROCESS 'account-table.inc' ACCOUNT_LINES = ACCOUNT_LINES, ENABLE_OPAC_PAYMENTS = ENABLE_OPAC_PAYMENTS, plugins = plugins %]
</div> <!-- / #useraccount -->
</div> <!-- / .span10 -->
</div> <!-- / .row-fluid -->
</div> <!-- / .container-fluid -->
</div> <!-- / .main -->
[% INCLUDE 'opac-bottom.inc' %]
[% BLOCK jsinclude %]
[% INCLUDE 'datatables.inc' %]
<script>
$( document ).ready(function() {
$("#finestable").dataTable($.extend(true, {}, dataTablesDefaults, {
"columnDefs": [
{ "type": "title-string", "targets" : [ "title-string" ] }
],
"order": [[ 0, "desc" ]]
} ));
$(".paypal").on("click", function() {
window.open('https://www.paypal.com/webapps/mpp/paypal-popup','WIPaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=1060, height=700');
return false;
});
$(".pay-online").removeClass("hidden");
$("#amount-to-pay-label").hide();
$(".checkbox-pay").change( function() {
// Disable the pay button if no fees are selected
$("#submit-pay").prop("disabled", ! $(".checkbox-pay:checked").length );
// Calculate the total amount to be paid based on selected fees
var total = 0;
$(".checkbox-pay").each( function() {
if ( $(this).is(":checked") ) {
var id = this.id.split("checkbox-pay-")[1];
total += parseFloat( $("#amount-" + id).val() );
}
});
if ( total ) {
$("#amount-to-pay").html( total.toFixed(2) );
$("#amount-to-pay-label").show();
} else {
$("#amount-to-pay-label").hide();
}
});
});
</script>
[% END %]