1 dump('entering cat/util.js\n');
3 if (typeof cat == 'undefined') var cat = {};
9 cat.util.EXPORT_TAGS = { ':all' : cat.util.EXPORT_OK };
11 cat.util.spawn_copy_editor = function(list,edit) {
14 JSAN.use('OpenILS.data'); obj.data = new OpenILS.data(); obj.data.init({'via':'stash'});
15 JSAN.use('util.network'); obj.network = new util.network();
16 JSAN.use('util.error'); obj.error = new util.error();
18 var title = list.length == 1 ? '' : 'Batch ';
19 title += edit == 1 ? 'Edit' : 'View';
20 title += ' Copy Attributes';
22 JSAN.use('util.window'); var win = new util.window();
24 obj.data.stash('temp');
26 window.xulG.url_prefix(urls.XUL_COPY_EDITOR)
27 +'?copy_ids='+window.escape(js2JSON(list))
30 'chrome,modal,resizable'
32 /* FIXME -- need to unique the temp space, and not rely on modalness of window */
33 obj.data.stash_retrieve();
34 var copies = JSON2js( obj.data.temp_copies );
35 obj.error.sdump('D_CAT','in cat/copy_status, copy editor, copies =\n<<' + copies + '>>');
36 if (edit=='1' && copies!='' && typeof copies != 'undefined') {
38 var r = obj.network.request(
39 api.FM_ACP_FLESHED_BATCH_UPDATE.app,
40 api.FM_ACP_FLESHED_BATCH_UPDATE.method,
43 /* FIXME -- revisit the return value here */
45 obj.error.standard_unexpected_error_alert('copy update error',E);
48 alert('not updating');
55 dump('exiting cat/util.js\n');