Bugzilla – Attachment 15971 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.76 KB, created by
Marcel de Rooy
on 2013-03-08 11:24:06 UTC
(
hide
)
Description:
Bug 8054 - double clicking can cause duplicate payments/fines
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2013-03-08 11:24:06 UTC
Size:
6.76 KB
patch
obsolete
>From 35a47334a7777392c4a5a0aa5b386d2fd920f33a 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 >Content-Type: text/plain; charset="utf-8" > >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> >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../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 171337d..e575df8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >@@ -5,6 +5,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){ >@@ -41,7 +42,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 %]" /> > <p><span class="checkall"><a id="CheckAll" href="#">Select all</a></span> | <span class="clearall"><a id="CheckNone" href="#">Clear all</a></span></p> > <table id="finest"> >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 5b3b2ca..f38d20c 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.7.6
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