Bug 22134: (follow-up) Simplify check for expired patron
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / holdshistory.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% USE Koha %]
5 [% USE AuthorisedValues %]
6 [% USE Branches %]
7 [% USE ColumnsSettings %]
8 [% USE ItemTypes %]
9 [% SET footerjs = 1 %]
10 [% INCLUDE 'doc-head-open.inc' %]
11 <title>Holds history for [% INCLUDE 'patron-title.inc' no_html = 1 %]</title>
12 [% INCLUDE 'doc-head-close.inc' %]
13 [% Asset.css("css/datatables.css") | $raw %]
14 </head>
15
16 <body id="pat_holdshistory" class="pat">
17 [% INCLUDE 'header.inc' %]
18 [% INCLUDE 'patron-search.inc' %]
19
20 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Holds history for [% INCLUDE 'patron-title.inc' %]</div>
21
22 <div class="main container-fluid">
23     <div class="row">
24         <div class="col-sm-10 col-sm-push-2">
25             <main>
26
27 [% INCLUDE 'members-toolbar.inc' %]
28 <h1>Holds history</h1>
29
30 [% UNLESS Koha.Preference('intranetreadinghistory') %]
31     <div class="dialog alert">Staff members are not allowed to access patron's holds history</div>
32 [% ELSIF is_anonymous %]
33     <div class="dialog alert">This is the anonymous patron, so no holds history is displayed.</div>
34 [% ELSIF ( !holds ) %]
35     <div class="dialog message">This patron has no holds history.</div>
36 [% ELSE %]
37
38 [% SET show_itemtype_column = Koha.Preference('AllowHoldItemTypeSelection') %]
39
40 <div id="holdshistory" style="overflow:hidden">
41   <table id="table_holdshistory">
42       <thead>
43         <tr>
44         <th class="anti-the">Title</th>
45         <th>Author</th>
46         <th>Barcode</th>
47         <th>Library</th>
48         <th class="title-string">Hold date</th>
49         <th class="title-string">Expiration date</th>
50         <th class="title-string">Waiting date</th>
51         <th class="title-string">Cancellation date</th>
52         [% IF show_itemtype_column %]
53           <th>Requested item type</th>
54         [% END %]
55         <th>Status</th>
56         </tr>
57       </thead>
58       <tbody>
59       [% FOREACH hold IN holds %]
60         <tr>
61           <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% hold.biblio.biblionumber | uri %]">[% hold.biblio.title | html %]</a></td>
62           <td>[% hold.biblio.author | html %]</td>
63           <td>[% hold.item.barcode | html %]</td>
64           <td>[% Branches.GetName( hold.branchcode ) | html %]</td>
65           <td><span title="[% hold.reservedate | html %]">[% hold.reservedate | $KohaDates %]</span></td>
66           <td>
67               [% IF hold.expirationdate %]
68                   <span title="[% hold.expirationdate | html %]">[% hold.expirationdate | $KohaDates %]</span>
69               [% ELSE %]
70                   <span title="0000-00-00"></span>
71               [% END %]
72           </td>
73           <td>
74               [% IF hold.waitingdate %]
75                   <span title="[% hold.waitingdate | html %]">[% hold.waitingdate | $KohaDates %]</span>
76               [% ELSE %]
77                   <span title="0000-00-00"></span>
78               [% END %]
79           </td>
80           <td>
81               [% IF hold.cancellationdate %]
82                   <span title="[% hold.cancellationdate | html %]">[% hold.cancellationdate | $KohaDates %]</span>
83               [% ELSE %]
84                   <span title="0000-00-00"></span>
85               [% END %]
86           </td>
87           [% IF show_itemtype_column %]
88             <td>
89               [% IF hold.itemtype %]
90                   [% ItemTypes.GetDescription( hold.itemtype ) | html %]
91               [% ELSE %]
92                   <span>Any item type</span>
93               [% END %]
94             </td>
95           [% END %]
96           <td>
97           [% IF hold.found == 'F' %]
98               Fulfilled
99           [% ELSIF hold.cancellationdate %]
100               Cancelled
101           [% ELSIF hold.found == 'W' %]
102               Waiting
103           [% ELSIF hold.found == 'T' %]
104               In transit
105           [% ELSE %]
106               Pending
107           [% END %]
108           </td>
109         </tr>
110       [% END %]
111       </tbody>
112   </table>
113 </div>
114
115 [% END %]
116
117             </main>
118         </div> <!-- /.col-sm-10.col-sm-push-2 -->
119
120         <div class="col-sm-2 col-sm-pull-10">
121             <aside>
122                 [% INCLUDE 'circ-menu.inc' %]
123             </aside>
124         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
125      </div> <!-- /.row -->
126
127 [% MACRO jsinclude BLOCK %]
128     [% INCLUDE 'datatables.inc' %]
129     [% INCLUDE 'columns_settings.inc' %]
130     [% INCLUDE 'str/members-menu.inc' %]
131     [% Asset.js("js/members-menu.js") | $raw %]
132     <script>
133         $(document).ready(function() {
134             var columns_settings = [% ColumnsSettings.GetColumns('members', 'holdshistory', 'holdshistory-table', 'json') %];
135             [% UNLESS show_itemtype_column %]
136               //Remove item type column settings
137               columns_settings = columns_settings.filter(function(c){return c['columnname'] != 'itemtype';});
138             [% END %]
139             var table = KohaTable("table_holdshistory", {
140                 "sPaginationType": "four_button",
141                 "aaSorting": [[4, 'desc']],
142                 "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
143                 "aoColumnDefs": [
144                     { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
145                     { "sType": "title-string", "aTargets" : [ "title-string" ] }
146                 ]
147             }, columns_settings);
148         });
149     </script>
150 [% END %]
151
152 [% INCLUDE 'intranet-bottom.inc' %]