Bug 27846: (follow-up) Add id back to breadcrumbs container
[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>Koha &rsaquo; Reports [% IF ( do_it ) %]&rsaquo; Catalog statistics &rsaquo; Results[% ELSE %]&rsaquo; Catalog statistics[% END %]</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 [% IF ( do_it ) %]
45         [% FOREACH mainloo IN mainloop %]
46                 <h1>Catalog statistics</h1>
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" class="datepicker" />
256                     <label for="acqdateTo">To</label>
257                     <input type="text" name="Filter" id="acqdateTo" class="datepicker" />
258                 </td>
259             </tr>
260             <tr id="removeddatetr">
261                 <td>Date deleted (item)</td>
262                 <td><input type="radio" name="Line" value="deleteditems.timestamp" /></td>
263                 <td><input type="radio" name="Column" value="deleteditems.timestamp" /></td>
264                 <td>
265                     <label for="deldateFrom">From</label>
266                     <input type="text" name="Filter" id="deldateFrom" class="datepicker" />
267                     <label for="deldateTo">To</label>
268                     <input type="text" name="Filter" id="deldateTo" class="datepicker"/>
269                 </td>
270             </tr>
271                 </tbody>
272         </table><br /></fieldset>
273
274     <fieldset class="rows">
275         <legend>Cell value</legend>
276         <ol>
277             <li>
278                 <label for="cellvalue_items">Count total items</label>
279                 <input type="radio" name="Cellvalue" value="items" id="cellvalue_items" checked="checked" />
280             </li>
281             <li>
282                 <label for="cellvalue_biblios">Count unique bibliographic records</label>
283                 <input type="radio" name="Cellvalue" value="biblios" id="cellvalue_biblios" />
284             </li>
285             <li>
286                 <label for="cellvalue_deleteditems">Count deleted items</label>
287                 <input type="radio" name="Cellvalue" value="deleteditems" id="cellvalue_deleteditems" />
288             </li>
289         </ol>
290     </fieldset>
291         
292         <fieldset class="rows">
293         <legend>Output</legend>
294         <ol><li><label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" /></li>
295                 <li><label for="outputfile">To a file: </label><input type="radio" name="output" value="file" id="outputfile" />
296                         <label class="inline" for="basename">Named: </label><input type="text" name="basename" id="basename" value="Export" />
297                         <label class="inline" for="MIME">Into an application: </label>
298                         <select name="MIME" id="MIME">
299                         [% FOREACH CGIextChoic IN CGIextChoice %]
300                         <option value="[% CGIextChoic.type | html %]">[% CGIextChoic.type | html %]</option>
301                         [% END %]
302                         </select>
303                         <!-- <label class="inline" for="sep">Delimiter: </label> -->
304             <select name="sep" id="sep" size="1">
305             [% FOREACH value IN CGIsepChoice.values.sort() %]
306               [% IF ( value == CGIsepChoice.default ) %]
307                 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
308               [% ELSE %]
309                 <option value="[% value | html %]">[% value | html %]</option>
310               [% END %]
311             [% END %]
312             </select>
313                 </li>
314         </ol>
315         </fieldset>
316
317         <fieldset class="action">
318         <input type="submit" value="Submit" />
319         <input type="hidden" name="report_name" value="[% report_name | html %]" />
320         <input type="hidden" name="do_it" value="1" />
321         </fieldset>
322         </form>
323 [% END %]
324
325             </main>
326         </div> <!-- /.col-sm-10.col-sm-push-2 -->
327
328         <div class="col-sm-2 col-sm-pull-10">
329             <aside>
330                 [% INCLUDE 'reports-menu.inc' %]
331             </aside>
332         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
333      </div> <!-- /.row -->
334
335 [% MACRO jsinclude BLOCK %]
336     [% INCLUDE 'calendar.inc' %]
337     [% INCLUDE 'datatables.inc' %]
338     [% INCLUDE 'columns_settings.inc' %]
339     <script>
340         function changeRemovedDateTrStatus() {
341             var Cellvalue = $("input[name='Cellvalue']:checked").val();
342             if(Cellvalue == "deleteditems") {
343                 $("#removeddatetr").show();
344                 $("input[value='deleteditems.timestamp']").prop('disabled', false);
345                 $("#deldateFrom").prop('disabled', false);
346                 $("#deldateTo").prop('disabled', false);
347             } else {
348                 $("#removeddatetr").hide();
349                 $("input[value='deleteditems.timestamp']").prop('disabled', true).prop('checked', false);
350                 $("#deldateFrom").prop('disabled', true).val('');
351                 $("#deldateTo").prop('disabled', true).val('');
352             }
353         }
354
355         $(document).ready(function() {
356             $('#acqdateFrom, #deldateFrom')
357               .datepicker('option', 'onSelect', function(selectedDate) {
358                 var id = $(this).attr('id').replace('From', 'To');
359                 $('#' + id).datepicker('option', 'minDate', selectedDate);
360               });
361             $('#acqdateTo, #deldateTo')
362               .datepicker('option', 'onSelect', function(selectedDate) {
363                 var id = $(this).attr('id').replace('To', 'From');
364                 $('#' + id).datepicker('option', 'maxDate', selectedDate);
365               });
366
367             $("input[name='Cellvalue']").change(function() {
368                 changeRemovedDateTrStatus();
369             });
370             changeRemovedDateTrStatus();
371
372             columns_settings = [% FILTER collapse %]
373                 [
374                     {
375                         "is_hidden": 0,
376                         "columnname": "[% mainloo.line | html %]_[% mainloo.column | html %]",
377                         "cannot_be_toggled": 1,
378                         "cannot_be_modified": 1
379                     },
380                     [% FOREACH loopco IN mainloo.loopcol %]
381                         {
382                             "is_hidden": 0,
383                             "columnname": "[% loopco.coltitle | html %]",
384                             "cannot_be_toggled": 0,
385                             "cannot_be_modified": 0
386                         },
387                     [% END %]
388                     {
389                         "is_hidden": 0,
390                         "columnname": "total",
391                         "cannot_be_toggled": 0,
392                         "cannot_be_modified": 0
393                     },
394                 ];
395             [% END %]
396
397             var catalogue_stats = KohaTable("catalogue_stats", {
398                 'autoWidth': false,
399                 'paging': false,
400             }, columns_settings );
401         });
402     </script>
403 [% END %]
404
405 [% INCLUDE 'intranet-bottom.inc' %]