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