3 INSERT INTO config.upgrade_log (version) VALUES ('0165'); -- phasefx
5 INSERT INTO action_trigger.hook (key,core_type,description,passive) VALUES (
10 'A patron acquisition request has been marked On-Order.',
20 'A patron acquisition request has been marked Received.',
30 'A patron acquisition request has been marked Cancelled.',
38 INSERT INTO action_trigger.validator (module,description) VALUES (
39 'Acq::UserRequestOrdered',
41 'Acq::UserRequestOrdered',
42 'Tests to see if the corresponding Line Item has a state of "on-order".',
47 'Acq::UserRequestReceived',
49 'Acq::UserRequestReceived',
50 'Tests to see if the corresponding Line Item has a state of "received".',
55 'Acq::UserRequestCancelled',
57 'Acq::UserRequestCancelled',
58 'Tests to see if the corresponding Line Item has a state of "cancelled".',
65 INSERT INTO action_trigger.event_definition (
78 'Email Notice: Patron Acquisition Request marked On-Order.',
80 'Acq::UserRequestOrdered',
84 [%- SET li = target.lineitem; -%]
85 [%- SET user = target.usr -%]
86 [%- SET title = helpers.get_li_attr("title", "", li.attributes) -%]
87 [%- SET author = helpers.get_li_attr("author", "", li.attributes) -%]
88 [%- SET edition = helpers.get_li_attr("edition", "", li.attributes) -%]
89 [%- SET isbn = helpers.get_li_attr("isbn", "", li.attributes) -%]
90 [%- SET publisher = helpers.get_li_attr("publisher", "", li.attributes) -%]
91 [%- SET pubdate = helpers.get_li_attr("pubdate", "", li.attributes) -%]
93 To: [%- params.recipient_email || user.email %]
94 From: [%- params.sender_email || default_sender %]
95 Subject: Acquisition Request Notification
97 Dear [% user.family_name %], [% user.first_given_name %]
98 Our records indicate the following acquisition request has been placed on order.
101 [% IF author %]Author: [% author %][% END %]
102 [% IF edition %]Edition: [% edition %][% END %]
103 [% IF isbn %]ISBN: [% isbn %][% END %]
104 [% IF publisher %]Publisher: [% publisher %][% END %]
105 [% IF pubdate %]Publication Date: [% pubdate %][% END %]
106 Lineitem ID: [% li.id %]
112 'Email Notice: Patron Acquisition Request marked Received.',
114 'Acq::UserRequestReceived',
118 [%- SET li = target.lineitem; -%]
119 [%- SET user = target.usr -%]
120 [%- SET title = helpers.get_li_attr("title", "", li.attributes) %]
121 [%- SET author = helpers.get_li_attr("author", "", li.attributes) %]
122 [%- SET edition = helpers.get_li_attr("edition", "", li.attributes) %]
123 [%- SET isbn = helpers.get_li_attr("isbn", "", li.attributes) %]
124 [%- SET publisher = helpers.get_li_attr("publisher", "", li.attributes) -%]
125 [%- SET pubdate = helpers.get_li_attr("pubdate", "", li.attributes) -%]
127 To: [%- params.recipient_email || user.email %]
128 From: [%- params.sender_email || default_sender %]
129 Subject: Acquisition Request Notification
131 Dear [% user.family_name %], [% user.first_given_name %]
132 Our records indicate the materials for the following acquisition request have been received.
135 [% IF author %]Author: [% author %][% END %]
136 [% IF edition %]Edition: [% edition %][% END %]
137 [% IF isbn %]ISBN: [% isbn %][% END %]
138 [% IF publisher %]Publisher: [% publisher %][% END %]
139 [% IF pubdate %]Publication Date: [% pubdate %][% END %]
140 Lineitem ID: [% li.id %]
146 'Email Notice: Patron Acquisition Request marked Cancelled.',
148 'Acq::UserRequestCancelled',
152 [%- SET li = target.lineitem; -%]
153 [%- SET user = target.usr -%]
154 [%- SET title = helpers.get_li_attr("title", "", li.attributes) %]
155 [%- SET author = helpers.get_li_attr("author", "", li.attributes) %]
156 [%- SET edition = helpers.get_li_attr("edition", "", li.attributes) %]
157 [%- SET isbn = helpers.get_li_attr("isbn", "", li.attributes) %]
158 [%- SET publisher = helpers.get_li_attr("publisher", "", li.attributes) -%]
159 [%- SET pubdate = helpers.get_li_attr("pubdate", "", li.attributes) -%]
161 To: [%- params.recipient_email || user.email %]
162 From: [%- params.sender_email || default_sender %]
163 Subject: Acquisition Request Notification
165 Dear [% user.family_name %], [% user.first_given_name %]
166 Our records indicate the following acquisition request has been cancelled.
169 [% IF author %]Author: [% author %][% END %]
170 [% IF edition %]Edition: [% edition %][% END %]
171 [% IF isbn %]ISBN: [% isbn %][% END %]
172 [% IF publisher %]Publisher: [% publisher %][% END %]
173 [% IF pubdate %]Publication Date: [% pubdate %][% END %]
174 Lineitem ID: [% li.id %]
178 INSERT INTO action_trigger.environment (
183 ( 15, 'lineitem.attributes' ),
187 ( 16, 'lineitem.attributes' ),
191 ( 17, 'lineitem.attributes' ),