[open-ils-commits] [GIT] Evergreen ILS branch master updated. a1b07a3722012b3684965d2e698526be676f6042

Evergreen Git git at git.evergreen-ils.org
Mon Jan 6 09:09:48 EST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  a1b07a3722012b3684965d2e698526be676f6042 (commit)
       via  4a6d1787208b1c0019083d03da04f39f7bb27e99 (commit)
       via  bcb902397123ebf504eee654d9e5552c4e08cc89 (commit)
      from  5e373d30ab716a94de7521409e12c1fdabcee5a9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a1b07a3722012b3684965d2e698526be676f6042
Author: Dan Scott <dscott at laurentian.ca>
Date:   Tue Dec 17 13:05:43 2013 -0500

    Sample library external URLs, phone numbers, and emails
    
    Supply reasonable URLs and contact information for the branches.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/tests/datasets/sql/libraries.sql b/Open-ILS/tests/datasets/sql/libraries.sql
index b2d0cc5..5124769 100644
--- a/Open-ILS/tests/datasets/sql/libraries.sql
+++ b/Open-ILS/tests/datasets/sql/libraries.sql
@@ -53,3 +53,16 @@ INSERT INTO actor.hours_of_operation (id, dow_0_open, dow_0_close, dow_1_open, d
     (6, '08:00', '23:30', '08:00', '23:30', '08:00', '23:30', '08:00', '23:30', '09:00', '23:30', '13:00', '23:30', '09:00', '23:30'),
 -- BR4 - closed on weekends (convention is 00:00 - 00:00)
     (7, '08:00', '23:30', '08:00', '23:30', '08:00', '23:30', '08:00', '23:30', '09:00', '23:30', '00:00', '00:00', '00:00', '00:00');
+
+-- Set some information URLs for library branches
+INSERT INTO actor.org_unit_setting(org_unit, name, value) VALUES
+    (4, 'lib.info_url', '"http://example.com/BR1"'), -- BR1
+    (5, 'lib.info_url', '"http://example.com/BR2"'), -- BR2
+    (6, 'lib.info_url', '"http://br3.example.com"'), -- BR3
+    (7, 'lib.info_url', '"http://br4.example.com/info"'); -- BR4
+
+
+UPDATE actor.org_unit SET email = 'br1 at example.com', phone = '(555)-555-0271' WHERE shortname = 'BR1';
+UPDATE actor.org_unit SET email = 'br2 at example.com', phone = '(555)-555-0272' WHERE shortname = 'BR2';
+UPDATE actor.org_unit SET email = 'br3 at example.com', phone = '(555)-555-0273' WHERE shortname = 'BR3';
+UPDATE actor.org_unit SET email = 'br4 at example.com', phone = '(555)-555-0274' WHERE shortname = 'BR4';

commit 4a6d1787208b1c0019083d03da04f39f7bb27e99
Author: Dan Scott <dscott at laurentian.ca>
Date:   Tue Dec 17 12:02:56 2013 -0500

    Add sample library addresses and hours of operation
    
    Provide branch-level granularity of addresses and hours of operation, using
    different addresses in some cases for mailing vs. billing vs. ILL vs. holds for
    more realism.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/tests/datasets/sql/env_create.sql b/Open-ILS/tests/datasets/sql/env_create.sql
index 9dedb06..b1ef2ac 100644
--- a/Open-ILS/tests/datasets/sql/env_create.sql
+++ b/Open-ILS/tests/datasets/sql/env_create.sql
@@ -5,6 +5,43 @@
 CREATE TABLE marcxml_import (id SERIAL PRIMARY KEY, marc TEXT, tag TEXT);
 
 /**
+ * Create an address for a given actor.org_unit
+ *
+ * The "address_type" parameter accepts a TEXT value that contains the
+ * strings 'mailing', 'interlibrary', 'billing', and 'holds' to enable
+ * you to provide granular control over which address is associated for
+ * each function; if given NULL, then all functions are associated with
+ * the incoming address.
+ *
+ * This will happily create duplicate addresses if given duplicate info.
+ */
+CREATE FUNCTION evergreen.create_aou_address
+    (owning_lib INTEGER, street1 TEXT, street2 TEXT, city TEXT, state TEXT, country TEXT,
+     post_code TEXT, address_type TEXT)
+RETURNS void AS $$
+BEGIN
+    INSERT INTO actor.org_address (org_unit, street1, street2, city, state, country, post_code)
+        VALUES ($1, $2, $3, $4, $5, $6, $7);
+    
+    IF $8 IS NULL THEN
+	UPDATE actor.org_unit SET holds_address = currval('actor.org_address_id_seq'), ill_address = currval('actor.org_address_id_seq'), billing_address = currval('actor.org_address_id_seq'), mailing_address = currval('actor.org_address_id_seq') WHERE id = $1;
+    END IF;
+    IF $8 ~ 'holds' THEN
+	UPDATE actor.org_unit SET holds_address = currval('actor.org_address_id_seq') WHERE id = $1;
+    END IF;
+    IF $8 ~ 'interlibrary' THEN
+	UPDATE actor.org_unit SET ill_address = currval('actor.org_address_id_seq') WHERE id = $1;
+    END IF;
+    IF $8 ~ 'billing' THEN
+	UPDATE actor.org_unit SET billing_address = currval('actor.org_address_id_seq') WHERE id = $1;
+    END IF;
+    IF $8 ~ 'mailing' THEN
+	UPDATE actor.org_unit SET mailing_address = currval('actor.org_address_id_seq') WHERE id = $1;
+    END IF;
+END
+$$ LANGUAGE PLPGSQL;
+
+/**
  * create a callnumber for every bib record in the database,
  * appending the bib ID to the callnumber label to differentiate.
  * If set, 'bib_tag' will limit the inserted callnumbers to bibs
diff --git a/Open-ILS/tests/datasets/sql/env_destroy.sql b/Open-ILS/tests/datasets/sql/env_destroy.sql
index 7c50514..3fec691 100644
--- a/Open-ILS/tests/datasets/sql/env_destroy.sql
+++ b/Open-ILS/tests/datasets/sql/env_destroy.sql
@@ -1,6 +1,7 @@
 
 -- clean up our temp tables / functions
 DROP TABLE marcxml_import;
+DROP FUNCTION evergreen.create_aou_address(INTEGER, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT);
 DROP FUNCTION evergreen.populate_call_number(INTEGER, TEXT, TEXT);
 DROP FUNCTION evergreen.populate_call_number(INTEGER, TEXT, TEXT, INTEGER);
 DROP FUNCTION evergreen.populate_copy(INTEGER, INTEGER, TEXT, TEXT);
diff --git a/Open-ILS/tests/datasets/sql/libraries.sql b/Open-ILS/tests/datasets/sql/libraries.sql
index f93edbb..b2d0cc5 100644
--- a/Open-ILS/tests/datasets/sql/libraries.sql
+++ b/Open-ILS/tests/datasets/sql/libraries.sql
@@ -15,10 +15,41 @@ INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES
 INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES 
     (9, 6, 5, 'BM1', oils_i18n_gettext(9, 'Example Bookmobile 1', 'aou', 'name'));
 
-INSERT INTO actor.org_address (org_unit, street1, city, state, country, post_code)
-SELECT id, '123 Main St.', 'Anywhere', 'GA', 'US', '30303'
-FROM actor.org_unit;
+-- Address for the Consortium
+SELECT evergreen.create_aou_address(1, '123 Main St.', NULL, 'Anywhere', 'GA', 'US', '30303', NULL);
 
-UPDATE actor.org_unit SET holds_address = id, ill_address = id, billing_address = id, mailing_address = id;
+-- Addresses for System 1
+SELECT evergreen.create_aou_address(2, '234 Side St.', NULL, 'Anywhere', 'GA', 'US', '30304', NULL);
 
+-- Addresses for System 2
+SELECT evergreen.create_aou_address(3, '345 Corner Crescent', NULL, 'Elsewhere', 'GA', 'US', '30335', NULL);
 
+-- Addresses for Branch 1
+SELECT evergreen.create_aou_address(4, 'BR1', '123 Main St.', 'Anywhere', 'GA', 'US', '30303', 'billing mailing');
+SELECT evergreen.create_aou_address(4, 'Holds and ILL', '125 Main St.', 'Anywhere', 'GA', 'US', '30303', 'interlibrary holds');
+
+-- Addresses for Branch 2
+SELECT evergreen.create_aou_address(5, 'BR2', '234 Side St.', 'Anywhere', 'GA', 'US', '30304', 'mailing');
+SELECT evergreen.create_aou_address(5, 'BR2 - Billing', '234 Side St.', 'Anywhere', 'GA', 'US', '30304', 'billing');
+SELECT evergreen.create_aou_address(5, 'BR2 - Holds and ILL', '234 Side St.', 'Anywhere', 'GA', 'US', '30304', 'interlibrary holds');
+
+-- Addresses for Branch 3
+SELECT evergreen.create_aou_address(6, 'BR3', '347 Corner Crescent', 'Elsewhere', 'GA', 'US', '30335', NULL);
+
+-- Addresses for Branch 4
+SELECT evergreen.create_aou_address(7, 'BR4', '446 Nowhere Road', 'Elsewhere', 'GA', 'US', '30404', 'mailing');
+SELECT evergreen.create_aou_address(7, 'BR4 - Billing Dept', '446 Nowhere Road', 'Elsewhere', 'GA', 'US', '30404', 'billing');
+SELECT evergreen.create_aou_address(7, 'BR4 - Holds and ILL', '756 Industrial Lane', 'Elsewhere', 'GA', 'US', '30304', 'interlibrary holds');
+
+-- Hours for branches
+INSERT INTO actor.hours_of_operation (id, dow_0_open, dow_0_close, dow_1_open, dow_1_close,
+    dow_2_open, dow_2_close, dow_3_open, dow_3_close, dow_4_open, dow_4_close,
+    dow_5_open, dow_5_close, dow_6_open, dow_6_close) VALUES
+-- BR1 - accept defaults of 09:00 - 17:00 for each day
+    (4, '09:00', '17:00', '09:00', '17:00', '09:00', '17:00', '09:00', '17:00', '09:00', '17:00', '09:00', '17:00', '09:00', '17:00'),
+-- BR2 - accept defaults of 09:00 - 17:00 for some days
+    (5, '08:30', '21:30', '09:30', '14:30', '10:00', '21:30', '08:30', '17:00', '09:00', '17:00', '09:00', '17:00', '09:00', '17:00'),
+-- BR3 - accept defaults of 09:00 - 17:00 for some days
+    (6, '08:00', '23:30', '08:00', '23:30', '08:00', '23:30', '08:00', '23:30', '09:00', '23:30', '13:00', '23:30', '09:00', '23:30'),
+-- BR4 - closed on weekends (convention is 00:00 - 00:00)
+    (7, '08:00', '23:30', '08:00', '23:30', '08:00', '23:30', '08:00', '23:30', '09:00', '23:30', '00:00', '00:00', '00:00', '00:00');

commit bcb902397123ebf504eee654d9e5552c4e08cc89
Author: Dan Scott <dscott at laurentian.ca>
Date:   Tue Dec 17 10:16:32 2013 -0500

    Move default actor.org_unit entries into sample data
    
    The only actor.org_unit entry we absolutely require in the sample data is the
    consortium, as many things are owned by it. Otherwise, we should treat the
    libraries and associated settings such as addresses as sample data.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Ben Shum <bshum at biblio.org>

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 770443e..e0912da 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -452,32 +452,11 @@ INSERT INTO actor.org_unit_type (id, name, opac_label, depth, parent) VALUES
 	oils_i18n_gettext(5, 'Your Bookmobile', 'aout', 'opac_label'), 3, 3 );
 SELECT SETVAL('actor.org_unit_type_id_seq'::TEXT, 100);
 
+-- We need one actor.org_unit to own many things
 INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES 
     (1, NULL, 1, 'CONS', oils_i18n_gettext(1, 'Example Consortium', 'aou', 'name'));
-INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES 
-    (2, 1, 2, 'SYS1', oils_i18n_gettext(2, 'Example System 1', 'aou', 'name'));
-INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES 
-    (3, 1, 2, 'SYS2', oils_i18n_gettext(3, 'Example System 2', 'aou', 'name'));
-INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES 
-    (4, 2, 3, 'BR1', oils_i18n_gettext(4, 'Example Branch 1', 'aou', 'name'));
-INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES 
-    (5, 2, 3, 'BR2', oils_i18n_gettext(5, 'Example Branch 2', 'aou', 'name'));
-INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES 
-    (6, 3, 3, 'BR3', oils_i18n_gettext(6, 'Example Branch 3', 'aou', 'name'));
-INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES 
-    (7, 3, 3, 'BR4', oils_i18n_gettext(7, 'Example Branch 4', 'aou', 'name'));
-INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES 
-    (8, 4, 4, 'SL1', oils_i18n_gettext(8, 'Example Sub-library 1', 'aou', 'name'));
-INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES 
-    (9, 6, 5, 'BM1', oils_i18n_gettext(9, 'Example Bookmobile 1', 'aou', 'name'));
 SELECT SETVAL('actor.org_unit_id_seq'::TEXT, 100);
 
-INSERT INTO actor.org_address (org_unit, street1, city, state, country, post_code)
-SELECT id, '123 Main St.', 'Anywhere', 'GA', 'US', '30303'
-FROM actor.org_unit;
-
-UPDATE actor.org_unit SET holds_address = id, ill_address = id, billing_address = id, mailing_address = id;
-
 INSERT INTO config.billing_type (id, name, owner) VALUES
 	( 1, oils_i18n_gettext(1, 'Overdue Materials', 'cbt', 'name'), 1);
 INSERT INTO config.billing_type (id, name, owner) VALUES
diff --git a/Open-ILS/tests/datasets/sql/libraries.sql b/Open-ILS/tests/datasets/sql/libraries.sql
new file mode 100644
index 0000000..f93edbb
--- /dev/null
+++ b/Open-ILS/tests/datasets/sql/libraries.sql
@@ -0,0 +1,24 @@
+INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES 
+    (2, 1, 2, 'SYS1', oils_i18n_gettext(2, 'Example System 1', 'aou', 'name'));
+INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES 
+    (3, 1, 2, 'SYS2', oils_i18n_gettext(3, 'Example System 2', 'aou', 'name'));
+INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES 
+    (4, 2, 3, 'BR1', oils_i18n_gettext(4, 'Example Branch 1', 'aou', 'name'));
+INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES 
+    (5, 2, 3, 'BR2', oils_i18n_gettext(5, 'Example Branch 2', 'aou', 'name'));
+INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES 
+    (6, 3, 3, 'BR3', oils_i18n_gettext(6, 'Example Branch 3', 'aou', 'name'));
+INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES 
+    (7, 3, 3, 'BR4', oils_i18n_gettext(7, 'Example Branch 4', 'aou', 'name'));
+INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES 
+    (8, 4, 4, 'SL1', oils_i18n_gettext(8, 'Example Sub-library 1', 'aou', 'name'));
+INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES 
+    (9, 6, 5, 'BM1', oils_i18n_gettext(9, 'Example Bookmobile 1', 'aou', 'name'));
+
+INSERT INTO actor.org_address (org_unit, street1, city, state, country, post_code)
+SELECT id, '123 Main St.', 'Anywhere', 'GA', 'US', '30303'
+FROM actor.org_unit;
+
+UPDATE actor.org_unit SET holds_address = id, ill_address = id, billing_address = id, mailing_address = id;
+
+
diff --git a/Open-ILS/tests/datasets/sql/load_all.sql b/Open-ILS/tests/datasets/sql/load_all.sql
index 4d051fa..0589bac 100644
--- a/Open-ILS/tests/datasets/sql/load_all.sql
+++ b/Open-ILS/tests/datasets/sql/load_all.sql
@@ -6,6 +6,9 @@ BEGIN;
 -- build functions, tables
 \i env_create.sql
 
+-- load libraries (org unit)
+\i libraries.sql
+
 -- load concerto authorities
 \i auth_concerto.sql
 
diff --git a/Open-ILS/tests/datasets/sql/load_concerto.sql b/Open-ILS/tests/datasets/sql/load_concerto.sql
index 7394ca3..73c66ff 100644
--- a/Open-ILS/tests/datasets/sql/load_concerto.sql
+++ b/Open-ILS/tests/datasets/sql/load_concerto.sql
@@ -6,6 +6,9 @@ BEGIN;
 -- build functions, tables
 \i env_create.sql
 
+-- load libraries (org units)
+\i libraries.sql
+
 -- load concerto authorities
 \i auth_concerto.sql
 

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/sql/Pg/950.data.seed-values.sql  |   23 +--------
 Open-ILS/tests/datasets/sql/env_create.sql    |   37 +++++++++++++
 Open-ILS/tests/datasets/sql/env_destroy.sql   |    1 +
 Open-ILS/tests/datasets/sql/libraries.sql     |   68 +++++++++++++++++++++++++
 Open-ILS/tests/datasets/sql/load_all.sql      |    3 +
 Open-ILS/tests/datasets/sql/load_concerto.sql |    3 +
 6 files changed, 113 insertions(+), 22 deletions(-)
 create mode 100644 Open-ILS/tests/datasets/sql/libraries.sql


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list