From a2e05b60df4662cd476e43602335d4446935ff61 Mon Sep 17 00:00:00 2001 From: phasefx Date: Sat, 21 Jul 2007 16:05:30 +0000 Subject: [PATCH] hrmm, the xul_param stuff has the side effect of updating xulG; need to change that. But this fixes the Cancel action or Close Window event for fancy prompts such as Merge Records git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@7569 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul | 8 ++++++-- Open-ILS/xul/staff_client/chrome/content/util/window.js | 1 + Open-ILS/xul/staff_client/server/cat/record_buckets.js | 5 +++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul b/Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul index 02d2f7d812..500bf22577 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul +++ b/Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul @@ -48,8 +48,6 @@ //g.data.fancy_prompt_data = ''; g.data.stash('fancy_prompt_data'); //g.data.fancy_prompt_data = {}; - xulG.fancy_status = 'incomplete'; - //var key = location.pathname + location.search + location.hash; //if (typeof g.data.modal_xulG_stack != 'undefined' && typeof g.data.modal_xulG_stack[key] != 'undefined') { // xulG = g.data.modal_xulG_stack[key][ g.data.modal_xulG_stack[key].length - 1 ]; @@ -96,6 +94,12 @@ if (xul_param('focus',{'modal_xulG':true})) document.getElementById(xul_param('focus',{'modal_xulG':true})).focus(); + JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'}); + xulG.fancy_status = 'incomplete'; + var key = location.pathname + location.search + location.hash; + data.modal_xulG_stack[key][ data.modal_xulG_stack[key].length - 1 ] = xulG; + data.stash('modal_xulG_stack'); + } catch(E) { var err_msg = "!! This software has encountered an error. Please tell your friendly " + "system administrator or software developer the following:\nfancy_prompt.xul\n" + E + '\n'; diff --git a/Open-ILS/xul/staff_client/chrome/content/util/window.js b/Open-ILS/xul/staff_client/chrome/content/util/window.js index a167d9344d..d8c17d0d22 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/window.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/window.js @@ -93,6 +93,7 @@ util.window.prototype = { } var w = this.SafeWindowOpen(url,title,features); if (features.match(/modal/) && my_xulG) { + data.init({'via':'stash'}); var x = data.modal_xulG_stack[key].pop(); data.stash('modal_xulG_stack'); return x; 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 ac6191bbaa..c4ae5f38fb 100644 --- a/Open-ILS/xul/staff_client/server/cat/record_buckets.js +++ b/Open-ILS/xul/staff_client/server/cat/record_buckets.js @@ -520,7 +520,8 @@ cat.record_buckets.prototype = { } ); //obj.data.stash_retrieve(); - if (fancy_prompt_data.fancy_status == 'incomplete') { alert('Merge Aborted'); return; } + + if (typeof fancy_prompt_data.fancy_status == 'undefined' || fancy_prompt_data.fancy_status == 'incomplete') { alert('Merge Aborted'); return; } var robj = obj.network.simple_request('MERGE_RECORDS', [ ses(), @@ -602,7 +603,7 @@ cat.record_buckets.prototype = { } ); //obj.data.stash_retrieve(); - if (fancy_prompt_data.fancy_status == 'incomplete') { alert('Delete Aborted'); return; } + if (typeof fancy_prompt_data.fancy_status == 'undefined' || fancy_prompt_data.fancy_status != 'complete') { alert('Delete Aborted'); return; } var s = ''; for (var i = 0; i < record_ids.length; i++) { var robj = obj.network.simple_request('FM_BRE_DELETE',[ses(),record_ids[i]]); -- 2.11.0