3 INSERT INTO config.upgrade_log (version) VALUES ('0285'); -- phasefx
5 INSERT INTO action_trigger.hook (key,core_type,description,passive) VALUES (
6 'circ.format.history.email',
9 'circ.format.history.email',
10 'An email has been requested for a circ history.',
17 'circ.format.history.print',
20 'circ.format.history.print',
21 'A circ history needs to be formatted for printing.',
28 'ahr.format.history.email',
31 'ahr.format.history.email',
32 'An email has been requested for a hold request history.',
39 'ahr.format.history.print',
42 'ahr.format.history.print',
43 'A hold request history needs to be formatted for printing.',
52 INSERT INTO action_trigger.event_definition (
68 'circ.format.history.email',
75 [%- SET user = target.0.usr -%]
76 To: [%- params.recipient_email || user.email %]
77 From: [%- params.sender_email || default_sender %]
78 Subject: Circulation History
80 [% FOR circ IN target %]
81 [% helpers.get_copy_bib_basics(circ.target_copy.id).title %]
82 Barcode: [% circ.target_copy.barcode %]
83 Checked Out: [% date.format(helpers.format_date(circ.xact_start), '%Y-%m-%d') %]
84 Due Date: [% date.format(helpers.format_date(circ.due_date), '%Y-%m-%d') %]
85 Returned: [% date.format(helpers.format_date(circ.checkin_time), '%Y-%m-%d') %]
94 'circ.format.history.print',
102 <style> li { padding: 8px; margin 5px; }</style>
103 <div>[% date.format %]</div>
106 [% user.family_name %], [% user.first_given_name %]
108 [% FOR circ IN target %]
110 <div>[% helpers.get_copy_bib_basics(circ.target_copy.id).title %]</div>
111 <div>Barcode: [% circ.target_copy.barcode %]</div>
112 <div>Checked Out: [% date.format(helpers.format_date(circ.xact_start), '%Y-%m-%d') %]</div>
113 <div>Due Date: [% date.format(helpers.format_date(circ.due_date), '%Y-%m-%d') %]</div>
114 <div>Returned: [% date.format(helpers.format_date(circ.checkin_time), '%Y-%m-%d') %]</div>
126 'ahr.format.history.email',
133 [%- SET user = target.0.usr -%]
134 To: [%- params.recipient_email || user.email %]
135 From: [%- params.sender_email || default_sender %]
136 Subject: Hold Request History
138 [% FOR hold IN target %]
139 [% helpers.get_copy_bib_basics(hold.current_copy.id).title %]
140 Requested: [% date.format(helpers.format_date(hold.request_time), '%Y-%m-%d') %]
141 [% IF hold.fulfillment_time %]Fulfilled: [% date.format(helpers.format_date(hold.fulfillment_time), '%Y-%m-%d') %][% END %]
150 'ahr.format.history.print',
158 <style> li { padding: 8px; margin 5px; }</style>
159 <div>[% date.format %]</div>
162 [% user.family_name %], [% user.first_given_name %]
164 [% FOR hold IN target %]
166 <div>[% helpers.get_copy_bib_basics(hold.current_copy.id).title %]</div>
167 <div>Requested: [% date.format(helpers.format_date(hold.request_time), '%Y-%m-%d') %]</div>
168 [% IF hold.fulfillment_time %]<div>Fulfilled: [% date.format(helpers.format_date(hold.fulfillment_time), '%Y-%m-%d') %]</div>[% END %]
178 INSERT INTO action_trigger.environment (
184 ,( 26, 'target_copy' )
186 ,( 27, 'current_copy' )
188 ,( 28, 'current_copy' )
192 -- DELETE FROM action_trigger.environment WHERE event_def IN (25,26,27,28); DELETE FROM action_trigger.event where event_def IN (25,26,27,28); DELETE FROM action_trigger.event_definition WHERE id IN (25,26,27,28); DELETE FROM action_trigger.hook WHERE key IN ('circ.format.history.email','circ.format.history.print','ahr.format.history.email','ahr.format.history.print'); DELETE FROM config.upgrade_log WHERE version = 'test'; -- from testing, this sql will remove these events, etc.