From eaaa9bf4144a3a4eb6827caf0dfb810fad31abaf Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Mon, 7 Mar 2011 06:42:45 -0500 Subject: [PATCH] retrieve and cache asset.call_number_class --- Open-ILS/examples/fm_IDL.xml | 7 ++++++- .../xul/staff_client/chrome/content/OpenILS/data.js | 21 +++++++++++++++++++++ .../staff_client/chrome/content/main/constants.js | 1 + .../staff_client/server/cat/volume_copy_creator.js | 9 +++++---- 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 7077fe2600..b3a5847e7c 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -1724,13 +1724,18 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - + + + + + + diff --git a/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js b/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js index f637bad8f6..202024e96e 100644 --- a/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js +++ b/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js @@ -595,6 +595,27 @@ OpenILS.data.prototype = { this.chain.push( function() { var f = gen_fm_retrieval_func( + 'acnc', + [ + api.FM_ACNC_RETRIEVE_VIA_PCRUD.app, + api.FM_ACNC_RETRIEVE_VIA_PCRUD.method, + [ obj.session.key, {"id":{"!=":null}}, {"order_by":{"acnc":"name"}} ], + false + ] + ); + try { + f(); + } catch(E) { + var error = 'Error: ' + js2JSON(E); + obj.error.sdump('D_ERROR',error); + throw(E); + } + } + ); + + this.chain.push( + function() { + var f = gen_fm_retrieval_func( 'ahrcc', [ api.FM_AHRCC_PCRUD_SEARCH.app, diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js index b2c7f8eae4..7ab5b6de36 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -88,6 +88,7 @@ var api = { 'FM_ACN_TREE_LIST_RETRIEVE_VIA_RECORD_ID_AND_ORG_IDS.authoritative' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.asset.copy_tree.retrieve.authoritative', 'secure' : false }, 'FM_ACN_TRANSFER' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.asset.volume.batch.transfer' }, 'FM_ACN_FIND_OR_CREATE' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.call_number.find_or_create', 'secure' : false }, + 'FM_ACNC_RETRIEVE_VIA_PCRUD' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.acnc.atomic', 'secure' : false }, 'FM_ACP_DETAILS' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.copy_details.retrieve' }, 'FM_ACP_DETAILS_VIA_BARCODE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.copy_details.retrieve.barcode' }, 'FM_ACP_DETAILS_VIA_BARCODE.authoritative' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.copy_details.retrieve.barcode.authoritative' }, diff --git a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js index 1d8db501c7..76efb96824 100644 --- a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js +++ b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js @@ -75,11 +75,12 @@ function my_init() { // Get the default callnumber classification scheme from OU settings dojo.require('fieldmapper.OrgUtils'); - var label_class = g.data.hash.aous['cat.default_classification_scheme']; //fieldmapper.aou.fetchOrgSettingDefault(ses('ws_ou'), 'cat.default_classification_scheme'); + //fieldmapper.aou.fetchOrgSettingDefault(ses('ws_ou'), 'cat.default_classification_scheme'); + g.label_class = g.data.hash.aous['cat.default_classification_scheme']; // Assign a default value if none was returned - if (!label_class) { - label_class = 1; + if (!g.label_class) { + g.label_class = g.data.list.acnc[0].id(); } /***********************************************************************************************************/ @@ -133,7 +134,7 @@ function my_init() { /***********************************************************************************************************/ /* For the call number drop down */ - g.list_callnumbers(g.doc_id, label_class); + g.list_callnumbers(g.doc_id, g.label_class); /***********************************************************************************************************/ /* render the orgs and volumes/input */ -- 2.11.0