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 %]
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>
83 [%# Copy the ctx.circs into a local array, then add a SORT field
84 that contains the value to sort on. Since we need the item attrs,
85 invoke it and save the result in ATTRS.
88 circ_items = ctx.circs; # Array assignment
90 sort_field = CGI.param('sort'); # unless changed below...
92 FOR circ IN circ_items;
93 circ.ATTRS = {marc_xml => circ.marc_xml};
94 PROCESS get_marc_attrs args=circ.ATTRS;
99 circ.SORTING = circ.ATTRS.sort_title;
102 circ.SORTING = circ.ATTRS.author;
105 circ.SORTING = circ.circ.renewal_remaining;
108 circ.SORTING = circ.circ.due_date;
111 circ.SORTING = circ.circ.target_copy.barcode;
114 circ.SORTING = circ.circ.target_copy.call_number.label;
121 IF (sort_field != "sort_title");
122 deemphasize_class = "";
124 deemphasize_class = " class=\"sort_deemphasize\"";
127 # Apply sorting to circ_items
129 circ_items = circ_items.sort("SORTING");
130 IF (CGI.param("sort_type") == "desc");
131 circ_items = circ_items.reverse;
135 # circ_items list is now sorted. Traverse and dump the information.
137 FOR circ IN circ_items; %]
139 <td class="checkbox_column" valign="top">
140 <input type="checkbox" name="circ"
141 title="[% l('Item Selected') %]"
142 [% IF circ.circ.renewal_remaining < 1 %] disabled="disabled" [% END %]
143 value="[% circ.circ.id %]" />
146 [% IF circ.circ.target_copy.call_number.id == -1 %]
147 [% circ.circ.target_copy.dummy_title | html %]
148 [% ELSIF circ.ATTRS.title %]
149 <a href="[% mkurl(ctx.opac_root _ '/record/' _
150 circ.circ.target_copy.call_number.record.id, {}, 1) %]"
151 name="[% l('Catalog record') %]"><span[%- deemphasize_class -%]>
152 [%- circ.ATTRS.title.substr(0,circ.ATTRS.nonfiling_characters) | html %]</span>
153 [%- circ.ATTRS.title.substr(circ.ATTRS.nonfiling_characters) | html %]</a>
157 [% IF circ.circ.target_copy.call_number.id == -1 %]
158 [% circ.circ.target_copy.dummy_author | html %]
159 [% ELSIF circ.ATTRS.author %]
160 <a href="[% mkurl(ctx.opac_root _ '/results',
161 {qtype => 'author', query => circ.ATTRS.author.replace('[,\.:;]', '')},
163 ) %]">[% circ.ATTRS.author | html %]</a>
167 [% circ.circ.renewal_remaining %]
170 due_date = ctx.parse_datetime(circ.circ.due_date);
171 due_class = (date.now > date.format(due_date, '%s')) ? 'error' : '';
173 <td name="due_date" class='[% due_class %]'>
174 [% date.format(due_date, DATE_FORMAT) %]
177 [% circ.circ.target_copy.barcode | html %]
179 <td name="call_number">
180 [% circ.circ.target_copy.call_number.label | html %]
183 [% IF circ.renewal_response AND
184 circ.renewal_response.textcode != 'SUCCESS' %]
186 <td colspan="6">[%# XXX colspan="0" does not work in IE %]
187 <span class="failure-text" title="[% circ.renewal_response.textcode | html %] / [% circ.renewal_response.fail_part | html %]">
190 IF circ.renewal_response.textcode == 'TOTAL_HOLD_COPY_RATIO_EXCEEDED' OR
191 circ.renewal_response.textcode == 'AVAIL_HOLD_COPY_RATIO_EXCEEDED';
192 # the stock hold ratio message may not be patron friendly
193 renew_fail_msg = l('Item is needed for a hold');
195 renew_fail_msg = circ.renewal_response.desc ||
196 circ.renewal_response.fail_part ||
197 circ.renewal_response.textcode;
199 renew_fail_msg | html;