From: senator Date: Wed, 10 Nov 2010 21:51:01 +0000 (+0000) Subject: Serials: patch from Dan Wells to address Launchpad bug #670734 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=012a4fc6e5e92c0e9ce4c760189bae4ddc5715a6;p=evergreen%2Fmasslnc.git Serials: patch from Dan Wells to address Launchpad bug #670734 Previously, a dialog box to select an org unit for the creation of legacy MFHD records relied on a feature (window.opener) that has been removed in newer versions of XULRunner. This patch has that dialog box use a different, safer approach to accomplish its task. git-svn-id: svn://svn.open-ils.org/ILS/trunk@18691 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- 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 c772ba65c6..15050bbcbf 100644 --- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js +++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js @@ -495,19 +495,19 @@ function set_serctrl_view() { function create_mfhd() { try { - g.data.create_mfhd_aou = ''; JSAN.use('util.window'); var win = new util.window(); - win.open( + var select_aou_window = win.open( xulG.url_prefix(urls.XUL_SERIAL_SELECT_AOU), '_blank', - 'chrome,resizable,modal,centerscreen' + 'chrome,resizable,modal,centerscreen', + {'server_unadorned' : g.data.server_unadorned} ); - if (!g.data.create_mfhd_aou) { + if (!select_aou_window.create_mfhd_aou) { return; } var r = g.network.simple_request( 'MFHD_XML_RECORD_CREATE', - [ ses(), 1, g.data.create_mfhd_aou, docid ] + [ ses(), 1, select_aou_window.create_mfhd_aou, docid ] ); if (typeof r.ilsevent != 'undefined') { throw(r); diff --git a/Open-ILS/xul/staff_client/server/serial/select_aou.xul b/Open-ILS/xul/staff_client/server/serial/select_aou.xul index 1c2eeadfe3..3a801530a2 100644 --- a/Open-ILS/xul/staff_client/server/serial/select_aou.xul +++ b/Open-ILS/xul/staff_client/server/serial/select_aou.xul @@ -48,6 +48,7 @@ var file; var list_data; var ml; file = new util.file('offline_ou_list'); + var server_unadorned = xul_param('server_unadorned',{'modal_xulG':true}); if (file._file.exists()) { list_data = file.get_object(); file.close(); ml = util.widgets.make_menulist( list_data[0], list_data[1] ); @@ -57,7 +58,7 @@ 'command', function(ev) { //if (document.getElementById('refresh_button')) document.getElementById('refresh_button').focus(); - JSAN.use('util.file'); var file = new util.file('mfhd_create_prefs.'+opener.g.data.server_unadorned); + JSAN.use('util.file'); var file = new util.file('mfhd_create_prefs.'+server_unadorned); util.widgets.save_attributes(file, { 'lib_menu' : [ 'value' ] }); }, false @@ -66,7 +67,7 @@ throw(document.getElementById('catStrings').getString('staff.cat.copy_browser.missing_library') + '\n'); //TODO: different error? } - file = new util.file('mfhd_create_prefs.'+opener.g.data.server_unadorned); + file = new util.file('mfhd_create_prefs.'+server_unadorned); util.widgets.load_attributes(file); ml.value = ml.getAttribute('value'); } catch(E) { @@ -76,7 +77,7 @@ } g.select_aou = function() { - opener.g.data.create_mfhd_aou = $('lib_menu').value; + update_modal_xulG({'create_mfhd_aou' : $('lib_menu').value}); window.close(); }