use the standardized list actions for copy buckets
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 11 Feb 2009 14:38:25 +0000 (14:38 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 11 Feb 2009 14:38:25 +0000 (14:38 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/staff-client-experiment@12148 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/cat/copy_buckets.js
Open-ILS/xul/staff_client/server/cat/copy_buckets.xul
Open-ILS/xul/staff_client/server/cat/copy_buckets_overlay.xul

index 373c840..f7f7a62 100644 (file)
@@ -81,7 +81,6 @@ cat.copy_buckets.prototype = {
                                        try {
                                                JSAN.use('util.functional');
                                                var sel = obj.list1.retrieve_selection();
-                                               document.getElementById('clip_button1').disabled = sel.length < 1;
                                                obj.selection_list1 = util.functional.map_list(
                                                        sel,
                                                        function(o) { return JSON2js(o.getAttribute('retrieve_id')); }
@@ -112,7 +111,6 @@ cat.copy_buckets.prototype = {
                                        try {
                                                JSAN.use('util.functional');
                                                var sel = obj.list2.retrieve_selection();
-                                               document.getElementById('clip_button2').disabled = sel.length < 1;
                                                obj.selection_list2 = util.functional.map_list(
                                                        sel,
                                                        function(o) { return JSON2js(o.getAttribute('retrieve_id')); }
@@ -140,22 +138,32 @@ cat.copy_buckets.prototype = {
                obj.controller.init(
                        {
                                'control_map' : {
-                                       'save_columns2' : [
-                                               ['command'],
-                                               function() { obj.list2.save_columns(); }
-                                       ],
-                                       'save_columns1' : [
-                                               ['command'],
-                                               function() { obj.list1.save_columns(); }
-                                       ],
-                                       'sel_clip2' : [
-                                               ['command'],
-                                               function() { obj.list2.clipboard(); }
-                                       ],
-                                       'sel_clip1' : [
-                                               ['command'],
-                                               function() { obj.list1.clipboard(); }
-                                       ],
+                    'list_actions1' : [
+                        ['render'],
+                        function(e) {
+                            return function() {
+                                e.appendChild( obj.list1.render_list_actions() );
+                                obj.list1.set_list_actions(
+                                    {
+                                        'on_complete' : function() { }
+                                    }
+                                );
+                            };
+                        }
+                    ],
+                    'list_actions2' : [
+                        ['render'],
+                        function(e) {
+                            return function() {
+                                e.appendChild( obj.list2.render_list_actions() );
+                                obj.list2.set_list_actions(
+                                    {
+                                        'on_complete' : function() { }
+                                    }
+                                );
+                            };
+                        }
+                    ],
                                        'copy_buckets_menulist_placeholder' : [
                                                ['render'],
                                                function(e) {
@@ -580,60 +588,6 @@ cat.copy_buckets.prototype = {
                                                        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_copy_buckets_reprint' : [
                                                ['command'],
                                                function() {
index a5c3cb0..a312771 100644 (file)
        <messagecatalog id="circStrings" src="/xul/server/locale/<!--#echo var='locale' -->/circ.properties"/>
 
        <commandset id="copy_buckets_cmds">
-               <command id="sel_clip1" />
-               <command id="save_columns1" />
-               <command id="sel_clip2" />
-               <command id="save_columns2" />
-               <command id="cmd_print_export1" />
-               <command id="cmd_export1" />
-               <command id="cmd_print_export2" />
                <command id="cmd_copy_buckets_submit_barcode" />
                <command id="cmd_copy_buckets_print" />
                <command id="cmd_copy_buckets_export" />
index 6c3e062..ffec808 100644 (file)
 </vbox>
 
 <hbox id="pending_buckets_bottom_ui">
-       <button id="save_button1" command="save_columns1" label="&staff.cat.copy_buckets_overlay.pending_buckets.save_columns1;" />
-       <button id="clip_button1" command="sel_clip1" label="&staff.cat.copy_buckets_overlay.pending_buckets.sel_clip1;" disabled="true" />
-       <button id="cmd_print_export_btn1" command="cmd_print_export1" label="&staff.cat.copy_buckets_overlay.pending_buckets.cmd_print_export1;" />
-       <button id="cmd_export_btn1" command="cmd_export1" label="&staff.cat.copy_buckets_overlay.pending_buckets.cmd_export1;" />
+    <hbox id="list_actions1"/>
        <spacer flex="1"/>
        <button label="&staff.cat.copy_buckets_overlay.pending_buckets.copy_buckets_add.label;" command="copy_buckets_add" accesskey="&staff.cat.copy_buckets_overlay.pending_buckets.copy_buckets_add.accesskey;" image="/xul/server/skin/media/images/down_arrow.gif"/>
        <button label="&staff.cat.copy_buckets_overlay.pending_buckets.copy_buckets_sel_add.label;" command="copy_buckets_sel_add" accesskey="" image="/xul/server/skin/media/images/down_arrow.gif"/>
@@ -46,8 +43,6 @@
        <button command="copy_buckets_delete_bucket" label="&staff.cat.copy_buckets_overlay.copy_buckets.copy_buckets_delete_bucket.label;"/>
        <button id="refresh" label="&staff.cat.copy_buckets_overlay.copy_buckets.refresh.label;"/>
        <spacer flex="1"/>
-       <button id="save_button2" command="save_columns2" label="&staff.cat.copy_buckets_overlay.copy_buckets.save_columns2.label;" />
-       <button id="clip_button2" command="sel_clip2" label="&staff.cat.copy_buckets_overlay.copy_buckets.sel_clip2.label;" disabled="true" />
        <button command="copy_buckets_delete_item" label="&staff.cat.copy_buckets_overlay.copy_buckets.delete_item.label;" disabled="true" image="/xul/server/skin/media/images/icon_delete.gif"/>
        <button command="copy_buckets_export" label="&staff.cat.copy_buckets_overlay.copy_buckets.export.label;" disabled="true" image="/xul/server/skin/media/images/up_arrow.gif"/>
 </hbox>
 </hbox>
 
 <hbox id="copy_buckets_bottom_ui">
-       <button id="copy_buckets_print" label="&staff.cat.copy_buckets_overlay.copy_buckets.print.label;" command="cmd_copy_buckets_print" accesskey="&staff.cat.copy_buckets_overlay.copy_buckets.print.accesskey;"/>
-       <button id="cmd_print_export_btn2" command="cmd_print_export2" label="&staff.cat.copy_buckets_overlay.copy_buckets.print_export.label;" />
-       <button id="copy_buckets_export" 
-               label="&staff.cat.copy_buckets_overlay.copy_buckets.cmd_copy_buckets_export.label;"
-               command="cmd_copy_buckets_export"
-               accesskey=""/>
+    <hbox id="list_actions2"/>
        <spacer flex="1"/>
        <hbox style="background: grey">
                <vbox><spacer flex="1"/><label value="&staff.cat.copy_buckets_overlay.copy_buckets.batch.label;" style="font-weight: bold"/><spacer flex="1"/></vbox>