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