Bug 27990: Replace obsolete title-string sorting: Patrons
[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.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>
57     <li><a href="#readingrec" id="tab_all">All</a></li>
58     <li><a href="#readingrec" id="tab_checkout">Checkouts</a></li>
59     <li><a href="#readingrec" id="tab_onsite_checkout">On-site checkouts</a></li>
60   </ul>
61   [% END %]
62   <div id="readingrec">
63     <table id="table_readingrec">
64       <thead>
65         <tr>
66         <th style="display:none;">Type</th>
67         <th>Date</th>
68         <th class="anti-the">Title</th>
69         <th>Author</th>
70         <th>Call no.</th>
71         <th>Barcode</th>
72         <th>Number of renewals</th>
73         <th>Checked out on</th>
74         <th>Checked out from</th>
75         [% IF Koha.Preference('RecordStaffUserOnCheckout') %]
76         <th>Checked out by</th>
77         [% END %]
78         <th>Date due</th>
79         <th>Return date</th>
80         </tr>
81       </thead>
82       <tbody>
83       [% FOREACH issue IN loop_reading %]
84         [% IF  issue.returndate  %]<tr>[% ELSE %]<tr class="onissue">[% END %]
85           <td style="display:none;">
86             [% IF issue.onsite_checkout %][% issuetype = 'onsite_checkout' | html %]
87             [% ELSE %][% issuetype = 'standard_checkout' | html %]
88             [% END %]
89             [% issuetype | html %]
90           </td>
91           <td data-order="[% issue.issuestimestamp | html %]">
92               [% issue.issuestimestamp | $KohaDates  with_hours => 1 %]
93           </td>
94           <td>
95             [% INCLUDE 'biblio-title.inc' biblio=issue link = 1 %]
96             </td>
97
98           <td>[% issue.author | html %]</td>
99
100           <td>
101             [% IF issue.classification %]
102                 [% issue.classification | html %]
103             [% ELSE %]
104                 [% issue.itemcallnumber | html %]
105             [% END %]
106           </td>
107
108           <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>
109           <td>[% issue.renewals | html %]</td>
110           <td data-order="[% issue.issuedate | html %]">
111               [% issue.issuedate |$KohaDates  with_hours => 1 %]
112           </td>
113           <td>[% Branches.GetName( issue.branchcode ) | html %]</td>
114           [% IF Koha.Preference('RecordStaffUserOnCheckout') %]
115           <td><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% issue.issuer_id | uri %]">[% issue.firstname | html %] [% issue.surname | html %]</a></td>
116           [% END %]
117           <td data-order="[% issue.date_due | html %]">
118               [% issue.date_due |$KohaDates  with_hours => 1 %]
119           </td>
120             [% IF  issue.returndate %]
121                 <td data-order="[% issue.returndate | html %]">
122                 [% issue.returndate |$KohaDates  with_hours => 1 %]
123             [% ELSE %]
124                 <td data-order="checked out">
125                 <small>Checked out</small>
126             [% END %]
127           </td>
128         </tr>
129       [% END %]
130       </tbody>
131     </table>
132   </div>
133 </div>
134 [% END %]
135
136             </main>
137         </div> <!-- /.col-sm-10.col-sm-push-2 -->
138
139         <div class="col-sm-2 col-sm-pull-10">
140             <aside>
141                 [% INCLUDE 'circ-menu.inc' %]
142             </aside>
143         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
144      </div> <!-- /.row -->
145
146 [% MACRO jsinclude BLOCK %]
147     [% INCLUDE 'str/members-menu.inc' %]
148     [% Asset.js("js/members-menu.js") | $raw %]
149     [% INCLUDE 'datatables.inc' %]
150     [% INCLUDE 'columns_settings.inc' %]
151     <script id="js">
152         $(document).ready(function() {
153             var columns_settings = [% TablesSettings.GetColumns('members', 'checkouthistory', 'checkouthistory-table', 'json') %];
154             var table = KohaTable("table_readingrec", {
155                 "sPaginationType": "full",
156                 "aaSorting": [[10, 'desc']]
157             }, columns_settings);
158
159             var tabs = $("#tabs").tabs({
160                 activate: function(e, ui) {
161                     var active = tabs.tabs("option", "active" );
162                     if ( active == 1 ) {
163                         table.fnFilter("standard_checkout", 0);
164                     } else if ( active == 2 ) {
165                         table.fnFilter("onsite_checkout", 0);
166                     } else { // all
167                         table.fnFilter('', 0);
168                     }
169                 }
170             });
171         });
172     </script>
173 [% END %]
174
175 [% INCLUDE 'intranet-bottom.inc' %]