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