Bug 34571: Remove use of "onclick" for ExpandField in cataloguing editors
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / reports / catalogue_stats.tt
1 [% USE raw %]
2 [% USE Branches %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>[% IF ( do_it ) %]Catalog statistics &rsaquo; Results[% ELSE %]Catalog statistics[% END %] &rsaquo; Reports &rsaquo; Koha</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 </head>
8
9 <body id="rep_catalogue_stats" class="rep">
10 [% WRAPPER 'header.inc' %]
11     [% INCLUDE 'cat-search.inc' %]
12 [% END %]
13
14 [% WRAPPER 'sub-header.inc' %]
15     [% WRAPPER breadcrumbs %]
16         [% WRAPPER breadcrumb_item %]
17             <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>
18         [% END %]
19         [% IF ( do_it ) %]
20             [% WRAPPER breadcrumb_item %]
21                 <a href="/cgi-bin/koha/reports/catalogue_stats.pl">Catalog statistics</a>
22             [% END %]
23             [% WRAPPER breadcrumb_item bc_active= 1 %]
24                 <span>Results</span>
25             [% END %]
26         [% ELSE %]
27             [% WRAPPER breadcrumb_item bc_active= 1 %]
28                 <span>Catalog statistics</span>
29             [% END %]
30         [% END # /IF ( do_it ) %]
31     [% END #/ WRAPPER breadcrumbs %]
32 [% END #/ WRAPPER sub-header.inc %]
33
34 <div class="main container-fluid">
35     <div class="row">
36         <div class="col-sm-10 col-sm-push-2">
37             <main>
38
39 <h1>Catalog statistics</h1>
40 [% IF ( do_it ) %]
41         [% FOREACH mainloo IN mainloop %]
42                 [% IF ( mainloo.loopfilter ) %]
43             <p>Filtered on:</p>
44                         [% FOREACH loopfilte IN mainloo.loopfilter %]
45                                         <p>[% loopfilte.crit | html %] =[% loopfilte.filter | html %]</p>
46                         [% END %]
47                 [% END %]
48                 
49         <table id="catalogue_stats">
50             <thead>
51                 <tr>
52                     <th>[% mainloo.line | html %] / [% mainloo.column | html %]</th>
53                     [% FOREACH loopco IN mainloo.loopcol %]
54                         <th>[% loopco.coltitle | html %]</th>
55                     [% END %]
56                     <th>TOTAL</th>
57                 </tr>
58             </thead>
59             <tbody>
60                                 [% FOREACH loopro IN mainloo.looprow %]
61                                         <tr>
62                                                 [% IF ( loopro.hilighted ) %]<td class="hilighted">[% ELSE %]<td>[% END %]
63                                                 [% loopro.rowtitle | html %]</td>
64                                                 [% FOREACH loopcel IN loopro.loopcell %]
65                                                         [% IF ( loopcel.hilighted ) %]<td>[% ELSE %]<td>[% END %]
66                                                                 [% IF ( loopcel.value ) %][% loopcel.value | html %]
67                                                                 [% ELSE %]&nbsp;
68                                                                 [% END %]
69                                                         </td>
70                                                 [% END %]
71                                                 [% IF ( loopro.hilighted ) %]<td>[% ELSE %]<td>[% END %]
72                                                         [% loopro.totalrow | html %]
73                                                 </td>
74                                         </tr>
75                                 [% END %]
76             </tbody>
77             <tfoot>
78                                 <tr>
79                     <th>TOTAL (all results)</th>
80                                         [% FOREACH loopfoote IN mainloo.loopfooter %]
81                                                 <th>
82                                                         [% loopfoote.totalcol | html %]
83                                                 </th>
84                                         [% END %]
85                                         <th>[% mainloo.total | html %]</th>
86                                 </tr>
87             </tfoot>
88                 </table>
89         [% END %]
90 [% ELSE %]
91
92         <form method="post" action="/cgi-bin/koha/reports/catalogue_stats.pl">
93         <fieldset class="rows">
94         <legend>Catalog statistics</legend>
95         <table>
96                 <thead>
97                         <tr>
98                         <th>Title</th>
99                         <th>Row</th>
100                         <th>Column</th>
101                         <th>Filter</th>
102                         </tr>
103                 </thead>
104                 <tbody>
105       <tr>
106         <td>Koha full call number</td>
107         <td><input type="radio" name="Line" value="items.itemcallnumber" /></td>
108         <td><input type="radio" name="Column" value="items.itemcallnumber" /></td>
109         <td><label for="callnoFrom">From</label> <input type="text" name="Filter" id="callnoFrom" /> <label for="callnoTo">To</label> <input type="text" name="Filter" id="callnoTo" /></td>
110       </tr>
111      <tr>
112         <td>&nbsp;</td>
113         <td colspan="2"><select name="cotedigits" id="cotedigits">
114           <option value=""> </option>
115           <option value ="1">1</option>
116           <option value ="2">2</option>
117           <option value ="3">3</option>
118           <option value ="4">4</option>
119           <option value ="5">5</option>
120           </select>
121           <label for="cotedigits">characters</label>
122         </td>
123         <td>&nbsp;</td>
124       </tr>
125                          <tr>
126                 <td>Item type</td>
127                                 <td><input type="radio" name="Line" value="[% item_itype | html %]" /></td>
128                 <td><input type="radio" checked="checked" name="Column" value="[% item_itype | html %]" /></td>
129                                 <td><select name="Filter" id="[% item_itype | html %]">
130                                         <option value=""> </option>
131                     [% FOREACH itemtype IN itemtypes %]
132                         <option value="[% itemtype.itemtype | html %]">[% itemtype.translated_description | html %]</option>
133                     [% END %]
134                                         </select>
135                                 </td>
136                         </tr>
137                          <tr>
138                                 <td>Publisher</td>
139                                 <td><input type="radio" name="Line" value="publishercode" /></td>
140                                 <td><input type="radio" name="Column" value="publishercode" /></td>
141                                 <td><input type="text" name="Filter" /></td>
142                         </tr>
143                         <tr>
144                 <td>Publication year</td>
145                                 <td><input type="radio" name="Line" value="publicationyear" /></td>
146                                 <td><input type="radio" name="Column" value="publicationyear" /></td>
147                 <td><label for="pubyearFrom">From</label> <input type="text" name="Filter" id="pubYearFrom" /> <label for="pubyearTo">To</label> <input type="text" name="Filter" id="pubyearTo" /></td>
148                         </tr>
149                         <tr>
150                 <td>Home library</td>
151                 <td><input type="radio" checked="checked" name="Line" value="items.homebranch" /></td>
152                                 <td><input type="radio" name="Column" value="items.homebranch" /></td>
153                                 <td><select name="Filter" id="branch">
154                     <option value=""> </option>
155                     [% PROCESS options_for_libraries libraries => Branches.all() %]
156                     </select>
157                                 </td>
158                         </tr>
159                         <tr>
160                 <td>Shelving location</td>
161                                 <td><input type="radio" name="Line" value="items.location" /></td>
162                                 <td><input type="radio" name="Column" value="items.location" /></td>
163                                 <td><select name="Filter" id="location">
164                                         <option value=""> </option>
165                                         [% FOREACH locationloo IN locationloop %]
166                                         [% IF ( locationloo.selected ) %]<option value="[% locationloo.code | html %]" selected="selected">[% locationloo.description | html %]</option>[% ELSE %]<option value="[% locationloo.code | html %]">[% locationloo.description | html %]</option>[% END %]
167                                         [% END %]
168                                         </select>
169                                 </td>
170                         </tr>
171                         <tr>
172                                 <td>Collection</td>
173                                 <td><input type="radio" name="Line"   value="items.ccode" /></td>
174                                 <td><input type="radio" name="Column" value="items.ccode" /></td>
175                                 <td><select name="Filter" id="ccode">
176                                         <option value=""> </option>
177                                         [% FOREACH authval IN authvals %]
178                                         [% IF ( authval.selected ) %]<option value="[% authval.code | html %]" selected="selected">[% authval.description | html %]</option>[% ELSE %]<option value="[% authval.code | html %]">[% authval.description | html %]</option>[% END %]
179                                         [% END %]
180                                         </select>
181                                 </td>
182                         </tr>
183             [% IF (notforloan) %]
184                 <tr>
185                     <td>[% notforloan_label | html %]</td>
186                     <td><input type="radio" name="Line"   value="items.notforloan" /></td>
187                     <td><input type="radio" name="Column" value="items.notforloan" /></td>
188                     <td>
189                         [% IF (notforloan_avlist) %]
190                             <select name="Filter" id="notforloan">
191                                 <option value="">&nbsp;</option>
192                                 [% FOREACH av IN notforloan_avlist %]
193                                     <option value="[% av.authorised_value | html %]">
194                                         [% av.lib | html %]
195                                     </option>
196                                 [% END %]
197                             </select>
198                         [% ELSE %]
199                             <input type="text" name="Filter" id="notforloan" />
200                         [% END %]
201                     </td>
202                 </tr>
203             [% ELSE %]
204                 <tr style="display:none">
205                     <td colspan="4"><input type="hidden" name="Filter" /></td>
206                 </tr>
207             [% END %]
208             [% IF (materials) %]
209                 <tr>
210                     <td>[% materials_label | html %]</td>
211                     <td><input type="radio" name="Line"   value="items.materials" /></td>
212                     <td><input type="radio" name="Column" value="items.materials" /></td>
213                     <td>
214                         [% IF (materials_avlist) %]
215                             <select name="Filter" id="materials">
216                                 <option value="">&nbsp;</option>
217                                 [% FOREACH av IN materials_avlist %]
218                                     <option value="[% av.authorised_value | html %]">
219                                         [% av.lib | html %]
220                                     </option>
221                                 [% END %]
222                             </select>
223                         [% ELSE %]
224                             <input type="text" name="Filter" id="materials" />
225                         [% END %]
226                     </td>
227                 </tr>
228             [% ELSE %]
229                 <tr style="display:none">
230                     <td colspan="4"><input type="hidden" name="Filter" /></td>
231                 </tr>
232             [% END %]
233             <tr>
234                 <td colspan="3">Filter barcode</td>
235                 <td>
236                     <select name="Filter" id="like">
237                         <option value="1">like</option>
238                         <option value="0">not like</option>
239                     </select>
240                     <input type="text" name="Filter" id="barcode" />
241                     (use * to do a fuzzy search)
242                 </td>
243             </tr>
244             <tr>
245                 <td>Date acquired (item)</td>
246                 <td><input type="radio" name="Line" value="items.dateaccessioned" /></td>
247                 <td><input type="radio" name="Column" value="items.dateaccessioned" /></td>
248                 <td>
249                     <label for="acqdateFrom">From</label>
250                     <input type="text" name="Filter" id="acqdateFrom" data-date_to="acqdateTo" class="flatpickr" />
251
252                     <label for="acqdateTo">To</label>
253                     <input type="text" name="Filter" id="acqdateTo" class="flatpickr" />
254                 </td>
255             </tr>
256             <tr id="removeddatetr">
257                 <td>Date deleted (item)</td>
258                 <td><input type="radio" name="Line" value="deleteditems.timestamp" /></td>
259                 <td><input type="radio" name="Column" value="deleteditems.timestamp" /></td>
260                 <td>
261                     <label for="deldateFrom">From</label>
262                     <input type="text" name="Filter" id="deldateFrom" data-date_to="deldateTo" class="flatpickr" />
263
264                     <label for="deldateTo">To</label>
265                     <input type="text" name="Filter" id="deldateTo" class="flatpickr" />
266                 </td>
267             </tr>
268                 </tbody>
269         </table><br /></fieldset>
270
271     <fieldset class="rows">
272         <legend>Cell value</legend>
273         <ol>
274             <li>
275                 <label for="cellvalue_items">Count total items</label>
276                 <input type="radio" name="Cellvalue" value="items" id="cellvalue_items" checked="checked" />
277             </li>
278             <li>
279                 <label for="cellvalue_biblios">Count unique bibliographic records</label>
280                 <input type="radio" name="Cellvalue" value="biblios" id="cellvalue_biblios" />
281             </li>
282             <li>
283                 <label for="cellvalue_deleteditems">Count deleted items</label>
284                 <input type="radio" name="Cellvalue" value="deleteditems" id="cellvalue_deleteditems" />
285             </li>
286         </ol>
287     </fieldset>
288         
289         <fieldset class="rows">
290         <legend>Output</legend>
291         <ol><li><label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" /></li>
292                 <li><label for="outputfile">To a file: </label><input type="radio" name="output" value="file" id="outputfile" />
293                         <label class="inline" for="basename">Named: </label><input type="text" name="basename" id="basename" value="Export" />
294                         <label class="inline" for="MIME">Into an application: </label>
295                         <select name="MIME" id="MIME">
296                         [% FOREACH CGIextChoic IN CGIextChoice %]
297                         <option value="[% CGIextChoic.type | html %]">[% CGIextChoic.type | html %]</option>
298                         [% END %]
299                         </select>
300                         <!-- <label class="inline" for="sep">Delimiter: </label> -->
301             <select name="sep" id="sep">
302             [% FOREACH value IN CGIsepChoice.values.sort() %]
303               [% IF ( value == CGIsepChoice.default ) %]
304                 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
305               [% ELSE %]
306                 <option value="[% value | html %]">[% value | html %]</option>
307               [% END %]
308             [% END %]
309             </select>
310                 </li>
311         </ol>
312         </fieldset>
313
314         <fieldset class="action">
315     <input type="submit" class="btn btn-primary" value="Submit" />
316         <input type="hidden" name="report_name" value="[% report_name | html %]" />
317         <input type="hidden" name="do_it" value="1" />
318         </fieldset>
319         </form>
320 [% END %]
321
322             </main>
323         </div> <!-- /.col-sm-10.col-sm-push-2 -->
324
325         <div class="col-sm-2 col-sm-pull-10">
326             <aside>
327                 [% INCLUDE 'reports-menu.inc' %]
328             </aside>
329         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
330      </div> <!-- /.row -->
331
332 [% MACRO jsinclude BLOCK %]
333     [% INCLUDE 'calendar.inc' %]
334     [% INCLUDE 'datatables.inc' %]
335     [% INCLUDE 'columns_settings.inc' %]
336     <script>
337         function changeRemovedDateTrStatus() {
338             var Cellvalue = $("input[name='Cellvalue']:checked").val();
339             if(Cellvalue == "deleteditems") {
340                 $("#removeddatetr").show();
341                 $("input[value='deleteditems.timestamp']").prop('disabled', false);
342                 $("#deldateFrom").prop('disabled', false);
343                 $("#deldateTo").prop('disabled', false);
344             } else {
345                 $("#removeddatetr").hide();
346                 $("input[value='deleteditems.timestamp']").prop('disabled', true).prop('checked', false);
347                 $("#deldateFrom").prop('disabled', true).val('');
348                 $("#deldateTo").prop('disabled', true).val('');
349             }
350         }
351
352         $(document).ready(function() {
353
354             $("input[name='Cellvalue']").change(function() {
355                 changeRemovedDateTrStatus();
356             });
357             changeRemovedDateTrStatus();
358
359             columns_settings = [% FILTER collapse %]
360                 [
361                     {
362                         "is_hidden": 0,
363                         "columnname": "[% mainloo.line | html %]_[% mainloo.column | html %]",
364                         "cannot_be_toggled": 1,
365                         "cannot_be_modified": 1
366                     },
367                     [% FOREACH loopco IN mainloo.loopcol %]
368                         {
369                             "is_hidden": 0,
370                             "columnname": "[% loopco.coltitle | html %]",
371                             "cannot_be_toggled": 0,
372                             "cannot_be_modified": 0
373                         },
374                     [% END %]
375                     {
376                         "is_hidden": 0,
377                         "columnname": "total",
378                         "cannot_be_toggled": 0,
379                         "cannot_be_modified": 0
380                     },
381                 ];
382             [% END %]
383
384             var catalogue_stats = KohaTable("catalogue_stats", {
385                 'autoWidth': false,
386                 'paging': false,
387             }, columns_settings );
388         });
389     </script>
390 [% END %]
391
392 [% INCLUDE 'intranet-bottom.inc' %]