make sure we can create empty volumes straight away without needing to enter barcodes
authorJason Etheridge <jason@esilibrary.com>
Fri, 11 Mar 2011 18:07:10 +0000 (13:07 -0500)
committerJason Etheridge <jason@esilibrary.com>
Fri, 11 Mar 2011 18:07:10 +0000 (13:07 -0500)
Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js

index 71796ef..1c9933e 100644 (file)
@@ -306,7 +306,10 @@ g.render_callnumber_copy_count_entry = function(row,ou_id,count) {
     ) {
         dump('handle_change_precipitating_barcode_rendering\n');
 
-        if (isNaN( Number( number_of_copies_column_textbox.value ) )) return;
+        if (isNaN( Number( number_of_copies_column_textbox.value ) )) {
+            dump('1:handle_change_precipitating_barcode_rendering early return\n');
+            return;
+        }
         if ( Number( number_of_copies_column_textbox.value ) > g_max_copies_that_can_be_added_at_a_time_per_volume ) {
             g.error.yns_alert($("catStrings").getFormattedString('staff.cat.volume_copy_creator.render_volume_count_entry.message', [g_max_copies_that_can_be_added_at_a_time_per_volume]),
                 $("catStrings").getString('staff.cat.volume_copy_creator.render_volume_count_entry.title'),
@@ -619,6 +622,7 @@ g.render_part_menuitems = function(menupopup) {
 
 g.render_barcode_entry = function(node,callnumber_composite_key,count,ou_id) {
     try {
+        dump('g.render_barcode_entry(node,'+callnumber_composite_key+','+count+','+ou_id+'\n');
         function ready_to_create(ev) {
             if (! xulG.unified_interface) {
                 document.getElementById("EditThenCreate").disabled = false;
@@ -689,6 +693,7 @@ g.render_barcode_entry = function(node,callnumber_composite_key,count,ou_id) {
             }
         }
 
+        g.gather_copies_soon();
         setTimeout( function() { if (g.first_focus) { g.first_focus.focus(); } }, 0 );
 
     } catch(E) {
@@ -954,6 +959,8 @@ g.vivicate_update_volumes = function() {
                         'FM_ACN_FIND_OR_CREATE',
                         [ ses(), callnumber_data.acn_label, g.doc_id, ou_id, acnp_id, acns_id, acnc_id ]
                     );
+                    dump('FM_ACN_FIND_OR_CREATE: label = ' + callnumber_data.acn_label
+                        + ' doc = ' + g.doc_id + ' ou = ' + ou_id + ' acnp = ' + acnp_id + ' acns = ' + acns_id + ' acnc = ' + acnc_id + '\n');
 
                     if (typeof acn_blob.ilsevent != 'undefined') {
                         alert('Error in g.vivicate_update_volumes, acn_id = ' + acn_id + ' acn_blob = ' + js2JSON(acn_blob));