From d4f127f3af48477b63ce785ba63bfb80d01df72e Mon Sep 17 00:00:00 2001 From: dbwells Date: Thu, 12 Aug 2010 21:39:11 +0000 Subject: [PATCH] bug fix for incorrect sdist editor and opac view interaction git-svn-id: svn://svn.open-ils.org/ILS/branches/seials-integration@17202 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/chrome/content/cat/opac.js | 5 ++--- .../xul/staff_client/server/serial/sdist_editor.js | 23 ++++++++++++---------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js index c77c72a733..dfa33d18aa 100644 --- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js +++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js @@ -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++) { diff --git a/Open-ILS/xul/staff_client/server/serial/sdist_editor.js b/Open-ILS/xul/staff_client/server/serial/sdist_editor.js index c2c838db89..3272a339d0 100644 --- a/Open-ILS/xul/staff_client/server/serial/sdist_editor.js +++ b/Open-ILS/xul/staff_client/server/serial/sdist_editor.js @@ -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); } }; -- 2.11.0