debugging tweaks; toward delayed volume updates
authorJason Etheridge <jason@esilibrary.com>
Thu, 10 Mar 2011 07:07:06 +0000 (02:07 -0500)
committerJason Etheridge <jason@esilibrary.com>
Thu, 10 Mar 2011 07:07:06 +0000 (02:07 -0500)
Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js

index da8134e..b861713 100644 (file)
@@ -735,7 +735,11 @@ g.gather_copies = function() {
             if ( nl[i].getAttribute('rel_vert_pos') == rel_vert_pos_call_number )  {
                 v_count++;
                 var ou_id = nl[i].getAttribute('ou_id');
-                var acn_id = nl[i].getAttribute('acn_id') || g.new_acn_node--;
+                var acn_id = nl[i].getAttribute('acn_id');
+                if (!acn_id) {
+                    acn_id = g.new_acn_id--;
+                    nl[i].setAttribute('acn_id',acn_id);
+                }
                 var acnc_id = nl[i].getAttribute('acnc_id') || g.label_class;
                 var acnp_id = nl[i].getAttribute('acnp_id') || -1;
                 var acns_id = nl[i].getAttribute('acns_id') || -1;
@@ -831,12 +835,13 @@ g.gather_copies = function() {
                     var acp_id = g.volumes_scaffold[ou_id][composite_key].barcode_data[i].acp_id;
                     var bmp_id = g.volumes_scaffold[ou_id][composite_key].barcode_data[i].bmp_id;
                     var acn_id = g.volumes_scaffold[ou_id][composite_key].callnumber_data.acn_id;
+                    dump('gather_copies(): barcode = ' + barcode + ' acp_id = ' + acp_id + ' bmp_id = ' + bmp_id + ' acn_id = ' + acn_id + '\n');
                     var copy = g.id_copy_map[ acp_id ];
                     if (!copy) {
                         copy = new_copy(acp_id,ou_id,acn_id,barcode);
                         g.id_copy_map[ acp_id ] = copy;
                     } else {
-                        copy.ischanged('1');
+                        copy.ischanged( get_db_true() );
                     }
                     copy.barcode( barcode );
                     copy.call_number( acn_id );
@@ -851,7 +856,7 @@ g.gather_copies = function() {
         return copies;
 
     } catch(E) {
-        g.error.standard_unexpected_error_alert('Error in volume_copy_creator.js, g.gather_copies():',E);
+        alert('Error in volume_copy_creator.js, g.gather_copies():' + E);
     }
 }