]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/myopac/circ_history.tt2
LP#1268636 My account various repairs
[working/Evergreen.git] / Open-ILS / src / templates / opac / myopac / circ_history.tt2
1 [%  PROCESS "opac/parts/header.tt2";
2     PROCESS "opac/parts/misc_util.tt2";
3     WRAPPER "opac/parts/myopac/base.tt2";
4     myopac_page = "circs"
5     limit = ctx.circ_history_limit;
6     offset = ctx.circ_history_offset;
7 %]
8
9 <div style="padding:0px;">
10     
11     <div id="acct_checked_tabs">
12         <div class="align">
13             <a href='[% mkurl('circs') %]'>[% l("Current Items Checked Out") %]</a>
14         </div>
15         <div class="align selected">
16             <a href="#">[% l("Check Out History") %]</a>
17         </div>
18     </div>
19
20     <div class="header_middle">
21         <span class="float-left">[% l('Previously Checked Out Items') %]</span>
22         <span class='float-left' style='padding-left: 10px;'>
23             <a href='[% mkurl('circ_history', {limit => limit, offset => (offset - limit)}) %]'
24                 [% IF offset == 0 %] class='invisible' [% END %]><span class="nav_arrow_fix">&#9668;</span>[% l('Previous') %]</a>
25             [%# TODO: get total to prevent paging off then end of the list.. %]
26             <a href='[% mkurl('circ_history', {limit => limit, offset => (offset + limit)}) %]'
27                [% IF ctx.circs.size < limit %] class='invisible' [% END %] >[% l('Next') %]<span class="nav_arrow_fix">&#9658;</span></a>
28         </span>
29         <div class="float-left">
30             <form action="[% mkurl(ctx.opac_root _ '/myopac/circ_history/export') %]" method="post">
31                 <div>
32                     [%- INCLUDE "opac/parts/preserve_params.tt2" %]
33                     [% IF ctx.circs.size > 0 %]
34                     <input type="hidden" name="filename" value="[% l('circ_history.csv') %]"/> 
35                     <button type="submit">[% l('Download CSV') %]</button>
36                     [% END %]
37                 </div>
38             </form>
39         </div>
40     </div>
41     <div class="clear-both"></div>
42
43     [% IF ctx.circs.size < 1 %]
44     <div class="warning_box">[% l('There are no items in your circulation history.') %]</div>
45     [% ELSE %]
46
47     <div id='checked_main'>
48         <table id="acct_checked_main_header"
49             title="[% l('History of Items Checked Out') %]">
50             <thead>
51                 <tr>
52                     <th>[% l('Title / Author') %]</th>
53                     <th>[% l('Checkout Date') %]</th>
54                     <th>[% l('Due Date') %]</th>
55                     <th>[% l('Date Returned') %]</th>
56                     <th>[% l('Barcode') %]</th>
57                     <th>[% l('Call Number') %]</th>
58                 </tr>
59             </thead>
60             <tbody>
61                 [% FOR circ IN ctx.circs;
62                     attrs = {marc_xml => circ.marc_xml};
63                     PROCESS get_marc_attrs args=attrs; %]
64                     <tr>
65                         <td>
66                             <a href="[% mkurl(ctx.opac_root _ '/record/' _ circ.circ.target_copy.call_number.record.id) %]" 
67                                 [% html_text_attr('title', l('Catalog record [_1]', attrs.title)) %]>
68                                 [% attrs.title | html %]
69                             </a>
70                             [% IF attrs.author %] /
71                             <a href="[% mkurl(ctx.opac_root _ '/results',
72                                 {qtype => 'author', query => attrs.author.replace('[,\.:;]', '')}
73                             )%]">[% attrs.author | html %]</a>
74                             [% END %]
75                         </td>
76                         <td>
77                             [% date.format(ctx.parse_datetime(circ.circ.xact_start),DATE_FORMAT); %]
78                         </td>
79                         <td>
80                             [% date.format(ctx.parse_datetime(circ.circ.due_date),DATE_FORMAT); %]
81                         </td>
82                         <td>
83                             [% 
84                                 IF circ.circ.checkin_time; 
85                                     date.format(ctx.parse_datetime(circ.circ.checkin_time),DATE_FORMAT); 
86                                 ELSE; %]
87                                 <span style='color:blue;'>*</span><!-- meh -->
88                             [% END; %]
89                         </td>
90                         <td>[% circ.circ.target_copy.barcode | html %]</td>
91                         <td>[% circ.circ.target_copy.call_number.label | html %]</td>
92                     </tr>
93                 [% END %]
94             </tbody>
95         </table>
96     </div>
97     [% END %]
98 </div>
99 [% END %]