From: phasefx Date: Wed, 13 Jan 2010 20:25:51 +0000 (+0000) Subject: This adds the ability to specify courier codes in transit and hold/transit slip templ... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6facc302870109c674ce2d681c3c4f0b50d86684;p=evergreen%2Fmasslnc.git This adds the ability to specify courier codes in transit and hold/transit slip templates via a %courier_code% macro and a lib.courier_code org unit setting. 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 --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 31341d049a..2614d06042 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -51,7 +51,7 @@ CREATE TABLE config.upgrade_log ( 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, diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index eb801aeb6e..4c7b9e79d2 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -1833,8 +1833,12 @@ INSERT into config.org_unit_setting_type ( '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: diff --git a/Open-ILS/src/sql/Pg/upgrade/0134.data.org-setting-courier-code.sql b/Open-ILS/src/sql/Pg/upgrade/0134.data.org-setting-courier-code.sql new file mode 100644 index 0000000000..e6a943bca7 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0134.data.org-setting-courier-code.sql @@ -0,0 +1,12 @@ +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; 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 9fe17d3c6b..4e541a2c90 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -136,6 +136,7 @@ const api = { '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 }, diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js index b2fdf2b1eb..cf96252c04 100644 --- a/Open-ILS/xul/staff_client/server/circ/util.js +++ b/Open-ILS/xul/staff_client/server/circ/util.js @@ -2303,6 +2303,7 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che 'route_to' : '', 'route_to_msg' : '', 'route_to_org_fullname' : '', + 'courier_code' : '', 'street1' : '', 'street2' : '', 'city_state_zip' : '', @@ -2607,6 +2608,10 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che 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();