[open-ils-commits] r15315 - in trunk/Open-ILS: src/sql/Pg src/sql/Pg/upgrade xul/staff_client/chrome/content/main xul/staff_client/server/circ (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Jan 13 15:25:56 EST 2010


Author: phasefx
Date: 2010-01-13 15:25:51 -0500 (Wed, 13 Jan 2010)
New Revision: 15315

Added:
   trunk/Open-ILS/src/sql/Pg/upgrade/0134.data.org-setting-courier-code.sql
Modified:
   trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
   trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
   trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js
   trunk/Open-ILS/xul/staff_client/server/circ/util.js
Log:
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)



Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2010-01-13 19:29:26 UTC (rev 15314)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2010-01-13 20:25:51 UTC (rev 15315)
@@ -51,7 +51,7 @@
     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,

Modified: trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2010-01-13 19:29:26 UTC (rev 15314)
+++ trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2010-01-13 20:25:51 UTC (rev 15315)
@@ -1833,8 +1833,12 @@
 ( '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:

Added: trunk/Open-ILS/src/sql/Pg/upgrade/0134.data.org-setting-courier-code.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0134.data.org-setting-courier-code.sql	                        (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0134.data.org-setting-courier-code.sql	2010-01-13 20:25:51 UTC (rev 15315)
@@ -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;

Modified: trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js	2010-01-13 19:29:26 UTC (rev 15314)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js	2010-01-13 20:25:51 UTC (rev 15315)
@@ -136,6 +136,7 @@
     '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 },

Modified: trunk/Open-ILS/xul/staff_client/server/circ/util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/util.js	2010-01-13 19:29:26 UTC (rev 15314)
+++ trunk/Open-ILS/xul/staff_client/server/circ/util.js	2010-01-13 20:25:51 UTC (rev 15315)
@@ -2303,6 +2303,7 @@
             'route_to' : '',
             'route_to_msg' : '',
             'route_to_org_fullname' : '',
+            'courier_code' : '',
             'street1' : '',
             'street2' : '',
             'city_state_zip' : '',
@@ -2607,6 +2608,10 @@
             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();



More information about the open-ils-commits mailing list