Main Koha release repository https://koha-community.org
Find a file
David Cook c061790f97 Bug 9783 - can hit submit twice when adding patrons
Currently, clicking twice or more on the Save button will generate
duplicate patrons when adding patrons in the Patron module. Of course,
there is handling that detects this, so you can choose to either edit
the original record (i.e. throw away the duplicate) or create a
duplicate record.

However, it shouldn't get to that point by clicking on the Save button.
That handling seems to be there to handle cases where you go through the
whole process of trying to add a new patron only to find out that they
already exist in the system (or at least their username/password do).

--

This patch uses the "preventDoubleFormSubmit" function (which is also
used in holds and fines to prevent double form submits). It was also
necessary to edit members.js, since "check_form_borrowers" was forcing
form submits despite the "preventDoubleFormSubmit" function. I've
changed it from forcing a document.form.submit to return true, which the
browser will still submit the form if it's a unique borrower, but the
"preventDoubleFormSubmit" function will still prevent multiple submits.

I've also added a "waiting" class to staff-global.js which changes the
cursor to "wait" (i.e. loading circle graphic). I've included an
"AddClass" call in "preventDoubleFormSubmit", so that the cursor graphic
will change to show users that the page is loading so that they don't
click Save again. Of course, even if they do click save again, there
will only be one submit. However, this way - as Chris Cormack mentioned
- the user knows that "something" is happening and that the form isn't
broken.

-------
Test Plan

Before applying patch...

1) Fill out the form for a new patron in the Patron module
2) Click "Save" several times
3) Once the page loads, you'll be shown a prompt that says that this
   borrower already exists. You will have the option to view the
   original record, edit the original record, or create a new patron
   anyway
4) Click on edit the existing record, and delete the patron

Apply the patch

5) Repeat steps 1 and 2
6) Notice that your cursor has changed into a little "loading" circle
   graphic when you hover over the "body" of the page, as well as any
   links or any inputs/buttons of the type "submit" within that form
7) Notice that no matter how many times you press the button, the form
   is not re-submitted. Eventually you will be taken to the new patron's
   record (no mention of duplication will occur)

Ta da! Multiple form submits are prevented and the loading graphic
signals to users that the form was submitted and that Koha is processing
their data

--

