if (g.cgi.param('copy_ids')) copy_ids = JSON2js( g.cgi.param('copy_ids') );
if (!copy_ids) copy_ids = [];
if (window.xulG && window.xulG.copy_ids) copy_ids = copy_ids.concat( window.xulG.copy_ids );
+ if (g.data.temp_copy_ids != 'undefined') copy_ids = copy_ids.concat( JSON2js( g.data.temp_copy_ids ) );
if (copy_ids.length > 0) g.copies = g.network.request(
api.FM_ACP_FLESHED_BATCH_RETRIEVE.app,
if (!g.copies) g.copies = [];
if (window.xulG && window.xulG.copies) g.copies = g.copies.concat( window.xulG.copies );
if (g.cgi.param('copies')) g.copies = g.copies.concat( JSON2js( g.cgi.param('copies') ) );
+ if (g.data.temp_copies != 'undefined') g.copies = g.copies.concat( JSON2js( g.data.temp_copies ) );
/******************************************************************************************************/
/* We try to retrieve callnumbers for existing copies, but for new copies, we rely on this */
if (window.xulG && window.xulG.callnumbers) g.callnumbers = window.xulG.callnumbers;
if (g.cgi.param('callnumbers')) g.callnumbers = JSON2js( g.cgi.param('callnumbers') );
+ if (g.data.temp_callnumbers != 'undefined') g.callnumbers = JSON2js( g.data.temp_callnumbers );
/******************************************************************************************************/
/* Is the interface an editor or a viewer, single or multi copy, existing copies or new copies? */
g.templates = {};
var robj = g.network.simple_request('FM_AUS_RETRIEVE',[ses(),g.data.list.au[0].id()]);
if (typeof robj['staff_client.copy_editor.templates'] != 'undefined') {
- g.templates = JSON2js( robj['staff_client.copy_editor.templates'] );
+ g.templates = robj['staff_client.copy_editor.templates'];
}
util.widgets.remove_children('template_placeholder');
var list = util.functional.map_object_to_list( g.templates, function(obj,i) { return [i, i]; } );
if (!name) return;
g.templates[name] = g.changed;
var robj = g.network.simple_request(
- 'FM_AUS_UPDATE',[ses(),g.data.list.au[0].id(), { 'staff_client.copy_editor.templates' : js2JSON(g.templates) }]
+ 'FM_AUS_UPDATE',[ses(),g.data.list.au[0].id(), { 'staff_client.copy_editor.templates' : g.templates }]
);
if (typeof robj.ilsevent != 'undefined') {
throw(robj);
if (! window.confirm('Delete template "' + name + '"?') ) return;
delete(g.templates[name]);
var robj = g.network.simple_request(
- 'FM_AUS_UPDATE',[ses(),g.data.list.au[0].id(), { 'staff_client.copy_editor.templates' : js2JSON(g.templates) }]
+ 'FM_AUS_UPDATE',[ses(),g.data.list.au[0].id(), { 'staff_client.copy_editor.templates' : g.templates }]
);
if (typeof robj.ilsevent != 'undefined') {
throw(robj);
JSAN.use('util.window'); var win = new util.window();
obj.data.temp = '';
obj.data.stash('temp');
+ obj.data.temp_copy_ids = js2JSON(list);
+ obj.data.stash('temp_copy_ids');
var w = win.open(
window.xulG.url_prefix(urls.XUL_COPY_EDITOR)
+'?copy_ids='+window.escape(js2JSON(list))
);
/* FIXME -- need to unique the temp space, and not rely on modalness of window */
obj.data.stash_retrieve();
+ obj.data.temp_copy_ids = null; obj.data.stash('temp_copy_ids');
var copies = JSON2js( obj.data.temp_copies );
+ obj.data.temp_copies = null; obj.data.stash('temp_copies');
+ obj.data.temp_callnumbers = null; obj.data.stash('temp_callnumbers');
obj.error.sdump('D_CAT','in cat/copy_status, copy editor, copies =\n<<' + copies + '>>');
if (edit=='1' && copies!='' && typeof copies != 'undefined') {
try {
JSAN.use('util.window'); var win = new util.window();
if (copies.length > 0) {
+ g.data.temp_copies = js2JSON(copies); g.data.stash('temp_copies');
+ g.data.temp_callnumbers = js2JSON(volume_labels); g.data.stash('temp_callnumbers');
var w = win.open(
urls.XUL_COPY_EDITOR
- +'?copies='+window.escape(js2JSON(copies))
- +'&callnumbers='+window.escape(js2JSON(volume_labels))
- +'&edit=1',
+ +'?edit=1',
title,
'chrome,modal,resizable'
);
/* FIXME -- need to unique the temp space, and not rely on modalness of window */
g.data.stash_retrieve();
+ g.data.temp_copy_ids = null; g.data.stash('temp_copy_ids');
copies = JSON2js( g.data.temp_copies );
+ g.data.temp_copies = null; g.data.stash('temp_copies');
+ g.data.temp_callnumbers = null; g.data.stash('temp_callnumbers');
if (!copies) {
alert('Items were not created.');
return;