1 [% PROCESS "opac/parts/header.tt2";
2 PROCESS "opac/parts/misc_util.tt2";
3 PROCESS "opac/parts/hold_status.tt2";
4 PROCESS "opac/parts/myopac/column_sort_support.tt2";
5 WRAPPER "opac/parts/myopac/base.tt2";
7 limit = (ctx.holds_limit.defined) ? ctx.holds_limit : 0;
8 offset = (ctx.holds_offset.defined) ? ctx.holds_offset : 0;
9 count = (ctx.holds_ids.size.defined) ? ctx.holds_ids.size : 0;
11 <h3 class="sr-only">[% l('My Holds') %]</h3>
12 <div id='myopac_holds_div'>
14 <ul class="nav nav-pills nav-fill">
15 <li class="nav-item m-2">
16 <a href='#' class="nav-link active">[% l("Items on Hold") %]</a>
18 [% IF ebook_api.enabled == 'true' %]
19 <li class="nav-item m-2">
20 <a href='[% mkurl('ebook_holds', {}, ['limit','offset','available','sort','sort_type']) %]' class="nav-link not_active_pill">[% l("E-Items on Hold") %]</a>
22 <li class="nav-item m-2">
23 <a href='[% mkurl('ebook_holds_ready', {}, ['limit','offset','available','sort','sort_type']) %]' class="nav-link not_active_pill">[% l("E-Items Ready for Checkout") %]</a>
26 <li class="nav-item m-2">
27 <a href='[% mkurl('hold_history', {}, ['limit','offset','available','sort','sort_type']) %]' class="nav-link not_active_pill">[% l("Holds History") %]</a>
32 <div class="header_middle">
33 <span id="acct_holds_header" style="float:left;">
34 [% IF CGI.param("available");
35 l("Items Ready for Pickup");
37 l("Current Items on Hold");
42 <div class="clear-both"></div>
46 <span class="col-md-11 my-2">
47 <select class="form-control" name="action" id="acct_holds_actions"
48 title="[% l('Select your action for the selected holds') %]">
49 <option id='myopac_holds_actions_none' value=''>
50 -- [% l("Actions for selected holds") %] --
52 <option value='suspend'>[% l("Suspend") %]</option>
53 <option value='activate'>[% l("Activate") %]</option>
54 <!-- XXX maybe later <option value='thaw_date'>[% l("Set Active Date") %]</option> -->
55 <option value='cancel'>[% l("Cancel") %]</option>
58 <span class="col-md-1 my-2">
59 <input type="submit" value="[% l('Go') %]"
60 title="[% l('Go') %]" class="btn btn-confirm" />
65 <div class="col-3 text-left">
66 <a href='[% mkurl('holds', {limit => limit,offset => (offset - limit)}) %]'
67 [% IF offset <= 0 %] class='invisible' [% END %]><span class="np_nav_link classic_link btn btn-outline-primary">◄[% l('Previous') %]</span></a>
68 [% IF offset > 0 || count > limit; curpage = 0; WHILE curpage * limit < count; IF curpage * limit == offset; %]
71 <a href='[% mkurl('holds', {limit => limit, offset => (curpage * limit)}) %]' class="np_nav_link classic_link btn btn-outline-primary">[% curpage + 1 %]</a>
72 [%- END; curpage = curpage + 1; END; END %]
74 <div class="col-6 text-center">
75 <span style="padding-left:5px;" class='error'>
76 [% IF ctx.hold_suspend_post_capture; l('One or more holds could not be suspended because the item is at (or en route to) the pickup library.'); END; %]
80 [% IF CGI.param("available") -%]
81 <a href="[% mkurl('holds', {}, ['limit','offset','available']) %]">[% l('Show all holds') %]</a> |
82 <strong>[% l("Show only available holds") %]</strong>
84 <strong>[% l("Show all holds") %]</strong> |
85 <a href="[% mkurl('holds',{available => 1},['limit','offset']) %]">[% l("Show only available holds") %]</a>
89 <img alt="[% l('Holds Help') %]" title="[% l('Actions for selected holds') %]" src="[% ctx.media_prefix %]/images/question-mark.png[% ctx.cache_key %]" />
93 <div class="col-3 text-right">
94 <a href='[% mkurl('holds', {limit => limit, offset => (offset + limit)}) %]'
95 [% IF count <= limit + offset %] class='invisible' [% END %] ><span class="np_nav_link classic_link btn btn-outline-primary">[% l('Next') %]►</span></a>
99 [% IF ctx.holds.size && ctx.holds.size < 1 %]
100 <div class="warning_box">[% l('No holds found.') %]</div>
102 <table title="[% l('Items on Hold') %]"
103 class="table table-hover miniTable activeHoldstable w-100 my-3">
106 <th class="checkbox_column">
107 <input type="checkbox" title="[% l('Select All Holds') %]"
108 onclick="var inputs=document.getElementsByTagName('input'); for (i = 0; i < inputs.length; i++) { if (inputs[i].name == 'hold_id' && !inputs[i].disabled) inputs[i].checked = this.checked;}"/>
110 <th>[% sort_head("sort_title", l('Title')) %]</th>
111 <th>[% sort_head("author", l('Author')) %]</th>
112 <th>[% sort_head("format", l('Format')) %]</th>
113 <th>[% l('Pickup Location') %]</th>
114 <th>[% l('Cancel if not filled by') %]</th>
115 <th>[% l('Status') %]</th>
116 <th>[% l('Notes') %]</th>
119 <tbody id="holds_temp_parent">
121 [%# Copy the ctx.holds into a local array, then add a SORT field
122 that contains the value to sort on. Since we need the item attrs,
123 invoke it and save the result in ATTRS.
126 hold_items = ctx.holds;
128 sort_field = CGI.param('sort');
130 FOR hold IN hold_items;
131 hold.ATTRS = {marc_xml => hold.marc_xml};
132 PROCESS get_marc_attrs args=hold.ATTRS;
137 hold.SORTING = hold.ATTRS.sort_title;
140 hold.SORTING = hold.ATTRS.author;
143 hold.SORTING = hold.ATTRS.format_label;
150 IF (sort_field != "sort_title");
151 deemphasize_class = "";
153 deemphasize_class = " class=\"sort_deemphasize\"";
156 # Apply sorting to hold_items
157 IF (sort_field != "");
158 hold_items = hold_items.sort("SORTING");
159 IF (CGI.param("sort_type") == "desc");
160 hold_items = hold_items.reverse;
163 # Shorten the hold_items list per offset/limit/count
164 hi = offset + limit - 1;
165 hi = hi > hold_items.max ? hold_items.max : hi;
167 hold_items = hold_items.slice(offset, hi);
170 # hold_items list is now sorted. Traverse and dump the information.
172 FOR hold IN hold_items;
173 ahr = hold.hold.hold;
176 <tr name="acct_holds_temp"
177 class="[% ahr.frozen == 't' ? ' inactive-hold' : '' %]">
178 <td class="checkbox_column">
180 <span class="sr-only">Hold Number [% cnt; %]</span>
181 <input type="checkbox" name="hold_id" value="[% ahr.id %]"
182 [% html_text_attr('title', l('Select hold [_1]', attrs.title)) %]/>
185 <span class="sr-only">Title</span>
187 [% title = hold.ATTRS.title;
188 IF ahr.hold_type == 'P';
189 title = l('[_1] ([_2])', title, hold.hold.part.label);
192 <a href="[% mkurl(ctx.opac_root _ '/record/' _
193 hold.hold.bre_id, {}, 1) %]"
194 name="[% l('Catalog record') %]"><span[%- deemphasize_class -%]>
195 [%- title.substr(0,hold.ATTRS.nonfiling_characters) | html %]</span>
196 [%- title.substr(hold.ATTRS.nonfiling_characters) | html %]</a>
200 <span class="sr-only">Author</span>
202 <a href="[% mkurl(ctx.opac_root _ '/results',
203 {qtype => 'author', query => hold.ATTRS.author.replace('[,\.:;]', '')},
205 ) %]">[% hold.ATTRS.author | html %]</a>
209 <span class="sr-only">Format</span>
210 <div class="format_icon">
212 formats = hold.ATTRS.all_formats;
213 IF ahr.hold_type == 'M';
214 # only show selected formats for metarecords
216 FOR ccvm IN hold.metarecord_selected_filters.icons;
217 NEXT IF ccvm.opac_visible == 'f';
219 format.label = ccvm.search_label || ccvm.value;
220 format.icon = PROCESS get_ccvm_icon ccvm=ccvm;
221 formats.push(format);
224 FOR format IN formats
226 <span class="sr-only">[% format.label | html %]</span>
227 <img title="[% format.label | html %]"
228 alt="[% format.label | html %]" src="[% format.icon %][% ctx.cache_key %]" />
233 <span class="sr-only">Pickup Location</span>
234 [% ctx.get_aou(ahr.pickup_lib).name | html %]
237 <span class="sr-only">Cancel if not filled by</span>
238 [% IF ahr.expire_time;
239 date.format(ctx.parse_datetime(ahr.expire_time), DATE_FORMAT);
243 <span class="sr-only">Status</span>
244 <div name="acct_holds_status">
245 [% PROCESS get_hold_status hold=hold; %]
248 <td class="hold_notes">
249 <span class="sr-only">Notes</span>
250 [%- FOREACH pubnote IN ahr.notes;
251 IF pubnote.pub == 't';
253 <div class="hold_note">
254 <span class="hold_note_title">[% pubnote.title | html %]</span>
256 <span class="hold_note_body">[% pubnote.body | html %]</span>
261 <a class="btn btn-confirm btn-sm" href="[% mkurl(ctx.opac_root _ '/myopac/holds/edit', {hid => ahr.id}) %]"
262 [% html_text_attr('title', l('Edit hold for item [_1]', attrs.title)) %]>