]> git.koha-community.org Git - koha.git/blob - koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tt
Bug 28949: Use Flatpickr on reports pages
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / reports / reserves_stats.tt
1 [% USE Branches %]
2 [% SET footerjs = 1 %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Holds statistics[% IF ( do_it ) %] &rsaquo; Results[% END %] &rsaquo; Reports &rsaquo; Koha</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 <style>
7         .sql {display:none;}
8 </style>
9 </head>
10
11 <body id="rep_reserve_stats" class="rep">
12 [% INCLUDE 'header.inc' %]
13 [% INCLUDE 'cat-search.inc' %]
14
15 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
16     <ol>
17         <li>
18             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
19         </li>
20         <li>
21             <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>
22         </li>
23         [% IF ( do_it ) %]
24             <li>
25                 <a href="/cgi-bin/koha/reports/reserves_stats.pl">Holds statistics</a>
26             </li>
27             <li>
28                 <a href="#" aria-current="page">
29                     Results
30                 </a>
31             </li>
32         [% ELSE %]
33             <li>
34                 <a href="#" aria-current="page">
35                     Holds statistics
36                 </a>
37             </li>
38         [% END %]
39     </ol>
40 </nav>
41
42 <div class="main container-fluid">
43     <div class="row">
44         <div class="col-sm-10 col-sm-push-2">
45             <main>
46
47
48 [% IF ( do_it ) %]
49     [% IF ( mainloop ) %]
50         <h1>Holds statistics</h1>
51         [% IF ( loopfilter ) %]
52             <p>Filtered on:</p>
53             <ul>
54             [% FOREACH loopfilte IN loopfilter %]
55                 [% IF ( loopfilte.err ) %]<li class="error">Error:
56                                 [% ELSIF ( loopfilte.sql ) %]<li class="sql">
57                                 [% ELSE %]<li>
58                                 [% END %]
59                                         [% loopfilte.crit | html %] [% loopfilte.filter | html %]
60                                 </li>
61             [% END %]
62             </ul>
63         [% END %]
64                 
65     [% FOREACH mainloo IN mainloop %]
66         
67         <table> 
68             <tr>
69                 <th>[% mainloo.line | html %] / [% mainloo.column | html %]</th>
70                 [% FOREACH loopco IN mainloo.loopcol %]
71                     <th>[% loopco.coltitle_display | html %]</th>
72                 [% END %]
73                 <th>TOTAL</th>
74                 </tr>
75                 [% FOREACH loopro IN mainloo.looprow %]
76                     <tr>
77                         <td>[% loopro.rowtitle_display or "UNKNOWN VALUE" | html %]</td>
78                     [% FOREACH loopcel IN loopro.loopcell %]
79                                                 <td align="center">
80                         [% IF ( loopcel.url_complement ) %]<a href="reserves_stats.pl?output=[% loopcel.output | uri %]&amp;[% loopcel.url_complement | uri %]">[% loopcel.value | html %]</a>[% ELSE %][% loopcel.value | html %][% END %]
81                                                 </td>
82                     [% END %]
83                                                 <td align="center">[% loopro.totalrow | html %]</td>
84                     </tr>
85                 [% END %]
86             <tr>
87                 <th>TOTAL</th>
88                 [% FOREACH loopfoote IN mainloo.loopfooter %]
89                 <th>[% loopfoote.totalcol | html %]</th>
90                 [% END %]
91                 <th>[% mainloo.total | html %]</th>
92             </tr>
93         </table>
94     [% END %]
95     [% END %]
96 [% ELSE %]
97
98     <form method="post" action="/cgi-bin/koha/reports/reserves_stats.pl">
99     <fieldset class="rows">
100         <legend>Holds statistics</legend><table>
101         <thead>
102             <tr>
103                 <th>Title</th>
104                 <th>Row</th>
105                 <th>Column</th>
106                 <th>Filter</th>
107             </tr>
108         </thead>
109         <tbody>
110                 <tr >
111                 <td>Hold status </td>
112                 <td><input type="radio" name="Line" value="reservestatus" /></td>
113                 <td><input type="radio" name="Column" value="reservestatus" checked="checked" /></td>
114                 <td>
115                                 <input type="checkbox" name="filter_reservestatus_or_1" value="1" /> Asked
116                                 <input type="checkbox" name="filter_reservestatus_or_2" value="2" /> Processing
117                                 <input type="checkbox" name="filter_reservestatus_or_3" value="3" /> Waiting
118                                 <input type="checkbox" name="filter_reservestatus_or_4" value="4" /> Satisfied
119                                 <input type="checkbox" name="filter_reservestatus_or_5" value="5" /> Cancelled
120                                 </td>
121              </tr>
122              <tr>
123                 <td>Hold date</td>
124                 <td><input type="radio" name="Line" value="reservedate" /></td>
125                 <td><input type="radio" name="Column" value="reservedate" /></td>
126                 <td>
127                     <label for="filter_reservedate_begin">From</label>
128                     <input type="text" size="10" id="filter_reservedate_begin" name="filter_reservedate_begin" />
129                     <label for="filter_reservedate_end">To</label>
130                     <input size="10" id="filter_reservedate_end" name="filter_reservedate_end" value="" type="text" />
131                 </td>
132             </tr>
133             <tr>
134                 <td>Notification date</td>
135                 <td><input type="radio" name="Line" value="notificationdate" /></td>
136                 <td><input type="radio" name="Column" value="notificationdate" /></td>
137                 <td>
138                     <label for="filter_notificationdate_begin">From</label>
139                     <input type="text" size="10" id="filter_notificationdate_begin" name="filter_notificationdate_begin" />
140                     <label for="filter_notificationdate_end">To</label>
141                     <input  size="10" id="filter_notificationdate_end" name="filter_notificationdate_end" value="" type="text" />
142                 </td>
143              </tr>
144             <tr>
145                 <td>Reminder date</td>
146                 <td><input type="radio" name="Line" value="reminderdate" /></td>
147                 <td><input type="radio" name="Column" value="reminderdate" /></td>
148                 <td>
149                     <label for="filter_reminderdate_begin">From</label>
150                     <input type="text" size="10" id="filter_reminderdate_begin" name="Filter" />
151                     <label for="filter_reminderdate_end">To</label>
152                     <input size="10" id="filter_reminderdate_end" name="filter_reminderdate_end" value="" type="text" />
153                 </td>
154              </tr>
155             <tr>
156                 <td>Waiting date</td>
157                 <td><input type="radio" name="Line" value="waitingdate" /></td>
158                 <td><input type="radio" name="Column" value="waitingdate" /></td>
159                 <td>
160                     <label for="filter_waitingdate_begin">From</label>
161                     <input type="text" size="10" id="filter_waitingdate_begin" name="filter_waitingdate_begin" />
162                     <label for="filter_waitingdate_end">To</label>
163                     <input  size="10" id="filter_waitingdate_end" name="filter_waitingdate_end" value="" type="text" />
164                 </td>
165              </tr>
166                          <tr>
167                 <td>Cancellation date</td>
168                 <td><input type="radio" name="Line" value="cancellationdate" /></td>
169                 <td><input type="radio" name="Column" value="cancellationdate" /></td>
170                 <td>
171                     <label for="filter_cancellationdate_begin">From</label>
172                     <input type="text" size="10" id="filter_cancellationdate_begin" name="filter_cancellationdate_begin" />
173                     <label for="filter_cancellationdate_end">To</label>
174                     <input  size="10" id="filter_cancellationdate_end" name="filter_cancellationdate_end" value="" type="text" />
175                 </td>
176              </tr>
177         <tr>
178             <td>Patron category</td>
179             <td><input type="radio" name="Line" value="borrowers.categorycode" /></td>
180             <td><input type="radio" name="Column" value="borrowers.categorycode" /></td>
181            <td><select name="filter_categorycode" id="borcat">
182                <option value=""> </option>
183                [% FOREACH categoryloo IN categoryloop %]
184                  <option value="[% categoryloo.categorycode | html %]">[% categoryloo.description | html %]</option>
185                [% END %]
186                </select>
187              </td> 
188         </tr>
189         <tr>
190             <td>Item type</td>
191             <td><input type="radio" name="Line" value="items.itype" /></td>
192             <td><input type="radio" name="Column" value="items.itype" /></td>
193            <td><select name="filter_items.itype" id="itype">
194                <option value=""> </option>
195                [% FOREACH itemtype IN itemtypes %]
196                  <option value="[% itemtype.itemtype | html %]">[% itemtype.translated_description | html %]</option>
197                [% END %]
198                </select>
199              </td> 
200         </tr>
201         <tr>
202             <td>Pickup library</td>
203             <td><input type="radio" name="Line" value="reserves.branchcode" checked="checked" /></td>
204             <td><input type="radio" name="Column" value="reserves.branchcode" /></td>
205             <td><select name="filter_reserves.branchcode" id="resbranchcode">
206                <option value=""> </option>
207                 [% PROCESS options_for_libraries libraries => Branches.all() %]
208                </select>
209              </td> 
210         </tr>
211         <tr>
212             <td>Holding library</td>
213             <td><input type="radio" name="Line" value="items.holdingbranch" /></td>
214             <td><input type="radio" name="Column" value="items.holdingbranch" /></td>
215             <td><select name="filter_items.holdingbranch" id="holdingbranch">
216                <option value=""> </option>
217                 [% PROCESS options_for_libraries libraries => Branches.all() %]
218                </select>
219              </td> 
220         </tr>
221         <tr>
222             <td>Home library</td>
223             <td><input type="radio" name="Line" value="items.homebranch" /></td>
224             <td><input type="radio" name="Column" value="items.homebranch" /></td>
225             <td><select name="filter_items.homebranch" id="homebranch">
226                 <option value=""> </option>
227                 [% PROCESS options_for_libraries libraries => Branches.all() %]
228                </select>
229              </td> 
230         </tr>
231         <tr>
232             <td>Collection</td>
233             <td><input type="radio" name="Line"   value="items.ccode" /></td>
234             <td><input type="radio" name="Column" value="items.ccode" /></td>
235             <td><select name="filter_items.ccode" id="ccode">
236                 <option value=""> </option>
237                 [% FOREACH ccodeloo IN ccodeloop %]
238                                         [% IF ( ccodeloo.selected ) %] <option value="[% ccodeloo.code | html %]" selected="selected">[% ccodeloo.description | html %]</option>[% ELSE %]<option value="[% ccodeloo.code | html %]">[% ccodeloo.description | html %]</option>[% END %]
239                 [% END %]
240                 </select>
241             </td>
242         </tr>
243         <tr>
244             <td>Shelving location</td>
245             <td><input type="radio" name="Line" value="items.location" /></td>
246             <td><input type="radio" name="Column" value="items.location" /></td>
247             <td><select name="filter_items.location" id="location">
248                 <option value=""> </option>
249                 [% FOREACH locationloo IN locationloop %]
250                                         [% IF ( locationloo.selected ) %]<option value="[% locationloo.code | html %]" selected="selected">[% locationloo.description | html %]</option>[% ELSE %]<option value="[% locationloo.code | html %]">[% locationloo.description | html %]</option>[% END %]
251                                 [% END %]
252                </select>
253             </td> 
254         </tr>
255         <tr>
256             <td>Item call number</td>
257             <td></td>
258             <td></td>
259             <td>From <input type="text" name="filter_items.itemcallnumber_begin" size="10" /> (inclusive) to <input type="text" name="filter_items.itemcallnumber_endex" size="10" /> (exclusive) </td>
260         </tr>
261         [% IF ( hassort1 ) %]
262         <tr><td>Patron sort 1</td>
263                         <td><input type="radio" name="Line" value="borrowers.sort1" /></td>
264                         <td><input type="radio" name="Column" value="borrowers.sort1" /></td>
265                         <td><select name="filter_borrowers.sort1" id="sort1">
266                <option value=""> </option>
267                [% FOREACH Bsort IN Bsort1 %]
268                            [% IF ( Bsort.selected ) %]<option value="[% Bsort.authorised_value | html %]" selected="selected">[% Bsort.lib | html %]</option>[% ELSE %]<option value="[% Bsort.authorised_value | html %]" >[% Bsort.lib | html %]</option>[% END %]
269                [% END %]
270                </select>
271             </td> 
272         </tr>
273         [% END %]
274         [% IF ( hassort2 ) %]
275         <tr><td>Patron sort 2</td>
276             <td><input type="radio" name="Line" value="borrowers.sort2" /></td>
277             <td><input type="radio" name="Column" value="borrowers.sort2" /></td>
278                 <td><select name="filter_borrowers.sort2" id="sort2">
279                <option value=""> </option>
280                [% FOREACH Bsort IN Bsort2 %]
281                            [% IF ( Bsort.selected ) %]<option value="[% Bsort.authorised_value | html %]" selected="selected">[% Bsort.lib | html %]</option>[% ELSE %]<option value="[% Bsort.authorised_value | html %]" >[% Bsort.lib | html %]</option>[% END %]
282                [% END %]
283                </select>
284             </td> 
285         </tr>
286         [% END %]
287         </tbody>
288     </table><br /></fieldset>
289
290 <fieldset class="rows"><legend>Cell value </legend><ol><li><label for="cellvalue1">Count holds:</label> <input type="radio" name="Cellvalue" value="1" id="cellvalue1" checked="checked" /> </li>
291             <li><label for="cellvalue2">Count unique borrowers:</label> <input type="radio" name="Cellvalue" value="2" id="cellvalue2" /> </li><li><label for="cellvalue3">Count unique items:</label> <input type="radio" name="Cellvalue" id="cellvalue3" value="3" /> </li><li><label for="cellvalue4">Count unique bibliographic records:</label> <input type="radio" name="Cellvalue" id="cellvalue4" value="4" /> </li></ol></fieldset>
292                         
293         <fieldset class="rows">
294         <legend>Output</legend>
295     <ol>
296         <li>
297             <label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" />
298         </li>
299         <li>
300             <label for="outputfile">To a file:</label> <input type="radio" name="output" value="file" id="outputfile" />
301             <label class="inline" for="basename">Named: </label><input type="text" name="basename" id="basename" value="Export" />
302             <label class="inline" for="MIME">Into an application:</label>
303             <select name="MIME" id="MIME">
304             [% FOREACH value IN CGIextChoice %]
305                 <option value="[% value | html %]">[% value | html %]</option>
306             [% END %]
307             </select>
308             <select name="sep" id="sep">
309             [% FOREACH value IN CGIsepChoice.values.sort() %]
310               [% IF ( value == CGIsepChoice.default ) %]
311                 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
312               [% ELSE %]
313                 <option value="[% value | html %]">[% value | html %]</option>
314               [% END %]
315             [% END %]
316             </select>
317         </li>
318     </ol>
319         </fieldset>
320
321         <fieldset class="action">
322         <input type="submit" value="Submit" />
323         <input type="hidden" name="report_name" value="[% report_name | html %]" />
324         <input type="hidden" name="do_it" value="1" />
325         </fieldset>
326         </form>
327 [% END %]
328
329             </main>
330         </div> <!-- /.col-sm-10.col-sm-push-2 -->
331
332         <div class="col-sm-2 col-sm-pull-10">
333             <aside>
334                 [% INCLUDE 'reports-menu.inc' %]
335             </aside>
336         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
337      </div> <!-- /.row -->
338
339 [% MACRO jsinclude BLOCK %]
340     [% INCLUDE 'calendar.inc' %]
341     <script>
342         $(document).ready(function() {
343             var filter_reservedate_begin = $("#filter_reservedate_begin").flatpickr({
344                 onClose: function( selectedDates, dateText, instance) {
345                     validate_date( selectedDates, instance );
346                     filter_reservedate_end.set('minDate', selectedDates[0]);
347                 }
348             });
349             var filter_reservedate_end = $("#filter_reservedate_end").flatpickr({
350                 onClose: function( selectedDates, dateText, instance) {
351                     validate_date( selectedDates, instance );
352                 },
353             });
354
355             var filter_notificationdate_begin = $("#filter_notificationdate_begin").flatpickr({
356                 onClose: function( selectedDates, dateText, instance) {
357                     validate_date( selectedDates, instance );
358                     filter_notificationdate_end.set('minDate', selectedDates[0]);
359                 }
360             });
361             var filter_notificationdate_end = $("#filter_notificationdate_end").flatpickr({
362                 onClose: function( selectedDates, dateText, instance) {
363                     validate_date( selectedDates, instance );
364                 },
365             });
366
367             var filter_reminderdate_begin = $("#filter_reminderdate_begin").flatpickr({
368                 onClose: function( selectedDates, dateText, instance) {
369                     validate_date( selectedDates, instance );
370                     filter_reminderdate_end.set('minDate', selectedDates[0]);
371                 }
372             });
373             var filter_reminderdate_end = $("#filter_reminderdate_end").flatpickr({
374                 onClose: function( selectedDates, dateText, instance) {
375                     validate_date( selectedDates, instance );
376                 },
377             });
378
379             var filter_waitingdate_begin = $("#filter_waitingdate_begin").flatpickr({
380                 onClose: function( selectedDates, dateText, instance) {
381                     validate_date( selectedDates, instance );
382                     filter_waitingdate_end.set('minDate', selectedDates[0]);
383                 }
384             });
385             var filter_waitingdate_end = $("#filter_waitingdate_end").flatpickr({
386                 onClose: function( selectedDates, dateText, instance) {
387                     validate_date( selectedDates, instance );
388                 },
389             });
390
391             var filter_cancellationdate_begin = $("#filter_cancellationdate_begin").flatpickr({
392                 onClose: function( selectedDates, dateText, instance) {
393                     validate_date( selectedDates, instance );
394                     filter_cancellationdate_end.set('minDate', selectedDates[0]);
395                 }
396             });
397             var filter_cancellationdate_end = $("#filter_cancellationdate_end").flatpickr({
398                 onClose: function( selectedDates, dateText, instance) {
399                     validate_date( selectedDates, instance );
400                 },
401             });
402         });
403     </script>
404 [% END %]
405
406 [% INCLUDE 'intranet-bottom.inc' %]