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");
23 <div class="col-12 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>[% l("Cover") %]</th>
85 <th>[% sort_head("sort_title", l('Title')) %]</th>
86 <th>[% sort_head("author", l('Author')) %]</th>
87 <th>[% sort_head("format", l('Format')) %]</th>
88 <th>[% l('Pickup Location') %]</th>
89 <th>[% l('Cancel if not filled by') %]</th>
90 <th>[% l('Status') %]</th>
91 <th>[% l('Notify Method') %]</th>
92 <th>[% l('Notes') %]</th>
93 <th>[% l('Edit') %]</th>
96 <tbody id="holds_temp_parent">
98 [%# Copy the ctx.holds into a local array, then add a SORT field
99 that contains the value to sort on. Since we need the item attrs,
100 invoke it and save the result in ATTRS.
103 hold_items = ctx.holds;
105 sort_field = CGI.param('sort');
107 FOR hold IN hold_items;
108 hold.ATTRS = {marc_xml => hold.marc_xml};
109 PROCESS get_marc_attrs args=hold.ATTRS;
114 hold.SORTING = hold.ATTRS.sort_title;
117 hold.SORTING = hold.ATTRS.author;
120 hold.SORTING = hold.ATTRS.format_label;
127 IF (sort_field != "sort_title");
128 deemphasize_class = "";
130 deemphasize_class = " class=\"sort_deemphasize\"";
133 # Apply sorting to hold_items
134 IF (sort_field != "");
135 hold_items = hold_items.sort("SORTING");
136 IF (CGI.param("sort_type") == "desc");
137 hold_items = hold_items.reverse;
140 # Shorten the hold_items list per offset/limit/count
141 hi = offset + limit - 1;
142 hi = hi > hold_items.max ? hold_items.max : hi;
144 hold_items = hold_items.slice(offset, hi);
147 # hold_items list is now sorted. Traverse and dump the information.
149 FOR hold IN hold_items;
150 ahr = hold.hold.hold;
153 <tr class="[% ahr.frozen == 't' ? ' inactive-hold' : '' %]">
154 <td class="checkbox_column">
156 <span class="sr-only">Hold Number [% cnt; %]</span>
157 <input type="checkbox" name="hold_id" value="[% ahr.id %]"
158 [% html_text_attr('title', l('Select hold [_1]', attrs.title)) %]/>
160 [% IF hold.ATTRS.issns.0;
161 row_isbnissn = hold.ATTRS.issns.0;
162 ELSIF hold.ATTRS.isbns.0;
163 row_isbnissn = hold.ATTRS.isbns.0;
167 row_rec_id = hold.hold.bre_id;
168 row_title = hold.ATTRS.title;
172 <span class="sr-only">Title</span>
174 [% title = hold.ATTRS.title;
175 IF ahr.hold_type == 'P';
176 title = l('[_1] ([_2])', title, hold.hold.part.label);
179 <a href="[% mkurl(ctx.opac_root _ '/record/' _
180 hold.hold.bre_id, {}, 1) %]"><span[%- deemphasize_class -%]>
181 [%- title.substr(0,hold.ATTRS.nonfiling_characters) | html %]</span>
182 [%- title.substr(hold.ATTRS.nonfiling_characters) | html %]</a>
186 <span class="sr-only">Author</span>
188 <a href="[% mkurl(ctx.opac_root _ '/results',
189 {qtype => 'author', query => hold.ATTRS.author.replace('[,\.:;]', '')},
191 ) %]">[% hold.ATTRS.author | html %]</a>
195 <span class="sr-only">Format</span>
196 <div class="format_icon">
198 formats = hold.ATTRS.all_formats;
199 IF ahr.hold_type == 'M';
200 # only show selected formats for metarecords
202 FOR ccvm IN hold.metarecord_selected_filters.icons;
203 NEXT IF ccvm.opac_visible == 'f';
205 format.label = ccvm.search_label || ccvm.value;
206 format.icon = PROCESS get_ccvm_icon ccvm=ccvm;
207 formats.push(format);
210 FOR format IN formats
212 <span class="sr-only">[% format.label | html %]</span>
213 <img title="[% format.label | html %]"
214 alt="[% format.label | html %]" src="[% format.icon %][% ctx.cache_key %]" />
219 <span class="sr-only">Pickup Location</span>
220 [% ctx.get_aou(ahr.pickup_lib).name | html %]
223 <span class="sr-only">Cancel if not filled by</span>
224 [% IF ahr.expire_time;
225 date.format(ctx.parse_datetime(ahr.expire_time), DATE_FORMAT);
229 <span class="sr-only">Status</span>
231 [% PROCESS get_hold_status hold=hold; %]
235 <span class="sr-only">Notify Method</span>
237 [% PROCESS get_hold_notify h=ahr; %]
240 <td class="hold_notes">
241 <span class="sr-only">Notes</span>
242 [%- FOREACH pubnote IN ahr.notes;
243 IF pubnote.pub == 't';
245 <div class="hold_note">
246 <span class="hold_note_title">[% pubnote.title | html %]</span>
248 <span class="hold_note_body">[% pubnote.body | html %]</span>
253 <a class="btn btn-confirm btn-sm" href="[% mkurl(ctx.opac_root _ '/myopac/holds/edit', {hid => ahr.id}) %]"
254 [% html_text_attr('title', l('Edit hold for item [_1]', attrs.title)) %]>
255 <i class="fas fa-edit" aria-hidden="true"></i>