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