3 INSERT INTO config.upgrade_log (version) VALUES ('0165'); -- phasefx
5 INSERT INTO action_trigger.hook (key,core_type,description,passive) VALUES (
11 'A patron acquisition request has been marked On-Order.',
21 'A patron acquisition request has been marked Received.',
31 'A patron acquisition request has been marked Cancelled.',
39 INSERT INTO action_trigger.validator (module,description) VALUES (
40 'Acq::UserRequestOrdered',
42 'Acq::UserRequestOrdered',
43 'Tests to see if the corresponding Line Item has a state of "on-order".',
48 'Acq::UserRequestReceived',
50 'Acq::UserRequestReceived',
51 'Tests to see if the corresponding Line Item has a state of "received".',
56 'Acq::UserRequestCancelled',
58 'Acq::UserRequestCancelled',
59 'Tests to see if the corresponding Line Item has a state of "cancelled".',
66 INSERT INTO action_trigger.event_definition (
79 'Email Notice: Patron Acquisition Request marked On-Order.',
81 'Acq::UserRequestOrdered',
85 [%- SET li = target.lineitem; -%]
86 [%- SET user = target.usr -%]
87 [%- SET title = helpers.get_li_attr("title", "", li.attributes) -%]
88 [%- SET author = helpers.get_li_attr("author", "", li.attributes) -%]
89 [%- SET edition = helpers.get_li_attr("edition", "", li.attributes) -%]
90 [%- SET isbn = helpers.get_li_attr("isbn", "", li.attributes) -%]
91 [%- SET publisher = helpers.get_li_attr("publisher", "", li.attributes) -%]
92 [%- SET pubdate = helpers.get_li_attr("pubdate", "", li.attributes) -%]
94 To: [%- params.recipient_email || user.email %]
95 From: [%- params.sender_email || default_sender %]
96 Subject: Acquisition Request Notification
98 Dear [% user.family_name %], [% user.first_given_name %]
99 Our records indicate the following acquisition request has been placed on order.
102 [% IF author %]Author: [% author %][% END %]
103 [% IF edition %]Edition: [% edition %][% END %]
104 [% IF isbn %]ISBN: [% isbn %][% END %]
105 [% IF publisher %]Publisher: [% publisher %][% END %]
106 [% IF pubdate %]Publication Date: [% pubdate %][% END %]
107 Lineitem ID: [% li.id %]
113 'Email Notice: Patron Acquisition Request marked Received.',
115 'Acq::UserRequestReceived',
119 [%- SET li = target.lineitem; -%]
120 [%- SET user = target.usr -%]
121 [%- SET title = helpers.get_li_attr("title", "", li.attributes) %]
122 [%- SET author = helpers.get_li_attr("author", "", li.attributes) %]
123 [%- SET edition = helpers.get_li_attr("edition", "", li.attributes) %]
124 [%- SET isbn = helpers.get_li_attr("isbn", "", li.attributes) %]
125 [%- SET publisher = helpers.get_li_attr("publisher", "", li.attributes) -%]
126 [%- SET pubdate = helpers.get_li_attr("pubdate", "", li.attributes) -%]
128 To: [%- params.recipient_email || user.email %]
129 From: [%- params.sender_email || default_sender %]
130 Subject: Acquisition Request Notification
132 Dear [% user.family_name %], [% user.first_given_name %]
133 Our records indicate the materials for the following acquisition request have been received.
136 [% IF author %]Author: [% author %][% END %]
137 [% IF edition %]Edition: [% edition %][% END %]
138 [% IF isbn %]ISBN: [% isbn %][% END %]
139 [% IF publisher %]Publisher: [% publisher %][% END %]
140 [% IF pubdate %]Publication Date: [% pubdate %][% END %]
141 Lineitem ID: [% li.id %]
147 'Email Notice: Patron Acquisition Request marked Cancelled.',
149 'Acq::UserRequestCancelled',
153 [%- SET li = target.lineitem; -%]
154 [%- SET user = target.usr -%]
155 [%- SET title = helpers.get_li_attr("title", "", li.attributes) %]
156 [%- SET author = helpers.get_li_attr("author", "", li.attributes) %]
157 [%- SET edition = helpers.get_li_attr("edition", "", li.attributes) %]
158 [%- SET isbn = helpers.get_li_attr("isbn", "", li.attributes) %]
159 [%- SET publisher = helpers.get_li_attr("publisher", "", li.attributes) -%]
160 [%- SET pubdate = helpers.get_li_attr("pubdate", "", li.attributes) -%]
162 To: [%- params.recipient_email || user.email %]
163 From: [%- params.sender_email || default_sender %]
164 Subject: Acquisition Request Notification
166 Dear [% user.family_name %], [% user.first_given_name %]
167 Our records indicate the following acquisition request has been cancelled.
170 [% IF author %]Author: [% author %][% END %]
171 [% IF edition %]Edition: [% edition %][% END %]
172 [% IF isbn %]ISBN: [% isbn %][% END %]
173 [% IF publisher %]Publisher: [% publisher %][% END %]
174 [% IF pubdate %]Publication Date: [% pubdate %][% END %]
175 Lineitem ID: [% li.id %]
179 INSERT INTO action_trigger.environment (
184 ( 15, 'lineitem.attributes' ),
188 ( 16, 'lineitem.attributes' ),
192 ( 17, 'lineitem.attributes' ),