Bug 27846: (follow-up) Add id back to breadcrumbs container
[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>Koha &rsaquo; Reports &rsaquo; Holds statistics [% IF ( do_it ) %]&rsaquo; Results[% END %]</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><label for="filter_reservedate_begin">From</label> <input type="text"  size="10" id="filter_reservedate_begin" name="filter_reservedate_begin" />
127                     <label for="filter_reservedate_end">To</label> <input size="10" id="filter_reservedate_end" name="filter_reservedate_end" value="" type="text" />
128                     </td>
129                 </tr>
130             <tr>
131                 <td>Notification date</td>
132                 <td><input type="radio" name="Line" value="notificationdate" /></td>
133                 <td><input type="radio" name="Column" value="notificationdate" /></td>
134                 <td><label for="filter_notificationdate_begin">From</label> <input type="text"  size="10" id="filter_notificationdate_begin" name="filter_notificationdate_begin" />
135                     <label for="filter_notificationdate_end">To</label> <input  size="10" id="filter_notificationdate_end" name="filter_notificationdate_end" value="" type="text" />
136                     </td>
137              </tr>
138             <tr>
139                 <td>Reminder date</td>
140                 <td><input type="radio" name="Line" value="reminderdate" /></td>
141                 <td><input type="radio" name="Column" value="reminderdate" /></td>
142                 <td><label for="filter_reminderdate_begin">From</label> <input type="text"  size="10" id="filter_reminderdate_begin" name="Filter" />
143                     <label for="filter_reminderdate_end">To</label> <input size="10" id="filter_reminderdate_end" name="filter_reminderdate_end" value="" type="text" />
144                     </td>
145              </tr>
146             <tr>
147                 <td>Waiting date</td>
148                 <td><input type="radio" name="Line" value="waitingdate" /></td>
149                 <td><input type="radio" name="Column" value="waitingdate" /></td>
150                 <td><label for="filter_waitingdate_begin">From</label> <input type="text"  size="10" id="filter_waitingdate_begin" name="filter_waitingdate_begin" />
151                     <label for="filter_waitingdate_end">To</label> <input  size="10" id="filter_waitingdate_end" name="filter_waitingdate_end" value="" type="text" />
152                     </td>
153              </tr>
154                          <tr>
155                 <td>Cancellation date</td>
156                 <td><input type="radio" name="Line" value="cancellationdate" /></td>
157                 <td><input type="radio" name="Column" value="cancellationdate" /></td>
158                 <td><label for="filter_cancellationdate_begin">From</label> <input type="text"  size="10" id="filter_cancellationdate_begin" name="filter_cancellationdate_begin" />
159                     <label for="filter_cancellationdate_end">To</label> <input  size="10" id="filter_cancellationdate_end" name="filter_cancellationdate_end" value="" type="text" />
160                     </td>
161              </tr>
162         <tr>
163             <td>Patron category</td>
164             <td><input type="radio" name="Line" value="borrowers.categorycode" /></td>
165             <td><input type="radio" name="Column" value="borrowers.categorycode" /></td>
166            <td><select name="filter_categorycode" id="borcat">
167                <option value=""> </option>
168                [% FOREACH categoryloo IN categoryloop %]
169                  <option value="[% categoryloo.categorycode | html %]">[% categoryloo.description | html %]</option>
170                [% END %]
171                </select>
172              </td> 
173         </tr>
174         <tr>
175             <td>Item type</td>
176             <td><input type="radio" name="Line" value="items.itype" /></td>
177             <td><input type="radio" name="Column" value="items.itype" /></td>
178            <td><select name="filter_items.itype" id="itype">
179                <option value=""> </option>
180                [% FOREACH itemtype IN itemtypes %]
181                  <option value="[% itemtype.itemtype | html %]">[% itemtype.translated_description | html %]</option>
182                [% END %]
183                </select>
184              </td> 
185         </tr>
186         <tr>
187             <td>Pickup library</td>
188             <td><input type="radio" name="Line" value="reserves.branchcode" checked="checked" /></td>
189             <td><input type="radio" name="Column" value="reserves.branchcode" /></td>
190             <td><select name="filter_reserves.branchcode" id="resbranchcode">
191                <option value=""> </option>
192                 [% PROCESS options_for_libraries libraries => Branches.all() %]
193                </select>
194              </td> 
195         </tr>
196         <tr>
197             <td>Holding library</td>
198             <td><input type="radio" name="Line" value="items.holdingbranch" /></td>
199             <td><input type="radio" name="Column" value="items.holdingbranch" /></td>
200             <td><select name="filter_items.holdingbranch" id="holdingbranch">
201                <option value=""> </option>
202                 [% PROCESS options_for_libraries libraries => Branches.all() %]
203                </select>
204              </td> 
205         </tr>
206         <tr>
207             <td>Home library</td>
208             <td><input type="radio" name="Line" value="items.homebranch" /></td>
209             <td><input type="radio" name="Column" value="items.homebranch" /></td>
210             <td><select name="filter_items.homebranch" id="homebranch">
211                 <option value=""> </option>
212                 [% PROCESS options_for_libraries libraries => Branches.all() %]
213                </select>
214              </td> 
215         </tr>
216         <tr>
217             <td>Collection</td>
218             <td><input type="radio" name="Line"   value="items.ccode" /></td>
219             <td><input type="radio" name="Column" value="items.ccode" /></td>
220             <td><select name="filter_items.ccode" id="ccode">
221                 <option value=""> </option>
222                 [% FOREACH ccodeloo IN ccodeloop %]
223                                         [% 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 %]
224                 [% END %]
225                 </select>
226             </td>
227         </tr>
228         <tr>
229             <td>Shelving location</td>
230             <td><input type="radio" name="Line" value="items.location" /></td>
231             <td><input type="radio" name="Column" value="items.location" /></td>
232             <td><select name="filter_items.location" id="location">
233                 <option value=""> </option>
234                 [% FOREACH locationloo IN locationloop %]
235                                         [% 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 %]
236                                 [% END %]
237                </select>
238             </td> 
239         </tr>
240         <tr>
241             <td>Item call number</td>
242             <td></td>
243             <td></td>
244             <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>
245         </tr>
246         [% IF ( hassort1 ) %]
247         <tr><td>Patron sort 1</td>
248                         <td><input type="radio" name="Line" value="borrowers.sort1" /></td>
249                         <td><input type="radio" name="Column" value="borrowers.sort1" /></td>
250                         <td><select name="filter_borrowers.sort1" id="sort1">
251                <option value=""> </option>
252                [% FOREACH Bsort IN Bsort1 %]
253                            [% 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 %]
254                [% END %]
255                </select>
256             </td> 
257         </tr>
258         [% END %]
259         [% IF ( hassort2 ) %]
260         <tr><td>Patron sort 2</td>
261             <td><input type="radio" name="Line" value="borrowers.sort2" /></td>
262             <td><input type="radio" name="Column" value="borrowers.sort2" /></td>
263                 <td><select name="filter_borrowers.sort2" id="sort2">
264                <option value=""> </option>
265                [% FOREACH Bsort IN Bsort2 %]
266                            [% 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 %]
267                [% END %]
268                </select>
269             </td> 
270         </tr>
271         [% END %]
272         </tbody>
273     </table><br /></fieldset>
274
275 <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>
276             <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>
277                         
278         <fieldset class="rows">
279         <legend>Output</legend>
280     <ol>
281         <li>
282             <label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" />
283         </li>
284         <li>
285             <label for="outputfile">To a file:</label> <input type="radio" name="output" value="file" id="outputfile" />
286             <label class="inline" for="basename">Named: </label><input type="text" name="basename" id="basename" value="Export" />
287             <label class="inline" for="MIME">Into an application:</label>
288             <select name="MIME" id="MIME" size="1">
289             [% FOREACH value IN CGIextChoice %]
290                 <option value="[% value | html %]">[% value | html %]</option>
291             [% END %]
292             </select>
293             <select name="sep" id="sep" size="1">
294             [% FOREACH value IN CGIsepChoice.values.sort() %]
295               [% IF ( value == CGIsepChoice.default ) %]
296                 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
297               [% ELSE %]
298                 <option value="[% value | html %]">[% value | html %]</option>
299               [% END %]
300             [% END %]
301             </select>
302         </li>
303     </ol>
304         </fieldset>
305
306         <fieldset class="action">
307         <input type="submit" value="Submit" />
308         <input type="hidden" name="report_name" value="[% report_name | html %]" />
309         <input type="hidden" name="do_it" value="1" />
310         </fieldset>
311         </form>
312 [% END %]
313
314             </main>
315         </div> <!-- /.col-sm-10.col-sm-push-2 -->
316
317         <div class="col-sm-2 col-sm-pull-10">
318             <aside>
319                 [% INCLUDE 'reports-menu.inc' %]
320             </aside>
321         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
322      </div> <!-- /.row -->
323
324 [% MACRO jsinclude BLOCK %]
325     [% INCLUDE 'calendar.inc' %]
326     <script>
327         $(document).ready(function() {
328             // http://jqueryui.com/demos/datepicker/#date-range
329             var dates = $( "#filter_reservedate_begin, #filter_reservedate_end" ).datepicker({
330                 changeMonth: true,
331                 numberOfMonths: 1,
332                 onSelect: function( selectedDate ) {
333                     var option = this.id == "filter_reservedate_begin" ? "minDate" : "maxDate",
334                         instance = $( this ).data( "datepicker" );
335                         date = $.datepicker.parseDate(
336                             instance.settings.dateFormat ||
337                             $.datepicker._defaults.dateFormat,
338                             selectedDate, instance.settings );
339                     dates.not( this ).datepicker( "option", option, date );
340                 }
341             });
342             var datesND = $( "#filter_notificationdate_begin, #filter_notificationdate_end" ).datepicker({
343                 changeMonth: true,
344                 numberOfMonths: 1,
345                 onSelect: function( selectedDate ) {
346                     var option = this.id == "filter_notificationdate_begin" ? "minDate" : "maxDate",
347                         instance = $( this ).data( "datepicker" );
348                         date = $.datepicker.parseDate(
349                             instance.settings.dateFormat ||
350                             $.datepicker._defaults.dateFormat,
351                             selectedDate, instance.settings );
352                     datesND.not( this ).datepicker( "option", option, date );
353                 }
354             });
355             var datesRD = $( "#filter_reminderdate_begin, #filter_reminderdate_end" ).datepicker({
356                 changeMonth: true,
357                 numberOfMonths: 1,
358                 onSelect: function( selectedDate ) {
359                     var option = this.id == "filter_reminderdate_begin" ? "minDate" : "maxDate",
360                         instance = $( this ).data( "datepicker" );
361                         date = $.datepicker.parseDate(
362                             instance.settings.dateFormat ||
363                             $.datepicker._defaults.dateFormat,
364                             selectedDate, instance.settings );
365                     datesRD.not( this ).datepicker( "option", option, date );
366                 }
367             });
368             var datesWD = $( "#filter_waitingdate_begin, #filter_waitingdate_end" ).datepicker({
369                 changeMonth: true,
370                 numberOfMonths: 1,
371                 onSelect: function( selectedDate ) {
372                     var option = this.id == "filter_waitingdate_begin" ? "minDate" : "maxDate",
373                         instance = $( this ).data( "datepicker" );
374                         date = $.datepicker.parseDate(
375                             instance.settings.dateFormat ||
376                             $.datepicker._defaults.dateFormat,
377                             selectedDate, instance.settings );
378                     datesWD.not( this ).datepicker( "option", option, date );
379                 }
380             });
381             var datesCD = $( "#filter_cancellationdate_begin, #filter_cancellationdate_end" ).datepicker({
382                 changeMonth: true,
383                 numberOfMonths: 1,
384                 onSelect: function( selectedDate ) {
385                     var option = this.id == "filter_cancellationdate_begin" ? "minDate" : "maxDate",
386                         instance = $( this ).data( "datepicker" );
387                         date = $.datepicker.parseDate(
388                             instance.settings.dateFormat ||
389                             $.datepicker._defaults.dateFormat,
390                             selectedDate, instance.settings );
391                     datesCD.not( this ).datepicker( "option", option, date );
392                 }
393             });
394         });
395     </script>
396 [% END %]
397
398 [% INCLUDE 'intranet-bottom.inc' %]