Bug 19539: Fix column index shift in cirulation rules
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 27 Oct 2017 14:12:57 +0000 (11:12 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 1 Nov 2017 16:09:52 +0000 (13:09 -0300)
This patch fixes an index shift introduced by bug 18857 when it introduced
a new column.

To test:
- On the Circulation and fine rules page
- Empty the value of 'Current on-site checkouts allowed' and save
- Notice 'Unlimited' shows on the saved rule.
- Click edit
=> FAIL: the 'Unlimited' string displays instead of the empty string on the editing row.
- Apply this patch
- Re-open the circ rules page
- Click edit
=> SUCCESS: An empty string fills the 'Unlimited' fields
- Sign off :-D

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt

index bfec588..c1d5931 100644 (file)
@@ -103,7 +103,7 @@ $(document).ready(function() {
                         // Remove potential previous input added
                         $(current_column).find("input").remove();
                         $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
-                    } else if ( i == 2 || i == 3 ) {
+                    } else if ( i == 3 || i == 4 ) {
                         // If the value is not an integer for "Current checkouts allowed" or "Current on-site checkouts allowed"
                         // The value is "Unlimited" (or an equivalent translated string)
                         // an it should be set to an empty string