From: Jason Stephenson Date: Tue, 4 Oct 2011 00:09:37 +0000 (-0400) Subject: Modify server/cat/bib_brief.js to check for source can have volumes. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5d491bcf35d73ca3de762f3f1939711ecd7d8ec7;p=working%2FEvergreen.git 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 --- 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..41ee31a5f0 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 } + var can_have_copies = true; + var cbsObj; + 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]; + cbsObj = g.network.request( + api.FM_CBS_RETRIEVE_VIA_PCRUD.app, + api.FM_CBS_RETRIEVE_VIA_PCRUD.method, + [ ses(), bibObj.source() ] + ); + can_have_copies = (cbsObj.can_have_copies() == get_db_true()); + } catch(E) { + g.error.sdump('D_ERROR','can have copies check: ' + E); + return; + } + + if (!can_have_copies) { + alert(document.getElementById('offlineStrings').getFormattedString('staff.cat.bib_source.can_have_copies.false', [cbs.source()])); + return false; + } + var title = document.getElementById('offlineStrings').getFormattedString('staff.circ.copy_status.add_volumes.title', [docid]); var url;