From 6df64494b870a2ea03d519b2371c48ebb564ba0c Mon Sep 17 00:00:00 2001 From: phasefx Date: Mon, 16 Jul 2007 20:14:11 +0000 Subject: [PATCH] fancy_prompt and modal_xulG bug where window.open was being used instead of the JSAN wrapper library (util.window) where the modal_xulG way of passing data to/from modal windows is managed git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@7556 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/server/cat/record_buckets.js | 87 ++++++++++++++++++++-- .../staff_client/server/patron/hold_notices.xul | 2 +- 2 files changed, 83 insertions(+), 6 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/cat/record_buckets.js b/Open-ILS/xul/staff_client/server/cat/record_buckets.js index c11fe24305..ac6191bbaa 100644 --- a/Open-ILS/xul/staff_client/server/cat/record_buckets.js +++ b/Open-ILS/xul/staff_client/server/cat/record_buckets.js @@ -508,7 +508,8 @@ cat.record_buckets.prototype = { xml += ''; //obj.data.temp_merge_top = top_xml; obj.data.stash('temp_merge_top'); //obj.data.temp_merge_mid = xml; obj.data.stash('temp_merge_mid'); - window.open( + JSAN.use('util.window'); var win = new util.window(); + var fancy_prompt_data = win.open( urls.XUL_FANCY_PROMPT, //+ '?xml_in_stash=temp_merge_mid' //+ '&top_xml_in_stash=temp_merge_top' @@ -518,15 +519,15 @@ cat.record_buckets.prototype = { 'top_xml' : top_xml, 'xml' : xml, 'title' : 'Record Merging' } ); - obj.data.stash_retrieve(); - if (obj.data.fancy_prompt_data == '') { alert('Merge Aborted'); return; } + //obj.data.stash_retrieve(); + if (fancy_prompt_data.fancy_status == 'incomplete') { alert('Merge Aborted'); return; } var robj = obj.network.simple_request('MERGE_RECORDS', [ ses(), - obj.data.fancy_prompt_data.lead, + fancy_prompt_data.lead, util.functional.filter_list( record_ids, function(o) { - return o != obj.data.fancy_prompt_data.lead; + return o != fancy_prompt_data.lead; } ) ] @@ -550,6 +551,82 @@ cat.record_buckets.prototype = { } ], + + 'cmd_delete_records' : [ + ['command'], + function() { + try { + obj.list2.select_all(); + obj.data.stash_retrieve(); + JSAN.use('util.functional'); + + var record_ids = util.functional.map_list( + obj.list2.dump_retrieve_ids(), + function (o) { + return JSON2js(o).docid; // docid + } + ); + + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite'); + var top_xml = ''; + top_xml += 'Delete these records?'; + top_xml += '