Bugzilla – Attachment 83804 Details for
Bug 11373
Add "change calculation" feature to the fine payment forms
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11373: (follow-up) Add "change calculation" feature to the fine payment forms
Bug-11373-follow-up-Add-change-calculation-feature.patch (text/plain), 4.73 KB, created by
Owen Leonard
on 2019-01-11 16:09:17 UTC
(
hide
)
Description:
Bug 11373: (follow-up) Add "change calculation" feature to the fine payment forms
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2019-01-11 16:09:17 UTC
Size:
4.73 KB
patch
obsolete
>From 87aff7e68fa697331d4e1d207fd957c3e1eab5c5 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 11 Jan 2019 16:05:12 +0000 >Subject: [PATCH] Bug 11373: (follow-up) Add "change calculation" feature to > the fine payment forms > >This patch provides some follow-ups, including corrections to the >JavaScript and updates to the text for readability. > >- Remove obsolete script "type" attribute >- Update the use of the obsolete jQuery method "bind" >- Use Bootstrap's built-in "show" option instead of simulated click >- Handle preventDoubleFormSubmit function's "waiting" class if modal is > closed manually > >To test, apply the patch and follow the original test plan. Everything >should work as expected. > >Note that when the modal is shown, the cursor changes to the "waiting" >one when you hover over the body of the page. If you click "No" in the >modal, the cursor should return to normal. >--- > .../prog/en/modules/members/paycollect.tt | 30 ++++++++++++++-------- > 1 file changed, 19 insertions(+), 11 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >index d3c84c8..0fbffe3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >@@ -99,11 +99,11 @@ > <ol> > > <li> >- <label for="paid">Amount paid: </label> >+ <label for="paid">Amount being paid: </label> > <input name="paid" id="paid" value="[% amountoutstanding | $Price %]"/> > </li> > <li> >- <label for="collected">Collect from patron: </label> >+ <label for="collected">Collected from patron: </label> > <input id="collected" value="[% amountoutstanding | $Price %]"/> > </li> > <li> >@@ -125,8 +125,10 @@ > </ol> > </fieldset> > >- <div class="action"><input type="submit" name="submitbutton" value="Confirm" /> >- <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a></div> >+ <div class="action"> >+ <input type="submit" name="submitbutton" value="Confirm" /> >+ <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a> >+ </div> > </form> > [% ELSIF ( writeoff_individual ) %] > <form name="woindivfine" id="woindivfine" action="/cgi-bin/koha/members/pay.pl" method="post" > >@@ -248,17 +250,16 @@ > </div> > > <!-- Modal --> >-<a class="hidden" href="#confirm_change_form" data-toggle="modal"></a> > <div id="confirm_change_form" class="modal" tabindex="-1" role="dialog" aria-hidden="true"> > <div class="modal-dialog"> > <div class="modal-content"> > <div class="modal-header"> >- <h3>Amount collected higher than paid</h3> >+ <h3>The amount collected is more than the outstanding charge</h3> > </div> > <div class="modal-body"> >- <p>The amount collected from the patron is higher than the amount paid.</p> >+ <p>The amount collected from the patron is higher than the amount to be paid.</p> > <p>The change to give is <b><span id="modal_change">0.00</span></b>.</p> >- <p>Do you still confirm the payment?</p> >+ <p>Confirm this payment?</p> > </div> > <div class="modal-footer"> > <button class="btn btn-default approve" id="modal_submit" type="button"><i class="fa fa-check"></i> Yes</button> >@@ -271,7 +272,7 @@ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'str/members-menu.inc' %] > [% Asset.js("js/members-menu.js") | $raw %] >- <script type= "text/javascript"> >+ <script> > $(document).ready(function() { > var forms = $('#payindivfine, #payfine'); > var change = $('#change')[0]; >@@ -285,14 +286,21 @@ > }); > > if (change != undefined) { >- forms.bind('submit', function(e) { >+ forms.on("submit", function(e) { > if (change.innerHTML > 0.00) { > e.preventDefault(); >- $('a[href="#confirm_change_form"]').click(); >+ $("#confirm_change_form").modal("show"); >+ } else { >+ return true; > } > }); > } > >+ $("#confirm_change_form").on("hidden.bs.modal", function(){ >+ // remove class added by preventDoubleFormSubmit if necessary >+ $("body, form input[type='submit'], form button[type='submit'], form a").removeClass('waiting'); >+ }); >+ > $('#modal_submit').click(function() { > forms[0].submit(); > }); >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11373
:
23382
|
26103
|
26108
|
29757
|
29938
|
36875
|
36876
|
36877
|
60528
|
60529
|
61233
|
61234
|
67348
|
68296
|
70043
|
71975
|
71976
|
77584
|
77585
|
79122
|
79171
|
79188
|
79507
|
79509
|
79529
|
79530
|
79538
|
79549
|
79759
|
79944
|
79951
|
80414
|
80986
|
82420
|
82797
|
83804
|
83812
|
83813
|
84653
|
84654