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