View | Details | Raw Unified | Return to bug 33452
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt (-270 / +290 lines)
Lines 16-23 Link Here
16
16
17
[% INCLUDE 'doc-head-close.inc' %]
17
[% INCLUDE 'doc-head-close.inc' %]
18
<style>
18
<style>
19
	.sql {display:none;}
19
    .sql {display:none;}
20
	.debug {display:none;}
20
    .debug {display:none;}
21
</style>
21
</style>
22
</head>
22
</head>
23
23
Lines 50-326 Link Here
50
    <div class="row">
50
    <div class="row">
51
        <div class="col-sm-10 col-sm-push-2">
51
        <div class="col-sm-10 col-sm-push-2">
52
            <main>
52
            <main>
53
53
                <h1>Patrons statistics</h1>
54
<h1>Patrons statistics</h1>
54
                [% IF ( do_it ) %]
55
[% IF ( do_it ) %]
55
                    [% FOREACH mainloo IN mainloop %]
56
	[% FOREACH mainloo IN mainloop %]
56
                        [% IF ( mainloo.loopfilter.size>0 ) %]
57
        [% IF ( mainloo.loopfilter.size>0 ) %]
57
                            <p>Filtered on:</p>
58
            <p>Filtered on:</p>
58
                            [% FOREACH loopfilte IN mainloo.loopfilter %]
59
			[% FOREACH loopfilte IN mainloo.loopfilter %]
59
                                <p>
60
				<p>
60
                                    [% loopfilte.crit | html %] = [% loopfilte.filter | html %]
61
					[% loopfilte.crit | html %] = [% loopfilte.filter | html %]
61
                                </p>
62
				</p>
62
                            [% END %]
63
			[% END %]
64
		[% END %]
65
		<table>
66
			<tr>
67
				<th>[% mainloo.line | html %] / [% mainloo.column | html %]</th>
68
				[% FOREACH loopco IN mainloo.loopcol %]
69
					<th>[% IF ( loopco.coltitle_display ) %][% loopco.coltitle_display | html %][% ELSE %][% loopco.coltitle | html %][% END %]
70
					</th>
71
				[% END %]
72
				<th>TOTAL</th>
73
			</tr>
74
				[% FOREACH loopro IN mainloo.looprow %]
75
                    <tr>
76
						<td>[% IF ( loopro.rowtitle_display ) %][% loopro.rowtitle_display | html %][% ELSE %][% loopro.rowtitle | html %][% END %]
77
						</td>
78
						[% FOREACH loopcel IN loopro.loopcell %]
79
						<td>[% IF ( loopcel.value ) %][% loopcel.value | html %][% ELSE %]&nbsp;[% END %]
80
						</td>
81
						[% END %]
82
						<td>[% loopro.totalrow | html %]</td>
83
					</tr>
84
				[% END %]
85
				<tr>
86
					<th>TOTAL</th>
87
					[% FOREACH loopfoote IN mainloo.loopfooter %]
88
						<th>[% loopfoote.totalcol | html %]</th>
89
					[% END %]
90
					<th>[% mainloo.total | html %]</th>
91
				</tr>
92
		</table>
93
	[% END %]
94
[% ELSE %]
95
96
	<form method="post" action="/cgi-bin/koha/reports/borrowers_stats.pl">
97
	<fieldset class="rows"><legend>Patrons statistics</legend>
98
	<table>
99
		<thead>
100
			<tr>
101
			<th>Title</th>
102
			<th>Row</th>
103
			<th>Column</th>
104
			<th>Filter</th>
105
			</tr>
106
		</thead>
107
		<tbody>
108
            <tr>
109
			<td>Patron category</td>
110
			<td><input type="radio" name="Line" value="categorycode" /></td>
111
            <td><input type="radio" checked="checked" name="Column" value="categorycode" /></td>
112
            <td>
113
                <select name="Filter" id="catcode">
114
                    <option value=""></option>
115
                    [% FOREACH patron_category IN patron_categories %]
116
                        <option value="[% patron_category.categorycode | html %]">[% patron_category.description | html %]</option>
117
                    [% END %]
