1 [% PROCESS "opac/parts/header.tt2";
2 PROCESS "opac/parts/misc_util.tt2";
3 PROCESS "opac/parts/hold_status.tt2";
4 PROCESS "opac/parts/hold_notify.tt2";
5 PROCESS "opac/parts/myopac/column_sort_support.tt2";
6 WRAPPER "opac/parts/myopac/base.tt2";
9 limit = (ctx.holds_limit.defined) ? ctx.holds_limit : 0;
10 offset = (ctx.holds_offset.defined) ? ctx.holds_offset : 0;
11 count = (ctx.holds_ids.size.defined) ? ctx.holds_ids.size : 0;
13 <h3> [% IF CGI.param("available");
14 l("Items Ready for Pickup");
16 l("Current Items on Hold");
23 <div class="col-4 text-left">
26 <button name="action" class="btn btn-action my-2" id="suspend" value="suspend" type="submit"><i class="fas fa-hand-paper" aria-hidden="true"></i> [% l("Suspend") %]</button>
27 <button name="action" class="btn btn-opac my-2" id="activate" value="activate" type="submit"><i class="fas fa-play" aria-hidden="true"></i> [% l("Activate") %] </button>
28 <button name="action" class="btn btn-danger my-2" id="cancel" value="cancel" type="submit" onclick="return confirm('[% l("Are you sure you wish to cancel the selected hold(s)?") %]');"><i class="fas fa-ban" aria-hidden="true"></i> [% l("Cancel") %]</button>
30 [% IF CGI.param("available") -%]
31 <a href="[% mkurl('holds', {}, ['limit','offset','available']) %]">[% l('Show all holds') %]</a> |
32 <strong>[% l("Show only available holds") %]</strong>
34 <strong>[% l("Show all holds") %]</strong> |
35 <a href="[% mkurl('holds',{available => 1},['limit','offset']) %]">[% l("Show only available holds") %]</a>
37 <a href="#" title="This option will show all items available for pickup." data-toggle="tooltip">
38 <i class="fas fa-question-circle" aria-hidden="true"></i>
45 [% IF offset != 0 %]<a href='[% mkurl('holds', {limit => limit,offset => (offset - limit)}) %]'
46 ><span class="np_nav_link classic_link btn btn-action">◄[% l('Previous') %]</span></a> [% END %]
48 [% IF offset > 0 || count > limit; curpage = 0; WHILE curpage * limit < count; IF curpage * limit == offset; %]
49 <span class="np_nav_link classic_link btn btn-action disabled">[% curpage + 1 %]</span>
52 <a href='[% mkurl('holds', {limit => limit, offset => (curpage * limit)}) %]' class="np_nav_link classic_link btn btn-action">[% curpage + 1 %]</a>
53 [%- END; curpage = curpage + 1; END; END %]
54 <span style="padding-left:5px;" class='error'>
55 [% 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; %]
59 [% IF count > limit + offset %]<a href='[% mkurl('holds', {limit => limit, offset => (offset + limit)}) %]'
60 ><span class="np_nav_link classic_link btn btn-action">[% l('Next') %]►</span></a>[% END %]
68 [% IF ctx.holds.size && ctx.holds.size < 1 %]
69 <div class="warning_box">[% l('No holds found.') %]</div>
71 <div class="d-block d-md-none">
72 <input id="check_all_holds" aria-label="[% l('Select All Items') %]" checked="checked" type="checkbox" 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;}"/>
74 <label for="check_all_holds">[% l('Check/Uncheck All') %]</label>
76 <table title="[% l('Items on Hold') %]"
77 class="table table-hover table-bordered miniTable activeHoldstable w-100 my-3">
80 <td class="checkCell">
81 <input type="checkbox" aria-label="[% l('Select All Holds') %]"
82 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;}"/>
84 <th>[% sort_head("sort_title", l('Title')) %]</th>
85 <th>[% sort_head("author", l('Author')) %]</th>
86 <th>[% sort_head("format", l('Format')) %]</th>
87 <th>[% l('Pickup Location') %]</th>
88 <th>[% l('Cancel if not filled by') %]</th>
89 <th>[% l('Status') %]</th>
90 <th>[% l('Notify Method') %]</th>
91 <th>[% l('Notes') %]</th>
92 <th>[% l('Edit') %]</th>
95 <tbody id="holds_temp_parent">
97 [%# Copy the ctx.holds into a local array, then add a SORT field
98 that contains the value to sort on. Since we need the item attrs,
99 invoke it and save the result in ATTRS.
102 hold_items = ctx.holds;
104 sort_field = CGI.param('sort');
106 FOR hold IN hold_items;
107 hold.ATTRS = {marc_xml => hold.marc_xml};
108 PROCESS get_marc_attrs args=hold.ATTRS;
113 hold.SORTING = hold.ATTRS.sort_title;
116 hold.SORTING = hold.ATTRS.author;
119 hold.SORTING = hold.ATTRS.format_label;
126 IF (sort_field != "sort_title");
127 deemphasize_class = "";
129 deemphasize_class = " class=\"sort_deemphasize\"";
132 # Apply sorting to hold_items
133 IF (sort_field != "");
134 hold_items = hold_items.sort("SORTING");
135 IF (CGI.param("sort_type") == "desc");
136 hold_items = hold_items.reverse;
139 # Shorten the hold_items list per offset/limit/count
140 hi = offset + limit - 1;
141 hi = hi > hold_items.max ? hold_items.max : hi;
143 hold_items = hold_items.slice(offset, hi);
146 # hold_items list is now sorted. Traverse and dump the information.
148 FOR hold IN hold_items;
149 ahr = hold.hold.hold;
152 <tr class="[% ahr.frozen == 't' ? ' inactive-hold' : '' %]">
153 <td class="checkbox_column">
155 <span class="sr-only">Hold Number [% cnt; %]</span>
156 <input type="checkbox" name="hold_id" value="[% ahr.id %]"
157 [% html_text_attr('title', l('Select hold [_1]', attrs.title)) %]/>
160 <span class="sr-only">Title</span>
162 [% title = hold.ATTRS.title;
163 IF ahr.hold_type == 'P';
164 title = l('[_1] ([_2])', title, hold.hold.part.label);
167 <a href="[% mkurl(ctx.opac_root _ '/record/' _
168 hold.hold.bre_id, {}, 1) %]"><span[%- deemphasize_class -%]>
169 [%- title.substr(0,hold.ATTRS.nonfiling_characters) | html %]</span>
170 [%- title.substr(hold.ATTRS.nonfiling_characters) | html %]</a>
174 <span class="sr-only">Author</span>
176 <a href="[% mkurl(ctx.opac_root _ '/results',
177 {qtype => 'author', query => hold.ATTRS.author.replace('[,\.:;]', '')},
179 ) %]">[% hold.ATTRS.author | html %]</a>
183 <span class="sr-only">Format</span>
184 <div class="format_icon">
186 formats = hold.ATTRS.all_formats;
187 IF ahr.hold_type == 'M';
188 # only show selected formats for metarecords
190 FOR ccvm IN hold.metarecord_selected_filters.icons;
191 NEXT IF ccvm.opac_visible == 'f';
193 format.label = ccvm.search_label || ccvm.value;
194 format.icon = PROCESS get_ccvm_icon ccvm=ccvm;
195 formats.push(format);
198 FOR format IN formats
200 <span class="sr-only">[% format.label | html %]</span>
201 <img title="[% format.label | html %]"
202 alt="[% format.label | html %]" src="[% format.icon %][% ctx.cache_key %]" />
207 <span class="sr-only">Pickup Location</span>
208 [% ctx.get_aou(ahr.pickup_lib).name | html %]
211 <span class="sr-only">Cancel if not filled by</span>
212 [% IF ahr.expire_time;
213 date.format(ctx.parse_datetime(ahr.expire_time), DATE_FORMAT);
217 <span class="sr-only">Status</span>
219 [% PROCESS get_hold_status hold=hold; %]
223 <span class="sr-only">Notify Method</span>
225 [% PROCESS get_hold_notify h=ahr; %]
228 <td class="hold_notes">
229 <span class="sr-only">Notes</span>
230 [%- FOREACH pubnote IN ahr.notes;
231 IF pubnote.pub == 't';
233 <div class="hold_note">
234 <span class="hold_note_title">[% pubnote.title | html %]</span>
236 <span class="hold_note_body">[% pubnote.body | html %]</span>
241 <a class="btn btn-confirm btn-sm" href="[% mkurl(ctx.opac_root _ '/myopac/holds/edit', {hid => ahr.id}) %]"
242 [% html_text_attr('title', l('Edit hold for item [_1]', attrs.title)) %]>
243 <i class="fas fa-edit" aria-hidden="true"></i>