From e863334eba377a8c1f8e2179b553eeb4cf02d2b1 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Fri, 11 Mar 2011 05:03:06 -0500 Subject: [PATCH] some more flex/persist/splitter tweaks, stubbing out some batch menus, giving batch label menu a blank entry for no change, and an accesskey --- .../xul/staff_client/server/cat/copy_editor.xul | 1 - .../staff_client/server/cat/volume_copy_creator.js | 79 +++++++++++++++++++--- .../server/cat/volume_copy_creator.xul | 7 +- .../staff_client/server/cat/volume_copy_editor.xul | 7 +- 4 files changed, 78 insertions(+), 16 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/cat/copy_editor.xul b/Open-ILS/xul/staff_client/server/cat/copy_editor.xul index 62edc318a1..5105ec13e5 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_editor.xul +++ b/Open-ILS/xul/staff_client/server/cat/copy_editor.xul @@ -20,7 +20,6 @@ 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 cb3fa416c2..afba813ce0 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 @@ -139,9 +139,13 @@ function my_init() { g.parts_hash = util.functional.convert_object_list_to_hash( g.parts ); /***********************************************************************************************************/ - /* For the call number drop down */ + /* For the batch drop downs */ + g.list_classes(); + g.list_prefixes(); g.list_callnumbers(g.doc_id, g.label_class); + g.list_suffixes(); + g.render_batch_button(); /***********************************************************************************************************/ /* render the orgs and volumes/input */ @@ -358,9 +362,12 @@ g.render_callnumber_copy_count_entry = function(row,ou_id,count) { var call_number_column_textbox = document.createElement('textbox'); call_number_column_box.appendChild(call_number_column_textbox); if (g.use_defaults && $('marc_cn').firstChild) { - // default to first value from batch callnumber menu - call_number_column_textbox.value = $('marc_cn').firstChild.value; - call_number_column_textbox.select(); + // default to first real value from batch callnumber menu + var menupopup = $('marc_cn').firstChild.firstChild; + if (menupopup.childNodes.length > 1) { + call_number_column_textbox.value = menupopup.childNodes[1].getAttribute('label'); + call_number_column_textbox.select(); + } } call_number_column_textbox.setAttribute('rel_vert_pos',rel_vert_pos_call_number); call_number_column_textbox.setAttribute('ou_id',ou_id); @@ -680,8 +687,15 @@ g.generate_barcodes = function() { for (var i = 0; i < barcodes.length; i++) { nodes[i+1].value = barcodes[i]; nodes[i+1].select(); + util.widgets.dispatch('change',nodes[i+1]); } + setTimeout( + function() { + g.gather_copies_soon(); + },0 + ); + } catch(E) { g.error.sdump('D_ERROR','g.generate_barcodes: ' + E); } @@ -1232,17 +1246,60 @@ g.list_callnumbers = function(doc_id, label_class) { } var hbox = document.getElementById('marc_cn'); var ml = util.widgets.make_menulist( - util.functional.map_list( - cn_blob, - function(o) { - for (var i in o) { - return [ o[i], i ]; + [ + [ '', '' ] + ].concat( + util.functional.map_list( + cn_blob, + function(o) { + for (var i in o) { + return [ o[i], i ]; + } } - } + ) ) ); hbox.appendChild(ml); ml.setAttribute('editable','true'); ml.setAttribute('width', '200'); + ml.setAttribute('id', 'marc_cn_menulist'); +} + +g.list_classes = function() { + var hbox = $('batch_class'); + var ml = util.widgets.make_menulist( + [ + [ '', false ] + ].concat( + util.functional.map_list( + g.data.list.acnc, + function(o) { + return [ o.name(), o.id() ]; + } + ) + ) + ); hbox.appendChild(ml); +} + +g.list_prefixes = function() { + var hbox = $('batch_prefix'); + var ml = util.widgets.make_menulist( + [ + [ '', false ] + ] + ); hbox.appendChild(ml); +} + +g.list_suffixes = function() { + var hbox = $('batch_suffix'); + var ml = util.widgets.make_menulist( + [ + [ '', false ] + ] + ); hbox.appendChild(ml); +} + +g.render_batch_button = function() { + var hbox = $('batch_button'); var btn = document.createElement('button'); btn.setAttribute('label',$('catStrings').getString('staff.cat.volume_copy_creator.my_init.btn.label')); btn.setAttribute('accesskey',$('catStrings').getString('staff.cat.volume_copy_creator.my_init.btn.accesskey')); @@ -1256,7 +1313,7 @@ g.list_callnumbers = function(doc_id, label_class) { if (nl[i].getAttribute('rel_vert_pos')==rel_vert_pos_call_number && !nl[i].disabled) { - nl[i].value = ml.value; + nl[i].value = $('marc_cn').firstChild.value; util.widgets.dispatch('change',nl[i]); } } diff --git a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.xul b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.xul index 7d4dee4219..0d4338f10a 100644 --- a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.xul +++ b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.xul @@ -19,7 +19,6 @@ @@ -48,10 +47,14 @@ - -- 2.11.0