preventing old copies from showing up in new copy editor. stash needs to be able...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 13 Jul 2006 22:18:09 +0000 (22:18 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 13 Jul 2006 22:18:09 +0000 (22:18 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5000 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/cat/copy_buckets.xul
Open-ILS/xul/staff_client/server/cat/copy_buckets_quick.xul
Open-ILS/xul/staff_client/server/cat/copy_editor.js
Open-ILS/xul/staff_client/server/cat/util.js
Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js

index 931f239..c292a55 100644 (file)
@@ -47,9 +47,9 @@
                                if (g.cgi.param('copy_ids')) copy_ids = copy_ids.concat( JSON2js( g.cgi.param('copy_ids') ) );
                                if (typeof window.xuLG == 'object' && typeof window.xulG.copy_ids != 'undefined')
                                        copy_ids = copy_ids.concat( window.xulG.copy_ids );
-                               if (g.data.temp_copy_ids != 'undefined' && g.data.temp_copy_ids != null) {
+                               if (typeof g.data.temp_copy_ids != 'undefined' && g.data.temp_copy_ids != null) {
                                        copy_ids = copy_ids.concat( JSON2js( g.data.temp_copy_ids ) );
-                                       g.data.temp_copy_ids = null; g.data.stash('temp_copy_ids');
+                                       g.data.temp_copy_ids = undefined; g.data.stash('temp_copy_ids');
                                }
 
                                JSAN.use('cat.copy_buckets'); g.copy_buckets = new cat.copy_buckets();
index 566a8ed..e4a9541 100644 (file)
@@ -50,9 +50,9 @@
                                if (g.cgi.param('copy_ids')) g.copy_ids = g.copy_ids.concat( JSON2js( g.cgi.param('copy_ids') ) );
                                if (typeof window.xuLG == 'object' && typeof window.xulG.copy_ids != 'undefined')
                                        g.copy_ids = g.copy_ids.concat( window.xulG.copy_ids );
-                               if (g.data.temp_copy_ids != 'undefined' && g.data.temp_copy_ids != null) {
+                               if (typeof g.data.temp_copy_ids != 'undefined' && g.data.temp_copy_ids != null) {
                                        g.copy_ids = g.copy_ids.concat( JSON2js( g.data.temp_copy_ids ) );
-                                       g.data.temp_copy_ids = null; g.data.stash('temp_copy_ids');
+                                       g.data.temp_copy_ids = undefined; g.data.stash('temp_copy_ids');
                                }
 
                                $('desc').appendChild( document.createTextNode( 
index 25389f6..36553c2 100644 (file)
@@ -27,7 +27,7 @@ function my_init() {
                var copy_ids = [];
                if (g.cgi.param('copy_ids')) copy_ids = JSON2js( g.cgi.param('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 (typeof g.data.temp_copy_ids != 'undefined' && g.data.temp_copy_ids != null) copy_ids = copy_ids.concat( JSON2js( g.data.temp_copy_ids ) );
                if (!copy_ids) copy_ids = [];
 
                if (copy_ids.length > 0) g.copies = g.network.request(
index 5dfa04f..fcd1048 100644 (file)
@@ -90,8 +90,8 @@ cat.util.spawn_copy_editor = function(list,edit) {
        title += ' Copy Attributes';
 
        JSAN.use('util.window'); var win = new util.window();
-       obj.data.temp = '';
-       obj.data.stash('temp');
+       obj.data.temp_copies = undefined; obj.data.stash('temp_copies');
+       obj.data.temp_callnumbers = undefined; obj.data.stash('temp_callnumbers');
        obj.data.temp_copy_ids = js2JSON(list);
        obj.data.stash('temp_copy_ids');
        var w = win.open(
@@ -104,9 +104,9 @@ cat.util.spawn_copy_editor = function(list,edit) {
        obj.data.stash_retrieve();
        if (!obj.data.temp_copies) return;
        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.data.temp_copy_ids = null; obj.data.stash('temp_copy_ids');
+       obj.data.temp_copies = undefined; obj.data.stash('temp_copies');
+       obj.data.temp_callnumbers = undefined; obj.data.stash('temp_callnumbers');
+       obj.data.temp_copy_ids = undefined; obj.data.stash('temp_copy_ids');
        obj.error.sdump('D_CAT','in cat/copy_status, copy editor, copies =\n<<' + copies + '>>');
        if (edit=='1' && copies!='' && typeof copies != 'undefined') {
                try {
index c5315c3..93cdfa1 100644 (file)
@@ -352,6 +352,7 @@ g.stash_and_close = function() {
                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_copy_ids = undefined; g.data.stash('temp_copy_ids');
                        g.data.temp_callnumbers = js2JSON(volume_labels); g.data.stash('temp_callnumbers');
                        var w = win.open(
                                urls.XUL_COPY_EDITOR
@@ -361,10 +362,10 @@ g.stash_and_close = function() {
                        );
                        /* 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');
+                       g.data.temp_copy_ids = undefined; g.data.stash('temp_copy_ids');
+                       g.data.temp_copies = undefined; g.data.stash('temp_copies');
+                       g.data.temp_callnumbers = undefined; g.data.stash('temp_callnumbers');
                        if (!copies) {
                                alert('Items were not created.');
                                return;