Bugzilla – Attachment 7642 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 - Part 2: OPAC
Bug-4054---Double-clicking-the-place-hold-button-c.patch (text/plain), 2.30 KB, created by
Kyle M Hall
on 2012-02-14 18:51:15 UTC
(
hide
)
Description:
Bug 4054 - Double-clicking the 'place hold' button can result in duplicate holds - Part 2: OPAC
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2012-02-14 18:51:15 UTC
Size:
2.30 KB
patch
obsolete
>From b2e0589cf7626e369cf584874d7845a3dd135fac 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] Bug 4054 - Double-clicking the 'place hold' button can result in duplicate holds - Part 2: OPAC > >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. >--- > koha-tmpl/opac-tmpl/prog/en/js/script.js | 10 ++++++++++ > .../opac-tmpl/prog/en/modules/opac-reserve.tt | 4 +++- > 2 files changed, 13 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..ade57b0 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/js/script.js >+++ b/koha-tmpl/opac-tmpl/prog/en/js/script.js >@@ -72,3 +72,13 @@ 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; >+ }); >+}; >+ >\ No newline at end of file >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.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 4054
:
7635
|
7636
|
7640
|
7642
|
7647