Bug 23061: Add column/print/export feature on checkout history page
[koha-equinox.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / readingrec.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% USE Koha %]
5 [% USE AuthorisedValues %]
6 [% USE Branches %]
7 [% USE ColumnsSettings %]
8 [% SET footerjs = 1 %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Circulation History for [% INCLUDE 'patron-title.inc' no_html = 1 %]</title>
11 [% INCLUDE 'doc-head-close.inc' %]
12 </head>
13
14 <body id="pat_readingrec" class="pat">
15 [% INCLUDE 'header.inc' %]
16 [% INCLUDE 'patron-search.inc' %]
17
18 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Circulation history for [% INCLUDE 'patron-title.inc' %]</div>
19
20 <div class="main container-fluid">
21     <div class="row">
22         <div class="col-sm-10 col-sm-push-2">
23             <main>
24
25 [% INCLUDE 'members-toolbar.inc' %]
26 <h1>Circulation history</h1>
27
28 [% UNLESS Koha.Preference('intranetreadinghistory') %]
29     <div class="dialog alert">Staff members are not allowed to access patron's checkout history</div>
30 [% ELSIF is_anonymous %]
31     <div class="dialog alert">This is the anonymous patron, so no circulation history is displayed. To get a list of anonymized loans, please run a report.</div>
32 [% ELSIF ( patron.privacy == 2)  %]
33     <div class="dialog message">This patron has set the privacy rules to never keeping a circulation history.</div>
34 [% ELSIF ( !loop_reading ) %]
35     <div class="dialog message">This patron has no circulation history.</div>
36 [% ELSE %]
37 <form action="/cgi-bin/koha/members/readingrec.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" /></form>
38
39
40 <div id="tabs" class="toptabs">
41   [% IF Koha.Preference('OnSiteCheckouts') %]
42   <ul>
43     <li><a href="#readingrec" id="tab_all">All</a></li>
44     <li><a href="#readingrec" id="tab_checkout">Checkouts</a></li>
45     <li><a href="#readingrec" id="tab_onsite_checkout">On-site checkouts</a></li>
46   </ul>
47   [% END %]
48   <div id="readingrec">
49     <table id="table_readingrec">
50       <thead>
51         <tr>
52         <th style="display:none;">Type</th>
53         <th class="title-string">Date</th>
54         <th class="anti-the">Title</th>
55         <th>Author</th>
56         <th>Call no.</th>
57         <th>Barcode</th>
58         <th>Number of renewals</th>
59         <th class="title-string">Checked out on</th>
60         <th>Checked out from</th>
61         <th class="title-string">Date due</th>
62         <th class="title-string">Return date</th>
63         </tr>
64       </thead>
65       <tbody>
66       [% FOREACH issue IN loop_reading %]
67         [% IF  issue.returndate  %]<tr>[% ELSE %]<tr class="onissue">[% END %]
68           <td style="display:none;">
69             [% IF issue.onsite_checkout %][% issuetype = 'onsite_checkout' | html %]
70             [% ELSE %][% issuetype = 'standard_checkout' | html %]
71             [% END %]
72             [% issuetype | html %]
73           </td>
74           <td>
75             <span title="[% issue.issuestimestamp | html %]">[% issue.issuestimestamp | $KohaDates  with_hours => 1 %]</span>
76           </td>
77           <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% issue.biblionumber | uri %]">[% issue.title | html %]</a></td>
78
79           <td>[% issue.author | html %]</td>
80
81           <td>
82             [% IF issue.classification %]
83                 [% issue.classification | html %]
84             [% ELSE %]
85                 [% issue.itemcallnumber | html %]
86             [% END %]
87           </td>
88
89           <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% issue.itemnumber | uri %]&amp;biblionumber=[% issue.biblionumber | uri %]&amp;bi=[% issue.biblioitemnumber | uri %]#item[% issue.itemnumber | uri %]">[% issue.barcode | html %]</a></td>
90           <td>[% issue.renewals | html %]</td>
91           <td>
92             <span title="[% issue.issuedate | html %]">[% issue.issuedate |$KohaDates  with_hours => 1 %]</span>
93           </td>
94           <td>[% Branches.GetName( issue.branchcode ) | html %]</td>
95           <td>
96             [% IF issue.date_due %]
97                 <span title="[% issue.date_due | html %]">[% issue.date_due |$KohaDates  with_hours => 1 %]</span>
98             [% ELSE %]
99                 <span title="0000-00-00"></span>
100             [% END %]
101           </td>
102           <td>
103             [% IF  issue.returndate %]
104               <span title="[% issue.returndate | html %]">[% issue.returndate |$KohaDates  with_hours => 1 %]</span>
105             [% ELSE %]
106               <span title="Checked out"><small>Checked out</small></span>
107             [% END %]
108           </td>
109         </tr>
110       [% END %]
111       </tbody>
112     </table>
113   </div>
114 </div>
115 [% END %]
116
117             </main>
118         </div> <!-- /.col-sm-10.col-sm-push-2 -->
119
120         <div class="col-sm-2 col-sm-pull-10">
121             <aside>
122                 [% INCLUDE 'circ-menu.inc' %]
123             </aside>
124         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
125      </div> <!-- /.row -->
126
127 [% MACRO jsinclude BLOCK %]
128     [% INCLUDE 'str/members-menu.inc' %]
129     [% Asset.js("js/members-menu.js") | $raw %]
130     [% INCLUDE 'datatables.inc' %]
131     [% INCLUDE 'columns_settings.inc' %]
132     <script id="js">
133         $(document).ready(function() {
134             var columns_settings = [% ColumnsSettings.GetColumns('members', 'checkouthistory', 'checkouthistory-table', 'json') %];
135             var table = KohaTable("table_readingrec", {
136                 "sPaginationType": "four_button",
137                 "aaSorting": [[10, 'desc']],
138                 "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
139                 "aoColumnDefs": [
140                     { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
141                     { "sType": "title-string", "aTargets" : [ "title-string" ] }
142                 ]
143             }, columns_settings);
144
145             var tabs = $("#tabs").tabs({
146                 activate: function(e, ui) {
147                     var active = tabs.tabs("option", "active" );
148                     if ( active == 1 ) {
149                         table.fnFilter("standard_checkout", 0);
150                     } else if ( active == 2 ) {
151                         table.fnFilter("onsite_checkout", 0);
152                     } else { // all
153                         table.fnFilter('', 0);
154                     }
155                 }
156             });
157         });
158     </script>
159 [% END %]
160
161 [% INCLUDE 'intranet-bottom.inc' %]