[GIT] Evergreen ILS branch main updated. cb22f90f2894128eab8a38886e927a96ef2b5c15

This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Evergreen ILS". The branch, main has been updated via cb22f90f2894128eab8a38886e927a96ef2b5c15 (commit) via 78365c1bd9d8f380824b2553ecd282c8f840aecd (commit) from 6f076e7192aae7496ed9394ac95c529ad8b71602 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit cb22f90f2894128eab8a38886e927a96ef2b5c15 Author: Michele Morgan <mmorgan@noblenet.org> Date: Tue Mar 25 14:42:28 2025 -0400 LP#2080899: BOOPAC: Disable Submit Payment Button when no amount selected Signed-off-by: Michele Morgan <mmorgan@noblenet.org> Signed-off-by: Llewellyn Marshall <llewellyn.marshall@dncr.nc.gov> Signed-off-by: Jane Sandberg <js7389@princeton.edu> diff --git a/Open-ILS/src/templates-bootstrap/opac/myopac/charges.tt2 b/Open-ILS/src/templates-bootstrap/opac/myopac/charges.tt2 index afc428d74a..03716f5766 100755 --- a/Open-ILS/src/templates-bootstrap/opac/myopac/charges.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/myopac/charges.tt2 @@ -244,6 +244,7 @@ $( document ).ready(function() { }); $("#total").val(amount); $("#selectPay").html('<i class="fas fa-money-bill-wave" aria-hidden="true"></i> [% l('Pay Selected Charges') %] - $' + amount.toFixed(2)); + $("#selectPay").prop('disabled', (amount == 0)); }); }); commit 78365c1bd9d8f380824b2553ecd282c8f840aecd Author: Michele Morgan <mmorgan@noblenet.org> Date: Mon Sep 16 17:08:32 2024 -0400 lp2080899 Prevent payment when no charges selected Adds code to disable the Submit Payment button if no checkboxes are selected. Release-note: Disables the Pay Selected Charges button when none are selected. Co-authored-by: Christine Morgan <cmorgan@noblenet.org> Signed-off-by: Michele Morgan <mmorgan@noblenet.org> Signed-off-by: Llewellyn Marshall <llewellyn.marshall@dncr.nc.gov> Signed-off-by: Jane Sandberg <js7389@princeton.edu> diff --git a/Open-ILS/src/templates/opac/myopac/main.tt2 b/Open-ILS/src/templates/opac/myopac/main.tt2 index ddf26ae5db..5d7b9d4289 100644 --- a/Open-ILS/src/templates/opac/myopac/main.tt2 +++ b/Open-ILS/src/templates/opac/myopac/main.tt2 @@ -47,6 +47,7 @@ <th nowrap="nowrap" style="white-space:nowrap;"> <input id="pay_fines_box1" checked="checked" type="checkbox" onclick="select_all_checkboxes('xact', this.checked)" + onchange=canSubmitPayment(event) title="[% l('Click to (un)select all charges') %]" /> </th> [% END %] @@ -73,7 +74,7 @@ <tr id='myopac_circ_trans_row'> [% IF myopac_cc_allowed %] <td> - <input type="checkbox" checked="checked" + <input type="checkbox" checked="checked" onchange=canSubmitPayment(event) title="[% l('Pay this fine') %]" name="xact" value="[% f.xact.id %]" /> </td> @@ -159,6 +160,7 @@ <th nowrap="nowrap" style="white-space:nowrap;"> <input id="pay_fines_box2" checked="checked" type="checkbox" onclick="select_all_checkboxes('xact_misc', this.checked)" + onchange=canSubmitPayment(event) title="[% l('Click to (un)select all fines') %]" /> </th> [% END %] @@ -177,7 +179,7 @@ [% IF myopac_cc_allowed %] <td > <input type="checkbox" title='[% l("Pay this fine") %]' - name="xact_misc" value="[% f.xact.id %]" + name="xact_misc" value="[% f.xact.id %]" onchange=canSubmitPayment(event) checked="checked" /> </td> [% END %] diff --git a/Open-ILS/web/js/ui/default/opac/simple.js b/Open-ILS/web/js/ui/default/opac/simple.js index 991971b509..b31abb14ba 100644 --- a/Open-ILS/web/js/ui/default/opac/simple.js +++ b/Open-ILS/web/js/ui/default/opac/simple.js @@ -361,4 +361,22 @@ function displayAlert(elementID) { el.classList.remove('d-none'); // fade out after 8 seconds setTimeout(() => {document.getElementById(elementID).classList.add('d-none')}, 8000); -} \ No newline at end of file +} + +function canSubmitPayment(evt){ + // check that charges are selected in opac for payment + // enable the submit payment button if they are + var form = document.getElementById('selected_fines'); + var submit = form.querySelector('input[type="submit"]'); + if (!form || !submit) return; + var els = form.elements; + for (i = 0; i < els.length; i++){ + var e = els[i]; + if (e.type == "checkbox" && !e.hidden && e.checked){ + submit.removeAttribute("disabled"); + return; + } + } + + submit.setAttribute("disabled",""); +} ----------------------------------------------------------------------- Summary of changes: .../src/templates-bootstrap/opac/myopac/charges.tt2 | 1 + Open-ILS/src/templates/opac/myopac/main.tt2 | 6 ++++-- Open-ILS/web/js/ui/default/opac/simple.js | 20 +++++++++++++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) hooks/post-receive -- Evergreen ILS
participants (1)
-
Git User