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