Bug 24224: Convert OpacNavBottom system preference to additional content
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-holdshistory.tt
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE Branches %]
4 [% USE KohaDates %]
5 [% USE TablesSettings %]
6 [% USE ItemTypes %]
7 [% USE AdditionalContents %]
8 [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
9 [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
10
11 [% INCLUDE 'doc-head-open.inc' %]
12 <title>Your holds history &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
13 [% INCLUDE 'doc-head-close.inc' %]
14 [% BLOCK cssinclude %]
15     <style>
16
17         .controls .paginate_button {
18             font-family: 'FontAwesome';
19             text-decoration: none;
20         }
21
22         .controls .paginate_button:not(.disabled) {
23             cursor: pointer;
24         }
25
26         .controls .paginate_button.disabled {
27             color: grey;
28         }
29
30         .controls .previous:before {
31             content: "\f104";
32             padding-right: .5em;
33         }
34
35         .controls .next:after {
36             content: "\f105";
37             padding-left: .5em;
38         }
39     </style>
40 [% END %]
41 </head>
42 [% INCLUDE 'bodytag.inc' bodyid='opac-holdshistory' %]
43 [% INCLUDE 'masthead.inc' %]
44
45 <div class="main">
46     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
47         <ol class="breadcrumb">
48             <li class="breadcrumb-item">
49                 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
50             </li>
51             <li class="breadcrumb-item">
52                 <a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
53             </li>
54             <li class="breadcrumb-item active">
55                 <a href="#" aria-current="page">Your holds history</a>
56             </li>
57         </ol>
58     </nav> <!-- /#breadcrumbs -->
59
60     <div class="container-fluid">
61         <div class="row">
62             <div class="col col-lg-2 order-2 order-lg-1">
63                 <div id="navigation">
64                     [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
65                 </div>
66             </div>
67             <div class="col-md-12 col-lg-10 order-1">
68                 <div id="userholdshistory">
69                     <h1>Holds history</h1>
70
71                     [% IF !holds %]
72                         You have never placed a hold from this library.
73                     [% ELSE %]
74                         [% SET show_itemtype_column = Koha.Preference('AllowHoldItemTypeSelection') %]
75                         <div id="opac-user-holdsrec">
76                             <div id="tabs-container">
77                                 <div class="controls">
78                                     <div class="resultscontrol resort">
79                                         <form id="sortform" action="/cgi-bin/koha/opac-holdshistory.pl" method="get">
80                                             [% IF ( unlimit ) %]<input type="hidden" name="unlimit" value="1" />[% END %]
81                                             <select name="sort" id="sort">
82                                                 [% IF ( sort == 'reservedate' ) %]<option value="reservedate" selected="selected">Order by date</option>[% ELSE %]<option value="reservedate">Order by date</option>[% END %]
83                                                 [% IF ( sort == 'biblio.title' ) %]<option value="biblio.title" selected="selected">Order by title</option>[% ELSE %]<option value="biblio.title">Order by title</option>[% END %]
84                                                 [% IF ( sort == 'biblio.author' ) %]<option value="biblio.author" selected="selected">Order by author</option>[% ELSE %]<option value="biblio.author">Order by author</option>[% END %]
85                                             </select>
86                                             <input type="submit" value="Go" id="sortsubmit" class="submit clearfix" />
87                                         </form>
88                                     </div>
89
90                                     [% UNLESS unlimit %]
91                                         <p>
92                                             Showing 50 items. <a href="/cgi-bin/koha/opac-holdshistory.pl?unlimit=1[% IF ( sort ) %]&amp;sort=[% sort | url %][% END %]">Show all items</a>
93                                         </p>
94                                     [% ELSE %]
95                                         <p>
96                                             Showing all items. <a href="/cgi-bin/koha/opac-holdshistory.pl[% IF ( sort ) %]?sort=[% sort | url %][% END %]">Show 50 items</a>
97                                         </p>
98                                     [% END %]
99                                 </div>
100                                 <table id="table_holdshistory" class="table table-bordered table-striped">
101                                     <caption class="sr-only">Holds history</caption>
102                                     <thead>
103                                         <tr>
104                                         <th class="anti-the">Title</th>
105                                         <th>Author</th>
106                                         <th>Barcode</th>
107                                         <th>Library</th>
108                                         <th>Hold date</th>
109                                         <th>Expiration date</th>
110                                         <th>Waiting date</th>
111                                         <th>Cancellation date</th>
112                                         [% IF show_itemtype_column %]
113                                         <th>Requested item type</th>
114                                         [% END %]
115                                         <th>Status</th>
116                                         </tr>
117                                     </thead>
118                                     <tbody>
119                                     [% FOREACH hold IN holds %]
120                                         <tr>
121                                         <td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% hold.biblio.biblionumber | uri %]">[% INCLUDE 'biblio-title.inc' biblio=hold.biblio %]</a></td>
122                                         <td>[% hold.biblio.author | html %]</td>
123                                         <td>[% hold.item.barcode | html %]</td>
124                                         <td>[% Branches.GetName( hold.branchcode ) | html %]</td>
125                                         <td data-order="[% hold.reservedate | html %]">[% hold.reservedate | $KohaDates %]</td>
126                                         <td data-order="[% hold.expirationdate | html %]">
127                                             [% IF hold.expirationdate %]
128                                                 [% hold.expirationdate | $KohaDates %]
129                                             [% END %]
130                                         </td>
131                                         <td data-order="[% hold.waitingdate | html %]">
132                                             [% IF hold.waitingdate %]
133                                                 [% hold.waitingdate | $KohaDates %]
134                                             [% END %]
135                                         </td>
136                                         <td data-order="[% hold.cancellationdate | html %]">
137                                             [% IF hold.cancellationdate %]
138                                                 [% hold.cancellationdate | $KohaDates %]
139                                             [% END %]
140                                         </td>
141                                         [% IF show_itemtype_column %]
142                                             <td>
143                                             [% IF hold.itemtype %]
144                                                 [% ItemTypes.GetDescription( hold.itemtype ) | html %]
145                                             [% ELSE %]
146                                                 <span>Any item type</span>
147                                             [% END %]
148                                             </td>
149                                         [% END %]
150                                         <td>
151                                         [% IF hold.found == 'F' %]
152                                             Fulfilled
153                                         [% ELSIF hold.cancellationdate %]
154                                             Cancelled
155                                         [% ELSIF hold.found == 'W' %]
156                                             Waiting
157                                         [% ELSIF hold.found == 'T' %]
158                                             In transit
159                                         [% ELSE %]
160                                             Pending
161                                         [% END %]
162                                         </td>
163                                         </tr>
164                                     [% END %]
165                                     </tbody>
166                                 </table>
167                             </div> <!-- / .tabs-container -->
168                         </div> <!-- / .opac-user-holdsrec -->
169                     [% END # / IF old_holds_count %]
170                 </div> <!-- / .userholdshistory -->
171             </div> <!-- / .span10 -->
172         </div> <!-- / .row-fluid -->
173     </div> <!-- / .container-fluid -->
174 </div> <!-- / .main -->
175
176 [% INCLUDE 'opac-bottom.inc' %]
177 [% BLOCK jsinclude %]
178 [% INCLUDE 'datatables.inc' %]
179 [% INCLUDE 'columns_settings.inc' %]
180 <script>
181     $(document).ready(function() {
182         $('#sort').change(function() {
183             $('#sortform').submit();
184         });
185         var columns_settings = []; // Empty because there are no columns we want to be configurable
186         var table = KohaTable("#table_holdshistory", {
187             "dom": '<"top"<"table_entries"i><"table_controls"fB>>t',
188             "autoWidth": false,
189             "sorting": [[4, 'desc']],
190             "columnDefs": [
191                 { "sType": "anti-the", "aTargets" : [ "anti-the" ] }
192             ],
193             "language": {
194                 "search": "_INPUT_",
195                 "searchPlaceholder": _("Search")
196             }
197         }, columns_settings);
198     });
199 </script>
200 [% END %]