some cosmetics, and batch item delete which doesnt work
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 1 Aug 2006 04:58:14 +0000 (04:58 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 1 Aug 2006 04:58:14 +0000 (04:58 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5214 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 f485a32..fba77cc 100644 (file)
@@ -358,6 +358,48 @@ cat.copy_buckets.prototype = {
                                                        }
                                                }
                                        ],
+                                       'copy_buckets_batch_copy_delete' : [
+                                               ['command'],
+                                               function() {
+                                                       try {
+                                                       
+                                                               JSAN.use('util.widgets'); JSAN.use('util.functional');
+
+                                                               var list = util.functional.map_list(
+                                                                       obj.list2.dump_retrieve_ids(),
+                                                                       function (o) {
+                                                                               return JSON2js(o)[0]; // acp_id
+                                                                       }
+                                                               );
+
+                                                               var copies = util.functional.map_list(
+                                                                       list,
+                                                                       function (acp_id) {
+                                                                               return obj.network.simple_request('FM_ACP_RETRIEVE',[acp_id]);
+                                                                       }
+                                                               );
+
+                                                               for (var i = 0; i < copies.length; i++) {
+                                                                       copies[i].ischanged(1);
+                                                                       copies[i].isdeleted(1);
+                                                               }
+
+                                                               var robj = obj.network.simple_request('FM_ACP_FLESHED_BATCH_UPDATE',[ ses, copies, true]);
+                                                               if (typeof robj.ilsevent != 'undefined') obj.error.standard_unexpected_error_alert('Batch Item Deletion',robj);
+
+                                                               obj.render_pending_copies(); // FIXME -- need a generic refresh for lists
+                                                               setTimeout(
+                                                                       function() {
+                                                                               JSAN.use('util.widgets'); 
+                                                                               util.widgets.dispatch('change_bucket',obj.controller.view.bucket_menulist);
+                                                                       }, 0
+                                                               );
+                                                       } catch(E) {
+                                                               alert( js2JSON(E) );
+                                                       }
+                                               }
+                                       ],
+
                                        'copy_buckets_transfer_to_volume' : [
                                                ['command'],
                                                function() {
index 3bf117e..911967a 100644 (file)
@@ -89,6 +89,7 @@
                <command id="copy_buckets_export" />
                <command id="copy_buckets_transfer_to_volume" />
                <command id="copy_buckets_batch_copy_edit" />
+               <command id="copy_buckets_batch_copy_delete" />
        </commandset>
 
        <box id="copy_buckets_main" />
index 5c6a486..8a9f3d2 100644 (file)
        <button id="copy_buckets_print" label="Print" command="cmd_copy_buckets_print" accesskey="P"/>
        <button id="copy_buckets_reprint" label="Print Last" command="cmd_copy_buckets_reprint" accesskey_disabled="L"/>
        <spacer flex="1"/>
-       <button label="Show All in Copy Status Interface" accesskey="C" command="cmd_export_to_copy_status"/>
-       <button command="copy_buckets_transfer_to_volume" label="Transfer All to Specific Volume"/>
-       <button command="copy_buckets_batch_copy_edit" label="Batch Edit" image="/xul/server/skin/media/images/grinder.gif"/>
-       <button id="copy_buckets_done" label="Done" command="cmd_copy_buckets_done" accesskey="D"/>
+       <hbox style="background: grey">
+               <vbox><spacer flex="1"/><label value="Batch:" style="font-weight: bold"/><spacer flex="1"/></vbox>
+               <button label="Show Status" command="cmd_export_to_copy_status"/>
+               <button command="copy_buckets_transfer_to_volume" label="Transfer to Specific Volume"/>
+               <button command="copy_buckets_batch_copy_edit" label="Edit Item Attributes" image="/xul/server/skin/media/images/grinder.gif"/>
+               <button command="copy_buckets_batch_copy_delete" label="Delete" />
+       </hbox>
 </hbox>
 
 </overlay>