hrmm, the xul_param stuff has the side effect of updating xulG; need to change that...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 21 Jul 2007 15:59:29 +0000 (15:59 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 21 Jul 2007 15:59:29 +0000 (15:59 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@7568 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul
Open-ILS/xul/staff_client/chrome/content/util/window.js
Open-ILS/xul/staff_client/server/cat/record_buckets.js

index 02d2f7d..500bf22 100644 (file)
@@ -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 ];
 
                                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';
index a167d93..d8c17d0 100644 (file)
@@ -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;
index ac6191b..c4ae5f3 100644 (file)
@@ -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]]);