]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/1300.data.pull-list-print-template.sql
6b1c71c0d9b9018f96772874c39dfa72b859421c
[Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / 1300.data.pull-list-print-template.sql
1
2 BEGIN;
3
4 -- SELECT evergreen.upgrade_deps_block_check('TODO', :eg_version);
5
6 -- NOTE: If the template ID requires changing, beware it appears in
7 -- 3 places below.
8
9 INSERT INTO config.print_template 
10     (id, name, locale, active, owner, label, template) 
11 VALUES (
12     4, 'hold_pull_list', 'en-US', TRUE,
13     (SELECT id FROM actor.org_unit WHERE parent_ou IS NULL),
14     oils_i18n_gettext(4, 'Hold Pull List ', 'cpt', 'label'),
15     ''
16 );
17
18 UPDATE config.print_template SET template = 
19 $TEMPLATE$
20 [%-
21     USE date;
22     SET holds = template_data;
23     # template_data is an arry of wide_hold hashes.
24 -%]
25 <div>
26   <style>
27     #holds-pull-list-table td { 
28       padding: 5px; 
29       border: 1px solid rgba(0,0,0,.05);
30     }
31   </style>
32   <table id="holds-pull-list-table">
33     <thead>
34       <tr>
35         <th>Type</th>
36         <th>Title</th>
37         <th>Author</th>
38         <th>Shelf Location</th>
39         <th>Call Number</th>
40         <th>Barcode/Part</th>
41       </tr>
42     </thead>
43     <tbody>
44       [% FOR hold IN holds %]
45       <tr>
46         <td>[% hold.hold_type %]</td>
47         <td style="width: 30%">[% hold.title %]</td>
48         <td style="width: 25%">[% hold.author %]</td>
49         <td>[% hold.acpl_name %]</td>
50         <td>[% hold.cn_full_label %]</td>
51         <td>[% hold.cp_barcode %][% IF hold.p_label %]/[% hold.p_label %][% END %]</td>
52       </tr>
53       [% END %]
54     </tbody>
55   </table>
56 </div>
57 $TEMPLATE$ WHERE id = 4;
58
59 INSERT INTO config.workstation_setting_type (name, grp, datatype, label)
60 VALUES (
61     'eg.grid.circ.holds.pull_list', 'gui', 'object', 
62     oils_i18n_gettext(
63         'circ.holds.pull_list',
64         'Hold Pull List Grid Settings',
65         'cwst', 'label'
66     )
67 ), (
68     'circ.holds.pull_list.prefetch', 'gui', 'bool', 
69     oils_i18n_gettext(
70         'circ.holds.pull_list.prefetch',
71         'Hold Pull List Prefetch Preference',
72         'cwst', 'label'
73     )
74 );
75
76 COMMIT;
77