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