Bug 34571: Remove use of "onclick" for ExpandField in cataloguing editors
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / reports / borrowers_stats.tt
1 [% USE raw %]
2 [% USE Branches %]
3 [% USE Koha %]
4 [% USE Asset %]
5 [% SET footerjs = 1 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>[% IF ( do_it ) %]Patrons statistics &rsaquo; Results[% ELSE %]Patrons statistics[% END %] &rsaquo; Reports &rsaquo; Koha</title>
8
9 [% INCLUDE 'doc-head-close.inc' %]
10 <style>
11         .sql {display:none;}
12         .debug {display:none;}
13 </style>
14 </head>
15
16 <body id="rep_borrowers_stats" class="rep">
17 [% WRAPPER 'header.inc' %]
18     [% INCLUDE 'cat-search.inc' %]
19 [% END %]
20
21 [% WRAPPER 'sub-header.inc' %]
22     [% WRAPPER breadcrumbs %]
23         [% WRAPPER breadcrumb_item %]
24             <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>
25         [% END %]
26         [% IF ( do_it ) %]
27             [% WRAPPER breadcrumb_item %]
28                 <a href="/cgi-bin/koha/reports/borrowers_stats.pl">Patrons statistics</a>
29             [% END %]
30             [% WRAPPER breadcrumb_item bc_active= 1 %]
31                 <span>Results</span>
32             [% END %]
33         [% ELSE %]
34             [% WRAPPER breadcrumb_item bc_active= 1 %]
35                 <span>Patrons statistics</span>
36             [% END %]
37         [% END %]
38     [% END #/ WRAPPER breadcrumbs %]
39 [% END #/ WRAPPER sub-header.inc %]
40
41 <div class="main container-fluid">
42     <div class="row">
43         <div class="col-sm-10 col-sm-push-2">
44             <main>
45
46 <h1>Patrons statistics</h1>
47 [% IF ( do_it ) %]
48         [% FOREACH mainloo IN mainloop %]
49         [% IF ( mainloo.loopfilter.size>0 ) %]
50             <p>Filtered on:</p>
51                         [% FOREACH loopfilte IN mainloo.loopfilter %]
52                                 <p>
53                                         [% loopfilte.crit | html %] = [% loopfilte.filter | html %]
54                                 </p>
55                         [% END %]
56                 [% END %]
57                 <table>
58                         <tr>
59                                 <th>[% mainloo.line | html %] / [% mainloo.column | html %]</th>
60                                 [% FOREACH loopco IN mainloo.loopcol %]
61                                         <th>[% IF ( loopco.coltitle_display ) %][% loopco.coltitle_display | html %][% ELSE %][% loopco.coltitle | html %][% END %]
62                                         </th>
63                                 [% END %]
64                                 <th>TOTAL</th>
65                         </tr>
66                                 [% FOREACH loopro IN mainloo.looprow %]
67                     <tr>
68                                                 <td>[% IF ( loopro.rowtitle_display ) %][% loopro.rowtitle_display | html %][% ELSE %][% loopro.rowtitle | html %][% END %]
69                                                 </td>
70                                                 [% FOREACH loopcel IN loopro.loopcell %]
71                                                 <td>[% IF ( loopcel.value ) %][% loopcel.value | html %][% ELSE %]&nbsp;[% END %]
72                                                 </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/borrowers_stats.pl">
89         <fieldset class="rows"><legend>Patrons statistics</legend>
90         <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>Patron category</td>
102                         <td><input type="radio" name="Line" value="categorycode" /></td>
103             <td><input type="radio" checked="checked" name="Column" value="categorycode" /></td>
104             <td>
105                 <select name="Filter" id="catcode">
106                     <option value=""></option>
107                     [% FOREACH patron_category IN patron_categories %]
108                         <option value="[% patron_category.categorycode | html %]">[% patron_category.description | html %]</option>
109                     [% END %]
110                 </select>
111             </td>
112                         </tr>
113                         <tr>
114                         <td>Patron status</td>
115                         <td colspan="2"></td>
116                         <td ><select name="status"><option value=""> </option><option value="debarred">restricted</option><option value="gonenoadress">gone no address</option><option value="lost">lost</option></select></td>
117                         </tr>
118             <tr>
119                         <td>Patron activity</td>
120                         <td colspan="2"><select name="period" id="period">
121                         <option value="1">1</option>
122                         <option value="2">2</option>
123                         <option value="3">3</option>
124                         </select>
125                         <label for="period">years of activity</label> 
126                         </td>
127                         <td><select name="activity"><option value=""> </option><option value="active">active</option><option value="nonactive">no active</option></select></td>
128                         </tr>
129
130                         <tr>
131             <td rowspan="2">ZIP/Postal code</td>
132                         <td><input type="radio" name="Line" value="zipcode" /></td>
133                         <td><input type="radio" name="Column" value="zipcode" /></td>
134             <td><select name="Filter" id="zipcode">
135                                 <option value=""> </option>
136                                 [% FOREACH ZIP_LOO IN ZIP_LOOP %]
137                                 <option value="[% ZIP_LOO.zipcode | html %]">[% ZIP_LOO.zipcode | html %]</option>
138                                 [% END %]
139                                 </select>
140                         </td>
141                         </tr>
142                         <tr>
143                         <td colspan="2"><select name="digits" id="digits">
144                         <option value=""> </option>
145                         <option value ="1">1</option>
146                         <option value ="2">2</option>
147                         <option value ="3">3</option>
148                         <option value ="4">4</option>
149                         <option value ="5">5</option>
150                         <option value ="6">6</option>
151                         <option value ="7">7</option>
152                         <option value ="8">8</option>
153                         <option value ="9">9</option>
154                         <option value ="10">10</option>
155                         </select>
156                         <label for="digits">digits</label> 
157                         </td>
158                         <td>&nbsp;</td>
159                         </tr>
160
161             <tr>
162                         <td>Library</td>
163             <td><input type="radio" checked="checked" name="Line"   value="branchcode" /></td>
164                         <td><input type="radio" name="Column" value="branchcode" /></td>
165                         <td>
166                 <select name="Filter" id="branch">
167                 <option value=""></option>
168                 [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
169                     <option value="[% l.branchcode | html %]">[% l.branchcode | html %] - [% l.branchname || 'UNKNOWN' | html %]</option>
170                 [% END %]
171                 </select>
172                         </td>
173                         </tr>
174                     <tr>
175                 <td>Date of birth</td>
176                 <td colspan="2"></td>
177                 <td>
178                     <label for="from">From</label>
179                     <input type="text" size="10" id="from" name="Filter" class="flatpickr"data-date_to="to" />
180                     <label for="to">To</label>
181                     <input size="10" id="to" name="Filter" value="" type="text" class="flatpickr" />
182                     <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
183                 </td>
184             </tr>
185             <tr>
186                 <td>Gender</td>
187                 <td><input type="radio" name="Line" value="sex" /></td>
188                 <td><input type="radio" name="Column" value="sex" /></td>
189                 <td>
190                     <select id="sex" name="Filter">
191                         <option value="" />
192                         <option value="M">Men</option>
193                         <option value="F">Women</option>
194                     </select>
195                 </td>
196             </tr>
197                         [% IF ( SORT1_LOOP ) %]
198                 <tr>
199                                 <td>Sort1</td>
200                                 <td><input type="radio" name="Line" value="sort1" /></td>
201                                 <td><input type="radio" name="Column" value="sort1" /></td>
202                                 <td>
203                     <select id="sort1" name="Filter">
204                                         <option value=""/>
205                                         [% FOREACH SORT1_LOO IN SORT1_LOOP %]
206                                                 <option value="[% SORT1_LOO.authorized_value | html %]">[% SORT1_LOO.lib | html %]</option>
207                                         [% END %]
208                                         </select>
209                                 </td>
210                                 </tr>
211             [% ELSE %]
212                 <input type="hidden" name="Filter" />
213                         [% END %]
214                         [% IF ( SORT2_LOOP ) %]
215                 <tr>
216                                 <td>Sort2</td>
217                                 <td><input type="radio" name="Line" value="sort2" /></td>
218                                 <td><input type="radio" name="Column" value="sort2" /></td>
219                                 <td>
220                     <select id="sort2" name="Filter">
221                                         <option value=""/>
222                                         [% FOREACH SORT2_LOO IN SORT2_LOOP %]
223                                                 <option value="[% SORT2_LOO.value | html %]">[% SORT2_LOO.value | html %]</option>
224                                         [% END %]
225                                         </select>
226                                 </td>
227                                 </tr>
228             [% ELSE %]
229                 <input type="hidden" name="Filter" />
230                         [% END %]
231             [% IF Koha.Preference('ExtendedPatronAttributes') %]
232                 <tr>
233                     <th colspan="4">Patron attributes</th>
234                 </tr>
235             [% FOREACH pa_loo IN patron_attributes %]
236                 [% IF (pa_loo.class) %]
237                     <tr>
238                         <th>[% pa_loo.class | html %] ([% pa_loo.lib | html %])</th>
239                         <th colspan="3"></th>
240                     </tr>
241                 [% END %]
242             [% FOREACH patron_attribute IN pa_loo.items %]
243                 <tr data-category_code="[% patron_attribute.category_code | html %]">
244                     <td>
245                         [% patron_attribute.code | html %]
246                         ([% patron_attribute.description | html %])
247                     </td>
248                     <td>
249                         <input type="radio" name="Line"
250                             value="patron_attr.[% patron_attribute.code | html %]" />
251                     </td>
252                     <td>
253                         <input type="radio" name="Column"
254                             value="patron_attr.[% patron_attribute.code | html %]" />
255                     </td>
256                     <td>
257                         [% IF ( patron_attribute.use_dropdown ) %]
258                             <select name="Filter_patron_attr.[% patron_attribute.code | html %]"  >
259                                 <option value="" />
260                                 [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
261                                     <option value="[% auth_val_loo.authorised_value | html %]" >
262                                         [% auth_val_loo.lib | html %]
263                                     </option>
264                                 [% END %]
265                             </select>
266                         [% ELSE %]
267                             <input type="text" maxlength="64"
268                                    name="Filter_patron_attr.[% patron_attribute.code | html %]" />
269                         [% END %]
270                     </td>
271                 </tr>
272             [% END %]
273             [% END %]
274             [% END %]
275         </tbody>
276     </table>
277     </fieldset>
278
279         
280         <fieldset class="rows">
281         <legend>Output</legend>
282     <ol>
283         <li>
284             <label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" />
285         </li>
286         <li>
287             <label for="outputfile">To a file:</label> <input type="radio" name="output" value="file" id="outputfile" />
288             <label class="inline" for="basename">Named: </label><input type="text" name="basename" id="basename" value="Export" />
289             <label class="inline" for="MIME">Into an application:</label>
290             <select name="MIME" id="MIME">
291             [% FOREACH value IN CGIextChoice %]
292                 <option value="[% value | html %]">[% value | html %]</option>
293             [% END %]
294             </select>
295             <select name="sep" id="sep">
296             [% FOREACH value IN CGIsepChoice.values.sort() %]
297               [% IF ( value == CGIsepChoice.default ) %]
298                 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
299               [% ELSE %]
300                 <option value="[% value | html %]">[% value | html %]</option>
301               [% END %]
302             [% END %]
303             </select>
304         </li>
305     </ol>
306         </fieldset>
307
308         <fieldset class="action">
309     <input type="submit" class="btn btn-primary" value="Submit" />
310         <input type="hidden" name="report_name" value="[% report_name | html %]" />
311         <input type="hidden" name="do_it" value="1" />
312         </fieldset>
313         </form>
314 [% END %]
315
316             </main>
317         </div> <!-- /.col-sm-10.col-sm-push-2 -->
318
319         <div class="col-sm-2 col-sm-pull-10">
320             <aside>
321                 [% INCLUDE 'reports-menu.inc' %]
322             </aside>
323         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
324      </div> <!-- /.row -->
325
326 [% MACRO jsinclude BLOCK %]
327     [% INCLUDE 'calendar.inc' %]
328 [% END %]
329
330 [% INCLUDE 'intranet-bottom.inc' %]