Bug 32165: Add page-section to issuehistory
[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>Checkout history for [% INCLUDE 'biblio-title-head.inc' %] &rsaquo; Catalog &rsaquo; Koha</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 </head>
12
13 <body id="catalog_issuehistory" class="catalog">
14
15 [% WRAPPER 'header.inc' %]
16     [% INCLUDE 'cat-search.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/catalogue/search.pl">Catalog</a>
27         </li>
28         <li>
29             [% INCLUDE 'biblio-title.inc' link = 1 %]
30         </li>
31         <li>
32             <a href="#" aria-current="page">
33                 Checkout history
34             </a>
35         </li>
36     </ol>
37 </nav>
38 [% END %]
39
40 <div class="main container-fluid">
41     <div class="row">
42         <div class="col-sm-10 col-sm-push-2">
43             <main>
44
45 <h1>Checkout history for [% INCLUDE 'biblio-title.inc' %]</h1>
46 [% IF biblio.author %]<h3>by [% biblio.author | html %]</h3>[% END %]
47
48 [% SET show_patron_column = Koha.Preference('intranetreadinghistory') AND CAN_user_circulate_circulate_remaining_permissions %]
49
50 <div class="searchresults page-section">
51     [% IF checkouts %]
52         <h2>Checked out [% checkouts.size | html %] times</h2>
53         <table id="table_issues">
54             <thead><tr>
55             [% IF show_patron_column %]
56             <th>Patron</th>
57             [% END %]
58             <th>Barcode</th>
59             <th>Checked out from</th>
60             [% IF Koha.Preference('RecordStaffUserOnCheckout') %]
61             <th>Checked out by</th>
62             [% ELSE %]
63             <th class="NoVisible">Checked out by</th>
64             [% END %]
65             <th>Renewed</th>
66             <th>Checkout on</th>
67             <th>Due date</th>
68             <th>Checkin on</th>
69             </tr></thead>
70             <tbody>
71         [% FOREACH checkout IN checkouts %]
72             <tr>
73                 [% IF show_patron_column %]
74                     <td>
75                         [% IF checkout.patron %][%# Not set for deleted patron records %]
76                             [% INCLUDE 'patron-title.inc' patron => checkout.patron hide_patron_infos_if_needed=1 %]
77                         [% END %]
78                     </td>
79                 [% END %]
80                 <td>
81                     [% IF checkout.item.barcode %] [%# FIXME This test is not mandatory I think %]
82                         <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% checkout.item.biblionumber | uri %]&amp;itemnumber=[% checkout.item.itemnumber | uri %]">[% checkout.item.barcode | html %]</a>
83                     [% ELSE %]
84                         &nbsp;
85                     [% END %]</td>
86                 <td>[% IF checkout.branchcode %]
87                         [% Branches.GetName( checkout.branchcode ) | html %]
88                     [% ELSE %]
89                         &nbsp;
90                     [% END %]</td>
91                 <td>[% IF checkout.issuer_id %]
92                     <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% checkout.issuer_id | uri %]">
93                     [% INCLUDE 'patron-title.inc' patron=checkout.issuer %]
94                     </a>
95                     [% END %]</td>
96                 <td>[% IF checkout.renewals_count %]
97                         Yes[% IF checkout.lastreneweddate %], <small>last on: [% checkout.lastreneweddate |$KohaDates  with_hours => 1 %]</small>
98                             [% END %]
99                     [% ELSE %]
100                         No
101                     [% END %]</td>
102                 <td data-order="[% checkout.issuedate | html %]">
103                     [% checkout.issuedate |$KohaDates  with_hours => 1 %]
104                 </td>
105                 <td data-order="[% checkout.date_due | html %]">
106                     [% checkout.date_due |$KohaDates  with_hours => 1 %]
107                 </td>
108                 <td data-order="[% checkout.returndate | html %]">
109                     [% checkout.returndate |$KohaDates  with_hours => 1 %]
110                 </td>
111            </tr>
112         [% END %]
113         </tbody>
114                 </table>
115     [% ELSE %]
116         <div class="dialog message"><p>
117         <strong>[% biblio.title | html %][% IF biblio.author %], by [% biblio.author | html %][% END %]</strong> has never been checked out.</p></div>
118
119     [% END %]
120 </div>
121
122             </main>
123         </div> <!-- /.col-sm-10.col-sm-push-2 -->
124
125         <div class="col-sm-2 col-sm-pull-10">
126             <aside>
127                 [% INCLUDE 'biblio-view-menu.inc' %]
128             </aside>
129         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
130      </div> <!-- /.row -->
131
132 [% MACRO jsinclude BLOCK %]
133 [% INCLUDE 'datatables.inc' %]
134 [% INCLUDE 'columns_settings.inc' %]
135     <script id="js">
136         $(document).ready(function() {
137             var table_settings = [% TablesSettings.GetTableSettings('catalogue', 'detail', 'checkoutshistory-table', 'json') | $raw %];
138             [% UNLESS show_patron_column %]
139                 // Remove the patron column definition
140                 table_settings['columns'].splice(0,1);
141             [% END %]
142             var table = KohaTable("table_issues", {
143                 "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
144                 "aaSorting": [[ 5, "desc" ]],
145                 "sPaginationType": "full_numbers"
146             }, table_settings);
147         });
148     </script>
149 [% END %]
150
151 [% INCLUDE 'intranet-bottom.inc' %]