From 186ea84d94e2bc2a1f876483c4f96c3a17f2265c Mon Sep 17 00:00:00 2001 From: phasefx Date: Sat, 8 Dec 2007 00:40:25 +0000 Subject: [PATCH] Hrmm, going back to the old--url param--way of passing data around windows/iframes here. Fixes a regression where Item Details weren't showing for Bill History/Alternate View/Full Details in billing interface. Remind me to never use iframes in the next major staff client overhaul; I'll use Bill & Mike's clone template node strategy first. :) Let's also trap the error I'm working around here, TypeError: this.docShell has no properties when trying to access the contentWindow for these specific iframes git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@8169 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../chrome/content/OpenILS/global_util.js | 22 +++++++++++++++------- .../staff_client/server/patron/bill_details.xul | 4 ++-- .../staff_client/server/patron/bill_history.xul | 4 ++-- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js b/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js index 43ef5d4805..987c2b75de 100644 --- a/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js +++ b/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js @@ -38,13 +38,21 @@ } function get_contentWindow(frame) { - netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); - if (frame && frame.contentWindow) { - if (typeof frame.contentWindow.wrappedJSObject != 'undefined') return frame.contentWindow.wrappedJSObject; - return frame.contentWindow; - } else { - return null; - } + try { + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); + if (frame && frame.contentWindow) { + try { + if (typeof frame.contentWindow.wrappedJSObject != 'undefined') return frame.contentWindow.wrappedJSObject; + } catch(E) { + alert("Error with get_contentWindow("+frame+") and wrappedJSObject:" + E); + } + return frame.contentWindow; + } else { + return null; + } + } catch(E) { + alert("Error with get_contentWindow("+frame+"): " + E); + } } function update_modal_xulG(v) { diff --git a/Open-ILS/xul/staff_client/server/patron/bill_details.xul b/Open-ILS/xul/staff_client/server/patron/bill_details.xul index 994922d837..c96069386e 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill_details.xul +++ b/Open-ILS/xul/staff_client/server/patron/bill_details.xul @@ -115,8 +115,8 @@ $('renewal').value = r || 'No'; netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - $('copy_summary').setAttribute('src',urls.XUL_COPY_SUMMARY); // + '?copy_id=' + r_circ.target_copy()); - get_contentWindow($('copy_summary')).xulG = { 'copy_id' : r_circ.target_copy() }; + $('copy_summary').setAttribute('src',urls.XUL_COPY_SUMMARY + '?copy_id=' + r_circ.target_copy()); + //get_contentWindow($('copy_summary')).xulG = { 'copy_id' : r_circ.target_copy() }; $('copy_summary').hidden=false; g.network.simple_request( diff --git a/Open-ILS/xul/staff_client/server/patron/bill_history.xul b/Open-ILS/xul/staff_client/server/patron/bill_history.xul index ac1df9fe14..5070047116 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill_history.xul +++ b/Open-ILS/xul/staff_client/server/patron/bill_history.xul @@ -159,8 +159,8 @@ $('due').value = r_circ.due_date() ? r_circ.due_date().toString().substr(0,10) : ''; netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - $('copy_summary').setAttribute('src',urls.XUL_COPY_SUMMARY); // + '?copy_id=' + r_circ.target_copy()); - get_contentWindow($('copy_summary')).xulG = { 'copy_id' : r_circ.target_copy() }; + $('copy_summary').setAttribute('src',urls.XUL_COPY_SUMMARY + '?copy_id=' + r_circ.target_copy()); + //get_contentWindow($('copy_summary')).xulG = { 'copy_id' : r_circ.target_copy() }; $('copy_summary').hidden=false; g.network.simple_request( -- 2.11.0