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