spawn buckets interface from copy status interface
[Evergreen.git] / Open-ILS / xul / staff_client / server / circ / copy_status.js
index 68bc677..ab7fef8 100644 (file)
@@ -104,7 +104,22 @@ circ.copy_status.prototype = {
                                        'sel_bucket' : [
                                                ['command'],
                                                function() {
-                                                       alert('Not Yet Implemented');
+                                                       JSAN.use('util.functional');
+                                                       JSAN.use('util.window'); var win = new util.window();
+                                                       win.open( 
+                                                               xulG.url_prefix(urls.XUL_COPY_BUCKETS) 
+                                                               + '?session=' + window.escape(obj.session)
+                                                               + '&copy_ids=' + js2JSON(
+                                                                       util.functional.map_list(
+                                                                               obj.selection_list,
+                                                                               function (o) {
+                                                                                       return o[0];
+                                                                               }
+                                                                       )
+                                                               ),
+                                                               'sel_bucket_win' + win.window_name_increment(),
+                                                               'chrome,resizable,modal,center'
+                                                       );
                                                }
                                        ],
                                        'copy_status_barcode_entry_textbox' : [
@@ -194,8 +209,8 @@ circ.copy_status.prototype = {
 
                list = util.functional.map_list(
                        list,
-                       function (obj) {
-                               return obj[0];
+                       function (o) {
+                               return o[0];
                        }
                );
 
@@ -216,15 +231,15 @@ circ.copy_status.prototype = {
                                        obj.data.list.au[0].id(), 
                                        util.functional.map_list(
                                                copies,
-                                               function (obj) {
-                                                       return obj.network.simple_request('FM_ACN_RETRIEVE',[obj.call_number()]).owning_lib();
+                                               function (o) {
+                                                       return obj.network.simple_request('FM_ACN_RETRIEVE',[o.call_number()]).owning_lib();
                                                }
                                        ),
                                        [ 'UPDATE_COPY', 'UPDATE_BATCH_COPY' ]
                                ]
                        ).length == 0 ? 1 : 0;
                } catch(E) {
-                       obj.error.sdump('batch permission check: ' + E);
+                       obj.error.sdump('D_ERROR','batch permission check: ' + E);
                }
 
                var title = list.length == 1 ? 'Copy' : 'Copies';