I understand that some people might want to change which elements are
given the "waiting" class. I'm happy to renegotiate this as necessary.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Looks good and works nicely.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-27 22:58:17 -04:00
acqui Bug 9506: FIX gst list values for each basket 2013-03-23 00:28:57 -04:00
admin Bug 9257 - Add "groups" to normal search pulldown 2013-03-22 08:20:08 -04:00
authorities BUG 9145: Authorities: standard language for UNIMARC 2013-02-20 08:42:10 -05:00
basket Bug 9073 - Download option from the cart should match the menu button in lists 2012-11-25 18:08:46 -05:00
C4 Revert "Merge branch 'bug_7688' into 3.12-master" 2013-03-23 00:36:37 -04:00
catalogue Bug 9875: Hide empty items tab 2013-03-20 14:37:52 -04:00
cataloguing Bug 9457: [ENH] Ordering branches should be case independent (2) 2013-03-20 15:35:58 -04:00
circ Bug 9604: filter overdues with homebranch and holdingbranch 2013-03-22 22:05:38 -04:00
debian Bug 9918 - build script updates, default to building 3.12 2013-03-27 21:49:27 -04:00
docs Add two new developers to the history 2013-03-27 22:14:22 -04:00
errors
etc Bug 9883 - Add missing parameter to koha-conf.xml causing Plugins.t to fail 2013-03-22 09:52:26 -04:00
install_misc Bug 9914: dependency updates for 3.12 2013-03-23 10:46:07 -04:00
installer Bug 9919: Correct syntax error caused by missing comma. 2013-03-25 08:43:26 -04:00
Koha Bug 9907 - Plugins test dies early on some servers 2013-03-22 17:50:09 -04:00
koha-tmpl Bug 9783 - can hit submit twice when adding patrons 2013-03-27 22:58:17 -04:00
labels Bug 9239: Allow the use of QueryParser for all queries 2013-03-16 21:32:32 -04:00
members Bug 9457 - Followup - Ordering branches should be case independent (2) 2013-03-20 15:36:19 -04:00
misc Update release notes for 3.12.00-beta1 2013-03-23 09:35:08 -04:00
offline_circ Bug 8220 - Allow koc uploads to go to process queue instead of being applied directly. 2013-03-21 20:35:37 -04:00
opac Bug 7740 follow-up : removing duplicate declaration 2013-03-22 22:57:32 -04:00
OpenILS Bug 9239 QA follow-up: remove stray debug code 2013-03-16 21:32:34 -04:00
patroncards Bug 9695 - Use alphabet system preference on page used to browse patrons for patron card batches 2013-03-13 08:43:25 -04:00
plugins Bug 7804 - Add Koha Plugin System - QA Followup 2 2013-03-20 14:50:19 -04:00
reports Bug 9117: Reports hierarchies management improvements 2013-03-21 18:54:09 -04:00
reserve Bug 9457 - Followup - Ordering branches should be case independent (2) 2013-03-20 15:36:19 -04:00
reviews
rotating_collections
selenium
serials Revert "Merge branch 'bug_7688' into 3.12-master" 2013-03-23 00:36:37 -04:00
services
skel Bug 7804 - Add Koha Plugin System 2013-03-20 14:49:47 -04:00
sms
suggestion Bug 9226: Wrong branch filter after suggestion creation 2013-02-15 08:34:11 -05:00
svc Bug 9827: remove 'insecure' system preference 2013-03-19 21:46:34 -04:00
t Bug 9912: DateUtils.t must not access database 2013-03-23 09:13:16 -04:00
tags bug 9401: remove direct reads of CGISESSID cookie by JavaScript 2013-02-01 11:05:35 -05:00
test
tmp/modified_authorities
tools Bug 8378 - show all items columns and new items.fine 2013-03-21 21:53:06 -04:00
virtualshelves Bug 7788: [SIGNED-OFF] Followup: GetShelf call in addbybiblio script corrected 2012-05-22 12:06:26 +02:00
xt Bug 9802 - add test case to ensure man pages have correct XML 2013-03-20 15:11:10 -04:00
.htaccess
.mailmap
about.pl Bug 7440 - Remove NoZebra vestiges 2013-03-19 21:17:04 -04:00
changelanguage.pl
edithelp.pl Bug 8622: Fix theme fallback 2012-09-05 11:39:14 +02:00
fix-perl-path.PL
help.pl Bug 8949: Trying to view help on a page without any help results in a nasty error 2012-11-05 08:39:23 -05:00
INSTALL
install-CPAN.pl
INSTALL.debian Bug 8092 follow-up: Add optional dependency on CHI 2012-06-09 13:08:18 +02:00
INSTALL.fedora7 Bug 7440 - Remove NoZebra vestiges 2013-03-19 21:17:04 -04:00
INSTALL.opensuse
INSTALL.ubuntu Bug 8092 follow-up: Add optional dependency on CHI 2012-06-09 13:08:18 +02:00
INSTALL.ubuntu.12.04 Bug 9267 - Ubuntu 12.04 install docs broken 2013-03-07 09:46:55 -05:00
INSTALL.ubuntu.lucid Bug 8092 follow-up: Add optional dependency on CHI 2012-06-09 13:08:18 +02:00
koha_perl_deps.pl Bug 8485 - Make koha_perl_deps.pl batch friendly Added a -b flag for brief which outputs only the perl library name (Foo::BaR), and added a -r flag for required which filters the list to required=Yes perl libraries. 2012-08-31 17:35:49 +02:00
kohaversion.pl Bump version for Koha 3.12.00-beta1 release 2013-03-23 09:54:28 -04:00
LICENSE Bug 9440 - update Koha's LICENSE file from GPL2 to GPL3 2013-02-12 08:52:10 -05:00
mainpage.pl Revert "Bug 7167: New version for updatedatabase" 2012-12-27 14:02:56 -05:00
Makefile.PL Bug 9890 - Fix the new plugin system for package installs 2013-03-22 16:54:04 -04:00
MANIFEST.SKIP Bug 9546 : Updating make manifest tardist 2013-02-06 23:54:46 -05:00
README Bug 9440 - update Koha's LICENSE file from GPL2 to GPL3 2013-02-12 08:52:10 -05:00
README.robots
rewrite-config.PL Bug 7804 - Add Koha Plugin System 2013-03-20 14:49:47 -04:00

Koha is a free software integrated library system.

Koha is distributed under the GNU GPL version 3 or later.
Please read the file LICENSE for more details.

To install or upgrade Koha, please see the INSTALL file appropriate
to your platform.

Report bugs at http://bugs.koha-community.org/

Visit the Koha Project website at http://www.koha-community.org/