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