Bug 21526: uri escape TT variables when used in 'a href'
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-readingrecord.tt
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE KohaDates %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your checkout history</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% BLOCK cssinclude %]
8     <style>ul.ui-tabs-nav li a, ul.ui-tabs-nav li span.a  { padding:0.6em 1em; }</style>
9 [% END %]
10 </head>
11 [% INCLUDE 'bodytag.inc' bodyid='opac-readingrecord' %]
12 [% INCLUDE 'masthead.inc' %]
13
14 [% IF Koha.Preference('AmazonAssocTag') %]
15     [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %]
16 [% ELSE %]
17     [% AmazonAssocTag = '' %]
18 [% END %]
19
20 <div class="main">
21     <ul class="breadcrumb">
22         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
23         <li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> <span class="divider">&rsaquo;</span></li>
24         <li><a href="#">Your checkout history</a></li>
25     </ul>
26
27     <div class="container-fluid">
28         <div class="row-fluid">
29             <div class="span2">
30                 <div id="navigation">
31                     [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
32                 </div>
33             </div>
34             <div class="span10">
35                 <div id="userreadingrecord">
36                     <h3>Checkout history</h3>
37
38                     [% IF READING_RECORD.size == 0 %]
39                         You have never borrowed anything from this library.
40                     [% ELSE %]
41                         <div id="opac-user-readingrec">
42                             <div class="resultscontrol resort">
43                                 <form id="sortform" action="/cgi-bin/koha/opac-readingrecord.pl" method="get">
44                                     [% UNLESS ( limit ) %]<input type="hidden" name="limit" value="full" />[% END %]
45                                     <select name="order" id="order">
46                                         [% IF ( orderbydate ) %]<option value="" selected="selected">Order by date</option>[% ELSE %]<option value="">Order by date</option>[% END %]
47                                         [% IF ( orderbytitle ) %]<option value="title" selected="selected">Order by title</option>[% ELSE %]<option value="title">Order by title</option>[% END %]
48                                         [% IF ( orderbyauthor ) %]<option value="author" selected="selected">Order by author</option>[% ELSE %]<option value="author">Order by author</option>[% END %]
49                                     </select>
50                                     <input type="submit" value="Go" id="sortsubmit" class="submit clearfix" />
51                                 </form>
52                             </div>
53
54                             [% IF limit %]
55                                 <p>
56                                     Showing last 50 items. <a href="/cgi-bin/koha/opac-readingrecord.pl?limit=full[% IF ( orderbytitle ) %]&amp;order=title[% END %]">Show all items</a>
57                                 </p>
58                             [% ELSE %]
59                                 <p>
60                                     Showing all items. <a href="/cgi-bin/koha/opac-readingrecord.pl?limit=50[% IF ( orderbytitle ) %]&amp;order=title[% END %]">Show last 50 items</a>
61                                 </p>
62                             [% END %]
63
64                             [% IF Koha.Preference( 'OnSiteCheckouts' ) == 1 %]
65                             <div id="tabs" class="toptabs">
66                                 <ul>
67                                     <li><a href="#tabs-container" id="tab_all">All</a></li>
68                                     <li><a href="#tabs-container" id="tab_checkout">Checkouts</a></li>
69                                     <li><a href="#tabs-container" id="tab_onsite_checkout">On-site checkouts</a></li>
70                                 </ul>
71                             [% END %]
72                                 <div id="tabs-container" style="overflow:hidden">
73                                     <table id="readingrec" class="table table-bordered table-striped">
74                                         <thead>
75                                             <tr>
76                                                 <th style="display:none;">Type</th>
77                                                 <th class="nosort"></th>
78                                                 <th class="anti-the">Title</th>
79                                                 <th>Item type</th>
80                                                 <th>Call no.</th>
81                                                 <th class="title-string">Date</th>
82                                                 [% IF ( OPACMySummaryHTML ) %]
83                                                     <th>Links</th>
84                                                 [% END %]
85                                             </tr>
86                                         </thead>
87                                         <tbody>
88                                             [% FOREACH issue IN READING_RECORD %]
89                                                 <tr>
90                                                     <td style="display:none;">
91                                                       [% IF issue.onsite_checkout %][% issuetype = 'onsite_checkout' %]
92                                                       [% ELSE %][% issuetype = 'standard_checkout' %]
93                                                       [% END %]
94                                                       [% issuetype | html %]
95                                                     </td>
96                                                 <td>
97                                                     [% IF  OPACAmazonCoverImages %]
98                                                         [% IF  issue.normalized_isbn %]
99                                                             <a href="http://www.amazon.com/gp/reader/[% issue.normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link"><img border="0" src="https://images-na.ssl-images-amazon.com/images/P/[% issue.normalized_isbn | html %].01.THUMBZZZ.jpg" alt="" class="item-thumbnail" /></a>
100                                                         [% ELSE %]
101                                                              <span class="no-image">No cover image available</span>
102                                                         [% END %]
103                                                     [% END %]
104
105                                                 [% IF GoogleJackets %]
106                                                     [% IF  issue.normalized_isbn %]
107                                                         <div title="[% issue.biblionumber |url %]" class="[% issue.normalized_isbn | html %]" id="gbs-thumbnail[% loop.count | html %]"></div>
108                                                     [% ELSE %]
109                                                        <span class="no-image">No cover image available</span>
110                                                     [% END %]
111                                                 [% END %]
112
113                                                 [% IF BakerTaylorEnabled %]
114                                                     [% bt_id = ( issue.normalized_upc || issue.normalized_isbn ) %]
115                                                     [% IF ( bt_id ) %]
116                                                        <a href="https://[% BakerTaylorBookstoreURL | uri %][% bt_id | uri %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
117                                                     [% ELSE %]
118                                                        <span class="no-image">No cover image available</span>
119                                                     [% END %]
120                                                 [% END %]
121
122                                                 [% IF SyndeticsEnabled && SyndeticsCoverImages %]
123                                                     <img src="https://secure.syndetics.com/index.aspx?isbn=[% issue.normalized_isbn | html %]/SC.GIF&amp;client=[% SyndeticsClientCode | html %]&amp;type=xw10&amp;upc=[% issue.normalized_upc | html %]&amp;oclc=[% issue.normalized_oclc | html %]" alt="" class="item-thumbnail" />
124                                                 [% END %]
125                                                 </td>
126                                                 <td>
127                                                 [% IF  issue.BiblioDefaultViewmarc %]
128                                                      <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% issue.biblionumber |url %]">[% issue.title | html %] [% IF  issue.subtitle  %][% FOREACH subtitl IN issue.subtitle %][% subtitl.subfield | html %][% END %][% END %]</a>
129                                                 [% ELSIF issue.BiblioDefaultViewisbd %]
130                                                      <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% issue.biblionumber |url %]">[% issue.title | html %] [% IF issue.subtitle %][% FOREACH subtitl IN issue.subtitle %][% subtitl.subfield | html %][% END %][% END %]</a>
131                                                 [% ELSE %]
132                                                      <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% issue.biblionumber |url %]">[% issue.title | html %] [% IF issue.subtitle %][% FOREACH subtitl IN issue.subtitle %][% subtitl.subfield | html %][% END %][% END %]</a>
133                                                 [% END %]
134                                                 <span class="item-details">[% issue.author | html %]</span>
135                                                 </td>
136                                                 <td>
137                                                 [% UNLESS ( noItemTypeImages ) %]
138                                                     [% IF ( issue.imageurl ) %]
139                                                         <img src="[% issue.imageurl | html %]" alt="" />
140                                                     [% END %]
141                                                 [% END %]
142                                                 <span class="tdlabel">Item type:</span>
143                                                 [% issue.translated_description | html %]</td>
144                                                 <td>
145                                                 <span class="tdlabel">Call number:</span>
146                                                 [% issue.itemcallnumber | html %]
147                                                 </td>
148                                                 <td>
149                                                     [% IF issue.returndate %]
150                                                         <span class="tdlabel">Check-in date:</span>
151                                                         <span title="[% issue.returndate | html %]">[% issue.returndate | $KohaDates %]</span>
152                                                     [% ELSE %]
153                                                         <span title="Checked out"><em>(Checked out)</em></span>
154                                                     [% END %]
155                                                 </td>
156                                                 [% IF OPACMySummaryHTML %]
157                                                     <td>[% issue.MySummaryHTML | $raw %]</td>
158                                                 [% END %]
159                                                 </tr>
160                                             [% END # / FOREACH issue %]
161                                         </tbody>
162                                     </table>
163                                 </div> <!-- / .tabs-container -->
164                             [% IF ( Koha.Preference( 'OnSiteCheckouts' ) == 1 ) %]
165                                 </div> <!-- /#tabs -->
166                             [% END %]
167                         </div> <!-- / .opac-user-readingrec -->
168                     [% END # / IF READING_RECORD.size %]
169                 </div> <!-- / .userreadingrecord -->
170             </div> <!-- / .span10 -->
171         </div> <!-- / .row-fluid -->
172     </div> <!-- / .container-fluid -->
173 </div> <!-- / .main -->
174
175 [% INCLUDE 'opac-bottom.inc' %]
176 [% BLOCK jsinclude %]
177 [% INCLUDE 'datatables.inc' %]
178 <script>
179 //<![CDATA[
180     $(document).ready(function(){
181         [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
182             $('#sortsubmit').hide();
183         $('#order').change(function() {
184             $('#sortform').submit();
185         });
186
187         var table = $("#readingrec").dataTable($.extend(true, {}, dataTablesDefaults, {
188             "sPaginationType": "four_button",
189             "columnDefs": [
190                 { "targets": [ "nosort" ],"sortable": false,"searchable": false },
191                 { "type": "anti-the", "targets" : [ "anti-the" ] },
192                 { "type": "title-string", "targets" : [ "title-string" ] }
193             ]
194         }));
195         var tabs = $("#tabs").tabs({
196             select: function(e, ui) {
197                 var id = $(ui.tab).attr("id");
198                 if ( id == "tab_checkout" ) {
199                     table.fnFilter("standard_checkout", 0);
200                 } else if ( id == "tab_onsite_checkout" ) {
201                     table.fnFilter("onsite_checkout", 0);
202                 } else { // all
203                     table.fnFilter('', 0);
204                 }
205             }
206         });
207     });
208 //]]>
209 </script>
210 [% END %]