Bug 22015: Move DataTables CSS to global include
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / catalogue / issuehistory.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE KohaDates %]
5 [% USE Branches %]
6 [% USE ColumnsSettings %]
7 [% SET footerjs = 1 %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Koha &rsaquo; Catalog &rsaquo; Checkout history for [% biblio.title | html %]</title>
10 [% INCLUDE 'doc-head-close.inc' %]
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 | html %]</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 | html %] 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>
51                         [% IF checkout.patron %][%# Not set for deleted patron records %]
52                             [% INCLUDE 'patron-title.inc' patron => checkout.patron hide_patron_infos_if_needed=1 %]
53                         [% END %]
54                     </td>
55                 [% END %]
56                 <td>
57                     [% IF checkout.item.barcode %] [%# FIXME This test is not mandatory I think %]
58                         <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% checkout.item.biblionumber | uri %]&amp;itemnumber=[% checkout.item.itemnumber | uri %]">[% checkout.item.barcode | html %]</a>
59                     [% ELSE %]
60                         &nbsp;
61                     [% END %]</td>
62                 <td>[% IF checkout.branchcode %]
63                         [% Branches.GetName( checkout.branchcode ) | html %]
64                     [% ELSE %]
65                         &nbsp;
66                     [% END %]</td>
67                 <td>[% IF checkout.renewals %]
68                         Yes[% IF checkout.lastreneweddate %], <small>last on: [% checkout.lastreneweddate |$KohaDates  with_hours => 1 %]</small>
69                             [% END %]
70                     [% ELSE %]
71                         No
72                     [% END %]</td>
73                 <td>[% IF checkout.issuedate %]
74                         <span title="[% checkout.issuedate | html %]">[% checkout.issuedate |$KohaDates  with_hours => 1 %]</span>
75                     [% ELSE %]
76                         <span title="0000-00-00"></span>
77                     [% END %]</td>
78                 <td>[% IF checkout.date_due %]
79                         <span title="[% checkout.date_due | html %]">[% checkout.date_due |$KohaDates  with_hours => 1 %]</span>
80                     [% ELSE %]
81                         <span title="0000-00-00"></span>
82                     [% END %]</td>
83                 <td>[% IF checkout.returndate %]
84                         <span title="[% checkout.returndate | html %]">[% checkout.returndate |$KohaDates  with_hours => 1 %]</span>
85                     [% ELSE %]
86                         <span title="Checked out"><small>Checked out</small></span>
87                     [% END %]</td>
88            </tr>
89         [% END %]
90         </tbody>
91                 </table>
92     [% ELSE %]
93         <div class="dialog message"><p>
94         <b>[% biblio.title | html %][% IF biblio.author %], by [% biblio.author | html %][% END %]</b> has never been checked out.</p></div>
95
96     [% END %]
97 </div>
98
99 </div>
100 </div>
101 <div class="yui-b">
102 [% INCLUDE 'biblio-view-menu.inc' %]
103 </div>
104 </div>
105
106 [% MACRO jsinclude BLOCK %]
107 [% INCLUDE 'datatables.inc' %]
108 [% INCLUDE 'columns_settings.inc' %]
109     <script type="text/javascript" id="js">
110         $(document).ready(function() {
111             var columns_settings = [% ColumnsSettings.GetColumns('catalogue', 'detail', 'checkoutshistory-table', 'json') %];
112             [% UNLESS show_patron_column %]
113             // Remove the patron column definition
114             columns_settings.splice(0,1);
115             [% END %]
116             var table = KohaTable("table_issues", {
117                 "aoColumnDefs": [
118                     { "sType": "title-string", "aTargets" : [ "title-string" ] }
119                 ],
120                 "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
121                 "aaSorting": [[ 4, "desc" ]],
122                 "sPaginationType": "full_numbers"
123             }, columns_settings);
124         });
125     </script>
126 [% END %]
127
128 [% INCLUDE 'intranet-bottom.inc' %]