[open-ils-commits] r14919 - in trunk/Open-ILS: examples src/sql/Pg src/sql/Pg/upgrade (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Nov 16 08:40:25 EST 2009


Author: erickson
Date: 2009-11-16 08:40:23 -0500 (Mon, 16 Nov 2009)
New Revision: 14919

Added:
   trunk/Open-ILS/src/sql/Pg/upgrade/0084.data.hold_request.long_wait.sql
Modified:
   trunk/Open-ILS/examples/action_trigger_filters.json.example
   trunk/Open-ILS/examples/fm_IDL.xml
   trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
   trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
Log:

Patch from Lebbeous Fogle-Weekley to add a sample long wait notice for holds



Modified: trunk/Open-ILS/examples/action_trigger_filters.json.example
===================================================================
--- trunk/Open-ILS/examples/action_trigger_filters.json.example	2009-11-16 08:19:44 UTC (rev 14918)
+++ trunk/Open-ILS/examples/action_trigger_filters.json.example	2009-11-16 13:40:23 UTC (rev 14919)
@@ -18,5 +18,13 @@
             "shelf_time": {"!=": null},
             "cancel_time": null
         }
+    },
+    "hold_request.long_wait" : {
+        "context_org": "pickup_lib",
+        "filter": {
+            "frozen": "f",
+            "cancel_time": null,
+            "capture_time": null
+        }
     }
 }

Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml	2009-11-16 08:19:44 UTC (rev 14918)
+++ trunk/Open-ILS/examples/fm_IDL.xml	2009-11-16 13:40:23 UTC (rev 14919)
@@ -4867,7 +4867,7 @@
 			<link field="id" reltype="might_have" key="id" map="" class="circ"/>
 		</links>
 	</class>
-	<class id="rhrr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::hold_request_record" oils_persist:tablename="reporter.hold_request_record" reporter:label="Hold Request Record">
+	<class id="rhrr" controller="open-ils.reporter-store open-ils.cstore" oils_obj:fieldmapper="reporter::hold_request_record" oils_persist:tablename="reporter.hold_request_record" reporter:label="Hold Request Record">
 		<fields oils_persist:primary="id">
 			<field reporter:label="Hold ID" name="id" reporter:datatype="id" />
 			<field reporter:label="Hold Target" name="target" reporter:datatype="int" />

Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2009-11-16 08:19:44 UTC (rev 14918)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2009-11-16 13:40:23 UTC (rev 14919)
@@ -51,7 +51,7 @@
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0083'); -- miker
+INSERT INTO config.upgrade_log (version) VALUES ('0084'); -- senator
 
 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	2009-11-16 08:19:44 UTC (rev 14918)
+++ trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2009-11-16 13:40:23 UTC (rev 14919)
@@ -2228,6 +2228,72 @@
     ( 7, 'pickup_lib.billing_address'),
     ( 7, 'usr');
 
+-- long wait hold request notifications
+
+INSERT INTO action_trigger.hook (
+        key,
+        core_type,
+        description,
+        passive
+    ) VALUES (
+        'hold_request.long_wait',
+        'ahr',
+        'A patron has been waiting on a hold to be fulfilled for a long time.',
+        TRUE
+    );
+
+INSERT INTO action_trigger.event_definition (
+        id,
+        active,
+        owner,
+        name,
+        hook,
+        validator,
+        reactor,
+        delay,
+        delay_field,
+        group_field,
+        template
+    ) VALUES (
+        9,
+        FALSE,
+        1,
+        'Hold waiting for pickup for long time',
+        'hold_request.long_wait',
+        'NOOP_True',
+        'SendEmail',
+        '6 MONTHS',
+        'request_time',
+        'usr',
+$$
+[%- USE date -%]
+[%- user = target.0.usr -%]
+To: [%- params.recipient_email || user.email %]
+From: [%- params.sender_email || default_sender %]
+Subject: Long Wait Hold Notification
+
+Dear [% user.family_name %], [% user.first_given_name %]
+
+You requested hold(s) on the following item(s), but unfortunately
+we have not been able to fulfill your request after a considerable
+length of time.  If you would still like to recieve these items,
+no action is required.
+
+[% FOR hold IN target %]
+    Title: [% hold.bib_rec.bib_record.simple_record.title %]
+    Author: [% hold.bib_rec.bib_record.simple_record.author %]
+[% END %]
+$$
+);
+
+INSERT INTO action_trigger.environment (event_def, path)
+    VALUES
+        (9, 'pickup_lib'),
+        (9, 'usr'),
+        (9, 'bib_rec.bib_record.simple_record');
+
+
+
 SELECT SETVAL('action_trigger.event_definition_id_seq'::TEXT, 100);
 
 -- Org Unit Settings for configuring org unit weights and org unit max-loops for hold targeting

Added: trunk/Open-ILS/src/sql/Pg/upgrade/0084.data.hold_request.long_wait.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0084.data.hold_request.long_wait.sql	                        (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0084.data.hold_request.long_wait.sql	2009-11-16 13:40:23 UTC (rev 14919)
@@ -0,0 +1,70 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0084'); -- senator
+
+INSERT INTO action_trigger.hook (
+        key,
+        core_type,
+        description,
+        passive
+    ) VALUES (
+        'hold_request.long_wait',
+        'ahr',
+        'A patron has been waiting on a hold to be fulfilled for a long time.',
+        TRUE
+    );
+
+INSERT INTO action_trigger.event_definition (
+        id,
+        active,
+        owner,
+        name,
+        hook,
+        validator,
+        reactor,
+        delay,
+        delay_field,
+        group_field,
+        template
+    ) VALUES (
+        9,
+        FALSE,
+        1,
+        'Hold waiting for pickup for long time',
+        'hold_request.long_wait',
+        'NOOP_True',
+        'SendEmail',
+        '6 MONTHS',
+        'request_time',
+        'usr',
+$$
+[%- USE date -%]
+[%- user = target.0.usr -%]
+To: [%- params.recipient_email || user.email %]
+From: [%- params.sender_email || default_sender %]
+Subject: Long Wait Hold Notification
+
+Dear [% user.family_name %], [% user.first_given_name %]
+
+You requested hold(s) on the following item(s), but unfortunately
+we have not been able to fulfill your request after a considerable
+length of time.  If you would still like to recieve these items,
+no action is required.
+
+[% FOR hold IN target %]
+    Title: [% hold.bib_rec.bib_record.simple_record.title %]
+    Author: [% hold.bib_rec.bib_record.simple_record.author %]
+[% END %]
+$$
+);
+
+INSERT INTO action_trigger.environment (
+        event_def,
+        path
+    ) VALUES
+    (9, 'pickup_lib'),
+    (9, 'usr'),
+    (9, 'bib_rec.bib_record.simple_record');
+
+
+COMMIT;



More information about the open-ils-commits mailing list