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