Bug 19663: Move JS to the footer: Reports
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / reports / issues_stats.tt
1 [% USE Branches %]
2 [% SET footerjs = 1 %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Reports &rsaquo; Circulation statistics [% IF ( do_it ) %]&rsaquo; Results[% END %]</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 <style type="text/css">
7         .sql {display:none;}
8 </style>
9 </head>
10
11 <body id="rep_issues_stats" class="rep">
12 [% INCLUDE 'header.inc' %]
13 [% INCLUDE 'cat-search.inc' %]
14
15 <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/issues_stats.pl">Circulation statistics</a> &rsaquo; Results [% ELSE %]&rsaquo; Circulation statistics[% END %]</div>
16
17 <div id="doc3" class="yui-t2">
18
19    <div id="bd">
20         <div id="yui-main">
21         <div class="yui-b">
22
23 [% IF ( do_it ) %]
24     [% FOREACH mainloo IN mainloop %]
25         <h1>Circulation statistics</h1>
26         [% IF ( mainloo.loopfilter ) %]
27             <p>Filtered on:</p>
28             <ul>
29             [% FOREACH loopfilte IN mainloo.loopfilter %]
30                 [% IF ( loopfilte.err ) %]
31                     <li class="error">Error:
32                 [% ELSIF ( loopfilte.sql ) %]
33                     <li class="sql">
34                 [% ELSE %]
35                     <li>
36                 [% END %]
37                 [% SWITCH loopfilte.crit %]
38                     [% CASE 0 %]Period From
39                     [% CASE 1 %]Period To
40                     [% CASE 2 %]Patron Category =
41                     [% CASE 3 %]Item Type =
42                     [% CASE 4 %]Issuing library =
43                     [% CASE 5 %]Collection =
44                     [% CASE 6 %]Location =
45                     [% CASE 7 %]Item call number &gt;=
46                     [% CASE 8 %]Item call number &lt;
47                     [% CASE 9 %]Patron sort1 =
48                     [% CASE 10 %]Patron sort2 =
49                     [% CASE 11 %]Home library =
50                     [% CASE 12 %]Holding library =
51                     [% CASE 13 %]Patron library =
52                     [% CASE 14 %]Issuing library =
53                     [% CASE %][% loopfilte.crit %] =
54                 [% END %]
55                 [% loopfilte.filter %]
56                                 </li>
57             [% END %]
58             </ul>
59         [% END %]
60         
61         <table> 
62             <tr>
63                 <th>[% mainloo.line %] / [% mainloo.column %]</th>
64                 [% FOREACH loopco IN mainloo.loopcol %]
65                     <th>[% loopco.coltitle_display |html %]</th>
66                 [% END %]
67                 <th>TOTAL</th>
68                 </tr>
69                 [% FOREACH loopro IN mainloo.looprow %]
70                     <tr>
71                         <td>[% loopro.rowtitle_display or "UNKNOWN VALUE" |html %]</td>
72                     [% FOREACH loopcel IN loopro.loopcell %]
73                                                 <td>[% loopcel.value || 0 %]</td>
74                     [% END %]
75                                                 <td>[% loopro.totalrow %]</td>
76                     </tr>
77                 [% END %]
78             <tr>
79                 <th>TOTAL</th>
80                 [% FOREACH loopfoote IN mainloo.loopfooter %]
81                 <th>[% loopfoote.totalcol %]</th>
82                 [% END %]
83                 <th>[% mainloo.total %]</th>
84             </tr>
85         </table>
86     [% END %]
87 [% ELSE %]
88
89     <form method="post" action="/cgi-bin/koha/reports/issues_stats.pl">
90     <fieldset class="rows">
91         <legend>Circulation statistics</legend><table>
92         <thead>
93             <tr>
94                 <th>Title</th>
95                 <th>Row</th>
96                 <th>Column</th>
97                 <th>Filter</th>
98             </tr>
99         </thead>
100         <tbody>
101             <tr>
102                 <td>Period</td>
103                 <td><input type="radio" name="Line" value="datetime" /></td>
104                 <td><input type="radio" name="Column" value="datetime" /></td>
105                 <td><label for="from">From</label> <input type="text" size="10" id="from" name="Filter" class="datepickerfrom" />
106                     <label for="to">To</label> <input size="10" id="to" name="Filter" value="" type="text" class="datepickerto" />
107                     <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
108                     </td>
109                 </tr>
110             <tr>
111                 <td><label for="PeriodTypeSel">Type:</label><select name="PeriodTypeSel" id="PeriodTypeSel">
112                     <option value ="issue">Checkout</option>
113                     <option value ="renew">Renewal</option>
114                     <option value ="return">Checkin</option>
115                     <option value ="localuse">Local Use</option>
116                     </select></td>
117                 <td colspan="2"><label for="DisplayBy">group by</label> <select name="DisplayBy" id="DisplayBy">
118                     <option value="">None</option>
119                     <option value ="4">Hour</option>
120                     <option value ="1">Day of week</option>
121                     <option value ="2">Month</option>
122                     <option value ="3">Year</option>
123                     </select>
124                 </td>
125                 <td>
126                     <label for="PeriodDaySel">Select day: </label><select name="PeriodDaySel" id="PeriodDaySel">
127                     <option value =""></option>
128                     <option value ="Monday">Monday</option>
129                     <option value ="Tuesday">Tuesday</option>
130                     <option value ="Wednesday">Wednesday</option>
131                     <option value ="Thursday">Thursday</option>
132                     <option value ="Friday">Friday</option>
133                     <option value ="Saturday">Saturday</option>
134                     <option value ="Sunday">Sunday</option>
135                     </select>
136                     <label for="PeriodMonthSel">Select month:</label> <select name="PeriodMonthSel" id="PeriodMonthSel">
137                     <option value =""></option>
138                     <option value ="January">January</option>
139                     <option value ="February">February</option>
140                     <option value ="March">March</option>
141                     <option value ="April">April</option>
142                     <option value ="May">May</option>
143                     <option value ="June">June</option>
144                     <option value ="July">July</option>
145                     <option value ="August">August</option>
146                     <option value ="September">September</option>
147                     <option value ="October">October</option>
148                     <option value ="November">November</option>
149                     <option value ="December">December</option>
150                     </select>
151                 </td>
152         </tr>
153         <tr>
154             <td>Patron category</td>
155             <td><input type="radio" name="Line" value="borrowers.categorycode" /></td>
156             <td><input type="radio" name="Column" value="borrowers.categorycode" /></td>
157            <td><select name="Filter" id="borcat">
158                <option value=""> </option>
159                [% FOREACH categoryloo IN categoryloop %]
160                  <option value="[% categoryloo.categorycode %]">[% categoryloo.description %]</option>
161                [% END %]
162                </select>
163              </td> 
164         </tr>
165         <tr>
166             <td>Item type</td>
167             <td><input type="radio" name="Line" value="itemtype" /></td>
168             <td><input type="radio" name="Column" value="itemtype" /></td>
169            <td><select name="Filter" id="itemtype">
170                <option value=""> </option>
171                [% FOREACH itemtype IN itemtypes %]
172                  <option value="[% itemtype.itemtype %]">[% itemtype.translated_description %]</option>
173                [% END %]
174                </select>
175              </td> 
176         </tr>
177         <tr>
178             <td>Issuing library</td>
179             <td><input type="radio" name="Line" value="branch" /></td>
180             <td><input type="radio" name="Column" value="branch" /></td>
181             <td><select name="Filter" id="branch">
182                 <option value=""> </option>
183                 [% PROCESS options_for_libraries libraries => Branches.all() %]
184                </select>
185              </td> 
186         </tr>
187         <tr>
188             <td>Collection</td>
189             <td><input type="radio" name="Line"   value="items.ccode" /></td>
190             <td><input type="radio" name="Column" value="items.ccode" /></td>
191             <td><select name="Filter" id="ccode">
192                 <option value=""> </option>
193                 [% FOREACH ccodeloo IN ccodeloop %]
194                     <option value="[% ccodeloo.code %]">[% ccodeloo.description %]</option>
195                 [% END %]
196                 </select>
197             </td>
198         </tr>
199         <tr>
200             <td>Shelving location</td>
201             <td><input type="radio" name="Line" value="items.location" /></td>
202             <td><input type="radio" name="Column" value="items.location" /></td>
203             <td><select name="Filter" id="location">
204                 <option value=""> </option>
205                 [% FOREACH locationloo IN locationloop %]
206                     <option value="[% locationloo.code %]">[% locationloo.description %]</option>
207                 [% END %]
208                </select>
209             </td> 
210         </tr>
211         <tr>
212             <td>Item call number</td>
213             <td></td>
214             <td></td>
215             <td>From <input type="text" name="Filter" size="10" /> (inclusive) to <input type="text" name="Filter" size="10" /> (exclusive) </td>
216         </tr>
217         [% IF ( hassort1 ) %]
218         <tr><td>Patron sort 1</td>
219                         <td><input type="radio" name="Line" value="borrowers.sort1" /></td>
220                         <td><input type="radio" name="Column" value="borrowers.sort1" /></td>
221                         <td><select name="Filter" id="sort1">
222                <option value=""> </option>
223                [% FOREACH Bsort IN Bsort1 %]
224                 <option value="[% Bsort.authorised_value %]" >[% Bsort.lib %]</option>
225                [% END %]
226                </select>
227             </td> 
228         </tr>
229         [% END %]
230         [% IF ( hassort2 ) %]
231         <tr><td>Patron sort 2</td>
232             <td><input type="radio" name="Line" value="borrowers.sort2" /></td>
233             <td><input type="radio" name="Column" value="borrowers.sort2" /></td>
234                 <td><select name="Filter" id="sort2">
235                <option value=""> </option>
236                [% FOREACH Bsort IN Bsort2 %]
237                    <option value="[% Bsort.authorised_value %]" >[% Bsort.lib %]</option>
238                [% END %]
239                </select>
240             </td> 
241         </tr>
242         [% END %]
243         <tr><td>Home library</td>
244             <td><input type="radio" name="Line" value="items.homebranch" /></td>
245             <td><input type="radio" name="Column" value="items.homebranch" /></td>
246             <td><select name="Filter" id="homebranch">
247                     <option value=""> </option>
248                     [% PROCESS options_for_libraries libraries => Branches.all() %]
249                 </select>
250             </td>
251         </tr>
252
253         <tr><td>Holding library</td>
254             <td><input type="radio" name="Line" value="items.holdingbranch" /></td>
255             <td><input type="radio" name="Column" value="items.holdingbranch" /></td>
256             <td><select name="Filter" id="holdingbranch">
257                     <option value=""> </option>
258                     [% PROCESS options_for_libraries libraries => Branches.all() %]
259                 </select>
260             </td>
261         </tr>
262         <tr>
263             <td>Patron library</td>
264             <td><input type="radio" name="Line" value="borrowers.branchcode" /></td>
265             <td><input type="radio" name="Column" value="borrowers.branchcode" /></td>
266             <td>
267                 <select name="Filter" id="patronbranch">
268                     <option value="">&nbsp;</option>
269                     [% FOREACH branch IN branchloop %]
270                         <option value="[% branch.value %]">
271                             [% branch.branchname %]
272                         </option>
273                     [% END %]
274                 </select>
275             </td>
276         </tr>
277         [% IF (attribute_types_by_class.keys.size) %]
278             <tr>
279                 <th colspan="4">Patron attributes</th>
280             </tr>
281             [% FOREACH class IN attribute_types_by_class.keys.sort %]
282                 [% IF (class) %]
283                 <tr>
284                     <th>[% class %]</th>
285                     <th colspan="3"></th>
286                 </tr>
287                 [% END %]
288                 [% FOREACH attr_type IN attribute_types_by_class.$class %]
289                     <tr>
290                         <td>[% attr_type.description %]</td>
291                         <td><input type="radio" name="Line" value="borrower_attributes.[% attr_type.code %]" /> </td>
292                         <td><input type="radio" name="Column" value="borrower_attributes.[% attr_type.code %]" /> </td>
293                         <td>
294                             [% IF attr_type.authorised_value_category %]
295                                 <select name="Filter_borrower_attributes.[% attr_type.code %]">
296                                     <option value="">&nbsp;</option>
297                                     [% FOREACH av IN attr_type.authorised_values %]
298                                         <option value="[% av.authorised_value %]">
299                                             [% av.lib %]
300                                         </option>
301                                     [% END %]
302                                 </select>
303                             [% ELSE %]
304                                 <input type="text" name="Filter_borrower_attributes.[% attr_type.code %]" />
305                             [% END %]
306                         </td>
307                     </tr>
308                 [% END %]
309             [% END %]
310         [% END %]
311
312         </tbody>
313     </table><br /></fieldset>
314
315 <fieldset class="rows">
316     <legend>Cell value</legend>
317     <ol>
318         <li>
319             <label for="cellvalue1">Count total items:</label>
320             <input type="radio" name="Cellvalue" value="1" id="cellvalue1" checked="checked" />
321         </li>
322         <li>
323             <label for="cellvalue3">Count unique items:</label>
324             <input type="radio" name="Cellvalue" id="cellvalue3" value="3" />
325         </li>
326         <li>
327             <label for="cellvalue5">Count unique biblios:</label>
328             <input type="radio" name="Cellvalue" id="cellvalue5" value="5" />
329         </li>
330     </ol>
331 </fieldset>
332                         
333         <fieldset class="rows">
334         <legend>Output</legend>
335     <ol>
336         <li>
337             <label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" />
338         </li>
339         <li>
340             <label for="outputfile">To a file:</label> <input type="radio" name="output" value="file" id="outputfile" />
341             <label class="inline" for="basename">Named: </label><input type="text" name="basename" id="basename" value="Export" />
342             <label class="inline" for="MIME">Into an application:</label>
343             <select name="MIME" id="MIME" size="1">
344             [% FOREACH value IN CGIextChoice %]
345                 <option value="[% value %]">[% value %]</option>
346             [% END %]
347             </select>
348             <select name="sep" id="sep" size="1">
349             [% FOREACH value IN CGIsepChoice.values.sort() %]
350               [% IF ( value == CGIsepChoice.default ) %]
351                 <option value="[% value %]" selected="selected">[% value %]</option>
352               [% ELSE %]
353                 <option value="[% value %]">[% value %]</option>
354               [% END %]
355             [% END %]
356             </select>
357         </li>
358     </ol>
359         </fieldset>
360
361         <fieldset class="action">
362         <input type="submit" value="Submit" />
363         <input type="hidden" name="report_name" value="[% report_name %]" />
364         <input type="hidden" name="do_it" value="1" />
365         </fieldset>
366         </form>
367 [% END %]
368
369 </div>
370 </div>
371 <div class="yui-b">
372 [% INCLUDE 'reports-menu.inc' %]
373 </div>
374 </div>
375
376 [% MACRO jsinclude BLOCK %]
377     [% INCLUDE 'calendar.inc' %]
378 [% END %]
379
380 [% INCLUDE 'intranet-bottom.inc' %]