var allowPendingAddr = false;
var myopacEnableRefWorks = false;
var myopacRefWorksHost = 'http://www.refworks.com';
-var paymentForm = new PaymentForm();
function clearNodes( node, keepArray ) {
balance = _finesFormatNumber(summary.balance_owed());
var req = new Request(FETCH_TRANSACTIONS, G.user.session, G.user.id() );
- req.callback(function(r) { myOPACShowTransactions(r, balance); });
+ req.callback(myOPACShowTransactions);
req.send();
}
$('myopac_fines_summary_total').appendChild(text(total));
$('myopac_fines_summary_paid').appendChild(text(paid));
- $("myopac_fines_summary_balance").appendChild(text(balance));
-
-}
-
-function preparePaymentForm(balance, transactions) {
- if (Number(balance) > 0) {
- var cxl_link = $("myopac_fines_payment_cancel_link");
- var pay_link = $("myopac_fines_payment_link");
-
- cxl_link.onclick = function() {
- hideMe(cxl_link);
- unHideMe(pay_link);
- unHideMe($("myopac_circ_trans_div"));
- $("myopac_payment_div").innerHTML = "";
- };
- pay_link.onclick = function() {
- dojo.xhrGet({
- "url": "/eg/circ/selfcheck/payment",
- "load": function(resp) {
- hideMe($("myopac_circ_trans_div"));
- $("myopac_payment_div").innerHTML = resp;
- dojo.parser.parse($("myopac_payment_div"));
- paymentForm.drawPayFinesPage(
- G.user, balance, dojo.map(
- transactions, function(t) {
- return [t.id(), Number(t.balance_owed()).toFixed(2)];
- }
- ),
- function() { alert("Payment registered"); /* LFW XXX */ }
- );
- hideMe(pay_link);
- unHideMe(cxl_link);
- },
- "error": function(e) {
- alert("Error preparing payment form: " + e); // XXX i18n; user-friendliness
- }
- });
- };
- unHideMe($("myopac_fines_payment"));
- }
+ $('myopac_fines_summary_balance').appendChild(text(balance));
}
function _finesFormatNumber(num) {
return d.iso8601Format('YMDHM',null,true,true);
}
-function myOPACShowTransactions(r, balance) {
+function myOPACShowTransactions(r) {
if(myopacGenericTransTemplate || myopacCircTransTemplate) return;
var transactions = r.getResultObject();
- var payment_xacts = [];
for( var idx in transactions ) {
else if(trans.xact_type() == 'grocery' )
myopacShowGenericTransaction( trans );
- payment_xacts.push(trans);
-
/* XXX need to copy circulation output function here
else if(trans.xact_type() == 'reservation' )
myopacShowReservationTransaction( trans );
*/
}
-
- preparePaymentForm(balance, payment_xacts);
}
var myopacGenericTransTemplate;
<script type="text/javascript" src='/js/dojo/dojo/dojo.js'></script>
<script type="text/javascript" src='/js/dojo/dojo/openils_dojo.js'></script>
- <script type="text/javascript" src='/js/dojo/opensrf/opensrf.js'></script>
- <script type="text/javascript" src="/js/ui/default/circ/selfcheck/payment.js"></script>
+ <script type="text/javascript" src='/js/dojo/opensrf/opensrf.js'></script>
<script language="javascript" type="text/javascript">
dojo.addOnLoad(init);
dojo.require("dijit._Calendar");
dojo.require("dijit.form.DateTextBox");
- dojo.require("dijit.form.NumberSpinner");
- dojo.require("dijit.form.CheckBox");
- dojo.require("dijit.form.TextBox");
dojo.require("dijit.form.FilteringSelect");
dojo.require("dojo.date.locale");
dojo.require("dojo.date.stamp");
dojo.require("dojo.parser");
dojo.require("openils.I18N");
- dojo.require("openils.Util");
</script>
<tr id='myopac_fines_summary_row' class='hide_me'>
<td id='myopac_fines_summary_total' >&common.currency;</td>
<td id='myopac_fines_summary_paid' >&common.currency;</td>
- <td style="color:red;font-weight: bold;">
- &common.currency;<span
- id="myopac_fines_summary_balance"></span>
- <span class="hide_me" id="myopac_fines_payment">
- [ <a id="myopac_fines_payment_link" href="javascript:void(0);">Pay this online</a>
- <a id="myopac_fines_payment_cancel_link" href="javascript:void(0);" class="hide_me">Cancel payment</a> ]
- </span>
- </td>
+ <td id='myopac_fines_summary_balance' style='color:red;font-weight: bold;'>&common.currency;</td>
</tr>
</tbody>
</table>
</div>
-->
- <div id="myopac_payment_div"></div>
<!-- Table for circulation transactions only -->
<div id='myopac_circ_trans_div' class='hide_me'>