copy transfer
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 22 Feb 2006 23:46:35 +0000 (23:46 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 22 Feb 2006 23:46:35 +0000 (23:46 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3174 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 8a424b6..460acf8 100644 (file)
@@ -314,6 +314,45 @@ cat.copy_buckets.prototype = {
                                                        }
                                                }
                                        ],
+                                       'copy_buckets_transfer_to_volume' : [
+                                               ['command'],
+                                               function() {
+                                                       // FM_ACN_RETRIEVE
+                                                       obj.data.stash_retrieve();
+                                                       if (!obj.data.marked_volume) {
+                                                               alert('Please mark a volume as the destination from within the copy browser and then try this again.');
+                                                               return;
+                                                       }
+                                                       var volume = obj.network.simple_request('FM_ACN_RETRIEVE',[ obj.data.marked_volume ]);
+                                                       // FIXME -- later, show some brief details for the record
+                                                       var confirm = prompt('Moving copies to volume "' + volume.label() + '".  To confirm, please retype the volume label.','','Copy Transfer');
+                                                       if (confirm == volume.label()) {
+                                                               JSAN.use('util.functional');
+
+                                                               var copies = obj.network.simple_request('FM_ACP_FLESHED_BATCH_RETRIEVE', [
+                                                                       util.functional.map_list(
+                                                                               obj.list2.dump_retrieve_ids(),
+                                                                               function (o) {
+                                                                                       return JSON2js(o)[0]; // acp_id
+                                                                               }
+                                                                       )
+                                                               ]);
+
+                                                               for (var i = 0; i < copies.length; i++) {
+                                                                       copies[i].call_number( obj.data.marked_volume );
+                                                                       copies[i].ischanged( 1 );
+                                                               }
+
+                                                               var robj = obj.network.simple_request('FM_ACP_FLESHED_BATCH_UPDATE',
+                                                                       [ obj.session, copies ]);
+                                                               // FIXME -- check return value at some point
+
+                                                               obj.controller.render('copy_buckets_menulist_placeholder');             
+                                                               obj.render_pending_copies(); // FIXME -- need a generic refresh for lists
+
+                                                       }
+                                               }
+                                       ],
                                        'cmd_broken' : [
                                                ['command'],
                                                function() { alert('Not Yet Implemented'); }
index 74a88a8..15f753b 100644 (file)
@@ -47,6 +47,7 @@
        <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 id="copy_buckets_transfer_to_volume" label="Transfer to Volume"/>
        <button id="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>