From a835939bcff6eb25df489488105c5c64704bf69a Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Mon, 3 Oct 2011 20:09:37 -0400 Subject: [PATCH] Modify server/cat/bib_brief.js to check for source can have volumes. Copy/paste code from chrome/content/cat/opac.js. Signed-off-by: Jason Stephenson Signed-off-by: Dan Scott --- Open-ILS/xul/staff_client/server/cat/bib_brief.js | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Open-ILS/xul/staff_client/server/cat/bib_brief.js b/Open-ILS/xul/staff_client/server/cat/bib_brief.js index d19742216b..189d52391c 100644 --- a/Open-ILS/xul/staff_client/server/cat/bib_brief.js +++ b/Open-ILS/xul/staff_client/server/cat/bib_brief.js @@ -170,6 +170,31 @@ function add_volumes() { return; // no read-only view for this interface } + try { + 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()])); + return; + } + } catch(E) { + g.error.sdump('D_ERROR','can have copies check: ' + E); + alert('Error in server/cat/bib_brief.js, add_volumes(): ' + E); + return; + } + var title = document.getElementById('offlineStrings').getFormattedString('staff.circ.copy_status.add_volumes.title', [docid]); var url; -- 2.11.0