Bug 4354: Manage the specific case "Unlimited" value
authorJonathan Druart <jonathan.druart@biblibre.com>
Thu, 21 Mar 2013 14:43:01 +0000 (15:43 +0100)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Fri, 22 Mar 2013 00:03:29 +0000 (20:03 -0400)
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All good :)
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt

index 7a9490a..a029443 100644 (file)
@@ -56,6 +56,13 @@ $(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 ) {
+                        // If the value is not an integer for "Current checkouts allowed"
+                        // The value is "Unlimited" (or an equivalent translated string)
+                        // an it should be set to an empty string
+                        if( !((parseFloat(itm) == parseInt(itm)) && !isNaN(itm)) ) {
+                            $(current_column).find("input[type='text']").val("");
+                        }
                     }
                 } else {
                     // specific processing for the Hard due date column