Bugzilla – Attachment 7647 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]
[Signed Off] Bug 4054 - Double-clicking the 'place hold' button can result in duplicate holds - Part 2: OPAC
Signed-Off-Bug-4054---Double-clicking-the-place-ho.patch (text/plain), 2.46 KB, created by
Liz Rea
on 2012-02-14 21:44:19 UTC
(
hide
)
Description:
[Signed Off] Bug 4054 - Double-clicking the 'place hold' button can result in duplicate holds - Part 2: OPAC
Filename:
MIME Type:
Creator:
Liz Rea
Created:
2012-02-14 21:44:19 UTC
Size:
2.46 KB
patch
obsolete
>From af445bb742a381c5441153cb462b04e975ea8cc1 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 14 Feb 2012 13:49:54 -0500 >Subject: [PATCH] [Signed Off] Bug 4054 - Double-clicking the 'place hold' > button can result in duplicate holds - Part 2: OPAC >Content-Type: text/plain; charset="utf-8" > >This commit adds a new jquery function to functions.js, preventDoubleFormSubmit(). >When used thusly: $('#form-id').preventDoubleFormSubmit(); >It will prevent a submitted form from being submitted a second time. >This commit uses said function to prevent double processing a hold >request from the opac. > >Signed-off-by: Liz Rea <wizzyrea@gmail.com> >Rapid clicking on the place hold button no longer causes duplicate holds! >Passes prove t xt t/db_dependent in line with current master. >--- > koha-tmpl/opac-tmpl/prog/en/js/script.js | 9 +++++++++ > .../opac-tmpl/prog/en/modules/opac-reserve.tt | 4 +++- > 2 files changed, 12 insertions(+), 1 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/prog/en/js/script.js b/koha-tmpl/opac-tmpl/prog/en/js/script.js >index 76a6c91..6859a74 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/js/script.js >+++ b/koha-tmpl/opac-tmpl/prog/en/js/script.js >@@ -72,3 +72,12 @@ YAHOO.util.Event.onContentReady("listsmenu", function () { > YAHOO.util.Event.addListener("listsmenulink", "click", listMenu.show, null, listMenu); > YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionlistMenu); > }); >+ >+jQuery.fn.preventDoubleFormSubmit = function() { >+ jQuery(this).submit(function() { >+ if (this.beenSubmitted) >+ return false; >+ else >+ this.beenSubmitted = true; >+ }); >+}; >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt >index 7e2683a..bfe59fe 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt >@@ -15,6 +15,8 @@ > } > > $(document).ready(function() { >+ $('#hold-request-form').preventDoubleFormSubmit(); >+ > var copiesRowId = null; > var wasSpecific = false; > var lastCopiesRowId = null; >@@ -226,7 +228,7 @@ > </div> > [% END %] > >- <form action="/cgi-bin/koha/opac-reserve.pl" method="post"> >+ <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form"> > <input type="hidden" name="place_reserve" value="1"/> > > <!-- These values are set dynamically by js --> >-- >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