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