some more flex/persist/splitter tweaks, stubbing out some batch menus, giving batch...
authorJason Etheridge <jason@esilibrary.com>
Fri, 11 Mar 2011 10:03:06 +0000 (05:03 -0500)
committerJason Etheridge <jason@esilibrary.com>
Fri, 11 Mar 2011 10:03:06 +0000 (05:03 -0500)
Open-ILS/xul/staff_client/server/cat/copy_editor.xul
Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
Open-ILS/xul/staff_client/server/cat/volume_copy_creator.xul
Open-ILS/xul/staff_client/server/cat/volume_copy_editor.xul

index 62edc31..5105ec1 100644 (file)
@@ -20,7 +20,6 @@
 
 <window id="cat_copy_editor_win" 
     onload="try { my_init(); font_helper(); persist_helper(); } catch(E) { alert(E); }"
-    width="800" height="580" oils_persist="width height"
     title="&staff.cat.copy_editor.window.label;"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
index cb3fa41..afba813 100644 (file)
@@ -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(
+        [
+            [ '<No Change>', 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(
+        [
+            [ '<No Change>', false ]
+        ]
+    ); hbox.appendChild(ml);
+}
+
+g.list_suffixes = function() {
+    var hbox = $('batch_suffix');
+    var ml = util.widgets.make_menulist(
+        [
+            [ '<No Change>', 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]);
                 }
             }
index 7d4dee4..0d4338f 100644 (file)
@@ -19,7 +19,6 @@
 
 <window id="cat_volume_copy_creator_win" 
     onload="try { my_init(); font_helper(); persist_helper(); } catch(E) { alert(E); }"
-    width="800" height="580" oils_persist="height width sizemode"
     title="&staff.cat.volume_copy_creator.title;"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
     <vbox id="main" oils_persist="height" flex="1">
         <hbox flex="0">
             <hbox id="batch_bar">
-                <label value="Batch:"/>
+                <label value="BATCH"/>
+                <label value="Classification:"/>
                 <hbox id="batch_class"/>
+                <label value="Prefix:"/>
                 <hbox id="batch_prefix"/>
+                <label value="Label:" accesskey="L" control="marc_cn_menulist"/>
                 <hbox id="marc_cn"/>
+                <label value="Suffix:"/>
                 <hbox id="batch_suffix"/>
                 <hbox id="batch_button"/>
             </hbox>
index 2e42a88..b35c077 100644 (file)
             resizeafter="flex"
             resizebefore="flex"
             oils_persist="state hidden"
-            oils_persist_peers="top_pane item_pane">
+            oils_persist_peers="top_pane bottom_pane">
             <grippy/>
         </splitter>
-        <browser id="item_pane" flex="1" oils_persist="height"/>
+        <vbox id="bottom_pane" flex="1" oils_persist="height">
+            <browser id="item_pane" flex="1" />
+            <hbox id="bottom_bar"/>
+        </vbox>
     </vbox>
 
 </window>