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