some debugging artifacts, replaced the evil g.error/catStrings lines, and have delaye...
authorJason Etheridge <jason@esilibrary.com>
Thu, 10 Mar 2011 07:55:33 +0000 (02:55 -0500)
committerJason Etheridge <jason@esilibrary.com>
Thu, 10 Mar 2011 07:55:33 +0000 (02:55 -0500)
Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js

index b861713..008a5b4 100644 (file)
@@ -675,24 +675,28 @@ g.abort_gather_copies_soon = function() {
 }
 
 g.gather_copies_soon = function() {
-    dump('g.gather_copies_soon()\n');
-    if (g.update_copy_editor_timeoutID) {
-        clearTimeout(g.update_copy_editor_timeoutID);
-    }
-    // This function is expensive when it comes to keeping the UI responsive, so let's give it a delay
-    // that quick entry of consecutive fields can override
-    g.update_copy_editor_timeoutID = setTimeout(
-        function() {
-            g.gather_copies();
-            try {
-                if (xulG.unified_interface) {
-                    xulG.refresh_copy_editor();
+    try {
+        dump('g.gather_copies_soon()\n');
+        if (g.update_copy_editor_timeoutID) {
+            clearTimeout(g.update_copy_editor_timeoutID);
+        }
+        // This function is expensive when it comes to keeping the UI responsive, so let's give it a delay
+        // that quick entry of consecutive fields can override
+        g.update_copy_editor_timeoutID = setTimeout(
+            function() {
+                try {
+                    g.gather_copies();
+                    if (xulG.unified_interface) {
+                        xulG.refresh_copy_editor();
+                    }
+                } catch(E) {
+                    alert('Error in volume_copy_editor.js with g.gather_copies_soon setTimeout func(): ' + E);
                 }
-            } catch(E) {
-                alert('Error in volume_copy_editor.js trying to call xulG.refresh_copy_editor(): ' + E);
-            }
-        }, 2000
-    );
+            }, 2000
+        );
+    } catch(E) {
+        alert('Error in volume_copy_creator.js, g.gather_copies_soon(): ' + E);
+    }
 }
 
 g.new_acp_id = -1;
@@ -866,7 +870,7 @@ g.vivicate_update_volumes = function() {
         for (var ou_id in g.volumes_scaffold) {
             for (var composite_key in g.volumes_scaffold[ou_id]) {
 
-                var callnumber_data = g.volumes_scaffold[ou_id][composite_key];
+                var callnumber_data = g.volumes_scaffold[ou_id][composite_key].callnumber_data;
                 var acn_id = callnumber_data.acn_id;
 
                 if (acn_id < 0) {
@@ -877,7 +881,7 @@ g.vivicate_update_volumes = function() {
                     );
 
                     if (typeof acn_blob.ilsevent != 'undefined') {
-                        g.error.standard_unexpected_error_alert($("catStrings").getFormattedString('staff.cat.volume_copy_creator.stash_and_close.problem_with_volume', [cn]), acn_blob);
+                        alert('Error in g.vivicate_update_volumes, acn_id = ' + acn_id + ' acn_blob = ' + js2JSON(acn_blob));
                         continue;
                     }
 
@@ -888,8 +892,8 @@ g.vivicate_update_volumes = function() {
                             'FM_ACN_RETRIEVE.authoritative',
                             [ acn_id ]
                         );
-                        if (typeof my_acn.ilsevent != 'undefined') {
-                            g.error.standard_unexpected_error_alert($("catStrings").getFormattedString('staff.cat.volume_copy_creator.stash_and_close.problem_with_volume', [cn]), acn_id);
+                        if (typeof temp_acn.ilsevent != 'undefined') {
+                            alert('Error in g.vivicate_update_volumes, acn_id = ' + acn_id + ' temp_acn = ' + js2JSON(temp_acn));
                             continue;
                         }
                         g.acn_map[ acn_id ] = temp_acn;
@@ -935,7 +939,7 @@ g.vivicate_update_volumes = function() {
                     [ ses(),volumes, false, { 'auto_merge_vols' : false } ]
                 );
                 if (typeof r.ilsevent != 'undefined') {
-                    g.error.standard_unexpected_error_alert('volume update',r);
+                    alert('error with volume update: ' + js2JSON(r));
                 }
             }
         }
@@ -982,7 +986,7 @@ g.stash_and_close = function(param) {
                     [ ses(),copies, true ]
                 );
                 if (typeof r.ilsevent != 'undefined') {
-                    g.error.standard_unexpected_error_alert('copy update',r);
+                    alert('error with copy update:' + js2JSON(r));
                 }
             }
             try {
@@ -999,7 +1003,7 @@ g.stash_and_close = function(param) {
                     );
                 }
             } catch(E) {
-                g.error.standard_unexpected_error_alert($('catStrings').getString('staff.cat.volume_copy_creator.stash_and_close.tree_err2'),E);
+                alert('2: Error in volume_copy_creator.js with g.stash_and_close(): ' + E);
             }
         }
 
@@ -1013,7 +1017,7 @@ g.stash_and_close = function(param) {
         if (! dont_close) { xulG.close_tab(); }
 
     } catch(E) {
-        g.error.standard_unexpected_error_alert($('catStrings').getString('staff.cat.volume_copy_creator.stash_and_close.tree_err3'),E);
+        alert('3: Error in volume_copy_creator.js with g.stash_and_close(): ' + E);
     }
 }
 
@@ -1044,7 +1048,7 @@ g.load_prefs = function() {
 
         }
     } catch(E) {
-        g.error.standard_unexpected_error_alert($('catStrings').getString('staff.cat.volume_copy_creator.load_prefs.err_retrieving_prefs'),E);
+        alert('Error in volume_copy_creator.js with g.load_prefs(): ' + E);
     }
 }
 
@@ -1060,7 +1064,7 @@ g.save_prefs = function () {
         );
         file.close();
     } catch(E) {
-        g.error.standard_unexpected_error_alert($('catStrings').getString('staff.cat.volume_copy_creator.save_prefs.err_storing_prefs'),E);
+        alert('Error in volume_copy_creator.js with g.save_prefs(): ' + E);
     }
 }