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>
14 <a href="[% mkurl('circ_history',{},1) %]">[% l("Check Out History") %]</a>
18 <div class="header_middle">
19 <span class="float-left">[% l('Current Items Checked Out') %]</span>
21 <div class="clear-both"></div>
22 [% IF ctx.circs.size < 1 %]
23 <div class="warning_box">[% l('You have no items checked out.') %]</div>
25 [% IF ctx.success_renewals %]
26 <div class="renew-summary">
27 [% l("Successfully renewed [_1] item(s)", ctx.success_renewals) %]
30 [% IF ctx.failed_renewals %]
31 <div class="renew-summary alert">
32 [% l("Failed to renew [_1] item(s)", ctx.failed_renewals) %]
35 <div id='checked_main'>
36 <form method="post" id="circ-form"
37 onsubmit="return confirm('[% l("Are you sure you wish to renew the selected item(s)?") %]');">
40 <select name="action" title="[% l('Select Action') %]">
41 <option value="renew">[% l('Renew Selected Titles') %]</option>
44 <span style="padding-left:9px;">
48 class="opac-button" />
50 <span style="padding-left:5px;">
52 alt="[% l('Renewing Help') %]"
53 title="[% l('Actions for checked out items') %]"
54 src="[% ctx.media_prefix %]/images/question-mark.png" /></a>
58 <table id="acct_checked_main_header"
59 title="[% l('Items Checked Out') %]"
60 class="table_no_border_space table_no_cell_pad item_list_padding">
63 <th class="checkbox_column">
64 <input type="checkbox" id="check_all_checked"
65 title="[% l('Select All Items') %]"
66 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;}"
69 <th>[% sort_head("sort_title", l("Title")) %]</th>
70 <th>[% sort_head("author", l("Author")) %]</th>
71 <th>[% sort_head("renews", l("Renewals Left")) %]</th>
72 <th>[% sort_head("due", l("Due Date")) %]</th>
73 <th>[% sort_head("barcode", l("Barcode")) %]</th>
74 <th>[% sort_head("callnum", l("Call number")) %]</th>
78 [%# Copy the ctx.circs into a local array, then add a SORT field
79 that contains the value to sort on. Since we need the item attrs,
80 invoke it and save the result in ATTRS.
83 circ_items = ctx.circs; # Array assignment
85 sort_field = CGI.param('sort'); # unless changed below...
87 FOR circ IN circ_items;
88 circ.ATTRS = {marc_xml => circ.marc_xml};
89 PROCESS get_marc_attrs args=circ.ATTRS;
94 circ.SORTING = circ.ATTRS.sort_title;
97 circ.SORTING = circ.ATTRS.author;
100 circ.SORTING = circ.circ.renewal_remaining;
103 circ.SORTING = circ.circ.due_date;
106 circ.SORTING = circ.circ.target_copy.barcode;
109 circ.SORTING = circ.circ.target_copy.call_number.label;
116 IF (sort_field != "sort_title");
117 deemphasize_class = "";
119 deemphasize_class = " class=\"sort_deemphasize\"";
122 # Apply sorting to circ_items
124 circ_items = circ_items.sort("SORTING");
125 IF (CGI.param("sort_type") == "desc");
126 circ_items = circ_items.reverse;
130 # circ_items list is now sorted. Traverse and dump the information.
132 FOR circ IN circ_items; %]
134 <td class="checkbox_column" valign="top">
135 <input type="checkbox" name="circ"
136 title="[% l('Item Selected') %]"
137 [% IF circ.circ.renewal_remaining < 1 %] disabled="disabled" [% END %]
138 value="[% circ.circ.id %]" />
141 [% IF circ.circ.target_copy.call_number.id == -1 %]
142 [% circ.circ.target_copy.dummy_title | html %]
143 [% ELSIF circ.ATTRS.title %]
144 <a href="[% mkurl(ctx.opac_root _ '/record/' _
145 circ.circ.target_copy.call_number.record.id, {}, 1) %]"
146 name="[% l('Catalog record') %]"><span[%- deemphasize_class -%]>
147 [%- circ.ATTRS.title.substr(0,circ.ATTRS.nonfiling_characters) | html %]</span>
148 [%- circ.ATTRS.title.substr(circ.ATTRS.nonfiling_characters) | html %]</a>
152 [% IF circ.circ.target_copy.call_number.id == -1 %]
153 [% circ.circ.target_copy.dummy_author | html %]
154 [% ELSIF circ.ATTRS.author %]
155 <a href="[% mkurl(ctx.opac_root _ '/results',
156 {qtype => 'author', query => circ.ATTRS.author.replace('[,\.:;]', '')},
158 ) %]">[% circ.ATTRS.author | html %]</a>
162 [% circ.circ.renewal_remaining %]
165 due_date = ctx.parse_datetime(circ.circ.due_date);
166 due_class = (date.now > date.format(due_date, '%s')) ? 'error' : '';
168 <td name="due_date" class='[% due_class %]'>
169 [% date.format(due_date, DATE_FORMAT) %]
172 [% circ.circ.target_copy.barcode | html %]
174 <td name="call_number">
175 [% circ.circ.target_copy.call_number.label | html %]
178 [% IF circ.renewal_response AND
179 circ.renewal_response.textcode != 'SUCCESS' %]
181 <td colspan="6">[%# XXX colspan="0" does not work in IE %]
182 <span class="failure-text" title="[% circ.renewal_response.textcode | html %] / [% circ.renewal_response.fail_part | html %]">
185 IF circ.renewal_response.textcode == 'TOTAL_HOLD_COPY_RATIO_EXCEEDED' OR
186 circ.renewal_response.textcode == 'AVAIL_HOLD_COPY_RATIO_EXCEEDED';
187 # the stock hold ratio message may not be patron friendly
188 renew_fail_msg = l('Item is needed for a hold');
190 renew_fail_msg = circ.renewal_response.desc ||
191 circ.renewal_response.fail_part ||
192 circ.renewal_response.textcode;
194 renew_fail_msg | html;