From: Jason Stephenson Date: Wed, 16 Nov 2011 01:36:01 +0000 (-0500) Subject: Revert changes to opac.js from "previous" commit. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e35a3b095a0cea5b0b2640ddda55ff90a26b345e;p=working%2FEvergreen.git 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 --- 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()]));