1 [% PROCESS "opac/parts/header.tt2";
2 PROCESS "opac/parts/misc_util.tt2";
3 PROCESS "opac/parts/myopac/column_sort_support.tt2";
4 WRAPPER "opac/parts/myopac/base.tt2";
8 <h3>[% l('Current Items Checked Out') %]</h3>
9 <div id='myopac_checked_div'>
13 [% IF ctx.circs.size < 1 %]
14 <div class="warning_box">[% l('You have no items checked out.') %]</div>
16 [% IF ctx.success_renewals %]
17 <div class="renew-summary">
18 [% l("Successfully renewed [_1] item(s)", ctx.success_renewals) %]
21 [% IF ctx.failed_renewals %]
22 <div class="renew-summary alert">
23 [% l("Failed to renew [_1] item(s)", ctx.failed_renewals) %]
26 <div id='checked_main'>
27 <form method="post" id="circ-form"
28 onsubmit="return confirm('[% l("Are you sure you wish to renew the selected item(s)?") %]');">
30 <button name="action" class="btn btn-confirm" id="renew" value="renew" type="submit"><i class="fas fa-redo-alt"></i> Renew Selected</button>
32 <div class="d-block d-md-none">
33 <input id="check_all_checked_alt" 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 == 'circ' && !inputs[i].disabled) inputs[i].checked = this.checked;}"/>
35 <label for="check_all_checked">[% l('Check/Uncheck All') %]</label>
37 <table id="acct_checked_main_header" title="[% l('Items Checked Out') %]"
38 class="table table-hover table-bordered miniTable circTable">
41 <td class="checkbox_column">
42 <input type="checkbox" id="check_all_checked"
43 aria-label="[% l('Select All Items') %]"
44 onclick="var inputs=document.getElementsByTagName('input'); for (i = 0; i < inputs.length; i++) { if (inputs[i].name == 'circ' && !inputs[i].disabled) inputs[i].checked = this.checked;}"
47 <th>[% sort_head("sort_title", l("Title")) %]</th>
48 <th>[% sort_head("author", l("Author")) %]</th>
49 <th>[% sort_head("renews", l("Renewals Left")) %]</th>
50 <th>[% sort_head("due", l("Due Date")) %]</th>
51 <th>[% sort_head("barcode", l("Barcode")) %]</th>
52 <th>[% sort_head("callnum", l("Call Number")) %]</th>
53 [% IF ctx.get_org_setting(ctx.user.home_ou, 'opac.show_owning_lib_column'); %]
54 <th>[% sort_head("lib", l("Owning Library")) %]</th>
62 [%# Copy the ctx.circs into a local array, then add a SORT field
63 that contains the value to sort on. Since we need the item attrs,
64 invoke it and save the result in ATTRS.
67 circ_items = ctx.circs; # Array assignment
69 sort_field = CGI.param('sort'); # unless changed below...
71 FOR circ IN circ_items;
72 circ.ATTRS = {marc_xml => circ.marc_xml};
73 PROCESS get_marc_attrs args=circ.ATTRS;
78 circ.SORTING = circ.ATTRS.sort_title;
81 circ.SORTING = circ.ATTRS.author;
84 circ.SORTING = circ.circ.renewal_remaining;
87 circ.SORTING = circ.circ.due_date;
90 circ.SORTING = circ.circ.target_copy.barcode;
93 circ.SORTING = circ.circ.target_copy.call_number.label;
95 circ.SORTING = circ.circ.target_copy.call_number.owning_lib.name;
102 IF (sort_field != "sort_title");
103 deemphasize_class = "";
105 deemphasize_class = " class=\"sort_deemphasize\"";
108 # Apply sorting to circ_items
110 circ_items = circ_items.sort("SORTING");
111 IF (CGI.param("sort_type") == "desc");
112 circ_items = circ_items.reverse;
116 # circ_items list is now sorted. Traverse and dump the information.
118 FOR circ IN circ_items; %]
120 <td class="checkCell">
121 <input type="checkbox" name="circ"
122 aria-label="[% l('Select Item') %]"
123 [% IF circ.circ.renewal_remaining < 1 %] disabled="disabled" [% END %]
124 value="[% circ.circ.id %]" />
127 <span class="sr-only">Title</span>
128 [% IF circ.circ.target_copy.call_number.id == -1 %]
129 [% circ.circ.target_copy.dummy_title | html %]
130 [% ELSIF circ.ATTRS.title %]
131 <a href="[% mkurl(ctx.opac_root _ '/record/' _
132 circ.circ.target_copy.call_number.record.id, {}, 1) %]"><span[%- deemphasize_class -%]>
133 [%- circ.ATTRS.title.substr(0,circ.ATTRS.nonfiling_characters) | html %]</span>
134 [%- circ.ATTRS.title.substr(circ.ATTRS.nonfiling_characters) | html %]</a>
138 [% IF circ.circ.target_copy.call_number.id == -1 %]
139 <span class="sr-only">Author</span>
140 [% circ.circ.target_copy.dummy_author | html %]
141 [% ELSIF circ.ATTRS.author %]
142 <span class="sr-only">Author</span>
143 <a href="[% mkurl(ctx.opac_root _ '/results',
144 {qtype => 'author', query => circ.ATTRS.author.replace('[,\.:;]', '')},
146 ) %]">[% circ.ATTRS.author | html %]</a>
152 <span class="sr-only">Renewals Remaining</span>
153 [% circ.circ.renewal_remaining %]
156 due_date = ctx.parse_datetime(circ.circ.due_date, circ.circ.circ_lib);
157 due_class = (date.now > date.format(due_date, '%s')) ? 'error' : '';
159 <td class='[% due_class %]'>
160 <span class="sr-only">Due Date</span>
161 [% date.format(due_date, DATE_FORMAT) %]
164 <span class="sr-only">Barcode</span>
165 <span class="speak:spell-out;">[% circ.circ.target_copy.barcode | html %]</span>
168 <span class="sr-only">Call Number</span>
169 [% circ.circ.target_copy.call_number.label | html %]
171 [% IF ctx.get_org_setting(ctx.user.home_ou, 'opac.show_owning_lib_column'); %]
173 [%- fleshed_ou = circ.circ.target_copy.call_number.owning_lib;
174 INCLUDE "opac/parts/library_name_link_from_ou.tt2";
179 [% IF circ.renewal_response AND
180 circ.renewal_response.textcode != 'SUCCESS' %]
182 <td colspan="[% column_count %]">[%# XXX colspan="0" does not work in IE %]
183 <span class="failure-text" title="[% circ.renewal_response.textcode | html %] / [% circ.renewal_response.fail_part | html %]">
186 IF circ.renewal_response.textcode == 'TOTAL_HOLD_COPY_RATIO_EXCEEDED' OR
187 circ.renewal_response.textcode == 'AVAIL_HOLD_COPY_RATIO_EXCEEDED';
188 # the stock hold ratio message may not be patron friendly
189 renew_fail_msg = l('Item is needed for a hold');
191 renew_fail_msg = circ.renewal_response.desc ||
192 circ.renewal_response.fail_part ||
193 circ.renewal_response.textcode;
195 renew_fail_msg | html;