Bugzilla – Attachment 14432 Details for
Bug 8054
can hit submit twice when paying fines
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8054 - double clicking can cause duplicate payments/fines
Bug-8054---double-clicking-can-cause-duplicate-pay.patch (text/plain), 6.50 KB, created by
Kyle M Hall (khall)
on 2013-01-04 17:59:17 UTC
(
hide
)
Description:
Bug 8054 - double clicking can cause duplicate payments/fines
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-01-04 17:59:17 UTC
Size:
6.50 KB
patch
obsolete
>From a82f3e529446a8eb5a1c14a48a7a31d90e6e661b Mon Sep 17 00:00:00 2001 >From: Liz Rea <liz@catalyst.net.nz> >Date: Thu, 27 Dec 2012 16:10:26 +1300 >Subject: [PATCH] Bug 8054 - double clicking can cause duplicate payments/fines > >Uses preventDoubleForSubmit() to prevent double form submissions in the fines module. > >To test: > >Create a manual invoice/fine >Create some manual fines, click save like mad - you should get only one fine (without, you will get several if you click madly enough) > >Click Pay fines >Pay some fines, clicking save like mad on each. You should only get one payment. (without, you will get several payments) > >Create a manual credit >Create a credit, click save like mad. You should only get one credit. (without you will get several if you click madly enough) > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > .../prog/en/modules/members/mancredit.tt | 3 ++- > .../prog/en/modules/members/maninvoice.tt | 3 ++- > .../intranet-tmpl/prog/en/modules/members/pay.tt | 3 ++- > .../prog/en/modules/members/paycollect.tt | 13 ++++++++++--- > 4 files changed, 16 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >index 8b71856..52264ee 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >@@ -5,6 +5,7 @@ > //<![CDATA[ > $(document).ready(function(){ > $("fieldset.rows input").keydown(function(e){ return checkEnter(e); }); >+ $('#mancredit').preventDoubleFormSubmit(); > }); > //]]> > </script> >@@ -32,7 +33,7 @@ $(document).ready(function(){ > </ul> > <div class="tabs-container"> > >-<form action="/cgi-bin/koha/members/mancredit.pl" method="post"> >+<form action="/cgi-bin/koha/members/mancredit.pl" method="post" id="mancredit"> > <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" /> > > <fieldset class="rows"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >index 217882e..dc9aac4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >@@ -5,6 +5,7 @@ > //<![CDATA[ > $(document).ready(function(){ > $("fieldset.rows input").keydown(function(e){ return checkEnter(e); }); >+ $('#maninvoice').preventDoubleFormSubmit(); > }); > //]]> > </script> >@@ -37,7 +38,7 @@ $(document).ready(function(){ > ERROR an invalid itemnumber was entered, please hit back and try again > [% END %] > [% ELSE %] >-<form action="/cgi-bin/koha/members/maninvoice.pl" method="post"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" /> >+<form action="/cgi-bin/koha/members/maninvoice.pl" method="post" id="maninvoice"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" /> > <fieldset class="rows"> > <legend>Manual Invoice</legend> > <ol> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >index 2780c3f..ad89b3c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >@@ -4,6 +4,7 @@ > <script type= "text/javascript"> > //<![CDATA[ > $(document).ready(function(){ >+ $('#pay-fines-form').preventDoubleFormSubmit(); > $("#woall").click(function(event){ > var answer = confirm(_("Are you sure you want to write off [% total | format('%.2f') %] in outstanding fines? This cannot be undone!")); > if (!answer){ >@@ -38,7 +39,7 @@ > <div class="tabs-container"> > > [% IF ( accounts ) %] >- <form action="/cgi-bin/koha/members/pay.pl" method="post"> >+ <form action="/cgi-bin/koha/members/pay.pl" method="post" id="pay-fines-form"> > <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" /> > > <table> >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 c558b08..cb1a540 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >@@ -3,6 +3,13 @@ > [% INCLUDE 'doc-head-close.inc' %] > <script type= "text/javascript"> > //<![CDATA[ >+$(document).ready(function() { >+ $('#payindivfine, #woindivfine, #payfine').preventDoubleFormSubmit(); >+}); >+//]]> >+</script> >+<script type= "text/javascript"> >+//<![CDATA[ > function moneyFormat(textObj) { > var newValue = textObj.value; > var decAmount = ""; >@@ -91,7 +98,7 @@ function moneyFormat(textObj) { > [% END %] > > [% IF ( pay_individual ) %] >- <form name="payindivfine" onsubmit="return validatePayment(this);" method="post" action="/cgi-bin/koha/members/paycollect.pl"> >+ <form name="payindivfine" id="payindivfine" onsubmit="return validatePayment(this);" method="post" action="/cgi-bin/koha/members/paycollect.pl"> > <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" /> > <input type="hidden" name="pay_individual" id="pay_individual" value="[% pay_individual %]" /> > <input type="hidden" name="itemnumber" id="itemnumber" value="[% itemnumber %]" /> >@@ -145,7 +152,7 @@ function moneyFormat(textObj) { > <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a></div> > </form> > [% ELSIF ( writeoff_individual ) %] >- <form name="woindivfine" action="/cgi-bin/koha/members/pay.pl" method="post" > >+ <form name="woindivfine" id="woindivfine" action="/cgi-bin/koha/members/pay.pl" method="post" > > <fieldset class="rows"> > <legend>Write off an individual fine</legend> > <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" /> >@@ -185,7 +192,7 @@ function moneyFormat(textObj) { > </form> > [% ELSE %] > >- <form name="payfine" onsubmit="return validatePayment(this);" method="post" action="/cgi-bin/koha/members/paycollect.pl"> >+ <form name="payfine" id="payfine" onsubmit="return validatePayment(this);" method="post" action="/cgi-bin/koha/members/paycollect.pl"> > <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" /> > <input type="hidden" name="selected_accts" id="selected_accts" value="[% selected_accts %]" /> > <input type="hidden" name="total" id="total" value="[% total %]" /> >-- >1.7.2.5
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 8054
:
14303
|
14432
|
15971