From e35a3b095a0cea5b0b2640ddda55ff90a26b345e Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Tue, 15 Nov 2011 20:36:01 -0500 Subject: [PATCH] Revert changes to opac.js from "previous" commit. Turns out that opac.js has problems using files from the server via JSAN. Signed-off-by: Jason Stephenson --- .../xul/staff_client/chrome/content/cat/opac.js | 30 +++++++++++++++++++--- 1 file changed, 26 insertions(+), 4 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 d6cca6869b..a07b9a4a90 100644 --- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js +++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js @@ -559,8 +559,19 @@ function set_serctrl_view() { function create_mfhd() { // Check if the source is allowed to have copies, first. try { - JSAN.use('cat.util'); - var cbsObj = cat.util.get_cbs_for_bre_id(docid); + var bibObj = g.network.request( + api.FM_BRE_RETRIEVE_VIA_ID.app, + api.FM_BRE_RETRIEVE_VIA_ID.method, + [ ses(), [docid] ] + ); + + bibObj = bibObj[0]; + + var cbsObj = g.network.request( + api.FM_CBS_RETRIEVE_VIA_PCRUD.app, + api.FM_CBS_RETRIEVE_VIA_PCRUD.method, + [ ses(), bibObj.source() ] + ); if (cbsObj.can_have_copies() != get_db_true()) { alert(document.getElementById('offlineStrings').getFormattedString('staff.cat.bib_source.can_have_copies.false', [cbsObj.source()])); @@ -923,8 +934,19 @@ function add_volumes() { // Check if the source is allowed to have copies. try { - JSAN.use('cat.util'); - var cbsObj = cat.util.get_cbs_for_bre_id(docid); + var bibObj = g.network.request( + api.FM_BRE_RETRIEVE_VIA_ID.app, + api.FM_BRE_RETRIEVE_VIA_ID.method, + [ ses(), [docid] ] + ); + + bibObj = bibObj[0]; + + var cbsObj = g.network.request( + api.FM_CBS_RETRIEVE_VIA_PCRUD.app, + api.FM_CBS_RETRIEVE_VIA_PCRUD.method, + [ ses(), bibObj.source() ] + ); if (cbsObj.can_have_copies() != get_db_true()) { alert(document.getElementById('offlineStrings').getFormattedString('staff.cat.bib_source.can_have_copies.false', [cbsObj.source()])); -- 2.11.0