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