[open-ils-commits] [GIT] Evergreen ILS branch master updated. 42c33a3af8727ff8d0f12490438816e5cf84e2a3
Evergreen Git
git at git.evergreen-ils.org
Wed Sep 7 16:29:23 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, master has been updated
via 42c33a3af8727ff8d0f12490438816e5cf84e2a3 (commit)
via 84a47bebf522f5d38e2c22ae84160099bbd1128d (commit)
from c7274c046952ae14bd70511ee3b3a3060390a5bd (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 42c33a3af8727ff8d0f12490438816e5cf84e2a3
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 68af8b0..1ec3d0e 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
@@ -576,9 +576,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 84a47bebf522f5d38e2c22ae84160099bbd1128d
Author: Jason Etheridge <jason at esilibrary.com>
Date: Wed Aug 31 15:07:52 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>
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 aecfe20..68af8b0 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
@@ -421,6 +421,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);
@@ -489,25 +490,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);
@@ -517,13 +510,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);
@@ -728,6 +717,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 ]) {
@@ -1264,20 +1254,21 @@ g.save_prefs = function () {
}
}
-g.render_class_menu = function(call_number_tb) {
+g.render_class_menu = function(call_number_tb,update_func) {
var ml = cat.util.render_cn_class_menu();
ml.setAttribute('rel_vert_pos',rel_vert_pos_call_number_classification);
ml.addEventListener(
'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 menulist = cat.util.render_cn_prefix_menu([ou_id]);
menulist.setAttribute('rel_vert_pos',rel_vert_pos_call_number_prefix);
@@ -1285,13 +1276,14 @@ 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
);
return menulist;
}
-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 menulist = cat.util.render_cn_suffix_menu([ou_id]);
menulist.setAttribute('rel_vert_pos',rel_vert_pos_call_number_suffix);
@@ -1299,6 +1291,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 | 63 +++++++++++--------
1 files changed, 36 insertions(+), 27 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list