Bug 12337 - Multi-clicking the renewal buttons on circulation.pl can trigger "renewal...
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 30 May 2014 11:17:25 +0000 (07:17 -0400)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 1 Jul 2014 12:47:38 +0000 (09:47 -0300)
Each time the "renew all" or "renew or return" buttons are click, the
renewal process is triggered. If the patron only has one renewal left,
and the button is multi-clicked, the librarian may receive a
"renewal failed" message even though the renewal did occur. In
addition, this can just unwanted multiple consecutive renewals
as well.

Test Plan:
1) Check out an item to a patron that can have 1 renewal
2) Click the "renew all" button multiple times, fast and furiously
3) Note the "renewal failed" messaged
4) Apply this patch
5) Repeat steps 1 and 2
6) Note the item is now renewed without the failure message

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt

index 6805126..75e05b3 100644 (file)
@@ -26,6 +26,7 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
 [% IF ( borrowernumber ) %]if($.cookie("holdfor") != [% borrowernumber %]){ $.cookie("holdfor",null, { path: "/", expires: 0 }); }[% ELSE %]$.cookie("holdfor",null, { path: "/", expires: 0 });[% END %]
 [% UNLESS ( borrowernumber ) %][% UNLESS ( CGIselectborrower ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %]
         $(document).ready(function() {
+        $('#issues-form').preventDoubleFormSubmit();
         $('#patronlists').tabs([% IF ( UseTablesortForCirc ) %]{
             // Correct table sizing for tables hidden in tabs
             // http://www.datatables.net/examples/api/tabs_and_scrolling.html
@@ -717,7 +718,7 @@ No patron matched <span class="ex">[% message %]</span>
 <!-- SUMMARY : TODAY & PREVIOUS ISSUES -->
 <div id="checkouts">
 [% IF ( issuecount ) %]
-    <form name="issues" action="/cgi-bin/koha/reserve/renewscript.pl" method="post" class="checkboxed">
+    <form id="issues-form" name="issues" action="/cgi-bin/koha/reserve/renewscript.pl" method="post" class="checkboxed">
     <input type="hidden" value="circ" name="destination" />
     <input type="hidden" name="cardnumber" value="[% cardnumber %]" />
     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />