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";
5 myopac_page = "circs" %]
6 <h3 class="sr-only">[% l('Current Items Checked Out') %]</h3>
7 <div id='myopac_checked_div'>
9 <div id="acct_checked_tabs">
10 <div class="align selected">
11 <a href="#">[% l("Current Items Checked Out") %]</a>
13 [%- IF ebook_api.enabled == 'true' %]
15 <a href="[% mkurl('ebook_circs',{},1) %]">[% l("E-Items Currently Checked Out") %]</a>
19 <a href="[% mkurl('circ_history',{},1) %]">[% l("Check Out History") %]</a>
23 <div class="header_middle">
24 <span class="float-left">[% l('Current Items Checked Out') %]</span>
26 <div class="clear-both"></div>
27 [% IF ctx.circs.size < 1 %]
28 <div class="warning_box">[% l('You have no items checked out.') %]</div>
30 [% IF ctx.success_renewals %]
31 <div class="renew-summary">
32 [% l("Successfully renewed [_1] item(s)", ctx.success_renewals) %]
35 [% IF ctx.failed_renewals %]
36 <div class="renew-summary alert">
37 [% l("Failed to renew [_1] item(s)", ctx.failed_renewals) %]
40 <div id='checked_main'>
41 <form method="post" id="circ-form"
42 onsubmit="return confirm('[% l("Are you sure you wish to renew the selected item(s)?") %]');">
45 <select name="action" title="[% l('Select Action') %]">
46 <option value="renew">[% l('Renew Selected Titles') %]</option>
49 <span style="padding-left:9px;">
53 class="opac-button" />
55 <span style="padding-left:5px;">
57 alt="[% l('Renewing Help') %]"
58 title="[% l('Actions for checked out items') %]"
59 src="[% ctx.media_prefix %]/images/question-mark.png[% ctx.cache_key %]" /></a>
63 <table id="acct_checked_main_header"
64 title="[% l('Items Checked Out') %]"
65 class="table_no_border_space table_no_cell_pad item_list_padding">
68 <th class="checkbox_column">
69 <input type="checkbox" id="check_all_checked"
70 title="[% l('Select All Items') %]"
71 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;}"
74 <th>[% sort_head("sort_title", l("Title")) %]</th>
75 <th>[% sort_head("author", l("Author")) %]</th>
76 <th>[% sort_head("renews", l("Renewals Left")) %]</th>
77 <th>[% sort_head("due", l("Due Date")) %]</th>
78 <th>[% sort_head("barcode", l("Barcode")) %]</th>
79 <th>[% sort_head("callnum", l("Call Number")) %]</th>
80 [% IF ctx.get_org_setting(ctx.user.home_ou, 'opac.show_owning_lib_column'); %]
81 <th>[% sort_head("lib", l("Owning Library")) %]</th>
89 [%# Copy the ctx.circs into a local array, then add a SORT field
90 that contains the value to sort on. Since we need the item attrs,
91 invoke it and save the result in ATTRS.
94 circ_items = ctx.circs; # Array assignment
96 sort_field = CGI.param('sort'); # unless changed below...
98 FOR circ IN circ_items;
99 circ.ATTRS = {marc_xml => circ.marc_xml};
100 PROCESS get_marc_attrs args=circ.ATTRS;
105 circ.SORTING = circ.ATTRS.sort_title;
108 circ.SORTING = circ.ATTRS.author;
111 circ.SORTING = circ.circ.renewal_remaining;
114 circ.SORTING = circ.circ.due_date;
117 circ.SORTING = circ.circ.target_copy.barcode;
120 circ.SORTING = circ.circ.target_copy.call_number.label;
122 circ.SORTING = circ.circ.target_copy.call_number.owning_lib.name;
129 IF (sort_field != "sort_title");
130 deemphasize_class = "";
132 deemphasize_class = " class=\"sort_deemphasize\"";
135 # Apply sorting to circ_items
137 circ_items = circ_items.sort("SORTING");
138 IF (CGI.param("sort_type") == "desc");
139 circ_items = circ_items.reverse;
143 # circ_items list is now sorted. Traverse and dump the information.
145 FOR circ IN circ_items; %]
147 <td class="checkbox_column" valign="top">
148 <input type="checkbox" name="circ"
149 title="[% l('Item Selected') %]"
150 [% IF circ.circ.renewal_remaining < 1 %] disabled="disabled" [% END %]
151 value="[% circ.circ.id %]" />
154 [% IF circ.circ.target_copy.call_number.id == -1 %]
155 [% circ.circ.target_copy.dummy_title | html %]
156 [% ELSIF circ.ATTRS.title %]
157 <a href="[% mkurl(ctx.opac_root _ '/record/' _
158 circ.circ.target_copy.call_number.record.id, {}, 1) %]"
159 name="[% l('Catalog record') %]"><span[%- deemphasize_class -%]>
160 [%- circ.ATTRS.title.substr(0,circ.ATTRS.nonfiling_characters) | html %]</span>
161 [%- circ.ATTRS.title.substr(circ.ATTRS.nonfiling_characters) | html %]</a>
165 [% IF circ.circ.target_copy.call_number.id == -1 %]
166 [% circ.circ.target_copy.dummy_author | html %]
167 [% ELSIF circ.ATTRS.author %]
168 <a href="[% mkurl(ctx.opac_root _ '/results',
169 {qtype => 'author', query => circ.ATTRS.author.replace('[,\.:;]', '')},
171 ) %]">[% circ.ATTRS.author | html %]</a>
175 [% circ.circ.renewal_remaining %]
178 due_date = ctx.parse_datetime(circ.circ.due_date, circ.circ.circ_lib);
179 due_class = (date.now > date.format(due_date, '%s')) ? 'error' : '';
181 <td name="due_date" class='[% due_class %]'>
182 [% date.format(due_date, DATE_FORMAT) %]
185 [% circ.circ.target_copy.barcode | html %]
187 <td name="call_number">
188 [% circ.circ.target_copy.call_number.label | html %]
190 [% IF ctx.get_org_setting(ctx.user.home_ou, 'opac.show_owning_lib_column'); %]
192 [%- fleshed_ou = circ.circ.target_copy.call_number.owning_lib;
193 INCLUDE "opac/parts/library_name_link_from_ou.tt2";
199 [% IF circ.renewal_response AND
200 circ.renewal_response.textcode != 'SUCCESS' %]
202 <td colspan="[% column_count %]">[%# XXX colspan="0" does not work in IE %]
203 <span class="failure-text" title="[% circ.renewal_response.textcode | html %] / [% circ.renewal_response.fail_part | html %]">
206 IF circ.renewal_response.textcode == 'TOTAL_HOLD_COPY_RATIO_EXCEEDED' OR
207 circ.renewal_response.textcode == 'AVAIL_HOLD_COPY_RATIO_EXCEEDED';
208 # the stock hold ratio message may not be patron friendly
209 renew_fail_msg = l('Item is needed for a hold');
211 renew_fail_msg = circ.renewal_response.desc ||
212 circ.renewal_response.fail_part ||
213 circ.renewal_response.textcode;
215 renew_fail_msg | html;