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