Bug 22456: (QA follow-up) Consider cancellation requested as cancelled in OPAC
[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 || default_branch, blocktitle => 0 ) %]
9 [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, 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                         No data available
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>[% INCLUDE 'biblio-title.inc' biblio=hold.biblio link=>1 %]</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                                             <span>Fulfilled</span>
153                                         [% ELSIF hold.cancellationdate %]
154                                             <span>Cancelled</span>
155                                         [% ELSIF hold.found == 'W' %]
156                                             [% IF hold.cancellation_requests.count == 0 %]
157                                                 <span>Waiting</span>
158                                             [% ELSE %]
159                                                 <span>Cancelled</span>
160                                             [% END %]
161                                         [% ELSIF hold.found == 'T' %]
162                                             <span>In transit</span>
163                                         [% ELSE %]
164                                             <span>Pending</span>
165                                         [% END %]
166                                         </td>
167                                         </tr>
168                                     [% END %]
169                                     </tbody>
170                                 </table>
171                             </div> <!-- / .tabs-container -->
172                         </div> <!-- / .opac-user-holdsrec -->
173                     [% END # / IF old_holds_count %]
174                 </div> <!-- / .userholdshistory -->
175             </div> <!-- / .span10 -->
176         </div> <!-- / .row-fluid -->
177     </div> <!-- / .container-fluid -->
178 </div> <!-- / .main -->
179
180 [% INCLUDE 'opac-bottom.inc' %]
181 [% BLOCK jsinclude %]
182 [% INCLUDE 'datatables.inc' %]
183 [% INCLUDE 'columns_settings.inc' %]
184 <script>
185     $(document).ready(function() {
186         $('#sort').change(function() {
187             $('#sortform').submit();
188         });
189         var columns_settings = []; // Empty because there are no columns we want to be configurable
190         var table = KohaTable("#table_holdshistory", {
191             "dom": '<"top"<"table_entries"i><"table_controls"fB>>t',
192             "autoWidth": false,
193             "sorting": [[4, 'desc']],
194             "columnDefs": [
195                 { "sType": "anti-the", "aTargets" : [ "anti-the" ] }
196             ],
197             "language": {
198                 "search": "_INPUT_",
199                 "searchPlaceholder": _("Search")
200             }
201         }, columns_settings);
202     });
203 </script>
204 [% END %]