67056a811a4bc39c19e448e824b764b6c58eccd2
[Evergreen.git] / Open-ILS / src / templates / circ / hold_pull_list.tt2
1 [% WRAPPER base.tt2 %]
2 [% ctx.page_title = l('Hold Pull List') %]
3 <script type="text/javascript">
4     dojo.require("dijit.form.Button");
5     dojo.require("openils.widget.OrgUnitFilteringSelect");
6     dojo.require("openils.widget.FlattenerGrid");
7
8     /* We're going to supress copy_circ_lib from the actual filter dialog later,
9        but we still want it here so we can use a special widget ot filter on
10        it.  This is the widget that's basically saying, "show me the pull list
11        for /what/ library." */
12     var map_extras = {
13         "copy_circ_lib": {
14             "path": "current_copy.circ_lib",
15             "filter": true
16         },
17         "call_number_sort_key": {
18             "path": "current_copy.call_number.label_sortkey",
19             "sort" :true
20         }
21     };
22
23     function set_grid_query_from_org_selector() {
24         grid.baseQuery = {  /* Don't optimize away this assignment.  It's
25                                important to store this data so that the filter
26                                dialog doesn't clobber it later. */
27             "copy_circ_lib": org_selector.attr("value")
28         };
29         grid.filter(
30             dojo.mixin(grid.query, grid.baseQuery),
31             true    /* re-fetch */
32         );
33         grid.refresh();
34     }
35
36     function prepare_org_selector(perm) {
37         new openils.User().buildPermOrgSelector(
38             perm, org_selector, null,
39             function() {
40                 dojo.connect(
41                     org_selector, "onChange", set_grid_query_from_org_selector
42                 );
43                 set_grid_query_from_org_selector();
44             }
45         );
46     }
47
48     openils.Util.addOnLoad(
49         function() {
50             prepare_org_selector("VIEW_HOLD");
51         }
52     );
53
54 </script>
55 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
56     <div dojoType="dijit.layout.ContentPane"
57          layoutAlign="top" class="oils-header-panel">
58         <div>[% l('Hold Pull List') %]</div>
59         <div>
60             <button dojoType="dijit.form.Button"
61                 onClick="grid.print();">[% l('Print Pull List') %]</button>
62         </div>
63     </div>
64     <div class="oils-acq-basic-roomy">
65         <label for="org_selector">[% l('Show the pull list for:') %]</label>
66         <select
67             id="org_selector" jsId="org_selector"
68             dojoType="openils.widget.OrgUnitFilteringSelect"
69             searchAttr="name" labelAttr="name">
70         </select>
71     </div>
72     <table
73         jsid="grid"
74         dojoType="openils.widget.FlattenerGrid"
75         columnPersistKey='"circ.hold_pull_list"'
76         autoHeight="10"
77         editOnEnter="false"
78         hideSelector="true"
79         autoCoreFields="true"
80         autoFieldFields="['current_copy','current_copy.call_number.record.simple_record']"
81         editStyle="pane"
82         showLoadFilter="true"
83         fmClass="'ahopl'"
84         defaultSort="['copy_location_order_position','call_number_sort_key']"
85         mapExtras="map_extras"
86         suppressFilterFields="['copy_circ_lib']"
87         sortFieldReMap="{call_number_label:'call_number_sort_key',shelving_loc:'copy_location_order_position'}"
88         fetchLock="true"
89         query="{}">
90         <thead>
91             <tr>
92                 <th field="shelving_loc" fpath="current_copy.location.name" ffilter="true">[% l('Shelving Location') %]</th>
93                 <th field="call_number_label" fpath="call_number_label" ffilter="true"></th>
94                 <th field="author" fpath="current_copy.call_number.record.simple_record.author" ffilter="true">[% l('Author') %]</th>
95                 <th field="title" fpath="current_copy.call_number.record.simple_record.title" ffilter="true">[% l('Title') %]</th>
96                 <th field="barcode" fpath="current_copy.barcode" ffilter="true"></th>
97                 <th field="parts" fpath="current_copy.parts.label" fsort="false">[% l('Parts') %]</th>
98                 <th field="copy_status" fpath="current_copy.status.name">[% l('Copy Status') %]</th>
99                 <th field="notes" fpath="notes.body" fsort="false" _visible="false">[% l('Hold Notes') %]</th>
100                 <th field="patron_barcode" fpath="usr.card.barcode" _visible="false" ffilter="true">[% l('Patron Barcode') %]</th>
101                 <th field="pickup_lib_name" fpath="pickup_lib.name" _visible="false" ffilter="true">[% l('Pickup Library') %]</th>
102                 <th field="pickup_lib_shortname" fpath="pickup_lib.shortname" _visible="false" ffilter="true">[% l('Pickup Library (Shortname)') %]</th>
103                 <th field="request_lib_name" fpath="request_lib.name" _visible="false" ffilter="true">[% l('Request Library') %]</th>
104                 <th field="request_lib_shortname" fpath="request_lib.shortname" _visible="false" ffilter="true">[% l('Request Library (Shortname)') %]</th>
105                 <th field="selection_ou" fpath="selection_ou.shortname" _visible="false" ffilter="true">[% l('Selection Locus') %]</th>
106                 <th field="sms_carrier_name" fpath="sms_carrier.name" _visible="false" ffilter="true">[% l('SMS Carrier') %]</th>
107             </tr>
108         </thead>
109     </table>
110 </div>
111 [% END %]