Bug 19902: (follow-up) Deal with patron column regarding on intranetreadinghistory...
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / catalogue / issuehistory.tt
1 [% USE Asset %]
2 [% USE Koha %]
3 [% USE KohaDates %]
4 [% USE Branches %]
5 [% USE ColumnsSettings %]
6 [% SET footerjs = 1 %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha &rsaquo; Catalog &rsaquo; Checkout history for [% biblio.title |html %]</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 [% Asset.css("css/datatables.css") %]
11 </head>
12
13 <body id="catalog_issuehistory" class="catalog">
14
15 [% INCLUDE 'header.inc' %]
16 [% INCLUDE 'cat-search.inc' %]
17
18 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>  &rsaquo; Checkout history for <i>[% biblio.title |html %]</i></div>
19
20 <div id="doc3" class="yui-t2">
21
22    <div id="bd">
23         <div id="yui-main">
24         <div class="yui-b">
25
26 <h1>Checkout history for [% biblio.title |html %]</h1>
27 [% IF biblio.author %]<h3>by [% biblio.author %]</h3>[% END %]
28
29 [% SET show_patron_column = Koha.Preference('intranetreadinghistory') AND CAN_user_circulate_circulate_remaining_permissions %]
30
31 <div class="searchresults">
32     [% IF checkouts %]
33         <h4>Checked out [% checkouts.size %] times</h4>
34         <table id="table_issues">
35             <thead><tr>
36             [% IF show_patron_column %]
37             <th>Patron</th>
38             [% END %]
39             <th>Barcode</th>
40             <th>Checked out from</th>
41             <th>Renewed</th>
42             <th class='title-string'>Checkout on</th>
43             <th class='title-string'>Due date</th>
44             <th class='title-string'>Checkin on</th>
45             </tr></thead>
46             <tbody>
47         [% FOREACH checkout IN checkouts %]
48             <tr>
49                 [% IF show_patron_column %]
50                 <td>[% INCLUDE 'patron-title.inc' patron => checkout.patron hide_patron_infos_if_needed=1 %]</td>
51                 [% END %]
52                 <td>
53                     [% IF checkout.item.barcode %] [%# FIXME This test is not mandatory I think %]
54                         <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% checkout.item.biblionumber %]&amp;itemnumber=[% checkout.item.itemnumber %]">[% checkout.item.barcode %]</a>
55                     [% ELSE %]
56                         &nbsp;
57                     [% END %]</td>
58                 <td>[% IF checkout.branchcode %]
59                         [% Branches.GetName( checkout.branchcode ) %]
60                     [% ELSE %]
61                         &nbsp;
62                     [% END %]</td>
63                 <td>[% IF checkout.renewals %]
64                         Yes[% IF checkout.lastreneweddate %], <small>last on: [% checkout.lastreneweddate |$KohaDates with_hours => 1  %]</small>
65                             [% END %]
66                     [% ELSE %]
67                         No
68                     [% END %]</td>
69                 <td>[% IF checkout.issuedate %]
70                         <span title="[% checkout.issuedate %]">[% checkout.issuedate |$KohaDates with_hours => 1  %]</span>
71                     [% ELSE %]
72                         <span title="0000-00-00"></span>
73                     [% END %]</td>
74                 <td>[% IF checkout.date_due %]
75                         <span title="[% checkout.date_due %]">[% checkout.date_due |$KohaDates with_hours => 1  %]</span>
76                     [% ELSE %]
77                         <span title="0000-00-00"></span>
78                     [% END %]</td>
79                 <td>[% IF checkout.returndate %]
80                         <span title="[% checkout.returndate %]">[% checkout.returndate |$KohaDates with_hours => 1  %]</span>
81                     [% ELSE %]
82                         <span title="Checked out"><small>Checked out</small></span>
83                     [% END %]</td>
84            </tr>
85         [% END %]
86         </tbody>
87                 </table>
88     [% ELSE %]
89         <div class="dialog message"><p>
90         <b>[% biblio.title |html %][% IF biblio.author %], by [% biblio.author %][% END %]</b> has never been checked out.</p></div>
91
92     [% END %]
93 </div>
94
95 </div>
96 </div>
97 <div class="yui-b">
98 [% INCLUDE 'biblio-view-menu.inc' %]
99 </div>
100 </div>
101
102 [% MACRO jsinclude BLOCK %]
103 [% INCLUDE 'datatables.inc' %]
104 [% INCLUDE 'columns_settings.inc' %]
105     <script type="text/javascript" id="js">
106         $(document).ready(function() {
107             var columns_settings = [% ColumnsSettings.GetColumns('catalogue', 'detail', 'checkoutshistory-table', 'json') %];
108             [% UNLESS show_patron_column %]
109             // Remove the patron column definition
110             columns_settings.splice(0,1);
111             [% END %]
112             var table = KohaTable("table_issues", {
113                 "aoColumnDefs": [
114                     { "sType": "title-string", "aTargets" : [ "title-string" ] }
115                 ],
116                 "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
117                 "aaSorting": [[ 4, "desc" ]],
118                 "sPaginationType": "full_numbers"
119             }, columns_settings);
120         });
121     </script>
122 [% END %]
123
124 [% INCLUDE 'intranet-bottom.inc' %]