Bugzilla – Attachment 7640 Details for
Bug 4054
Double-clicking the 'place hold' button can result in duplicate holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 4054 - Double-clicking the 'place hold' button can result in duplicate holds
Bug-4054---Double-clicking-the-place-hold-button-c.patch (text/plain), 2.72 KB, created by
Liz Rea
on 2012-02-14 17:10:21 UTC
(
hide
)
Description:
Bug 4054 - Double-clicking the 'place hold' button can result in duplicate holds
Filename:
MIME Type:
Creator:
Liz Rea
Created:
2012-02-14 17:10:21 UTC
Size:
2.72 KB
patch
obsolete
>From d557bb087018ef711307cdbb467bf8e8950962bc Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 14 Feb 2012 10:53:19 -0500 >Subject: [PATCH] Bug 4054 - Double-clicking the 'place hold' button can > result in duplicate holds >Content-Type: text/plain; charset="utf-8" > >This commit adds a new jquery function to staff-global.js, preventDoubleFormSubmit(). >When used thusly: $('#form-id').preventDoubleFormSubmit(); >It will prevent a submitted form from being submitted a second time. >It is currently only added to the Place Hold form in reserve/request.pl > >http://bugs.koha-community.org/show_bug.cgi?id=4045 >Signed-off-by: Liz Rea <wizzyrea@gmail.com> >Tested: >Double clicking no longer causes identical double holds to be placed. >passes prove t xt t/db_dependent in line with current master. > >Reminder: this will need to be added to the OPAC as well. >--- > koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js | 11 ++++++++++- > .../prog/en/modules/reserve/request.tt | 4 +++- > 2 files changed, 13 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js >index f491773..24b785d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js >@@ -92,4 +92,13 @@ function checkEnter(e){ //e is event object passed from function invocation > > function clearHoldFor(){ > $.cookie("holdfor",null, { path: "/", expires: 0 }); >-} >\ No newline at end of file >+} >+ >+jQuery.fn.preventDoubleFormSubmit = function() { >+ jQuery(this).submit(function() { >+ if (this.beenSubmitted) >+ return false; >+ else >+ this.beenSubmitted = true; >+ }); >+}; >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index 1719af4..fa45e26 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -127,6 +127,8 @@ function checkMultiHold() { > $("#requestany").attr("checked","checked"); > } > }); >+ >+ $('#hold-request-form').preventDoubleFormSubmit(); > }); > > // ]]> >@@ -238,7 +240,7 @@ function checkMultiHold() { > <fieldset class="rows left"> > <legend>Hold details</legend> > [% UNLESS ( multi_hold ) %] >- <form action="placerequest.pl" method="post" onsubmit="return check();" name="form"> >+ <form action="placerequest.pl" method="post" onsubmit="return check();" name="form" id="hold-request-form"> > [% ELSE %] > <form action="placerequest.pl" method="post" onsubmit="return checkMultiHold();" name="form"> > [% END %] >-- >1.7.5.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 4054
:
7635
|
7636
| 7640 |
7642
|
7647