Bug 23838: Use $datetime formater
[koha.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 TablesSettings %]
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-header.inc' %]
17
18 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
19     <ol>
20         <li>
21             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
22         </li>
23         <li>
24             <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
25         </li>
26         <li>
27             <a href="#" aria-current="page">
28                 Circulation history for [% INCLUDE 'patron-title.inc' %]
29             </a>
30         </li>
31     </ol>
32 </nav>
33
34 <div class="main container-fluid">
35     <div class="row">
36         <div class="col-sm-10 col-sm-push-2">
37             <main>
38
39 [% INCLUDE 'members-toolbar.inc' %]
40 <h1>Circulation history</h1>
41
42 [% UNLESS Koha.Preference('intranetreadinghistory') %]
43     <div class="dialog alert">Staff members are not allowed to access patron's checkout history</div>
44 [% ELSIF is_anonymous %]
45     <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>
46 [% ELSIF ( patron.privacy == 2)  %]
47     <div class="dialog message">This patron has set the privacy rules to never keeping a circulation history.</div>
48 [% ELSIF ( !loop_reading ) %]
49     <div class="dialog message">This patron has no circulation history.</div>
50 [% ELSE %]
51 <form action="/cgi-bin/koha/members/readingrec.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" /></form>
52
53
54 <div id="tabs" class="toptabs">
55   [% IF Koha.Preference('OnSiteCheckouts') %]
56   <ul class="nav nav-tabs" role="tablist">
57     <li role="presentation" class="active"><a href="#readingrec" aria-controls="readingrec" role="tab" data-toggle="tab" data-tabname="all" id="tab_all">All</a></li>
58     <li role="presentation"><a href="#readingrec" aria-controls="readingrec" role="tab" data-toggle="tab" data-tabname="checkouts" id="tab_checkout">Checkouts</a></li>
59     <li role="presentation"><a href="#readingrec" aria-controls="readingrec" role="tab" data-toggle="tab" id="tab_onsite_checkout" data-tabname="onsite">On-site checkouts</a></li>
60   </ul>
61   <div class="tab-content">
62       <div id="readingrec" role="tabpanel" class="tab-pane active">
63   [% ELSE %]
64     <div id="readingrec">
65   [% END %]
66     <table id="table_readingrec">
67       <thead>
68         <tr>
69         <th style="display:none;">Type</th>
70         <th>Date</th>
71         <th class="anti-the">Title</th>
72         <th>Author</th>
73         <th>Call number</th>
74         <th>Barcode</th>
75         <th>Number of renewals</th>
76         <th>Checked out on</th>
77         <th>Checked out from</th>
78         [% IF Koha.Preference('RecordStaffUserOnCheckout') %]
79         <th>Checked out by</th>
80         [% END %]
81         <th>Date due</th>
82         <th>Return date</th>
83         </tr>
84       </thead>
85       <tbody>
86       [% FOREACH issue IN loop_reading %]
87         [% IF  issue.returndate  %]<tr>[% ELSE %]<tr class="onissue">[% END %]
88           <td style="display:none;">
89             [% IF issue.onsite_checkout %][% issuetype = 'onsite_checkout' | html %]
90             [% ELSE %][% issuetype = 'standard_checkout' | html %]
91             [% END %]
92             [% issuetype | html %]
93           </td>
94           <td data-order="[% issue.issuestimestamp | html %]">
95               [% issue.issuestimestamp | $KohaDates  with_hours => 1 %]
96           </td>
97           <td>
98             [% INCLUDE 'biblio-title.inc' biblio=issue link = 1 %]
99             </td>
100
101           <td>[% issue.author | html %]</td>
102
103           <td>
104             [% IF issue.classification %]
105                 [% issue.classification | html %]
106             [% ELSE %]
107                 [% issue.itemcallnumber | html %]
108             [% END %]
109           </td>
110
111           <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>
112           <td>
113               [% issue.renewals_count | html %]
114               [% IF issue.renewals_count > 0 %]
115                   [ <a class="patron_renewals_view" data-renewals="[% issue.renewals_count | html %]" data-issueid="[% issue.issue_id %]" href="#">View</a> ]
116               [% END %]
117           </td>
118           <td data-order="[% issue.issuedate | html %]">
119               [% issue.issuedate |$KohaDates  with_hours => 1 %]
120           </td>
121           <td>[% Branches.GetName( issue.branchcode ) | html %]</td>
122           [% IF Koha.Preference('RecordStaffUserOnCheckout') %]
123           <td><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% issue.issuer_id | uri %]">[% issue.firstname | html %] [% issue.surname | html %]</a></td>
124           [% END %]
125           <td data-order="[% issue.date_due | html %]">
126               [% issue.date_due |$KohaDates  with_hours => 1 %]
127           </td>
128             [% IF  issue.returndate %]
129                 <td data-order="[% issue.returndate | html %]">
130                 [% issue.returndate |$KohaDates  with_hours => 1 %]
131             [% ELSE %]
132                 <td data-order="checked out">
133                 <small>Checked out</small>
134             [% END %]
135           </td>
136         </tr>
137       [% END %]
138       </tbody>
139     </table>
140   </div>
141   [% IF Koha.Preference('OnSiteCheckouts') %]
142     </div> <!-- /.tab-content -->
143   [% END %]
144 </div>
145 [% END %]
146
147             </main>
148         </div> <!-- /.col-sm-10.col-sm-push-2 -->
149
150         <div class="col-sm-2 col-sm-pull-10">
151             <aside>
152                 [% INCLUDE 'circ-menu.inc' %]
153             </aside>
154         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
155      </div> <!-- /.row -->
156
157 [% MACRO jsinclude BLOCK %]
158     [% INCLUDE 'str/members-menu.inc' %]
159     [% Asset.js("js/members-menu.js") | $raw %]
160     [% INCLUDE 'datatables.inc' %]
161     [% INCLUDE 'columns_settings.inc' %]
162     [% INCLUDE 'patron-renewal-modal.inc' %]
163     [% INCLUDE 'patron-renewal-modal-strings.inc' %]
164     [% INCLUDE 'js-date-format.inc' %]
165     [% Asset.js("js/patron-renewal-modal.js") | $raw %]
166     <script id="js">
167         $(document).ready(function() {
168             var table_settings = [% TablesSettings.GetTableSettings('members', 'checkouthistory', 'checkouthistory-table', 'json') | $raw %];
169             var table = KohaTable("table_readingrec", {
170                 "sPaginationType": "full",
171                 "aaSorting": [[10, 'desc']]
172             }, table_settings);
173
174             $("#tabs a[data-toggle='tab']").on("shown.bs.tab", function (e) {
175                 active_tab = $(this).data("tabname");
176                 if( active_tab == "checkouts" ){
177                     table.fnFilter("standard_checkout", 0);
178                 } else if( active_tab == "onsite" ){
179                     table.fnFilter("onsite_checkout", 0);
180                 } else {
181                     table.fnFilter('', 0);
182                 }
183             });
184         });
185     </script>
186 [% END %]
187
188 [% INCLUDE 'intranet-bottom.inc' %]