3 SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
5 INSERT into config.org_unit_setting_type
6 ( name, grp, label, description, datatype, fm_class ) VALUES
7 ( 'opac.email_record.allow_without_login', 'opac',
8 oils_i18n_gettext('opac.email_record.allow_without_login',
9 'Allow record emailing without login',
11 oils_i18n_gettext('opac.email_record.allow_without_login',
12 'Instead of forcing a patron to log in in order to email the details of a record, just challenge them with a simple catpcha.',
13 'coust', 'description'),
17 CREATE TABLE action_trigger.event_def_group (
18 id SERIAL PRIMARY KEY,
19 owner INT NOT NULL REFERENCES actor.org_unit (id)
20 ON DELETE RESTRICT ON UPDATE CASCADE
21 DEFERRABLE INITIALLY DEFERRED,
22 hook TEXT NOT NULL REFERENCES action_trigger.hook (key)
23 ON DELETE RESTRICT ON UPDATE CASCADE
24 DEFERRABLE INITIALLY DEFERRED,
25 active BOOL NOT NULL DEFAULT TRUE,
28 SELECT SETVAL('action_trigger.event_def_group_id_seq'::TEXT, 100, TRUE);
30 CREATE TABLE action_trigger.event_def_group_member (
31 id SERIAL PRIMARY KEY,
32 grp INT NOT NULL REFERENCES action_trigger.event_def_group (id)
33 ON DELETE CASCADE ON UPDATE CASCADE
34 DEFERRABLE INITIALLY DEFERRED,
35 event_def INT NOT NULL REFERENCES action_trigger.event_definition (id)
36 ON DELETE RESTRICT ON UPDATE CASCADE
37 DEFERRABLE INITIALLY DEFERRED,
38 sortable BOOL NOT NULL DEFAULT TRUE,
39 holdings BOOL NOT NULL DEFAULT FALSE,
40 external BOOL NOT NULL DEFAULT FALSE,
44 INSERT INTO action_trigger.event_def_group (id, owner, hook, name)
45 VALUES (1, 1, 'biblio.format.record_entry.print','Print Record(s)');
47 INSERT INTO action_trigger.event_def_group_member (grp, name, event_def)
48 SELECT 1, 'Brief', id FROM action_trigger.event_definition WHERE hook = 'biblio.format.record_entry.print';
50 INSERT INTO action_trigger.event_def_group_member (grp, name, holdings, event_def)
51 SELECT 1, 'Full', TRUE, id FROM action_trigger.event_definition WHERE hook = 'biblio.format.record_entry.print';
53 INSERT INTO action_trigger.event_def_group (id, owner, hook, name)
54 VALUES (2,1,'biblio.format.record_entry.email','Email Record(s)');
56 INSERT INTO action_trigger.event_def_group_member (grp, name, event_def)
57 SELECT 2, 'Brief', id FROM action_trigger.event_definition WHERE hook = 'biblio.format.record_entry.email';
59 INSERT INTO action_trigger.event_def_group_member (grp, name, holdings, event_def)
60 SELECT 2, 'Full', TRUE, id FROM action_trigger.event_definition WHERE hook = 'biblio.format.record_entry.email';
62 UPDATE action_trigger.event_definition SET template = $$
64 [%- SET user = target.0.owner -%]
65 To: [%- params.recipient_email || user_data.0.email || user.email %]
66 From: [%- params.sender_email || default_sender %]
67 Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %]
68 Subject: [%- user_data.0.subject || 'Bibliographic Records' %]
69 Auto-Submitted: auto-generated
71 [% FOR cbreb IN target;
74 IF user_data.0.type == 'full';
75 flesh_list = flesh_list _ ',holdings_xml,acp';
76 IF params.holdings_limit;
77 flimit = 'acn=>' _ params.holdings_limit _ ',acp=>' _ params.holdings_limit;
80 flesh_list = flesh_list _ '}';
82 item_list = helpers.sort_bucket_unapi_bre(cbreb.items,{flesh => flesh_list, site => user_data.0.context_org, flesh_limit => flimit}, user_data.0.sort_by, user_data.0.sort_dir);
84 FOR item IN item_list %]
86 [% loop.count %]/[% loop.size %]. Bib ID# [% item.id %]
87 [% IF item.isbn %]ISBN: [% item.isbn _ "\n" %][% END -%]
88 [% IF item.issn %]ISSN: [% item.issn _ "\n" %][% END -%]
89 [% IF item.upc %]UPC: [% item.upc _ "\n" %][% END -%]
90 Title: [% item.title %]
91 [% IF item.author %]Author: [% item.author _ "\n" %][% END -%]
92 Publication Info: [% item.publisher %] [% item.pubdate %]
93 Item Type: [% item.item_type %]
94 [% IF user_data.0.type == 'full' && item.holdings.size == 0 %]
95 * No items for this record at the selected location
97 [% FOR cp IN item.holdings -%]
98 * Library: [% cp.circ_lib %]
99 Location: [% cp.location %]
100 Call Number: [% cp.prefix _ ' ' _ cp.callnumber _ ' ' _ cp.suffix %]
101 [% IF cp.parts %] Parts: [% cp.parts _ "\n" %][% END -%]
102 Status: [% cp.status_label %]
103 Barcode: [% cp.barcode %]
109 $$ WHERE hook = 'biblio.format.record_entry.email';
111 UPDATE action_trigger.event_definition SET template = $$
113 <style> li { padding: 8px; margin 5px; }</style>
115 [% FOR cbreb IN target;
118 IF user_data.0.type == 'full';
119 flesh_list = flesh_list _ ',holdings_xml,acp';
120 IF params.holdings_limit;
121 flimit = 'acn=>' _ params.holdings_limit _ ',acp=>' _ params.holdings_limit;
124 flesh_list = flesh_list _ '}';
126 item_list = helpers.sort_bucket_unapi_bre(cbreb.items,{flesh => flesh_list, site => user_data.0.context_org, flesh_limit => flimit}, user_data.0.sort_by, user_data.0.sort_dir);
127 FOR item IN item_list %]
129 Bib ID# [% item.id %]<br />
130 [% IF item.isbn %]ISBN: [% item.isbn %]<br />[% END %]
131 [% IF item.issn %]ISSN: [% item.issn %]<br />[% END %]
132 [% IF item.upc %]UPC: [% item.upc %]<br />[% END %]
133 Title: [% item.title %]<br />
134 [% IF item.author %] Author: [% item.author %]<br />[% END -%]
135 Publication Info: [% item.publisher %] [% item.pubdate %]<br/>
136 Item Type: [% item.item_type %]
138 [% IF user_data.0.type == 'full' && item.holdings.size == 0 %]
139 <li>No items for this record at the selected location</li>
141 [% FOR cp IN item.holdings -%]
143 Library: [% cp.circ_lib %]<br/>
144 Location: [% cp.location %]<br/>
145 Call Number: [% cp.prefix _ ' ' _ cp.callnumber _ ' ' _ cp.suffix %]<br/>
146 [% IF cp.parts %]Parts: [% cp.parts %]<br/>[% END %]
147 Status: [% cp.status_label %]<br/>
148 Barcode: [% cp.barcode %]
157 $$ WHERE hook = 'biblio.format.record_entry.print';