Merge branch 'master' of git.evergreen-ils.org:Evergreen into social
[evergreen-equinox.git] / Open-ILS / xul / staff_client / server / cat / volume_copy_creator.js
index e394dfb..1aea205 100644 (file)
@@ -448,6 +448,7 @@ g.render_callnumber_copy_count_entry = function(row,ou_id,count) {
                         ,false
                     );
                     classification_column_box.appendChild(classification_column_menulist);
+                    classification_column_menulist.value = g.label_class;
 
                     /**** PREFIX COLUMN revisited ****/
                     var prefix_column_menulist = g.render_prefix_menu(call_number_column_textbox);
@@ -776,11 +777,10 @@ g.delay_gather_copies_soon = function() {
     }
 }
 
-g.gather_copies_soon = function() {
+g.gather_copies_soon = function(ev) {
     try {
         if (!xulG.unified_interface) { return; }
         dump('g.gather_copies_soon()\n');
-        document.getElementById("Create").disabled = true;
         if (g.update_copy_editor_timeoutID) {
             clearTimeout(g.update_copy_editor_timeoutID);
         }
@@ -791,9 +791,8 @@ g.gather_copies_soon = function() {
                 try {
                     g.gather_copies();
                     xulG.refresh_copy_editor();
-                    document.getElementById("Create").disabled = false;
                 } catch(E) {
-                    alert('Error in volume_copy_editor.js with g.gather_copies_soon setTimeout func(): ' + E);
+                    dump('Error in volume_copy_editor.js with g.gather_copies_soon setTimeout func(): ' + E + '\n');
                 }
             }, update_timer
         );
@@ -876,6 +875,9 @@ g.gather_copies = function() {
 
         for (var i = 0; i < barcodes.length; i++) {
             var acp_id = barcodes[i].getAttribute('acp_id') || g.new_acp_id--;
+            if (acp_id < 0) {
+                barcodes[i].setAttribute('acp_id',acp_id);
+            }
             var ou_id = barcodes[i].getAttribute('ou_id');
             var callnumber_composite_key = barcodes[i].getAttribute('callkey');
             var barcode = barcodes[i].value;
@@ -1075,12 +1077,17 @@ g.stash_and_close = function(param) {
 
     try {
 
+        if (g.update_copy_editor_timeoutID) {
+            clearTimeout(g.update_copy_editor_timeoutID);
+        }
+
         var copies;
         if (xulG.unified_interface) {
+            g.gather_copies();
+            xulG.refresh_copy_editor();
             copies = xulG.copies;
         } else {
             copies = g.gather_copies();
-            copies = blob.copies;
         }
 
         var dont_close = false;