Bug 28768: Fix borrowernumber from opac-readingrecord.tt
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-readingrecord.tt
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE KohaDates %]
4 [% USE TablesSettings %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Your checkout history &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% BLOCK cssinclude %]
9     <style>ul.ui-tabs-nav li a, ul.ui-tabs-nav li span.a  { padding:0.6em 1em; }</style>
10 [% END %]
11 </head>
12 [% INCLUDE 'bodytag.inc' bodyid='opac-readingrecord' %]
13 [% INCLUDE 'masthead.inc' %]
14
15 [% IF Koha.Preference('AmazonAssocTag') %]
16     [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %]
17 [% ELSE %]
18     [% AmazonAssocTag = '' %]
19 [% END %]
20
21 <div class="main">
22     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
23         <ol class="breadcrumb">
24             <li class="breadcrumb-item">
25                 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
26             </li>
27             <li class="breadcrumb-item">
28                 <a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
29             </li>
30             <li class="breadcrumb-item active">
31                 <a href="#" aria-current="page">Your checkout history</a>
32             </li>
33         </ol>
34     </nav> <!-- /#breadcrumbs -->
35
36     <div class="container-fluid">
37         <div class="row">
38             <div class="col col-lg-2 order-2 order-lg-1">
39                 <div id="navigation">
40                     [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
41                 </div>
42             </div>
43             <div class="col-md-12 col-lg-10 order-1">
44
45                 <div id="userreadingrecord" class="maincontent">
46                     <h1>Checkout history</h1>
47
48                     [% IF READING_RECORD.size == 0 %]
49                         You have never borrowed anything from this library.
50                     [% ELSE %]
51                         <div id="opac-user-readingrec">
52
53                             <div class="resultscontrol resort js-hide">
54                                 <form id="sortform" action="/cgi-bin/koha/opac-readingrecord.pl" method="get">
55                                     [% UNLESS ( limit ) %]<input type="hidden" name="limit" value="full" />[% END %]
56                                     <select name="order" id="order">
57                                         [% IF ( orderbydate ) %]<option value="" selected="selected">Order by date</option>[% ELSE %]<option value="">Order by date</option>[% END %]
58                                         [% IF ( orderbytitle ) %]<option value="title" selected="selected">Order by title</option>[% ELSE %]<option value="title">Order by title</option>[% END %]
59                                         [% IF ( orderbyauthor ) %]<option value="author" selected="selected">Order by author</option>[% ELSE %]<option value="author">Order by author</option>[% END %]
60                                     </select>
61                                     <input type="submit" value="Go" id="sortsubmit" class="submit clearfix" />
62                                 </form>
63                             </div>
64
65                             [% IF limit %]
66                                 <p>
67                                     Showing last 50 items. <a href="/cgi-bin/koha/opac-readingrecord.pl?limit=full[% IF ( orderbytitle ) %]&amp;order=title[% END %]">Show all items</a>
68                                 </p>
69                             [% ELSE %]
70                                 <p>
71                                     Showing all items. <a href="/cgi-bin/koha/opac-readingrecord.pl?limit=50[% IF ( orderbytitle ) %]&amp;order=title[% END %]">Show last 50 items</a>
72                                 </p>
73                             [% END %]
74
75                             [% IF Koha.Preference( 'OnSiteCheckouts' ) == 1 %]
76                             <div id="tabs" class="toptabs">
77                                 <ul class="js-show">
78                                     <li id="tab_all"><a href="#tabs-container">All</a></li>
79                                     <li id="tab_checkout"><a href="#tabs-container">Checkouts</a></li>
80                                     <li id="tab_onsite_checkout"><a href="#tabs-container">On-site checkouts</a></li>
81                                 </ul>
82                             [% END %]
83                                 <div id="tabs-container" style="overflow:hidden">
84                                     <table id="readingrec" class="table table-bordered table-striped">
85                                         <caption class="sr-only">Checkout history</caption>
86                                         <thead>
87                                             <tr>
88                                                 <th style="display:none;" class="noExport">Type</th>
89                                                 <th class="NoSort noExport"></th>
90                                                 <th class="anti-the">Title</th>
91                                                 <th>Item type</th>
92                                                 <th>Call number</th>
93                                                 <th>Date</th>
94                                                 [% IF ( OPACMySummaryHTML ) %]
95                                                     <th class="NoSort noExport">Links</th>
96                                                 [% END %]
97                                             </tr>
98                                         </thead>
99                                         <tbody>
100                                             [% FOREACH issue IN READING_RECORD %]
101                                                 <tr>
102                                                     <td style="display:none;">
103                                                       [% IF issue.onsite_checkout %][% issuetype = 'onsite_checkout' %]
104                                                       [% ELSE %][% issuetype = 'standard_checkout' %]
105                                                       [% END %]
106                                                       [% issuetype | html %]
107                                                     </td>
108                                                 <td>
109                                                     [% IF  OPACAmazonCoverImages %]
110                                                         [% IF  issue.normalized_isbn %]
111                                                             <a href="http://www.amazon.com/gp/reader/[% issue.normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link"><img src="https://images-na.ssl-images-amazon.com/images/P/[% issue.normalized_isbn | html %].01.THUMBZZZ.jpg" alt="" class="item-thumbnail" /></a>
112                                                         [% ELSE %]
113                                                              <span class="no-image">No cover image available</span>
114                                                         [% END %]
115                                                     [% END %]
116
117                                                 [% IF GoogleJackets %]
118                                                     [% IF  issue.normalized_isbn %]
119                                                         <div title="[% issue.biblionumber |url %]" class="[% issue.normalized_isbn | html %]" id="gbs-thumbnail[% loop.count | html %]"></div>
120                                                     [% ELSE %]
121                                                        <span class="no-image">No cover image available</span>
122                                                     [% END %]
123                                                 [% END %]
124
125                                                 [% IF BakerTaylorEnabled %]
126                                                     [% bt_id = ( issue.normalized_upc || issue.normalized_isbn ) %]
127                                                     [% IF ( bt_id ) %]
128                                                        <a href="https://[% BakerTaylorBookstoreURL | uri %][% bt_id | uri %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
129                                                     [% ELSE %]
130                                                        <span class="no-image">No cover image available</span>
131                                                     [% END %]
132                                                 [% END %]
133
134                                                 [% IF SyndeticsEnabled && SyndeticsCoverImages %]
135                                                     <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" />
136                                                 [% END %]
137                                                 </td>
138                                                 <td>
139                                                 [% IF  issue.BiblioDefaultViewmarc %]
140                                                      <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% issue.biblionumber |url %]">[% INCLUDE 'biblio-title.inc' biblio=issue %]</a>
141                                                 [% ELSIF issue.BiblioDefaultViewisbd %]
142                                                      <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% issue.biblionumber |url %]">[% INCLUDE 'biblio-title.inc' biblio=issue %]</a>
143                                                 [% ELSE %]
144                                                      <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% issue.biblionumber |url %]">[% INCLUDE 'biblio-title.inc' biblio=issue %]</a>
145                                                 [% END %]
146                                                 <p class="results-summary item-details">[% issue.author | html %]</p>
147
148                                                     [% IF ( Koha.Preference( 'OpacStarRatings' ) == 'all' ) %]
149                                                         [% INCLUDE 'user-star-ratings.inc' item=issue %]
150                                                     [% END %]
151
152                                                 </td>
153                                                 <td>
154                                                 [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %]
155                                                     [% IF ( issue.imageurl ) %]
156                                                         <img src="[% issue.imageurl | html %]" alt="" />
157                                                     [% END %]
158                                                 [% END %]
159                                                 <span class="tdlabel">Item type:</span>
160                                                 [% issue.translated_description | html %]</td>
161                                                 <td>
162                                                 <span class="tdlabel">Call number:</span>
163                                                 [% issue.itemcallnumber | html %]
164                                                 </td>
165                                                 [% IF issue.returndate %]
166                                                     <td data-order="[% issue.returndate | html %]">
167                                                         <span class="tdlabel">Check-in date:</span>
168                                                         [% issue.returndate | $KohaDates %]
169                                                 [% ELSE %]
170                                                     <td data-order="Checked out">
171                                                         <em>(Checked out)</em>
172                                                 [% END %]
173                                                 </td>
174                                                 [% IF OPACMySummaryHTML %]
175                                                     <td>[% issue.MySummaryHTML | $raw %]</td>
176                                                 [% END %]
177                                                 </tr>
178                                             [% END # / FOREACH issue %]
179                                         </tbody>
180                                     </table>
181                                 </div> <!-- / .tabs-container -->
182                             [% IF ( Koha.Preference( 'OnSiteCheckouts' ) == 1 ) %]
183                                 </div> <!-- /#tabs -->
184                             [% END %]
185                         </div> <!-- / .opac-user-readingrec -->
186                     [% END # / IF READING_RECORD.size %]
187                 </div> <!-- / .userreadingrecord -->
188             </div> <!-- / .col-lg-10 -->
189         </div> <!-- / .row -->
190     </div> <!-- / .container-fluid -->
191 </div> <!-- / .main -->
192
193 [% INCLUDE 'opac-bottom.inc' %]
194 [% BLOCK jsinclude %]
195 [% INCLUDE 'datatables.inc' %]
196 [% INCLUDE 'columns_settings.inc' %]
197 <script>
198     $(document).ready(function(){
199         [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
200         $('#order').change(function() {
201             $('#sortform').submit();
202         });
203
204         var columns_settings = []; // Empty because there are no columns we want to be configurable
205         var table = KohaTable("#readingrec", {
206             "dom": '<"top"<"table_entries"i><"table_controls"fB>>t',
207             "autoWidth": false,
208             "language": {
209                 "search": "_INPUT_",
210                 "searchPlaceholder": _("Search")
211             }
212         }, columns_settings);
213
214         var tabs = $("#tabs").tabs({
215             activate: function(e, ui) {
216                 var id = $(ui.newTab).attr("id");
217                 if ( id == "tab_checkout" ) {
218                     table.fnFilter("standard_checkout", 0);
219                 } else if ( id == "tab_onsite_checkout" ) {
220                     table.fnFilter("onsite_checkout", 0);
221                 } else { // all
222                     table.fnFilter('', 0);
223                 }
224             }
225         });
226     });
227     var borrowernumber = "[% logged_in_user.borrowernumber | html %]";
228     var MSG_YOUR_RATING = _("Your rating: %s, ");
229     var MSG_AVERAGE_RATING = _("Average rating: %s (%s votes)");
230 </script>
231     [% IF ( Koha.Preference('OpacStarRatings') == 'all' ) %]
232         [% Asset.js("lib/jquery/plugins/jquery.barrating.min.js") | $raw %]
233         [% Asset.js("js/ratings.js") | $raw %]
234     [% END %]
235 [% END %]