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";
6 limit = ctx.circ_history_limit;
7 offset = ctx.circ_history_offset;
10 <h3 class="sr-only">[% l('History of Checked Out Items') %]</h3>
11 <div style="padding:0px;">
13 <div id="acct_checked_tabs">
15 <a href='[% mkurl('circs',{},1) %]'>[% l("Current Items Checked Out") %]</a>
17 <div class="align selected">
18 <a href="#">[% l("Check Out History") %]</a>
23 # In the sorting case, the size is the size of ALL the circ items. In the non-sorting case,
24 # the size is simply the size of the chunk passed in. See the TODO below for the still-lingering
26 sort_field = CGI.param('sort');
28 no_next = ctx.circs.size - offset <= limit;
30 no_next = ctx.circs.size < limit;
34 <div class="header_middle">
35 <span class="float-left">[% l('Previously Checked Out Items') %]</span>
36 <span class='float-left' style='padding-left: 10px;'>
37 <a href='[% mkurl('circ_history', {limit => limit, offset => (offset - limit)}) %]'
38 [% IF offset == 0 %] class='invisible' [% END %]><span class="nav_arrow_fix">◄</span>[% l('Previous') %]</a>
39 [%# TODO: get total to prevent paging off then end of the list.. %]
40 <a href='[% mkurl('circ_history', {limit => limit, offset => (offset + limit)}) %]'
41 [% IF no_next %] class='invisible' [% END %] >[% l('Next') %]<span class="nav_arrow_fix">►</span></a>
43 <div class="float-left">
44 <form action="[% mkurl(ctx.opac_root _ '/myopac/circ_history/export') %]" method="post">
46 [%- INCLUDE "opac/parts/preserve_params.tt2" %]
47 [% IF ctx.circs.size > 0 %]
48 <input type="hidden" name="filename" value="[% l('circ_history.csv') %]"/>
49 <button type="submit">[% l('Download CSV') %]</button>
55 <div class="clear-both"></div>
57 [% IF ctx.circs.size < 1 %]
58 <div class="warning_box">[% l('There are no items in your circulation history.') %]</div>
61 <form method="post" id="circ-form"
62 onsubmit="return confirm('[% l("Are you sure you wish to delete the selected item(s)?") %]');">
63 <table cellpadding='0' cellspacing='0' class="item_list_padding">
66 <select name="action">
67 <option value="delete">[% l('Delete Selected Titles') %]</option>
70 <td style="padding-left:9px;">
73 alt="[% l('Go') %]" title="[% l('Go') %]"
74 class="opac-button" />
77 <td style="padding-left:5px;">
78 <a href="#"><img alt="[% l('Deleting Help') %]"
79 src="[% ctx.media_prefix %]/images/question-mark.png" /></a>
84 <div id='checked_main'>
85 <table id="acct_checked_hist_header"
86 title="[% l('History of Items Checked Out') %]">
89 <th class="checkbox_column">
90 <input type="checkbox" onclick="var inputs=document.getElementsByTagName('input'); for (i = 0; i < inputs.length; i++) { if (inputs[i].name == 'circ_id' && !inputs[i].disabled) inputs[i].checked = this.checked;}"/>
92 <th>[% sort_head("sort_title", l("Title")) %]</th>
93 <th>[% sort_head("author", l("Author")) %]</th>
94 <th>[% sort_head("checkout", l("Checkout Date")) %]</th>
95 <th>[% sort_head("due", l("Due Date")) %]</th>
96 <th>[% sort_head("returned", l("Date Returned")) %]</th>
97 <th>[% sort_head("barcode", l("Barcode")) %]</th>
98 <th>[% sort_head("callnum", l("Call Number")) %]</th>
102 [%# Copy the ctx.circs into a local array, then add a SORT field
103 that contains the value to sort on. Since we need the item attrs,
104 invoke it and save the result in ATTRS.
107 circ_items = ctx.circs; # Array assignment
109 FOR circ IN circ_items;
110 circ.ATTRS = {marc_xml => circ.marc_xml};
111 PROCESS get_marc_attrs args=circ.ATTRS;
116 circ.SORTING = circ.ATTRS.sort_title;
119 circ.SORTING = circ.ATTRS.author;
122 circ.SORTING = circ.circ.xact_start;
125 circ.SORTING = circ.circ.due_date;
128 circ.SORTING = circ.circ.checkin_time;
131 circ.SORTING = circ.circ.target_copy.barcode;
134 circ.SORTING = circ.circ.target_copy.call_number.label;
141 IF (sort_field != "sort_title");
142 deemphasize_class = "";
144 deemphasize_class = " class=\"sort_deemphasize\"";
147 # Apply sorting to circ_items
149 circ_items = circ_items.sort("SORTING");
150 IF (CGI.param("sort_type") == "desc");
151 circ_items = circ_items.reverse;
154 # Shorten the circ_items list per offset/limit/cout
155 hi = offset + limit - 1;
156 hi = hi > circ_items.max ? circ_items.max : hi;
158 circ_items = circ_items.slice(offset, hi);
161 # circ_items list is now sorted. Traverse and dump the information.
163 FOR circ IN circ_items; %]
165 <td class="checkbox_column">
166 <input type="checkbox" name="circ_id" value="[% circ.circ.id %]" />
169 <a href="[% mkurl(ctx.opac_root _ '/record/' _
170 circ.circ.target_copy.call_number.record.id, {}, 1) %]"
171 name="[% l('Catalog record') %]"><span[%- deemphasize_class -%]>
172 [%- circ.ATTRS.title.substr(0,circ.ATTRS.nonfiling_characters) | html %]</span>
173 [%- circ.ATTRS.title.substr(circ.ATTRS.nonfiling_characters) | html %]</a>
176 <a href="[% mkurl(ctx.opac_root _ '/results',
177 {qtype => 'author', query => circ.ATTRS.author.replace('[,\.:;]', '')},
179 ) %]">[% circ.ATTRS.author | html %]</a>
182 [% date.format(ctx.parse_datetime(circ.circ.xact_start),DATE_FORMAT); %]
185 [% date.format(ctx.parse_datetime(circ.circ.due_date),DATE_FORMAT); %]
188 [% IF circ.circ.checkin_time;
189 date.format(ctx.parse_datetime(circ.circ.checkin_time),DATE_FORMAT);
191 <span style='color:blue;'>*</span><!-- meh -->
194 <td>[% circ.circ.target_copy.barcode | html %]</td>
195 <td>[% circ.circ.target_copy.call_number.label | html %]</td>