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