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