Bug 8986: Followup FIX a JS error if there is no valid card number
authorJonathan Druart <jonathan.druart@biblibre.com>
Mon, 19 Nov 2012 16:11:21 +0000 (17:11 +0100)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Fri, 23 Nov 2012 18:35:03 +0000 (13:35 -0500)
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
I can't reproduce the JS error but the template changes are correct
with regard to how the page should handle errors.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt

index 377a87d..62d2eb3 100644 (file)
@@ -9,24 +9,26 @@
         var patron_attributes_lib = new Array();
         var patron_attributes_values = new Array();
         $(document).ready(function() {
-            $("#borrowerst").tablesorter({
-                [% IF ( op == 'show' ) %]headers: { 0: { sorter: false}},[% END %]
-                widgets : ['zebra'],
-                sortList: [[1,0]]
-            });
+            [% IF borrowers %]
+                $("#borrowerst").tablesorter({
+                    headers: { 0: { sorter: false}},
+                    widgets : ['zebra'],
+                    sortList: [[1,0]]
+                });
 
-            $("#selectallbutton").click(function() {
-                $("#borrowerst").find("input:checkbox").each(function() {
-                    $(this).attr("checked", true);
+                $("#selectallbutton").click(function() {
+                    $("#borrowerst").find("input:checkbox").each(function() {
+                        $(this).attr("checked", true);
+                    });
+                    return false;
                 });
-                return false;
-            });
-            $("#clearallbutton").click(function() {
-                $("#borrowerst").find("input:checkbox").each(function() {
-                    $(this).attr("checked", false);
+                $("#clearallbutton").click(function() {
+                    $("#borrowerst").find("input:checkbox").each(function() {
+                        $(this).attr("checked", false);
+                    });
+                    return false;
                 });
-                return false;
-            });
+            [% END %]
 
             var values = new Array();
             var lib = new Array();
                             <div id="toolbar"><a id="selectallbutton" href="#">Select All</a> | <a id="clearallbutton" href="#">Clear All</a></div>
                         [% END %]
                     [% END %]
+                        [% IF borrowers %]
                             <div id="cataloguing_additem_itemlist">
                                 <div style="overflow:auto">
                                     <table id="borrowerst">
                             </div>
                         </form>
                         [% END %]
+                    [% END %]
                 [% END %]
                 [% IF ( op == 'show_results' ) %]
                 <p>