118
                </select>
119
            </td>
120
			</tr>
121
			<tr>
122
			<td>Patron status</td>
123
			<td colspan="2"></td>
124
			<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>
125
			</tr>
126
            <tr>
127
			<td>Patron activity</td>
128
			<td colspan="2"><select name="period" id="period">
129
			<option value="1">1</option>
130
			<option value="2">2</option>
131
			<option value="3">3</option>
132
			</select>
133
			<label for="period">years of activity</label> 
134
			</td>
135
			<td><select name="activity"><option value=""> </option><option value="active">active</option><option value="nonactive">no active</option></select></td>
136
			</tr>
137
138
			<tr>
139
            <td rowspan="2">ZIP/Postal code</td>
140
			<td><input type="radio" name="Line" value="zipcode" /></td>
141
			<td><input type="radio" name="Column" value="zipcode" /></td>
142
            <td><select name="Filter" id="zipcode">
143
				<option value=""> </option>
144
				[% FOREACH ZIP_LOO IN ZIP_LOOP %]
145
				<option value="[% ZIP_LOO.zipcode | html %]">[% ZIP_LOO.zipcode | html %]</option>
146
				[% END %]
147
				</select>
148
			</td>
149
			</tr>
150
			<tr>
151
			<td colspan="2"><select name="digits" id="digits">
152
			<option value=""> </option>
153
			<option value ="1">1</option>
154
			<option value ="2">2</option>
155
			<option value ="3">3</option>
156
			<option value ="4">4</option>
157
			<option value ="5">5</option>
158
			<option value ="6">6</option>
159
			<option value ="7">7</option>
160
			<option value ="8">8</option>
161
			<option value ="9">9</option>
162
			<option value ="10">10</option>
163
			</select>
164
			<label for="digits">digits</label> 
165
			</td>
166
			<td>&nbsp;</td>
167
			</tr>
168
169
            <tr>
170
			<td>Library</td>
171
            <td><input type="radio" checked="checked" name="Line"   value="branchcode" /></td>
172
			<td><input type="radio" name="Column" value="branchcode" /></td>
173
			<td>
174
                <select name="Filter" id="branch">
175
                <option value=""></option>
