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