Bug 29760: Add patron category column to view_holdsqueue.tt
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / view_holdsqueue.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE KohaDates %]
5 [% USE ItemTypes %]
6 [% USE Branches %]
7 [% USE AuthorisedValues %]
8 [% USE TablesSettings %]
9 [% USE Koha %]
10 [% SET footerjs = 1 %]
11 [% INCLUDE 'doc-head-open.inc' %]
12 <title>Holds queue &rsaquo; Circulation &rsaquo; Koha</title>
13 [% INCLUDE 'doc-head-close.inc' %]
14 <style> p { margin-top: 0; }</style>
15 </head>
16
17 <body id="circ_view_holdsqueue" class="circ">
18 [% INCLUDE 'header.inc' %]
19 [% INCLUDE 'cat-search.inc' %]
20
21 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
22     <ol>
23         <li>
24             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
25         </li>
26         <li>
27             <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
28         </li>
29
30         [% IF ( run_report ) %]
31             <li>
32                 <a href="/cgi-bin/koha/circ/view_holdsqueue.pl">Holds queue</a>
33             </li>
34             <li>
35                 <a href="#" aria-current="page">
36                     Results
37                 </a>
38             </li>
39
40         [% ELSE %]
41             <li>
42                 <a href="#" aria-current="page">
43                     Holds queue
44                 </a>
45             </li>
46         [% END %]
47     </ol>
48 </nav>
49
50 <div class="main container-fluid">
51     <div class="row">
52         <div class="col-sm-12">
53             <main>
54                 <div class="row">
55
56                 [% IF ( total || Koha.Preference('CircSidebar') ) %]
57                     <div class="col-sm-10 col-sm-push-2">
58                 [% ELSE %]
59                     <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
60                 [% END %]
61
62 <h1>Holds queue</h1>
63
64 [% IF ( run_report ) %]
65     [% IF ( total ) %]
66         <div class="results">[% total | html %] items found for
67             [% IF ( branchlimit ) %][% Branches.GetName( branchlimit ) | html %][% ELSE %]All libraries[% END %]
68             [% IF ( itemtypeslimit ) %] and item type: [% ItemTypes.GetDescription( itemtypeslimit ) | html %][% END %]
69             [% IF ( ccodeslimit ) %] and collection: [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode' authorised_value = ccodeslimit ) | html %][% END %]
70             [% IF ( locationslimit ) %] and shelving location: [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location' authorised_value = locationslimit ) | html %][% END %]
71         </div>
72     [% ELSE %]
73         <div class="dialog message">No items found.</div>
74     [% END %]
75     [% IF ( itemsloop ) %]
76 <table id="holdst">
77         <thead>
78     <tr>
79         <th class="hq-title anti-the">Title</th>
80         <th class="hq-collection">Collection</th>
81         <th class="hq-itemtype">Item type</th>
82         <th class="hq-callnumber">Call number</th>
83         <th class="hq-copynumber">Copy number</th>
84         <th class="hq-enumchron">Enumeration</th>
85         <th class="hq-barcode">Barcode</th>
86         <th class="hq-patron">Patron</th>
87         <th class="hq-patroncategory">Patron category</th>
88         <th class="hq-sendto">Send to</th>
89         <th class="hq-date">Date</th>
90         <th class="hq-notes">Notes</th>
91     </tr>
92     <tr>
93         <td class="hq-title">
94             <span class="filter_column filter_text">
95                 <input class="text_filter" type="text" placeholder="Title">
96             </span>
97         </td>
98         <td class="hq-collection">
99             <span class="filter_column filter_text">
100                 <input type="text" placeholder="Collection">
101             </span>
102         </td>
103         <td class="hq-itemtype">
104             <span class="filter_column filter_text">
105                 <input type="text" placeholder="Item type">
106             </span>
107         </td>
108         <td class="hq-callnumber">
109             <span class="filter_column filter_text">
110                 <input type="text" placeholder="Call number">
111             </span>
112         </td>
113         <td class="hq-copynumber">
114             <span class="filter_column filter_text">
115                 <input type="text" placeholder="Copy number">
116             </span>
117         </td>
118         <td class="hq-enumchron">
119             <span class="filter_column filter_text">
120                 <input type="text" placeholder="Enumeration">
121             </span>
122         </td>
123         <td class="hq-barcode">
124             <span class="filter_column filter_text">
125                 <input type="text" placeholder="Barcode">
126             </span>
127         </td>
128         <td class="hq-patron">
129             <span class="filter_column filter_text">
130                 <input type="text" placeholder="Patron">
131             </span>
132         </td>
133         <td class="hq-patroncategory">
134             <span class="filter_column filter_text">
135                 <input type="text" placeholder="Patron category">
136             </span>
137         </td>
138         <td class="hq-sendto">
139             <span class="filter_column filter_text">
140                 <input type="text" placeholder="Send to">
141             </span>
142         </td>
143         <td class="hq-date">
144             <span class="filter_column filter_text">
145                 <input type="text" placeholder="Date">
146             </span>
147         </td>
148         <td class="hq-notes">
149             <span class="filter_column filter_text">
150                 <input type="text" placeholder="Notes">
151             </span>
152         </td>
153     </tr>
154         </thead>
155      <tbody>[% FOREACH itemsloo IN itemsloop %]
156         <tr>
157             <td class="hq-title">
158                 <p>
159                     [% INCLUDE 'biblio-title.inc' biblio=itemsloo link = 1 %]
160                 </p>
161                 <p>
162                     <div class="hq-biblionumber content_hidden">[% itemsloo.biblionumber | html %]</div>
163                     <div class="hq-author">[% itemsloo.author | html %]</div>
164                     [% IF ( itemsloo.editionstatement ) %]<div class="hq-editionstatement">[% itemsloo.editionstatement | html %]</div>[% END %]
165                     <div class="hq-pubdata">
166                         [% IF ( itemsloo.publishercode ) %][% itemsloo.publishercode | html %][% END %]
167
168                         [% IF ( itemsloo.publicationyear ) %]
169                             , [% itemsloo.publicationyear | html %]
170                         [% ELSIF ( itemsloo.copyrightdate ) %]
171                             , [% itemsloo.copyrightdate | html %]
172                         [% END %]
173
174                         [% IF ( itemsloo.pages ) %]: [% itemsloo.pages | html %] [% END %]
175
176                         [% IF ( itemsloo.item('size') ) %][% itemsloo.item('size') | html %][% END %]
177
178                         [% IF ( itemsloo.isbn ) %]ISBN: [% itemsloo.isbn | html %][% END %]
179                     </div>
180                 </p>
181             </td>
182             <td class="hq-collection">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemsloo.ccode ) | html %]</td>
183             <td class="hq-itemtype">[% ItemTypes.GetDescription( itemsloo.itype ) | html %]</td>
184             <td class="hq-callnumber">[% IF ( itemsloo.location ) %]<em>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => itemsloo.location ) | html %]</em> [% END %][% itemsloo.itemcallnumber | html %]</td>
185             <td class="hq-copynumber">[% itemsloo.copynumber | html %]</td>
186             <td class="hq-enumchron">[% itemsloo.enumchron | html %]</td>
187             <td class="hq-barcode">
188                 [% IF ( itemsloo.item_level_request ) %]
189                     <em>Only item:</em> <strong>[% itemsloo.barcode | html %]</strong>
190                 [% ELSE %]
191                     <strong>[% itemsloo.barcode | html %]</strong> <em>or any available</em>
192                 [% END %]
193             </td>
194             <td class="hq-patron">
195               <p>
196                   [% INCLUDE 'patron-title.inc' invert_name=1 patron=itemsloo.patron hide_patron_infos_if_needed=1 link_to="circulation_reserves" %]
197               </p>
198               [% UNLESS Koha.Preference('HidePatronName') %]
199                  <p>[% itemsloo.patron.phone | html %]</p>
200               [% END %]
201             </td>
202             <td class="hq-patron-category">[% itemsloo.patron.category.description | html %] ([% itemsloo.patron.categorycode | html %])</td>
203             <td class="hq-sendto">[% Branches.GetName( itemsloo.pickbranch ) | html %]</td>
204             <td class="hq-date" data-order="[% itemsloo.reservedate | html %]">[% itemsloo.reservedate | $KohaDates %]</td>
205             <td class="hq-notes">[% itemsloo.notes | html %]</td>
206         </tr>
207     [% END %]</tbody>
208     </table>
209         [% END %] 
210         [% END %]
211
212                         [% UNLESS ( total ) %]
213                             [% branchlimit = Branches.GetLoggedInBranchcode %]
214                             [% PROCESS filter_form %]
215                         [% END %]
216
217                     </div> <!-- /.col-sm-10.col-sm-push-2 -->
218                     [% IF ( total || Koha.Preference('CircSidebar') ) %]
219                         <div class="col-sm-2 col-sm-pull-10">
220                             <aside>
221                                 [% IF ( total ) %]
222                                     [% PROCESS filter_form %]
223                                 [% END %]
224                                 [% IF Koha.Preference('CircSidebar') %]
225                                     [% INCLUDE 'circ-nav.inc' %]
226                                 [% END %]
227                             </aside>
228                         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
229                     [% END %]
230                 </div> <!-- /.row -->
231
232             </main>
233         </div> <!-- /.col-sm-12 -->
234     </div> <!-- /.row -->
235
236 [% BLOCK filter_form %]
237     <form name="f" action="/cgi-bin/koha/circ/view_holdsqueue.pl">
238         [% IF ( total ) %]
239             <fieldset class="brief">
240         [% ELSE -%]
241             <fieldset class="rows">
242         [% END %]
243             <ol>
244                 <li>
245                     <label for="branchlimit">Library: </label>
246                     <select name="branchlimit" id="branchlimit">
247                         <option value="">All</option>
248                         [% PROCESS options_for_libraries libraries => Branches.all( selected => branchlimit, only_from_group => 1 ) %]
249                     </select>
250                 </li>
251                 <li>
252                     <label for="itemtypeslimit">Item type: </label>
253                     <select name="itemtypeslimit" id="itemtypeslimit">
254                         <option value="">All</option>
255                         [% PROCESS options_for_item_types itemtypes => ItemTypes.Get(), selected_itemtype => itemtypeslimit %]
256                     </select>
257                 </li>
258                 <li>
259                     <label for="ccodeslimit">Collection: </label>
260                     <select name="ccodeslimit" id="ccodeslimit">
261                         <option value="">All</option>
262                         [% PROCESS options_for_authorised_values authorised_values => AuthorisedValues.GetAuthValueDropbox( 'CCODE' ), selected_av => ccodeslimit %]
263                     </select>
264                 </li>
265                 <li>
266                     <label for="locationsslimit">Shelving location: </label>
267                     <select name="locationslimit" id="locationslimit">
268                         <option value="">All</option>
269                         [% PROCESS options_for_authorised_values authorised_values => AuthorisedValues.GetAuthValueDropbox( 'LOC' ), selected_av => locationslimit %]
270                     </select>
271                 </li>
272             </ol>
273         </fieldset>
274         <fieldset class="action">
275             <input type="submit" value="Submit" />
276             <input type="hidden" name="run_report" value="1" />
277         </fieldset>
278     </form>
279 [% END %]
280
281 [% MACRO jsinclude BLOCK %]
282     [% INCLUDE 'datatables.inc' %]
283     [% INCLUDE 'columns_settings.inc' %]
284     <script>
285         $(document).ready(function() {
286             var holdst;
287
288             // Setup filters before DataTables initialisation, in case some columns are
289             // hidden by default
290             var filterColumnTimeoutId;
291             var filterColumn = function(e) {
292                 clearTimeout(filterColumnTimeoutId);
293                 filterColumnTimeoutId = setTimeout(function() {
294                     var input = $(e.target);
295                     var idx = input.parents('td').index();
296                     holdst.api().column(idx + ':visible').search(input.val()).draw();
297                 }, 200);
298             };
299             $('#holdst thead input').on('change keyup keydown', filterColumn);
300
301             var columns_settings = [% TablesSettings.GetColumns('circ', 'view_holdsqueue', 'holds-table', 'json') | $raw %];
302             var holdst = KohaTable("holdst", {
303                 "aaSorting": [[ 3, "asc" ]],
304                 "sDom": 'B<"clearfix">t',
305                 "bSortCellsTop": true,
306                 "bPaginate": false
307             }, columns_settings);
308
309         });
310     </script>
311 [% END %]
312
313 [% INCLUDE 'intranet-bottom.inc' %]