So if an item at library BR1 is to be routed to library BR2, the org unit setting for BR2 is retrieved and that value is used for %courier_code%.
POSSIBLE TODO: Add simple interface-scoped caching for the courier code lookup (and perhaps for the mailing address lookup as well)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15315
dcc99617-32d9-48b4-a31d-
7c20da2025e4
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0132'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0134'); -- phasefx
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
( 'ui.admin.patron_log.max_entries',
oils_i18n_gettext('ui.admin.patron_log.max_entries', 'GUI: Work Log: Maximum Patrons Logged', 'coust', 'label'),
oils_i18n_gettext('ui.admin.patron_log.max_entries', 'Maximum entries for "Most Recently Affected Patrons..." section of the Work Log interface.', 'coust', 'description'),
- 'interval' )
+ 'interval' ),
+( 'lib.courier_code',
+ oils_i18n_gettext('lib.courier_code', 'Courier Code', 'coust', 'label'),
+ oils_i18n_gettext('lib.courier_code', 'Courier Code for the library. Available in transit slip templates as the %courier_code% macro.', 'coust', 'description'),
+ 'string')
;
-- Org_unit_setting_type(s) that need an fm_class:
--- /dev/null
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0134');
+
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES
+( 'lib.courier_code',
+ oils_i18n_gettext('lib.courier_code', 'Courier Code', 'coust', 'label'),
+ oils_i18n_gettext('lib.courier_code', 'Courier Code for the library. Available in transit slip templates as the %courier_code% macro.', 'coust', 'description'),
+ 'string')
+;
+
+COMMIT;
'FM_AOU_IDS_RETRIEVE_VIA_RECORD_ID' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.actor.org_unit.retrieve_by_title', 'secure' : false },
'FM_AOU_IDS_RETRIEVE_VIA_RECORD_ID.authoritative' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.actor.org_unit.retrieve_by_title.authoritative', 'secure' : false },
'FM_AOUS_RETRIEVE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.org_unit_setting.values.ranged.retrieve' },
+ 'FM_AOUS_SPECIFIC_RETRIEVE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.ou_setting.ancestor_default' },
'FM_AOUT_RETRIEVE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.org_types.retrieve', 'secure' : false },
'FM_ASC_BATCH_RETRIEVE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.stat_cat.asset.retrieve.batch', 'secure' : false },
'FM_ASC_RETRIEVE_VIA_AOU' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.stat_cat.asset.retrieve.all', 'secure' : false },
'route_to' : '',
'route_to_msg' : '',
'route_to_org_fullname' : '',
+ 'courier_code' : '',
'street1' : '',
'street2' : '',
'city_state_zip' : '',
print_data.route_to_org = lib;
print_data.route_to_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to.destination', [check.route_to]);
print_data.route_to_org_fullname = lib.name();
+ var aous_req = network.simple_request('FM_AOUS_SPECIFIC_RETRIEVE',[ lib.id(), 'lib.courier_code', ses() ]);
+ if (aous_req) {
+ print_data.courier_code = aous_req.value || '';
+ }
msg += print_data.route_to_msg;
msg += '\n\n';
msg += lib.name();