enable actual volume/item creation in unified interface masslnc-vol-item-ui
authorJason Etheridge <jason@esilibrary.com>
Wed, 2 Mar 2011 06:37:53 +0000 (01:37 -0500)
committerJason Etheridge <jason@esilibrary.com>
Wed, 2 Mar 2011 15:20:58 +0000 (10:20 -0500)
Open-ILS/xul/staff_client/server/cat/copy_editor.js
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/locale/en-US/cat.properties

index 9b9d57f..8c1ffff 100644 (file)
@@ -185,7 +185,10 @@ function my_init() {
                 } catch(E) {
                     alert('Error in copy_editor.js, xulG.refresh_copy_editor(): ' + E);
                 }
-            }
+            };
+            xulG.unlock_copy_editor = function() {
+                oils_unlock_page();
+            };
         }
 
     } catch(E) {
index 37d1500..3b8805e 100644 (file)
@@ -23,6 +23,8 @@ function my_init() {
 
         if (xulG.unified_interface) {
             $('non_unified_buttons').hidden = true;
+        } else {
+            $('Create').hidden = true;
         }
 
         /***********************************************************************************************************/
@@ -47,11 +49,15 @@ function my_init() {
             set_attr('EditThenCreate','accesskey','staff.cat.volume_copy_creator.edit_then_rebarcode.btn.accesskey');
             set_attr('CreateWithDefaults','label','staff.cat.volume_copy_creator.rebarcode.btn.label');
             set_attr('CreateWithDefaults','accesskey','staff.cat.volume_copy_creator.rebarcode.btn.accesskey');
+            set_attr('Create','label','staff.cat.volume_copy_creator.rebarcode.btn.label');
+            set_attr('Create','accesskey','staff.cat.volume_copy_creator.rebarcode.btn.accesskey');
         } else {
             set_attr('EditThenCreate','label','staff.cat.volume_copy_creator.edit_then_create.btn.label');
             set_attr('EditThenCreate','accesskey','staff.cat.volume_copy_creator.edit_then_create.btn.accesskey');
             set_attr('CreateWithDefaults','label','staff.cat.volume_copy_creator.create_with_defaults.btn.label');
             set_attr('CreateWithDefaults','accesskey','staff.cat.volume_copy_creator.create_with_defaults.btn.accesskey');
+            set_attr('Create','label','staff.cat.volume_copy_creator.create.btn.label');
+            set_attr('Create','accesskey','staff.cat.volume_copy_creator.create.btn.accesskey');
         }
 
         //g.error.sdump('D_ERROR','location.href = ' + location.href + '\n\ncopy_short cut = ' + g.copy_shortcut + '\n\nou_ids = ' + xul_param('ou_ids'));
@@ -231,6 +237,8 @@ g.render_callnumber_copy_count_entry = function(row,ou_id,count) {
         if (! xulG.unified_interface) {
             document.getElementById("EditThenCreate").disabled = false;
             document.getElementById("CreateWithDefaults").disabled = false;
+        } else {
+            document.getElementById("Create").disabled = false;
         }
     }
 
@@ -321,6 +329,8 @@ g.render_barcode_entry = function(node,callnumber,count,ou_id) {
             if (! xulG.unified_interface) {
                 document.getElementById("EditThenCreate").disabled = false;
                 document.getElementById("CreateWithDefaults").disabled = false;
+            } else {
+                document.getElementById("Create").disabled = false;
             }
         }
 
@@ -521,7 +531,12 @@ g.stash_and_close = function(param) {
 
     try {
 
-        var copies = g.gather_copies();
+        var copies;
+        if (xulG.unified_interface) {
+            copies = xulG.copies;
+        } else {
+            copies = g.gather_copies();
+        }
 
         var dont_close = false;
         JSAN.use('util.window'); var win = new util.window();
@@ -562,6 +577,10 @@ g.stash_and_close = function(param) {
         try { if (typeof window.refresh == 'function') { window.refresh(); } } catch(E) { dump(E+'\n'); }
         try { if (typeof g.refresh == 'function') { g.refresh(); } } catch(E) { dump(E+'\n'); }
 
+        if (typeof xulG.unlock_copy_editor == 'function') {
+            xulG.unlock_copy_editor();
+        }
+
         if (! dont_close) { xulG.close_tab(); }
 
     } catch(E) {
index 0a2ddb4..4d62a96 100644 (file)
             </rows>
         </grid>
     </groupbox>
-    <hbox id="non_unified_buttons" style="border-bottom: solid black thin">
+    <hbox style="border-bottom: solid black thin">
         <spacer flex="1" />
-        <button id="CreateWithDefaults" disabled="true" oncommand="g.stash_and_close('noedit');"/>
-        <button id="EditThenCreate" disabled="true" oncommand="g.stash_and_close('edit');"/>
+        <hbox id="non_unified_buttons">
+            <button id="CreateWithDefaults" disabled="true" oncommand="g.stash_and_close('noedit');"/>
+            <button id="EditThenCreate" disabled="true" oncommand="g.stash_and_close('edit');"/>
+        </hbox>
+        <button id="Create" disabled="true" oncommand="g.stash_and_close('unified_interface');"/>
     </hbox>
 
 </window>
index 79dd237..8ac1b3f 100644 (file)
@@ -396,6 +396,8 @@ staff.cat.volume_copy_creator.edit_then_create.btn.label=Edit then Create
 staff.cat.volume_copy_creator.edit_then_create.btn.accesskey=C
 staff.cat.volume_copy_creator.create_with_defaults.btn.label=Create with Defaults
 staff.cat.volume_copy_creator.create_with_defaults.btn.accesskey=D
+staff.cat.volume_copy_creator.create.btn.label=Create Volumes/Items
+staff.cat.volume_copy_creator.create.btn.accesskey=C
 staff.cat.volume_copy_creator.edit_then_rebarcode.btn.label=Edit then Re-barcode
 staff.cat.volume_copy_creator.edit_then_rebarcode.btn.accesskey=E
 staff.cat.volume_copy_creator.rebarcode.btn.label=Re-barcode