176
                [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
177
                    <option value="[% l.branchcode | html %]">[% l.branchcode | html %] - [% l.branchname || 'UNKNOWN' | html %]</option>
178
                [% END %]
179
                </select>
180
			</td>
181
			</tr>
182
		    <tr>
183
                <td>Date of birth</td>
184
                <td colspan="2"></td>
185
                <td>
186
                    <label for="from">From</label>
187
                    <input type="text" size="10" id="from" name="Filter" class="flatpickr"data-date_to="to" />
188
                    <label for="to">To</label>
189
                    <input size="10" id="to" name="Filter" value="" type="text" class="flatpickr" />
190
                    <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
191
                </td>
192
            </tr>
193
            <tr>
194
                <td>Gender</td>
195
                <td><input type="radio" name="Line" value="sex" /></td>
196
                <td><input type="radio" name="Column" value="sex" /></td>
197
                <td>
198
                    <select id="sex" name="Filter">
199
                        <option value="" />
200
                        <option value="M">Men</option>
201
                        <option value="F">Women</option>
202
                    </select>
203
                </td>
204
            </tr>
205
			[% IF ( SORT1_LOOP ) %]
206
                <tr>
207
				<td>Sort1</td>
208
				<td><input type="radio" name="Line" value="sort1" /></td>
209
				<td><input type="radio" name="Column" value="sort1" /></td>
210
				<td>
211
                    <select id="sort1" name="Filter">
212
					<option value=""/>
213
					[% FOREACH SORT1_LOO IN SORT1_LOOP %]
214
						<option value="[% SORT1_LOO.authorized_value | html %]">[% SORT1_LOO.lib | html %]</option>
215
					[% END %]
216
					</select>
217
				</td>
218
				</tr>
219
            [% ELSE %]
220
                <input type="hidden" name="Filter" />
221
			[% END %]
222
			[% IF ( SORT2_LOOP ) %]
223
                <tr>
224
				<td>Sort2</td>
225
				<td><input type="radio" name="Line" value="sort2" /></td>
226
				<td><input type="radio" name="Column" value="sort2" /></td>
227
				<td>
228
                    <select id="sort2" name="Filter">
229
					<option value=""/>
230
					[% FOREACH SORT2_LOO IN SORT2_LOOP %]
231
						<option value="[% SORT2_LOO.value | html %]">[% SORT2_LOO.value | html %]</option>
232
					[% END %]
233
					</select>
234
				</td>
235
				</tr>
236
            [% ELSE %]
237
                <input type="hidden" name="Filter" />
238
			[% END %]
239
            [% IF Koha.Preference('ExtendedPatronAttributes') %]
240
                <tr>
241
                    <th colspan="4">Patron attributes</th>
242
                </tr>
243
            [% FOREACH pa_loo IN patron_attributes %]
244
                [% IF (pa_loo.class) %]
245
                    <tr>
246
                        <th>[% pa_loo.class | html %] ([% pa_loo.lib | html %])</th>
247
                        <th colspan="3"></th>
248
                    </tr>
249
                [% END %]
250
            [% FOREACH patron_attribute IN pa_loo.items %]
251
                <tr data-category_code="[% patron_attribute.category_code | html %]">
252
                    <td>
253
                        [% patron_attribute.code | html %]
254
                        ([% patron_attribute.description | html %])
255
                    </td>
256
                    <td>
257
                        <input type="radio" name="Line"
258
                            value="patron_attr.[% patron_attribute.code | html %]" />
259
                    </td>
260
                    <td>
261
                        <input type="radio" name="Column"
262
                            value="patron_attr.[% patron_attribute.code | html %]" />
263
                    </td>
264
                    <td>
265
                        [% IF ( patron_attribute.use_dropdown ) %]
266
                            <select name="Filter_patron_attr.[% patron_attribute.code | html %]"  >
267
                                <option value="" />
268
                                [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
269
                                    <option value="[% auth_val_loo.authorised_value | html %]" >
270
                                        [% auth_val_loo.lib | html %]
271
                                    </option>
272
                                [% END %]
273
                            </select>
274
                        [% ELSE %]
275
                            <input type="text" maxlength="64"
276
                                   name="Filter_patron_attr.[% patron_attribute.code | html %]" />
277
                        [% END %]
63
                        [% END %]
278
                    </td>
64
                        <table>
279
                </tr>
65
                            <tr>
280
            [% END %]
66
                                <th>[% mainloo.line | html %] / [% mainloo.column | html %]</th>
281
            [% END %]
67
                                [% FOREACH loopco IN mainloo.loopcol %]
282
            [% END %]
68
                                    <th>
283
        </tbody>
69
                                        [% IF ( loopco.coltitle_display ) %][% loopco.coltitle_display | html %][% ELSE %][% loopco.coltitle | html %][% END %]
284
    </table>
70
                                    </th>
285
    </fieldset>
71
                                [% END %]
72
                                <th>TOTAL</th>
73
                            </tr>
74
                            [% FOREACH loopro IN mainloo.looprow %]
75
                                <tr>
76
                                    <td>
77
                                        [% IF ( loopro.rowtitle_display ) %][% loopro.rowtitle_display | html %][% ELSE %][% loopro.rowtitle | html %][% END %]
78
                                    </td>
79
                                    [% FOREACH loopcel IN loopro.loopcell %]
80
                                    <td>
81
                                        [% IF ( loopcel.value ) %]
82
                                            [% loopcel.value | html %]
83
                                        [% ELSE %]
84
                                            &nbsp;
85
                                        [% END %]
86
                                    </td>
87
                                    [% END %]
88
                                    <td>[% loopro.totalrow | html %]</td>
89
                                </tr>
90
                            [% END %]
91
                            <tr>
92
                                <th>TOTAL</th>
93
                                [% FOREACH loopfoote IN mainloo.loopfooter %]
94
                                    <th>[% loopfoote.totalcol | html %]</th>
95
                                [% END %]
96
                                <th>[% mainloo.total | html %]</th>
97
                            </tr>
98
                        </table>
99
                    [% END %]
100
                [% ELSE %]
286
101
287
	
102
                    <form method="post" action="/cgi-bin/koha/reports/borrowers_stats.pl">
288
	<fieldset class="rows">
103
                        <fieldset class="rows">
289
	<legend>Output</legend>
104
                            <legend>Patrons statistics</legend>
290
    <ol>
105
                            <table>
291
        <li>
106
                                <thead>
292
            <label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" />
107
                                    <tr>
293
        </li>
108
                                    <th>Title</th>
294
        <li>
109
                                    <th>Row</th>
295
            <label for="outputfile">To a file:</label> <input type="radio" name="output" value="file" id="outputfile" />
110
                                    <th>Column</th>
296
            <label class="inline" for="basename">Named: </label><input type="text" name="basename" id="basename" value="Export" />
111
                                    <th>Filter</th>
297
            <label class="inline" for="MIME">Into an application:</label>
112
                                    </tr>
298
            <select name="MIME" id="MIME">
113
                                </thead>
299
            [% FOREACH value IN CGIextChoice %]
114
                                <tbody>
300
                <option value="[% value | html %]">[% value | html %]</option>
115
                                    <tr>
301
            [% END %]
116
                                        <td>Patron category</td>
302
            </select>
117
                                        <td><input type="radio" name="Line" value="categorycode" /></td>
303
            <select name="sep" id="sep">
118
                                        <td><input type="radio" checked="checked" name="Column" value="categorycode" /></td>
304
            [% FOREACH value IN CGIsepChoice.values.sort() %]
119
                                        <td>
305
              [% IF ( value == CGIsepChoice.default ) %]
120
                                            <select name="Filter" id="catcode">
306
                <option value="[% value | html %]" selected="selected">[% value | html %]</option>
121
                                                <option value=""></option>
307
              [% ELSE %]
122
                                                [% FOREACH patron_category IN patron_categories %]
308
                <option value="[% value | html %]">[% value | html %]</option>
123
                                                    <option value="[% patron_category.categorycode | html %]">[% patron_category.description | html %]</option>
309
              [% END %]
124
                                                [% END %]
310
            [% END %]
125
                                            </select>
311
            </select>
126
                                        </td>
312
        </li>
127
                                    </tr>
313
    </ol>
128
                                    <tr>
314
	</fieldset>
129
                                        <td>Patron status</td>
130
                                        <td colspan="2"></td>
131
                                        <td>
132
                                            <select name="status">
133
                                                <option value=""> </option>
134
                                                <option value="debarred">restricted</option>
135
                                                <option value="gonenoadress">gone no address</option>
136
                                                <option value="lost">lost</option>
137
                                            </select>
138
                                        </td>
139
                                    </tr>
140
                                    <tr>
141
                                        <td>Patron activity</td>
142
                                        <td colspan="2">
143
                                            <select name="period" id="period">
144
                                                <option value="1">1</option>
145
                                                <option value="2">2</option>
146
                                                <option value="3">3</option>
147
                                            </select>
148
                                            <label for="period">years of activity</label>
149
                                        </td>
150
                                        <td>
151
                                            <select name="activity">
152
                                                <option value=""> </option>
153
                                                <option value="active">active</option>
154
                                                <option value="nonactive">no active</option>
155
                                            </select>
156
                                        </td>
157
                                    </tr>
158
                                    <tr>
159
                                        <td rowspan="2">ZIP/Postal code</td>
160
                                        <td><input type="radio" name="Line" value="zipcode" /></td>
161
                                        <td><input type="radio" name="Column" value="zipcode" /></td>
162
                                        <td>
163
                                            <select name="Filter" id="zipcode">
164
                                                <option value=""> </option>
165
                                                [% FOREACH ZIP_LOO IN ZIP_LOOP %]
166
                                                    <option value="[% ZIP_LOO.zipcode | html %]">[% ZIP_LOO.zipcode | html %]</option>
167
                                                [% END %]
168
                                            </select>
169
                                        </td>
170
                                    </tr>
171
                                    <tr>
172
                                        <td colspan="2">
173
                                            <select name="digits" id="digits">
174
                                                <option value=""> </option>
175
                                                <option value ="1">1</option>
176
                                                <option value ="2">2</option>
177
                                                <option value ="3">3</option>
178
                                                <option value ="4">4</option>
179
                                                <option value ="5">5</option>
180
                                                <option value ="6">6</option>
181
                                                <option value ="7">7</option>
182
                                                <option value ="8">8</option>
183
                                                <option value ="9">9</option>
184
                                                <option value ="10">10</option>
185
                                            </select>
186
                                            <label for="digits">digits</label>
187
                                        </td>
188
                                        <td>&nbsp;</td>
189
                                    </tr>
190
                                    <tr>
191
                                        <td>Library</td>
192
                                        <td><input type="radio" checked="checked" name="Line" value="branchcode" /></td>
193
                                        <td><input type="radio" name="Column" value="branchcode" /></td>
194
                                        <td>
195
                                            <select name="Filter" id="branch">
196
                                                <option value=""></option>
197
                                                [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
198
                                                    <option value="[% l.branchcode | html %]">[% l.branchcode | html %] - [% l.branchname || 'UNKNOWN' | html %]</option>
199
                                                [% END %]
200
                                            </select>
201
                                        </td>
202
                                    </tr>
203
                                    <tr>
204
                                        <td>Date of birth</td>
205
                                        <td colspan="2"></td>
206
                                        <td>
207
                                            <label for="from">From</label>
208
                                            <input type="text" size="10" id="from" name="Filter" class="flatpickr"data-date_to="to" />
209
                                            <label for="to">To</label>
210
                                            <input size="10" id="to" name="Filter" value="" type="text" class="flatpickr" />
211
                                            <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
212
                                        </td>
213
                                    </tr>
214
                                    <tr>
215
                                        <td>Gender</td>
216
                                        <td><input type="radio" name="Line" value="sex" /></td>
217
                                        <td><input type="radio" name="Column" value="sex" /></td>
218
                                        <td>
219
                                            <select id="sex" name="Filter">
220
                                                <option value="" />
221
                                                <option value="M">Men</option>
222
                                                <option value="F">Women</option>
223
                                            </select>
224
                                        </td>
225
                                    </tr>
226
                                    [% IF ( SORT1_LOOP ) %]
227
                                        <tr>
228
                                            <td>Sort1</td>
229
                                            <td><input type="radio" name="Line" value="sort1" /></td>
230
                                            <td><input type="radio" name="Column" value="sort1" /></td>
231
                                            <td>
232
                                                <select id="sort1" name="Filter">
233
                                                    <option value=""/>
234
                                                    [% FOREACH SORT1_LOO IN SORT1_LOOP %]
235
                                                        <option value="[% SORT1_LOO.authorized_value | html %]">[% SORT1_LOO.lib | html %]</option>
236
                                                    [% END %]
237
                                                </select>
238
                                            </td>
239
                                        </tr>
240
                                    [% ELSE %]
241
                                        <input type="hidden" name="Filter" />
242
                                    [% END %]
243
                                    [% IF ( SORT2_LOOP ) %]
244
                                        <tr>
245
                                            <td>Sort2</td>
246
                                            <td><input type="radio" name="Line" value="sort2" /></td>
247
                                            <td><input type="radio" name="Column" value="sort2" /></td>
248
                                            <td>
249
                                                <select id="sort2" name="Filter">
250
                                                    <option value=""/>
251
                                                    [% FOREACH SORT2_LOO IN SORT2_LOOP %]
252
                                                        <option value="[% SORT2_LOO.value | html %]">[% SORT2_LOO.value | html %]</option>
253
                                                    [% END %]
254
                                                </select>
255
                                            </td>
256
                                        </tr>
257
                                    [% ELSE %]
258
                                        <input type="hidden" name="Filter" />
259
                                    [% END %]
260
                                    [% IF Koha.Preference('ExtendedPatronAttributes') %]
261
                                        <tr>
262
                                            <th colspan="4">Patron attributes</th>
263
                                        </tr>
264
                                        [% FOREACH pa_loo IN patron_attributes %]
265
                                            [% IF (pa_loo.class) %]
266
                                                <tr>
267
                                                    <th>[% pa_loo.class | html %] ([% pa_loo.lib | html %])</th>
268
                                                    <th colspan="3"></th>
269
                                                </tr>
270
                                            [% END %]
271
                                            [% FOREACH patron_attribute IN pa_loo.items %]
272
                                                <tr data-category_code="[% patron_attribute.category_code | html %]">
273
                                                    <td>
274
                                                        [% patron_attribute.code | html %]
275
                                                        ([% patron_attribute.description | html %])
276
                                                    </td>
277
                                                    <td>
278
                                                        <input type="radio" name="Line"
279
                                                            value="patron_attr.[% patron_attribute.code | html %]" />
280
                                                    </td>
281
                                                    <td>
282
                                                        <input type="radio" name="Column"
283
                                                            value="patron_attr.[% patron_attribute.code | html %]" />
284
                                                    </td>
285
                                                    <td>
286
                                                        [% IF ( patron_attribute.use_dropdown ) %]
287
                                                            <select name="Filter_patron_attr.[% patron_attribute.code | html %]"  >
288
                                                                <option value="" />
289
                                                                [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
290
                                                                    <option value="[% auth_val_loo.authorised_value | html %]" >
291
                                                                        [% auth_val_loo.lib | html %]
292
                                                                    </option>
293
                                                                [% END %]
294
                                                            </select>
295
                                                        [% ELSE %]
296
                                                            <input type="text" maxlength="64"
297
                                                                   name="Filter_patron_attr.[% patron_attribute.code | html %]" />
298
                                                        [% END %]
299
                                                    </td>
300
                                                </tr>
301
                                            [% END %]
302
                                        [% END %]
303
                                    [% END %]
304
                                </tbody>
305
                            </table>
306
                        </fieldset>
315
307
316
	<fieldset class="action">
308
                        <fieldset class="rows">
317
    <input type="submit" class="btn btn-primary" value="Submit" />
309
                            <legend>Output</legend>
318
	<input type="hidden" name="report_name" value="[% report_name | html %]" />
310
                            <ol>
319
	<input type="hidden" name="do_it" value="1" />
311
                                <li>
320
	</fieldset>
312
                                    <label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" />
321
	</form>
313
                                </li>
322
[% END %]
314
                                <li>
315
                                    <label for="outputfile">To a file:</label>
316
                                    <input type="radio" name="output" value="file" id="outputfile" />
317
                                    <label class="inline" for="basename">Named:</label>
318
                                    <input type="text" name="basename" id="basename" value="Export" />
319
                                    <label class="inline" for="MIME">Into an application:</label>
320
                                    <select name="MIME" id="MIME">
321
                                        [% FOREACH value IN CGIextChoice %]
322
                                            <option value="[% value | html %]">[% value | html %]</option>
323
                                        [% END %]
324
                                    </select>
325
                                    <select name="sep" id="sep">
326
                                        [% FOREACH value IN CGIsepChoice.values.sort() %]
327
                                            [% IF ( value == CGIsepChoice.default ) %]
328
                                                <option value="[% value | html %]" selected="selected">[% value | html %]</option>
329
                                            [% ELSE %]
330
                                                <option value="[% value | html %]">[% value | html %]</option>
331
                                            [% END %]
332
                                        [% END %]
333
                                    </select>
334
                                </li>
335
                            </ol>
336
                        </fieldset>
323
337
338
                        <fieldset class="action">
339
                            <input type="submit" class="btn btn-primary" value="Submit" />
340
                            <input type="hidden" name="report_name" value="[% report_name | html %]" />
341
                            <input type="hidden" name="do_it" value="1" />
342
                        </fieldset>
343
                    </form>
344
                [% END %]
324
            </main>
345
            </main>
325
        </div> <!-- /.col-sm-10.col-sm-push-2 -->
346
        </div> <!-- /.col-sm-10.col-sm-push-2 -->
326
347
327
- 

Return to bug 33452