bug fix for incorrect sdist editor and opac view interaction seials-integration
authordbwells <dbwells@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 12 Aug 2010 21:39:11 +0000 (21:39 +0000)
committerdbwells <dbwells@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 12 Aug 2010 21:39:11 +0000 (21:39 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/seials-integration@17202 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/cat/opac.js
Open-ILS/xul/staff_client/server/serial/sdist_editor.js

index c77c72a..dfa33d1 100644 (file)
@@ -321,9 +321,8 @@ function set_opac() {
                 win.attachEvt("rdetail", "MFHDDrawn",
                     function() {
                         if (win.mfhdDetails && win.mfhdDetails.length > 0) {
-                            g.data.mfhd = {};
-                            g.data.mfhd.details = win.mfhdDetails;
-                            g.data.stash('mfhd');
+                            g.mfhd = {};
+                            g.mfhd.details = win.mfhdDetails;
                             mfhd_edit_menu.disabled = false;
                             mfhd_delete_menu.disabled = false;
                             for (var i = 0; i < win.mfhdDetails.length; i++) {
index c2c838d..3272a33 100644 (file)
@@ -21,19 +21,22 @@ serial.sdist_editor = function (params) {
     this.editor_values = {};
 
     // setup sre arrays
-    var mfhd_details = this.data.mfhd.details;
     this.sre_id_map = {};
     this.sres_ou_map = {};
-    for (var i = 0; i < mfhd_details.length; i++) {
-        var mfhd_detail = mfhd_details[i];
-        mfhd_detail.label = mfhd_detail.label + ' (' + (mfhd_detail.entryNum + 1) + ')';
-        var sre_id = mfhd_detail.id;
-        var org_unit_id = mfhd_detail.owning_lib;
-        this.sre_id_map[sre_id] = mfhd_detail;
-        if (!this.sres_ou_map[org_unit_id]) {
-            this.sres_ou_map[org_unit_id] = [];
+    var parent_g = window.parent.g;
+    if (parent_g.mfhd) {
+        var mfhd_details = parent_g.mfhd.details;
+        for (var i = 0; i < mfhd_details.length; i++) {
+            var mfhd_detail = mfhd_details[i];
+            mfhd_detail.label = mfhd_detail.label + ' (' + (mfhd_detail.entryNum + 1) + ')';
+            var sre_id = mfhd_detail.id;
+            var org_unit_id = mfhd_detail.owning_lib;
+            this.sre_id_map[sre_id] = mfhd_detail;
+            if (!this.sres_ou_map[org_unit_id]) {
+                this.sres_ou_map[org_unit_id] = [];
+            }
+            this.sres_ou_map[org_unit_id].push(mfhd_detail);
         }
-        this.sres_ou_map[org_unit_id].push(mfhd_detail);
     }
 };