quick copy bucket add
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 29 Jun 2006 14:41:45 +0000 (14:41 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 29 Jun 2006 14:41:45 +0000 (14:41 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@4834 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/main/constants.js
Open-ILS/xul/staff_client/server/cat/copy_buckets.xul
Open-ILS/xul/staff_client/server/cat/util.js

index 057cf19..a23cae2 100644 (file)
@@ -146,6 +146,7 @@ const urls = {
        'XUL_CHECKOUT' : '/xul/server/circ/checkout.xul',
        'XUL_CIRC_BRIEF' : '/xul/server/circ/circ_brief.xul',
        'XUL_CIRC_SUMMARY' : '/xul/server/circ/circ_summary.xul',
+       'XUL_COPY_BUCKETS_QUICK' : '/xul/server/cat/copy_buckets_quick.xul',
        'XUL_COPY_BUCKETS' : '/xul/server/cat/copy_buckets.xul',
        'XUL_COPY_EDITOR' : '/xul/server/cat/copy_editor.xul',
        'XUL_COPY_LOCATION_EDIT' : '/xul/server/admin/copy_locations.xhtml',
index 026d493..931f239 100644 (file)
                                JSAN.addRepository('/xul/server/');
                                JSAN.use('util.error'); g.error = new util.error();
                                g.error.sdump('D_TRACE','my_init() for copy_buckets.xul');
+                               JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.init({'via':'stash'});
 
                                g.cgi = new CGI();
+                               var copy_ids = [];
+                               if (g.cgi.param('copy_ids')) copy_ids = copy_ids.concat( JSON2js( g.cgi.param('copy_ids') ) );
+                               if (typeof window.xuLG == 'object' && typeof window.xulG.copy_ids != 'undefined')
+                                       copy_ids = copy_ids.concat( window.xulG.copy_ids );
+                               if (g.data.temp_copy_ids != 'undefined' && g.data.temp_copy_ids != null) {
+                                       copy_ids = copy_ids.concat( JSON2js( g.data.temp_copy_ids ) );
+                                       g.data.temp_copy_ids = null; g.data.stash('temp_copy_ids');
+                               }
 
                                JSAN.use('cat.copy_buckets'); g.copy_buckets = new cat.copy_buckets();
                                g.copy_buckets.init( 
                                        { 
-                                               'copy_ids' : JSON2js( g.cgi.param('copy_ids') ),
+                                               'copy_ids' : copy_ids,
                                        } 
                                );
        
index 3a974ca..647fc01 100644 (file)
@@ -57,16 +57,18 @@ cat.util.show_in_opac = function(selection_list) {
 cat.util.add_copies_to_bucket = function(selection_list) {
        JSAN.use('util.functional');
        JSAN.use('util.window'); var win = new util.window();
+       JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
+       data.temp_copy_ids = js2JSON(
+               util.functional.map_list(
+                       selection_list,
+                       function (o) {
+                               return o.copy_id;
+                       }
+               )
+       );
+       data.stash('temp_copy_ids');
        win.open( 
-               xulG.url_prefix(urls.XUL_COPY_BUCKETS) 
-               + '?copy_ids=' + js2JSON(
-                       util.functional.map_list(
-                               selection_list,
-                               function (o) {
-                                       return o.copy_id;
-                               }
-                       )
-               ),
+               xulG.url_prefix(urls.XUL_COPY_BUCKETS_QUICK),
                'sel_bucket_win' + win.window_name_increment(),
                'chrome,resizable,modal,center'
        );