3 INSERT INTO config.upgrade_log (version) VALUES ('0165'); -- phasefx
5 INSERT INTO action_trigger.hook (
13 'A patron acquisition request has been marked On-Order.',
18 'A patron acquisition request has been marked Received.',
23 'A patron acquisition request has been marked Cancelled.',
27 INSERT INTO action_trigger.validator (module,description) VALUES (
28 'Acq::UserRequestOrdered',
29 'Tests to see if the corresponding Line Item has a state of "on-order".'
31 'Acq::UserRequestReceived',
32 'Tests to see if the corresponding Line Item has a state of "received".'
34 'Acq::UserRequestCancelled',
35 'Tests to see if the corresponding Line Item has a state of "cancelled".'
38 INSERT INTO action_trigger.event_definition (
51 'Email Notice: Patron Acquisition Request marked On-Order.',
53 'Acq::UserRequestOrdered',
57 [%- SET li = target.lineitem; -%]
58 [%- SET user = target.usr -%]
59 [%- SET title = helpers.get_li_attr("title", "", li.attributes) %]
60 [%- SET author = helpers.get_li_attr("author", "", li.attributes) %]
61 [%- SET edition = helpers.get_li_attr("edition", "", li.attributes) %]
62 [%- SET isbn = helpers.get_li_attr("isbn", "", li.attributes) %]
63 [%- SET publisher = helpers.get_li_attr("publisher", "", li.attributes) -%]
64 [%- SET pubdate = helpers.get_li_attr("pubdate", "", li.attributes) -%]
66 To: [%- params.recipient_email || user.email %]
67 From: [%- params.sender_email || default_sender %]
68 Subject: Acquisition Request Notification
70 Dear [% user.family_name %], [% user.first_given_name %]
71 Our records indicate the following acquisition request has been placed on order.
74 [% IF author %]Author: [% author %][% END %]
75 [% IF edition %]Edition: [% edition %][% END %]
76 [% IF isbn %]ISBN: [% isbn %][% END %]
77 [% IF publisher %]Publisher: [% publisher %][% END %]
78 [% IF pubdate %]Publication Date: [% pubdate %][% END %]
79 Lineitem ID: [% li.id %]
85 'Email Notice: Patron Acquisition Request marked Received.',
87 'Acq::UserRequestReceived',
91 [%- SET li = target.lineitem; -%]
92 [%- SET user = target.usr -%]
93 [%- SET title = helpers.get_li_attr("title", "", li.attributes) %]
94 [%- SET author = helpers.get_li_attr("author", "", li.attributes) %]
95 [%- SET edition = helpers.get_li_attr("edition", "", li.attributes) %]
96 [%- SET isbn = helpers.get_li_attr("isbn", "", li.attributes) %]
97 [%- SET publisher = helpers.get_li_attr("publisher", "", li.attributes) -%]
98 [%- SET pubdate = helpers.get_li_attr("pubdate", "", li.attributes) -%]
100 To: [%- params.recipient_email || user.email %]
101 From: [%- params.sender_email || default_sender %]
102 Subject: Acquisition Request Notification
104 Dear [% user.family_name %], [% user.first_given_name %]
105 Our records indicate the materials for the following acquisition request have been received.
108 [% IF author %]Author: [% author %][% END %]
109 [% IF edition %]Edition: [% edition %][% END %]
110 [% IF isbn %]ISBN: [% isbn %][% END %]
111 [% IF publisher %]Publisher: [% publisher %][% END %]
112 [% IF pubdate %]Publication Date: [% pubdate %][% END %]
113 Lineitem ID: [% li.id %]
119 'Email Notice: Patron Acquisition Request marked Cancelled.',
121 'Acq::UserRequestCancelled',
125 [%- SET li = target.lineitem; -%]
126 [%- SET user = target.usr -%]
127 [%- SET title = helpers.get_li_attr("title", "", li.attributes) %]
128 [%- SET author = helpers.get_li_attr("author", "", li.attributes) %]
129 [%- SET edition = helpers.get_li_attr("edition", "", li.attributes) %]
130 [%- SET isbn = helpers.get_li_attr("isbn", "", li.attributes) %]
131 [%- SET publisher = helpers.get_li_attr("publisher", "", li.attributes) -%]
132 [%- SET pubdate = helpers.get_li_attr("pubdate", "", li.attributes) -%]
134 To: [%- params.recipient_email || user.email %]
135 From: [%- params.sender_email || default_sender %]
136 Subject: Acquisition Request Notification
138 Dear [% user.family_name %], [% user.first_given_name %]
139 Our records indicate the following acquisition request has been cancelled.
142 [% IF author %]Author: [% author %][% END %]
143 [% IF edition %]Edition: [% edition %][% END %]
144 [% IF isbn %]ISBN: [% isbn %][% END %]
145 [% IF publisher %]Publisher: [% publisher %][% END %]
146 [% IF pubdate %]Publication Date: [% pubdate %][% END %]
147 Lineitem ID: [% li.id %]
151 INSERT INTO action_trigger.environment (
156 ( 15, 'lineitem.attributes' ),
160 ( 16, 'lineitem.attributes' ),
164 ( 17, 'lineitem.attributes' ),