Bug 29015: (follow-up) Show sidebar filter form with results
[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 code:([% 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-sendto">Send to</th>
88         <th class="hq-date">Date</th>
89         <th class="hq-notes">Notes</th>
90     </tr>
91     <tr>
92         <td class="hq-title">
93             <span class="filter_column filter_text">
94                 <input class="text_filter" type="text" placeholder="Title">
95             </span>
96         </td>
97         <td class="hq-collection">
98             <span class="filter_column filter_text">
99                 <input type="text" placeholder="Collection">
100             </span>
101         </td>
102         <td class="hq-itemtype">
103             <span class="filter_column filter_text">
104                 <input type="text" placeholder="Item type">
105             </span>
106         </td>
107         <td class="hq-callnumber">
108             <span class="filter_column filter_text">
109                 <input type="text" placeholder="Call number">
110             </span>
111         </td>
112         <td class="hq-copynumber">
113             <span class="filter_column filter_text">
114                 <input type="text" placeholder="Copy number">
115             </span>
116         </td>
117         <td class="hq-enumchron">
118             <span class="filter_column filter_text">
119                 <input type="text" placeholder="Enumeration">
120             </span>
121         </td>
122         <td class="hq-barcode">
123             <span class="filter_column filter_text">
124                 <input type="text" placeholder="Barcode">
125             </span>
126         </td>
127         <td class="hq-patron">
128             <span class="filter_column filter_text">
129                 <input type="text" placeholder="Patron">
130             </span>
131         </td>
132         <td class="hq-sendto">
133             <span class="filter_column filter_text">
134                 <input type="text" placeholder="Send to">
135             </span>
136         </td>
137         <td class="hq-date">
138             <span class="filter_column filter_text">
139                 <input type="text" placeholder="Date">
140             </span>
141         </td>
142         <td class="hq-notes">
143             <span class="filter_column filter_text">
144                 <input type="text" placeholder="Notes">
145             </span>
146         </td>
147     </tr>
148         </thead>
149      <tbody>[% FOREACH itemsloo IN itemsloop %]
150         <tr>
151             <td class="hq-title">
152                 <p>
153                     [% INCLUDE 'biblio-title.inc' biblio=itemsloo link = 1 %]
154                 </p>
155                 <p>
156                     <div class="hq-biblionumber content_hidden">[% itemsloo.biblionumber | html %]</div>
157                     <div class="hq-author">[% itemsloo.author | html %]</div>
158                     [% IF ( itemsloo.editionstatement ) %]<div class="hq-editionstatement">[% itemsloo.editionstatement | html %]</div>[% END %]
159                     <div class="hq-pubdata">
160                         [% IF ( itemsloo.publishercode ) %][% itemsloo.publishercode | html %][% END %]
161
162                         [% IF ( itemsloo.publicationyear ) %]
163                             , [% itemsloo.publicationyear | html %]
164                         [% ELSIF ( itemsloo.copyrightdate ) %]
165                             , [% itemsloo.copyrightdate | html %]
166                         [% END %]
167
168                         [% IF ( itemsloo.pages ) %]: [% itemsloo.pages | html %] [% END %]
169
170                         [% IF ( itemsloo.item('size') ) %][% itemsloo.item('size') | html %][% END %]
171
172                         [% IF ( itemsloo.isbn ) %]ISBN: [% itemsloo.isbn | html %][% END %]
173                     </div>
174                 </p>
175             </td>
176             <td class="hq-collection">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemsloo.ccode ) | html %]</td>
177             <td class="hq-itemtype">[% ItemTypes.GetDescription( itemsloo.itype ) | html %]</td>
178             <td class="hq-callnumber">[% IF ( itemsloo.location ) %]<em>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => itemsloo.location ) | html %]</em> [% END %][% itemsloo.itemcallnumber | html %]</td>
179             <td class="hq-copynumber">[% itemsloo.copynumber | html %]</td>
180             <td class="hq-enumchron">[% itemsloo.enumchron | html %]</td>
181             <td class="hq-barcode">
182                 [% IF ( itemsloo.item_level_request ) %]
183                     <em>Only item:</em> <strong>[% itemsloo.barcode | html %]</strong>
184                 [% ELSE %]
185                     <strong>[% itemsloo.barcode | html %]</strong> <em>or any available</em>
186                 [% END %]
187             </td>
188             <td class="hq-patron">
189               <p>
190                   [% INCLUDE 'patron-title.inc' invert_name=1 patron=itemsloo.patron hide_patron_infos_if_needed=1 link_to="circulation_reserves" %]
191               </p>
192               [% UNLESS Koha.Preference('HidePatronName') %]
193                  <p>[% itemsloo.patron.phone | html %]</p>
194               [% END %]
195             </td>
196             <td class="hq-sendto">[% Branches.GetName( itemsloo.pickbranch ) | html %]</td>
197             <td class="hq-date" data-order="[% itemsloo.reservedate | html %]">[% itemsloo.reservedate | $KohaDates %]</td>
198             <td class="hq-notes">[% itemsloo.notes | html %]</td>
199         </tr>
200     [% END %]</tbody>
201     </table>
202         [% END %] 
203         [% END %]
204
205                         [% UNLESS ( total ) %]
206                             [% PROCESS filter_form %]
207                         [% END %]
208
209                     </div> <!-- /.col-sm-10.col-sm-push-2 -->
210                     [% IF ( total || Koha.Preference('CircSidebar') ) %]
211                         <div class="col-sm-2 col-sm-pull-10">
212                             <aside>
213                                 [% IF ( total ) %]
214                                     [% PROCESS filter_form %]
215                                 [% END %]
216                                 [% IF Koha.Preference('CircSidebar') %]
217                                     [% INCLUDE 'circ-nav.inc' %]
218                                 [% END %]
219                             </aside>
220                         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
221                     [% END %]
222                 </div> <!-- /.row -->
223
224             </main>
225         </div> <!-- /.col-sm-12 -->
226     </div> <!-- /.row -->
227
228 [% BLOCK filter_form %]
229     <form name="f" action="/cgi-bin/koha/circ/view_holdsqueue.pl">
230         [% IF ( total ) %]
231             <fieldset class="brief">
232         [% ELSE -%]
233             <fieldset class="rows">
234         [% END %]
235             <ol>
236                 <li>
237                     <label for="branchlimit">Library: </label>
238                     <select name="branchlimit" id="branchlimit">
239                         <option value="">All</option>
240                         [% PROCESS options_for_libraries libraries => Branches.all( selected => branchlimit, only_from_group => 1 ) %]
241                     </select>
242                 </li>
243                 <li>
244                     <label for="itemtypeslimit">Item type: </label>
245                     <select name="itemtypeslimit" id="itemtypeslimit">
246                         <option value="">All</option>
247                         [% PROCESS options_for_item_types itemtypes => ItemTypes.Get(), selected_itemtype => itemtypeslimit %]
248                     </select>
249                 </li>
250                 <li>
251                     <label for="ccodeslimit">Collection code: </label>
252                     <select name="ccodeslimit" id="ccodeslimit">
253                         <option value="">All</option>
254                         [% PROCESS options_for_authorised_values authorised_values => AuthorisedValues.GetAuthValueDropbox( 'CCODE' ), selected_av => ccodeslimit %]
255                     </select>
256                 </li>
257                 <li>
258                     <label for="locationsslimit">Shelving location: </label>
259                     <select name="locationslimit" id="locationslimit">
260                         <option value="">All</option>
261                         [% PROCESS options_for_authorised_values authorised_values => AuthorisedValues.GetAuthValueDropbox( 'LOC' ), selected_av => locationslimit %]
262                     </select>
263                 </li>
264             </ol>
265         </fieldset>
266         <fieldset class="action">
267             <input type="submit" value="Submit" />
268             <input type="hidden" name="run_report" value="1" />
269         </fieldset>
270     </form>
271 [% END %]
272
273 [% MACRO jsinclude BLOCK %]
274     [% INCLUDE 'datatables.inc' %]
275     [% INCLUDE 'columns_settings.inc' %]
276     <script>
277         $(document).ready(function() {
278             var holdst;
279
280             // Setup filters before DataTables initialisation, in case some columns are
281             // hidden by default
282             var filterColumnTimeoutId;
283             var filterColumn = function(e) {
284                 clearTimeout(filterColumnTimeoutId);
285                 filterColumnTimeoutId = setTimeout(function() {
286                     var input = $(e.target);
287                     var idx = input.parents('td').index();
288                     holdst.api().column(idx + ':visible').search(input.val()).draw();
289                 }, 200);
290             };
291             $('#holdst thead input').on('change keyup keydown', filterColumn);
292
293             var columns_settings = [% TablesSettings.GetColumns('circ', 'view_holdsqueue', 'holds-table', 'json') | $raw %];
294             var holdst = KohaTable("holdst", {
295                 "aaSorting": [[ 3, "asc" ]],
296                 "sDom": 'B<"clearfix">t',
297                 "bSortCellsTop": true,
298                 "bPaginate": false
299             }, columns_settings);
300
301         });
302     </script>
303 [% END %]
304
305 [% INCLUDE 'intranet-bottom.inc' %]