interface tweaks: CSV to clipboard, printer, or file
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 15 Mar 2008 06:53:22 +0000 (06:53 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 15 Mar 2008 06:53:22 +0000 (06:53 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@9046 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/cat/record_buckets.js
Open-ILS/xul/staff_client/server/cat/record_buckets.xul
Open-ILS/xul/staff_client/server/cat/record_buckets_overlay.xul

index b43a59c..318d88b 100644 (file)
@@ -445,66 +445,12 @@ cat.record_buckets.prototype = {
                                                }
                                        ],
                                        
-                                       'cmd_record_buckets_export' : [
-                                               ['command'],
-                                               function() {
-                                                       obj.list2.dump_csv_to_clipboard();
-                                               }
-                                       ],
-
-                                       'cmd_export1' : [
-                                               ['command'],
-                                               function() {
-                                                       obj.list1.dump_csv_to_clipboard();
-                                               }
-                                       ],
-
-                    'cmd_print_export1' : [
-                        ['command'],
-                        function() {
-                            try {
-                                obj.list1.on_all_fleshed =
-                                    function() {
-                                        try {
-                                            dump( obj.list1.dump_csv() + '\n' );
-                                            //copy_to_clipboard(obj.list.dump_csv());
-                                            JSAN.use('util.print'); var print = new util.print();
-                                            print.simple(obj.list1.dump_csv(),{'content_type':'text/plain'});
-                                            setTimeout(function(){ obj.list1.on_all_fleshed = null; },0);
-                                        } catch(E) {
-                                            obj.error.standard_unexpected_error_alert('print export',E);
-                                        }
-                                    }
-                                obj.list1.full_retrieve();
-                            } catch(E) {
-                                obj.error.standard_unexpected_error_alert('print export',E);
-                            }
-                        }
-                    ],
-
-
-                    'cmd_print_export2' : [
-                        ['command'],
-                        function() {
-                            try {
-                                obj.list2.on_all_fleshed =
-                                    function() {
-                                        try {
-                                            dump( obj.list2.dump_csv() + '\n' );
-                                            //copy_to_clipboard(obj.list.dump_csv());
-                                            JSAN.use('util.print'); var print = new util.print();
-                                            print.simple(obj.list2.dump_csv(),{'content_type':'text/plain'});
-                                            setTimeout(function(){ obj.list2.on_all_fleshed = null; },0);
-                                        } catch(E) {
-                                            obj.error.standard_unexpected_error_alert('print export',E);
-                                        }
-                                    }
-                                obj.list2.full_retrieve();
-                            } catch(E) {
-                                obj.error.standard_unexpected_error_alert('print export',E);
-                            }
-                        }
-                    ],
+                                       'cmd_pending_buckets_csv_to_clipboard' : [ ['command'], function() { obj.list1.dump_csv_to_clipboard(); } ], 
+                                       'cmd_record_buckets_csv_to_clipboard' : [ ['command'], function() { obj.list2.dump_csv_to_clipboard(); } ],
+                    'cmd_pending_buckets_csv_to_printer' : [ ['command'], function() { obj.list1.dump_csv_to_printer(); } ],
+                    'cmd_record_buckets_csv_printer' : [ ['command'], function() { obj.list2.dump_csv_to_printer(); } ], 
+                    'cmd_pending_buckets_csv_to_file' : [ ['command'], function() { obj.list1.dump_csv_to_file( { 'defaultFileName' : 'pending_records.txt' } ); } ],
+                    'cmd_record_buckets_csv_file' : [ ['command'], function() { obj.list2.dump_csv_to_file( { 'defaultFileName' : 'bucket_records.txt' } ); } ], 
 
                                        'cmd_export_records_usmarc' : [
                                                ['command'],
@@ -691,12 +637,6 @@ cat.record_buckets.prototype = {
                                                ['command'],
                                                function() { alert('Not Yet Implemented'); }
                                        ],
-                                       'cmd_record_buckets_done' : [
-                                               ['command'],
-                                               function() {
-                                                       window.close();
-                                               }
-                                       ],
                                        'cmd_sel_opac' : [
                                                ['command'],
                                                function() {
@@ -737,9 +677,6 @@ cat.record_buckets.prototype = {
                if (typeof xulG == 'undefined') {
                        obj.controller.view.cmd_sel_opac.disabled = true;
                        obj.controller.view.cmd_sel_opac.setAttribute('disabled',true);
-               } else {
-                       obj.controller.view.cmd_record_buckets_done.disabled = true;
-                       obj.controller.view.cmd_record_buckets_done.setAttribute('disabled',true);
                }
        },
 
index 4febb7f..9ad970b 100644 (file)
                <command id="sel_clip2" />
                <command id="save_columns1" />
                <command id="save_columns2" />
-               <command id="cmd_print_export1" />
-               <command id="cmd_export1" />
-               <command id="cmd_print_export2" />
-               <command id="cmd_record_buckets_submit_barcode" />
-               <command id="cmd_record_buckets_print" />
-               <command id="cmd_record_buckets_export" />
-               <command id="cmd_record_buckets_reprint" />
-               <command id="cmd_record_buckets_done" />
+
+               <command id="cmd_pending_buckets_csv_to_printer" />
+               <command id="cmd_pending_buckets_csv_to_clipboard" />
+               <command id="cmd_pending_buckets_csv_to_file" />
+
+               <command id="cmd_record_buckets_csv_to_printer" />
+               <command id="cmd_record_buckets_csv_to_clipboard" />
+               <command id="cmd_record_buckets_csv_to_file" />
+
                <command id="cmd_merge_records" />
                <command id="cmd_export_records_usmarc" />
                <command id="cmd_export_records_unimarc" />
index f84be23..4b6bd73 100644 (file)
 </vbox>
 
 <hbox id="pending_buckets_bottom_ui">
+       <button id="pending_buckets_export_list" label="Export List" type="menu" allowevents="true">
+        <menupopup id="pending_buckets_export_actions">
+           <menuitem command="cmd_pending_buckets_csv_to_printer" label="Print List CSV" />
+               <menuitem command="cmd_pending_buckets_csv_to_clipboard" label="Copy List CSV to Clipboard" accesskey=""/>
+               <menuitem command="cmd_pending_buckets_csv_to_file" label="Save List CSV to File" accesskey=""/>
+        </menupopup>
+    </button>
        <button id="save_button1" command="save_columns1" label="Save Columns" />
        <button id="clip_button1" command="sel_clip1" label="Copy to Clipboard" disabled="true" />
-       <button id="cmd_print_export_btn1" command="cmd_print_export1" label="Print CSV" />
-       <button id="cmd_export_btn1" command="cmd_export1" label="CVS to Clipboard" />
        <spacer flex="1"/>
        <button label="Add All" id="record_buckets_add" accesskey="A" image="/xul/server/skin/media/images/down_arrow.gif"/>
        <button label="Add Selected" id="record_buckets_sel_add" accesskey="" image="/xul/server/skin/media/images/down_arrow.gif"/>
 </hbox>
 
 <hbox id="record_buckets_bottom_ui">
-       <button id="cmd_print_export_btn2" command="cmd_print_export2" label="Print CSV" />
-       <button id="record_buckets_export" 
-               label="CSV to Clipboard"
-               command="cmd_record_buckets_export"
-               accesskey=""/>
+       <button id="record_buckets_export_list" label="Export List" type="menu" allowevents="true">
+        <menupopup id="record_buckets_export_actions">
+           <menuitem command="cmd_record_buckets_csv_to_printer" label="Print List CSV" />
+               <menuitem command="cmd_record_buckets_csv_to_clipboard" label="Copy List CSV to Clipboard" accesskey=""/>
+               <menuitem command="cmd_record_buckets_csv_to_file" label="Save List CSV to File" accesskey=""/>
+        </menupopup>
+    </button>
        <spacer flex="1"/>
        <hbox style="background: grey">
                <vbox><spacer flex="1"/><label value="Batch:" style="font-weight: bold"/><spacer flex="1"/></vbox>