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