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