[open-ils-commits] r16045 - in trunk/Open-ILS/src/sql/Pg: . upgrade (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Mar 29 16:36:19 EDT 2010
Author: phasefx
Date: 2010-03-29 16:36:14 -0400 (Mon, 29 Mar 2010)
New Revision: 16045
Modified:
trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
trunk/Open-ILS/src/sql/Pg/upgrade/0165.data.acq.patron_requests.sql
trunk/Open-ILS/src/sql/Pg/upgrade/test.data.acq.patron_requests.sql
Log:
seed data
Modified: trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2010-03-29 20:36:12 UTC (rev 16044)
+++ trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2010-03-29 20:36:14 UTC (rev 16045)
@@ -3333,8 +3333,286 @@
(9, 'usr'),
(9, 'bib_rec.bib_record.simple_record');
+-- trigger data related to acq user requests
+INSERT INTO action_trigger.hook (key,core_type,description,passive) VALUES (
+ 'aur.ordered',
+ 'aur',
+ oils_i18n_gettext(
+ 'aur.ordered',
+ 'aur.ordered',
+ 'A patron acquisition request has been marked On-Order.',
+ 'ath',
+ 'description'
+ ),
+ TRUE
+ ), (
+ 'aur.received',
+ 'aur',
+ oils_i18n_gettext(
+ 'aur.received',
+ 'A patron acquisition request has been marked Received.',
+ 'ath',
+ 'description'
+ ),
+ TRUE
+ ), (
+ 'aur.cancelled',
+ 'aur',
+ oils_i18n_gettext(
+ 'aur.cancelled',
+ 'A patron acquisition request has been marked Cancelled.',
+ 'ath',
+ 'description'
+ ),
+ TRUE
+ ), (
+ 'aur.created',
+ 'aur',
+ oils_i18n_gettext(
+ 'aur.created',
+ 'A patron has made an acquisitions request.',
+ 'ath',
+ 'description'
+ ),
+ TRUE
+ ), (
+ 'aur.rejected',
+ 'aur',
+ oils_i18n_gettext(
+ 'aur.rejected',
+ 'A patron acquisition request has been rejected.',
+ 'ath',
+ 'description'
+ ),
+ TRUE
+ )
+;
+INSERT INTO action_trigger.validator (module,description) VALUES (
+ 'Acq::UserRequestOrdered',
+ oils_i18n_gettext(
+ 'Acq::UserRequestOrdered',
+ 'Tests to see if the corresponding Line Item has a state of "on-order".',
+ 'atval',
+ 'description'
+ )
+ ), (
+ 'Acq::UserRequestReceived',
+ oils_i18n_gettext(
+ 'Acq::UserRequestReceived',
+ 'Tests to see if the corresponding Line Item has a state of "received".'
+ 'atval',
+ 'description'
+ )
+ ), (
+ 'Acq::UserRequestCancelled',
+ oils_i18n_gettext(
+ 'Acq::UserRequestCancelled',
+ 'Tests to see if the corresponding Line Item has a state of "cancelled".'
+ 'atval',
+ 'description'
+ )
+ )
+;
+
+INSERT INTO action_trigger.event_definition (
+ id,
+ active,
+ owner,
+ name,
+ hook,
+ validator,
+ reactor,
+ template
+ ) VALUES (
+ 15,
+ FALSE,
+ 1,
+ 'Email Notice: Patron Acquisition Request marked On-Order.',
+ 'aur.ordered',
+ 'Acq::UserRequestOrdered',
+ 'SendEmail',
+$$
+[%- USE date -%]
+[%- SET li = target.lineitem; -%]
+[%- SET user = target.usr -%]
+[%- SET title = helpers.get_li_attr("title", "", li.attributes) -%]
+[%- SET author = helpers.get_li_attr("author", "", li.attributes) -%]
+[%- SET edition = helpers.get_li_attr("edition", "", li.attributes) -%]
+[%- SET isbn = helpers.get_li_attr("isbn", "", li.attributes) -%]
+[%- SET publisher = helpers.get_li_attr("publisher", "", li.attributes) -%]
+[%- SET pubdate = helpers.get_li_attr("pubdate", "", li.attributes) -%]
+
+To: [%- params.recipient_email || user.email %]
+From: [%- params.sender_email || default_sender %]
+Subject: Acquisition Request Notification
+
+Dear [% user.family_name %], [% user.first_given_name %]
+Our records indicate the following acquisition request has been placed on order.
+
+Title: [% title %]
+[% IF author %]Author: [% author %][% END %]
+[% IF edition %]Edition: [% edition %][% END %]
+[% IF isbn %]ISBN: [% isbn %][% END %]
+[% IF publisher %]Publisher: [% publisher %][% END %]
+[% IF pubdate %]Publication Date: [% pubdate %][% END %]
+Lineitem ID: [% li.id %]
+$$
+ ), (
+ 16,
+ FALSE,
+ 1,
+ 'Email Notice: Patron Acquisition Request marked Received.',
+ 'aur.received',
+ 'Acq::UserRequestReceived',
+ 'SendEmail',
+$$
+[%- USE date -%]
+[%- SET li = target.lineitem; -%]
+[%- SET user = target.usr -%]
+[%- SET title = helpers.get_li_attr("title", "", li.attributes) %]
+[%- SET author = helpers.get_li_attr("author", "", li.attributes) %]
+[%- SET edition = helpers.get_li_attr("edition", "", li.attributes) %]
+[%- SET isbn = helpers.get_li_attr("isbn", "", li.attributes) %]
+[%- SET publisher = helpers.get_li_attr("publisher", "", li.attributes) -%]
+[%- SET pubdate = helpers.get_li_attr("pubdate", "", li.attributes) -%]
+
+To: [%- params.recipient_email || user.email %]
+From: [%- params.sender_email || default_sender %]
+Subject: Acquisition Request Notification
+
+Dear [% user.family_name %], [% user.first_given_name %]
+Our records indicate the materials for the following acquisition request have been received.
+
+Title: [% title %]
+[% IF author %]Author: [% author %][% END %]
+[% IF edition %]Edition: [% edition %][% END %]
+[% IF isbn %]ISBN: [% isbn %][% END %]
+[% IF publisher %]Publisher: [% publisher %][% END %]
+[% IF pubdate %]Publication Date: [% pubdate %][% END %]
+Lineitem ID: [% li.id %]
+$$
+ ), (
+ 17,
+ FALSE,
+ 1,
+ 'Email Notice: Patron Acquisition Request marked Cancelled.',
+ 'aur.cancelled',
+ 'Acq::UserRequestCancelled',
+ 'SendEmail',
+$$
+[%- USE date -%]
+[%- SET li = target.lineitem; -%]
+[%- SET user = target.usr -%]
+[%- SET title = helpers.get_li_attr("title", "", li.attributes) %]
+[%- SET author = helpers.get_li_attr("author", "", li.attributes) %]
+[%- SET edition = helpers.get_li_attr("edition", "", li.attributes) %]
+[%- SET isbn = helpers.get_li_attr("isbn", "", li.attributes) %]
+[%- SET publisher = helpers.get_li_attr("publisher", "", li.attributes) -%]
+[%- SET pubdate = helpers.get_li_attr("pubdate", "", li.attributes) -%]
+
+To: [%- params.recipient_email || user.email %]
+From: [%- params.sender_email || default_sender %]
+Subject: Acquisition Request Notification
+
+Dear [% user.family_name %], [% user.first_given_name %]
+Our records indicate the following acquisition request has been cancelled.
+
+Title: [% title %]
+[% IF author %]Author: [% author %][% END %]
+[% IF edition %]Edition: [% edition %][% END %]
+[% IF isbn %]ISBN: [% isbn %][% END %]
+[% IF publisher %]Publisher: [% publisher %][% END %]
+[% IF pubdate %]Publication Date: [% pubdate %][% END %]
+Lineitem ID: [% li.id %]
+$$
+ ), (
+ 18,
+ FALSE,
+ 1,
+ 'Email Notice: Acquisition Request created.',
+ 'aur.created',
+ 'NOOP_True',
+ 'SendEmail',
+$$
+[%- USE date -%]
+[%- SET user = target.usr -%]
+[%- SET title = target.title -%]
+[%- SET author = target.author -%]
+[%- SET isxn = target.isxn -%]
+[%- SET publisher = target.publisher -%]
+[%- SET pubdate = target.pubdate -%]
+
+To: [%- params.recipient_email || user.email %]
+From: [%- params.sender_email || default_sender %]
+Subject: Acquisition Request Notification
+
+Dear [% user.family_name %], [% user.first_given_name %]
+Our records indicate that you have made the following acquisition request:
+
+Title: [% title %]
+[% IF author %]Author: [% author %][% END %]
+[% IF edition %]Edition: [% edition %][% END %]
+[% IF isbn %]ISXN: [% isxn %][% END %]
+[% IF publisher %]Publisher: [% publisher %][% END %]
+[% IF pubdate %]Publication Date: [% pubdate %][% END %]
+$$
+ ), (
+ 19,
+ FALSE,
+ 1,
+ 'Email Notice: Acquisition Request Rejected.',
+ 'aur.rejected',
+ 'NOOP_True',
+ 'SendEmail',
+$$
+[%- USE date -%]
+[%- SET user = target.usr -%]
+[%- SET title = target.title -%]
+[%- SET author = target.author -%]
+[%- SET isxn = target.isxn -%]
+[%- SET publisher = target.publisher -%]
+[%- SET pubdate = target.pubdate -%]
+[%- SET cancel_reason = target.cancel_reason.description -%]
+
+To: [%- params.recipient_email || user.email %]
+From: [%- params.sender_email || default_sender %]
+Subject: Acquisition Request Notification
+
+Dear [% user.family_name %], [% user.first_given_name %]
+Our records indicate the following acquisition request has been rejected for this reason: .
+
+Title: [% title %]
+[% IF author %]Author: [% author %][% END %]
+[% IF edition %]Edition: [% edition %][% END %]
+[% IF isbn %]ISBN: [% isbn %][% END %]
+[% IF publisher %]Publisher: [% publisher %][% END %]
+[% IF pubdate %]Publication Date: [% pubdate %][% END %]
+$$
+ )
+;
+
+INSERT INTO action_trigger.environment (
+ event_def,
+ path
+ ) VALUES
+ ( 15, 'lineitem' ),
+ ( 15, 'lineitem.attributes' ),
+ ( 15, 'usr' ),
+
+ ( 16, 'lineitem' ),
+ ( 16, 'lineitem.attributes' ),
+ ( 16, 'usr' ),
+
+ ( 17, 'lineitem' ),
+ ( 17, 'lineitem.attributes' ),
+ ( 17, 'usr' ),
+
+ ( 18, 'usr' ),
+ ( 19, 'usr' )
+ ;
+
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
Modified: trunk/Open-ILS/src/sql/Pg/upgrade/0165.data.acq.patron_requests.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0165.data.acq.patron_requests.sql 2010-03-29 20:36:12 UTC (rev 16044)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0165.data.acq.patron_requests.sql 2010-03-29 20:36:14 UTC (rev 16045)
@@ -2,38 +2,66 @@
INSERT INTO config.upgrade_log (version) VALUES ('0165'); -- phasefx
-INSERT INTO action_trigger.hook (
- key,
- core_type,
- description,
- passive
- ) VALUES (
+INSERT INTO action_trigger.hook (key,core_type,description,passive) VALUES (
'aur.ordered',
- 'aur',
- 'A patron acquisition request has been marked On-Order.',
+ 'aur',
+ oils_i18n_gettext(
+ 'aur.ordered',
+ 'aur.ordered',
+ 'A patron acquisition request has been marked On-Order.',
+ 'ath',
+ 'description'
+ ),
TRUE
), (
- 'aur.received',
- 'aur',
- 'A patron acquisition request has been marked Received.',
+ 'aur.received',
+ 'aur',
+ oils_i18n_gettext(
+ 'aur.received',
+ 'A patron acquisition request has been marked Received.',
+ 'ath',
+ 'description'
+ ),
TRUE
), (
'aur.cancelled',
'aur',
- 'A patron acquisition request has been marked Cancelled.',
+ oils_i18n_gettext(
+ 'aur.cancelled',
+ 'A patron acquisition request has been marked Cancelled.',
+ 'ath',
+ 'description'
+ ),
TRUE
- );
+ )
+;
INSERT INTO action_trigger.validator (module,description) VALUES (
'Acq::UserRequestOrdered',
- 'Tests to see if the corresponding Line Item has a state of "on-order".'
+ oils_i18n_gettext(
+ 'Acq::UserRequestOrdered',
+ 'Tests to see if the corresponding Line Item has a state of "on-order".',
+ 'atval',
+ 'description'
+ )
), (
'Acq::UserRequestReceived',
- 'Tests to see if the corresponding Line Item has a state of "received".'
+ oils_i18n_gettext(
+ 'Acq::UserRequestReceived',
+ 'Tests to see if the corresponding Line Item has a state of "received".'
+ 'atval',
+ 'description'
+ )
), (
'Acq::UserRequestCancelled',
- 'Tests to see if the corresponding Line Item has a state of "cancelled".'
- );
+ oils_i18n_gettext(
+ 'Acq::UserRequestCancelled',
+ 'Tests to see if the corresponding Line Item has a state of "cancelled".'
+ 'atval',
+ 'description'
+ )
+ )
+;
INSERT INTO action_trigger.event_definition (
id,
Modified: trunk/Open-ILS/src/sql/Pg/upgrade/test.data.acq.patron_requests.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/test.data.acq.patron_requests.sql 2010-03-29 20:36:12 UTC (rev 16044)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/test.data.acq.patron_requests.sql 2010-03-29 20:36:14 UTC (rev 16045)
@@ -2,22 +2,28 @@
INSERT INTO config.upgrade_log (version) VALUES ('test'); -- phasefx
-INSERT INTO action_trigger.hook (
- key,
- core_type,
- description,
- passive
- ) VALUES (
+INSERT INTO action_trigger.hook (key,core_type,description,passive) VALUES (
'aur.created',
'aur',
- 'A patron has made an acquisitions request.',
+ oils_i18n_gettext(
+ 'aur.created',
+ 'A patron has made an acquisitions request.',
+ 'ath',
+ 'description'
+ ),
TRUE
), (
'aur.rejected',
'aur',
- 'A patron acquisition request has been rejected.',
+ oils_i18n_gettext(
+ 'aur.rejected',
+ 'A patron acquisition request has been rejected.',
+ 'ath',
+ 'description'
+ ),
TRUE
- );
+ )
+;
INSERT INTO action_trigger.event_definition (
id,
@@ -98,7 +104,6 @@
path
) VALUES
( 18, 'usr' ),
-
( 19, 'usr' )
;
More information about the open-ils-commits
mailing list