Merge remote-tracking branch 'origin/new/bug_8251'
[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                     [% IF ( loop.odd ) %]
122                     <tr>
123                     [% ELSE %]
124                     <tr class="highlight">
125                     [% END %]
126                         <td>[% loopro.rowtitle_display or "UNKNOWN VALUE" |html %]</td>
127                     [% FOREACH loopcel IN loopro.loopcell %]
128                                                 <td align="center">
129                                                 [% IF ( loopcel.url_complement ) %]<a href="reserves_stats.pl?output=[% loopcel.output %]&amp;[% loopcel.url_complement %]">[% loopcel.value %]</a>[% ELSE %][% loopcel.value %][% END %]
130                                                 </td>
131                     [% END %]
132                                                 <td align="center">[% loopro.totalrow %]</td>
133                     </tr>
134                 [% END %]
135             <tr>
136                 <th>TOTAL</th>
137                 [% FOREACH loopfoote IN mainloo.loopfooter %]
138                 <th>[% loopfoote.totalcol %]</th>
139                 [% END %]
140                 <th>[% mainloo.total %]</th>
141             </tr>
142         </table>
143     [% END %]
144     [% END %]
145 [% ELSE %]
146
147     <form method="post" action="/cgi-bin/koha/reports/reserves_stats.pl">
148     <fieldset class="rows">
149         <legend>Holds statistics</legend><table>
150         <thead>
151             <tr>
152                 <th>Title</th>
153                 <th>Row</th>
154                 <th>Column</th>
155                 <th>Filter</th>
156             </tr>
157         </thead>
158         <tbody>
159                 <tr >
160                 <td>Hold status </td>
161                 <td><input type="radio" name="Line" value="reservestatus" /></td>
162                 <td><input type="radio" name="Column" value="reservestatus" checked="checked" /></td>
163                 <td>
164                                 <input type="checkbox" name="filter_reservestatus_or_1" value="1" /> Asked
165                                 <input type="checkbox" name="filter_reservestatus_or_2" value="2" /> Processing
166                                 <input type="checkbox" name="filter_reservestatus_or_3" value="3" /> Waiting
167                                 <input type="checkbox" name="filter_reservestatus_or_4" value="4" /> Satisfied
168                                 <input type="checkbox" name="filter_reservestatus_or_5" value="5" /> Cancelled
169                                 </td>
170              </tr>
171              <tr class="highlight">
172                 <td>Hold Date</td>
173                 <td><input type="radio" name="Line" value="reservedate" /></td>
174                 <td><input type="radio" name="Column" value="reservedate" /></td>
175                 <td><label for="filter_reservedate_begin">From</label> <input type="text"  size="10" id="filter_reservedate_begin" name="filter_reservedate_begin" />
176                     <label for="filter_reservedate_end">To</label> <input size="10" id="filter_reservedate_end" name="filter_reservedate_end" value="" type="text" />
177                     </td>
178                 </tr>
179             <tr>
180                 <td>Notification Date</td>
181                 <td><input type="radio" name="Line" value="notificationdate" /></td>
182                 <td><input type="radio" name="Column" value="notificationdate" /></td>
183                 <td><label for="filter_notificationdate_begin">From</label> <input type="text"  size="10" id="filter_notificationdate_begin" name="filter_notificationdate_begin" />
184                     <label for="filter_notificationdate_end">To</label> <input  size="10" id="filter_notificationdate_end" name="filter_notificationdate_end" value="" type="text" />
185                     </td>
186              </tr>
187             <tr>
188                 <td>Reminder Date</td>
189                 <td><input type="radio" name="Line" value="reminderdate" /></td>
190                 <td><input type="radio" name="Column" value="reminderdate" /></td>
191                 <td><label for="filter_reminderdate_begin">From</label> <input type="text"  size="10" id="filter_reminderdate_begin" name="Filter" />
192                     <label for="filter_reminderdate_end">To</label> <input size="10" id="filter_reminderdate_end" name="filter_reminderdate_end" value="" type="text" />
193                     </td>
194              </tr>
195             <tr>
196                 <td>Waiting Date</td>
197                 <td><input type="radio" name="Line" value="waitingdate" /></td>
198                 <td><input type="radio" name="Column" value="waitingdate" /></td>
199                 <td><label for="filter_waitingdate_begin">From</label> <input type="text"  size="10" id="filter_waitingdate_begin" name="filter_waitingdate_begin" />
200                     <label for="filter_waitingdate_end">To</label> <input  size="10" id="filter_waitingdate_end" name="filter_waitingdate_end" value="" type="text" />
201                     </td>
202              </tr>
203                          <tr>
204                 <td>Cancellation Date</td>
205                 <td><input type="radio" name="Line" value="cancellationdate" /></td>
206                 <td><input type="radio" name="Column" value="cancellationdate" /></td>
207                 <td><label for="filter_cancellationdate_begin">From</label> <input type="text"  size="10" id="filter_cancellationdate_begin" name="filter_cancellationdate_begin" />
208                     <label for="filter_cancellationdate_end">To</label> <input  size="10" id="filter_cancellationdate_end" name="filter_cancellationdate_end" value="" type="text" />
209                     </td>
210              </tr>
211         <tr>
212             <td>Patron category</td>
213             <td><input type="radio" name="Line" value="borrowers.categorycode" /></td>
214             <td><input type="radio" name="Column" value="borrowers.categorycode" /></td>
215            <td><select name="filter_categorycode" id="borcat">
216                <option value=""> </option>
217                [% FOREACH categoryloo IN categoryloop %]
218                  [% IF ( categoryloo.selected ) %]<option value="[% categoryloo.categorycode %]" selected="selected">[% categoryloo.description %]</option>[% ELSE %]<option value="[% categoryloo.categorycode %]">[% categoryloo.description %]</option>[% END %]
219                [% END %]
220                </select>
221              </td> 
222         </tr>
223         <tr class="highlight">
224             <td>Item type</td>
225             <td><input type="radio" name="Line" value="items.itype" /></td>
226             <td><input type="radio" name="Column" value="items.itype" /></td>
227            <td><select name="filter_items.itype" id="itype">
228                <option value=""> </option>
229                [% FOREACH itypeloo IN itemtypeloop %]
230                  [% IF ( itypeloo.selected ) %]<option value="[% itypeloo.code %]" selected="selected">[% itypeloo.description %]</option>[% ELSE %]<option value="[% itypeloo.code %]">[% itypeloo.description %]</option>[% END %]
231                [% END %]
232                </select>
233              </td> 
234         </tr>
235         <tr>
236             <td>Pickup library</td>
237             <td><input type="radio" name="Line" value="reserves.branchcode" checked="checked" /></td>
238             <td><input type="radio" name="Column" value="reserves.branchcode" /></td>
239             <td><select name="filter_reserves.branchcode" id="resbranchcode">
240                <option value=""> </option>
241                [% FOREACH branchloo IN branchloop %]
242 [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]
243                                 [% END %]
244                </select>
245              </td> 
246         </tr>
247         <tr class="highlight">
248             <td>Holding library</td>
249             <td><input type="radio" name="Line" value="items.holdingbranch" /></td>
250             <td><input type="radio" name="Column" value="items.holdingbranch" /></td>
251             <td><select name="filter_items.holdingbranch" id="holdingbranch">
252                <option value=""> </option>
253                [% FOREACH branchloo IN branchloop %]
254 [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]
255                                 [% END %]
256                </select>
257              </td> 
258         </tr>
259         <tr>
260             <td>Home library</td>
261             <td><input type="radio" name="Line" value="items.homebranch" /></td>
262             <td><input type="radio" name="Column" value="items.homebranch" /></td>
263             <td><select name="filter_items.homebranch" id="homebranch">
264                <option value=""> </option>
265                [% FOREACH branchloo IN branchloop %]
266 [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]
267                                 [% END %]
268                </select>
269              </td> 
270         </tr>
271         <tr class="highlight">
272             <td>Collection</td>
273             <td><input type="radio" name="Line"   value="items.ccode" /></td>
274             <td><input type="radio" name="Column" value="items.ccode" /></td>
275             <td><select name="filter_items.ccode" id="ccode">
276                 <option value=""> </option>
277                 [% FOREACH ccodeloo IN ccodeloop %]
278                                         [% IF ( ccodeloo.selected ) %] <option value="[% ccodeloo.code %]" selected="selected">[% ccodeloo.description %]</option>[% ELSE %]<option value="[% ccodeloo.code %]">[% ccodeloo.description %]</option>[% END %]
279                 [% END %]
280                 </select>
281             </td>
282         </tr>
283         <tr>
284             <td>Shelving location</td>
285             <td><input type="radio" name="Line" value="items.location" /></td>
286             <td><input type="radio" name="Column" value="items.location" /></td>
287             <td><select name="filter_items.location" id="location">
288                 <option value=""> </option>
289                 [% FOREACH locationloo IN locationloop %]
290                                         [% IF ( locationloo.selected ) %]<option value="[% locationloo.code %]" selected="selected">[% locationloo.description %]</option>[% ELSE %]<option value="[% locationloo.code %]">[% locationloo.description %]</option>[% END %]
291                                 [% END %]
292                </select>
293             </td> 
294         </tr>
295         <tr class="highlight">
296             <td>Item call number</td>
297             <td></td>
298             <td></td>
299             <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>
300         </tr>
301         [% IF ( hassort1 ) %]
302         <tr><td>Patron sort 1</td>
303                         <td><input type="radio" name="Line" value="borrowers.sort1" /></td>
304                         <td><input type="radio" name="Column" value="borrowers.sort1" /></td>
305                         <td><select name="filter_borrowers.sort1" id="sort1">
306                <option value=""> </option>
307                [% FOREACH Bsort IN Bsort1 %]
308                            [% IF ( Bsort.selected ) %]<option value="[% Bsort.authorised_value %]" selected="selected">[% Bsort.lib %]</option>[% ELSE %]<option value="[% Bsort.authorised_value %]" >[% Bsort.lib %]</option>[% END %]
309                [% END %]
310                </select>
311             </td> 
312         </tr>
313         [% END %]
314         [% IF ( hassort2 ) %]
315         <tr class="highlight"><td>Patron sort 2</td>
316             <td><input type="radio" name="Line" value="borrowers.sort2" /></td>
317             <td><input type="radio" name="Column" value="borrowers.sort2" /></td>
318                 <td><select name="filter_borrowers.sort2" id="sort2">
319                <option value=""> </option>
320                [% FOREACH Bsort IN Bsort2 %]
321                            [% IF ( Bsort.selected ) %]<option value="[% Bsort.authorised_value %]" selected="selected">[% Bsort.lib %]</option>[% ELSE %]<option value="[% Bsort.authorised_value %]" >[% Bsort.lib %]</option>[% END %]
322                [% END %]
323                </select>
324             </td> 
325         </tr>
326         [% END %]
327         </tbody>
328     </table><br /></fieldset>
329
330 <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>
331             <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>
332                         
333         <fieldset class="rows">
334         <legend>Output</legend>
335 <ol><li><label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" /> </li>
336 <li><label for="outputfile">To a file:</label> <input type="radio" name="output" value="file" id="outputfile" /> <label class="inline" for="basename">Named: </label><input type="text" name="basename" id="basename" value="Export" /> <label class="inline" for="MIME">Into an application  
337                 </label>[% CGIextChoice %]
338                 [% CGIsepChoice %]</li></ol>
339         </fieldset>
340
341         <fieldset class="action">
342         <input type="submit" value="Submit" />
343         <input type="hidden" name="report_name" value="[% report_name %]" />
344         <input type="hidden" name="do_it" value="1" />
345         </fieldset>
346         </form>
347 [% END %]
348
349 </div>
350 </div>
351 <div class="yui-b">
352 [% INCLUDE 'reports-menu.inc' %]
353 </div>
354 </div>
355 [% INCLUDE 'intranet-bottom.inc' %]