From d537b0e77a7135517a238b28e4fbcaed09114ea0 Mon Sep 17 00:00:00 2001 From: phasefx Date: Mon, 29 Mar 2010 20:36:10 +0000 Subject: [PATCH] We'll be renaming this before it goes into master git-svn-id: svn://svn.open-ils.org/ILS/trunk@16043 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../Pg/upgrade/test.data.acq.patron_requests.sql | 106 +++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/upgrade/test.data.acq.patron_requests.sql diff --git a/Open-ILS/src/sql/Pg/upgrade/test.data.acq.patron_requests.sql b/Open-ILS/src/sql/Pg/upgrade/test.data.acq.patron_requests.sql new file mode 100644 index 0000000000..487d56afc6 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/test.data.acq.patron_requests.sql @@ -0,0 +1,106 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('test'); -- phasefx + +INSERT INTO action_trigger.hook ( + key, + core_type, + description, + passive + ) VALUES ( + 'aur.created', + 'aur', + 'A patron has made an acquisitions request.', + TRUE + ), ( + 'aur.rejected', + 'aur', + 'A patron acquisition request has been rejected.', + TRUE + ); + +INSERT INTO action_trigger.event_definition ( + id, + active, + owner, + name, + hook, + validator, + reactor, + template + ) VALUES ( + 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 + ( 18, 'usr' ), + + ( 19, 'usr' ) + ; + +COMMIT; + -- 2.11.0