[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. 9911ea7643e742a52cbf8446bbbf8de799eb7a1b

Evergreen Git git at git.evergreen-ils.org
Wed Sep 7 16:39:14 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_1 has been updated
       via  9911ea7643e742a52cbf8446bbbf8de799eb7a1b (commit)
       via  883a5a0c1cddd6d5b523cbc0af95f346c4af1a19 (commit)
      from  075be204b7698a0351fcd60a77a9d456d497e109 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9911ea7643e742a52cbf8446bbbf8de799eb7a1b
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Wed Sep 7 03:29:40 2011 -0400

    Fix unified interface w/ editing multiple volumes
    
    Breakage if editing existing items across volumes with non-default values for
    call number class, prefix, or suffix.  This was due to some logic happening
    within a loop that was sadly referencing data that changed out from under it
    with every loop iteration (so for example, we were effectively referencing the
    last rendered class menu instead of each in turn).
    
    Remember folks:
    
    for (var unsafe = 0; unsafe < 10; unsafe++) {
        setTimeout(
            function(safe) {
                return function() {
                    do_something_with(safe); // good
                    do_something_with(unsafe); // bad
                };
            }(unsafe),
            1000
        );
    }
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
index 954c191..5957068 100644
--- a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
+++ b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
@@ -561,9 +561,25 @@ g.render_callnumber_copy_count_entry = function(row,ou_id,count) {
                             var acnp_id = callnumber_composite_key.split(/:/)[1];
                             var acns_id = callnumber_composite_key.split(/:/).slice(-1)[0];
                             call_number_column_textbox.value = acn_label;
-                            classification_column_menulist.value = acnc_id;
-                            prefix_column_menulist.value = acnp_id;
-                            suffix_column_menulist.value = acns_id;
+
+                            var _call_number_column_box = call_number_column_textbox.parentNode;
+
+                            var _classification_column_box =
+                                _call_number_column_box.previousSibling.previousSibling; /* two over to the left */
+                            var _classification_column_menulist =
+                                _classification_column_box.firstChild;
+                            var _prefix_column_box =
+                                _call_number_column_box.previousSibling; /* one over to the left */
+                            var _prefix_column_menulist =
+                                _prefix_column_box.firstChild;
+                            var _suffix_column_box =
+                                _call_number_column_box.nextSibling; /* one over to the right */
+                            var _suffix_column_menulist =
+                                _suffix_column_box.firstChild;
+
+                            _classification_column_menulist.value = acnc_id;
+                            _prefix_column_menulist.value = acnp_id;
+                            _suffix_column_menulist.value = acns_id;
                             dump('\tacn_label = ' + acn_label + ' acnc_id = ' + acnc_id + ' acnp_id = ' + acnp_id + ' acns_id = ' + acns_id + '\n');
                             handle_change_to_callnumber_data({'target':call_number_column_textbox});
                         } else {

commit 883a5a0c1cddd6d5b523cbc0af95f346c4af1a19
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Wed Sep 7 16:34:00 2011 -0400

    LP#838311 acn_id = undefined error in vol/copy ui
    
    Fixes race condition between multiple event listeners on drop-down menus.  Bug
    happened most often when batch applying values across multiple volumes and then
    hitting save/create/update.
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    
    Resolved conflict:
    
    	Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
index 9cb8164..954c191 100644
--- a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
+++ b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
@@ -406,6 +406,7 @@ g.render_callnumber_copy_count_entry = function(row,ou_id,count) {
         dump('\tcomposite_key = ' + callnumber_composite_key + '\n');
 
         _call_number_column_textbox.setAttribute('callkey',callnumber_composite_key);
+        //_call_number_column_textbox.setAttribute('tooltiptext',callnumber_composite_key);
         _call_number_column_textbox.setAttribute('acnc_id',acnc_id);
         _call_number_column_textbox.setAttribute('acnp_id',acnp_id);
         _call_number_column_textbox.setAttribute('acns_id',acns_id);
@@ -474,25 +475,17 @@ g.render_callnumber_copy_count_entry = function(row,ou_id,count) {
                     call_number_column_textbox.addEventListener( 'focus', function(ev) { g.last_focus = ev.target; }, false );
 
                     /**** CLASSIFICATION COLUMN revisited ****/
-                    var classification_column_menulist = g.render_class_menu(call_number_column_textbox);
-                    classification_column_menulist.addEventListener(
-                        'command',
-                        function() {
-                            handle_change_to_callnumber_data({'target':call_number_column_textbox});
-                        }
-                        ,false
+                    var classification_column_menulist = g.render_class_menu(
+                        call_number_column_textbox,
+                        handle_change_to_callnumber_data
                     );
                     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);
-                    prefix_column_menulist.addEventListener(
-                        'command',
-                        function() {
-                            handle_change_to_callnumber_data({'target':call_number_column_textbox});
-                        }
-                        ,false
+                    var prefix_column_menulist = g.render_prefix_menu(
+                        call_number_column_textbox,
+                        handle_change_to_callnumber_data
                     );
 
                     prefix_column_box.appendChild(prefix_column_menulist);
@@ -502,13 +495,9 @@ g.render_callnumber_copy_count_entry = function(row,ou_id,count) {
             suffix_column_box.setAttribute('class','cn_suffix');
             r.appendChild(suffix_column_box);
             suffix_column_box.width = $('batch_suffix').parentNode.boxObject.width;
-                var suffix_column_menulist = g.render_suffix_menu(call_number_column_textbox);
-                suffix_column_menulist.addEventListener(
-                    'command',
-                    function() {
-                        handle_change_to_callnumber_data({'target':call_number_column_textbox});
-                    }
-                    ,false
+                var suffix_column_menulist = g.render_suffix_menu(
+                    call_number_column_textbox,
+                    handle_change_to_callnumber_data
                 );
                 suffix_column_box.appendChild(suffix_column_menulist);
 
@@ -713,6 +702,7 @@ g.render_barcode_entry = function(node,callnumber_composite_key,count,ou_id) {
             }
             tb.setAttribute('ou_id',ou_id);
             tb.setAttribute('callkey',callnumber_composite_key);
+            //tb.setAttribute('tooltiptext',callnumber_composite_key);
             tb.setAttribute('rel_vert_pos',rel_vert_pos_barcode);
             part_menu.firstChild.setAttribute('rel_vert_pos',rel_vert_pos_part);
             if (!tb.value && g.org_label_existing_copy_map[ ou_id ]) {
@@ -1258,13 +1248,14 @@ g.render_class_menu = function(call_number_tb) {
         'command',
         function() {
             call_number_tb.setAttribute('acnc_id',ml.value);
+            update_func({'target':call_number_tb});
         },
         false
     );
     return ml;
 }
 
-g.render_prefix_menu = function(call_number_tb) {
+g.render_prefix_menu = function(call_number_tb,update_func) {
     var ou_id = call_number_tb.getAttribute('ou_id');
     var org = g.data.hash.aou[ ou_id ];
     var menulist = document.createElement('menulist');
@@ -1287,6 +1278,7 @@ g.render_prefix_menu = function(call_number_tb) {
         'command',
         function() {
             call_number_tb.setAttribute('acnp_id',menulist.value);
+            update_func({'target':call_number_tb});
         },
         false
     );
@@ -1320,7 +1312,7 @@ g.render_prefix_menu_items = function(menupopup,ou_id) {
     }
 }
 
-g.render_suffix_menu = function(call_number_tb) {
+g.render_suffix_menu = function(call_number_tb,update_func) {
     var ou_id = call_number_tb.getAttribute('ou_id');
     var org = g.data.hash.aou[ ou_id ];
     var menulist = document.createElement('menulist');
@@ -1343,6 +1335,7 @@ g.render_suffix_menu = function(call_number_tb) {
         'command',
         function() {
             call_number_tb.setAttribute('acns_id',menulist.value);
+            update_func({'target':call_number_tb});
         },
         false
     );

-----------------------------------------------------------------------

Summary of changes:
 .../staff_client/server/cat/volume_copy_creator.js |   61 +++++++++++--------
 1 files changed, 35 insertions(+), 26 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list