Bug 18939: Acquisition statistics - Fix wrong template variable name for collection...
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / reports / acquisitions_stats.tt
1 [% SET footerjs = 1 %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Reports [% IF ( do_it ) %]&rsaquo; Acquisitions statistics &rsaquo; Results[% ELSE %]&rsaquo; Acquisitions statistics[% END %]</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 </head>
6
7 <body id="rep_acquisitions_stats" class="rep">
8 [% INCLUDE 'header.inc' %]
9 [% INCLUDE 'cat-search.inc' %]
10
11 <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/acquisitions_stats.pl">Acquisitions statistics</a> &rsaquo; Results[% ELSE %] &rsaquo; Acquisitions statistics [% END %]</div>
12
13 <div class="main container-fluid">
14     <div class="row">
15         <div class="col-sm-10 col-sm-push-2">
16             <main>
17
18 [% IF ( do_it ) %]
19         [% FOREACH mainloo IN mainloop %]
20                 <h1>Acquisitions statistics </h1>
21         [% IF ( mainloo.loopfilter.size ) %]
22             <p><b>Filtered on:</b></p>
23             [% FOREACH loopfilte IN mainloo.loopfilter %]
24                 <p>
25                     [% SWITCH loopfilte.crit %]
26                         [% CASE '0' %] Placed on (from)
27                         [% CASE '1' %] Placed on (to)
28                         [% CASE '2' %] Received on (from)
29                         [% CASE '3' %] Received on (to)
30                         [% CASE '4' %] Vendor
31                         [% CASE '5' %] Home library
32                         [% CASE '6' %] Collection
33                         [% CASE '7' %] Item type
34                         [% CASE '8' %] Fund
35                         [% CASE '9' %] Sort1
36                         [% CASE '10' %] Sort2
37                         [% CASE %] Unknown filter
38                     [% END %]
39                     : [% loopfilte.filter | html %]
40                 </p>
41                         [% END %]
42                 [% END %]
43
44                 <table>
45                         <tr >
46                                 <th>[% mainloo.line | html %] / [% mainloo.column | html %]</th>
47                                 [% FOREACH loopco IN mainloo.loopcol %]
48                                         <th>[% loopco.coltitle | html %]</th>
49                                 [% END %]
50                                 <th>TOTAL</th>
51                         </tr>
52                                 [% FOREACH loopro IN mainloo.looprow %]
53                                         <tr>
54                                                 [% IF ( loopro.hilighted ) %]<td class="hilighted">[% ELSE %]<td>[% END %]
55                                                 [% loopro.rowtitle | html %]</td>
56                                                 [% FOREACH loopcel IN loopro.loopcell %]
57                                                         [% IF ( loopcel.hilighted ) %]<td>[% ELSE %]<td>[% END %]
58                                                                 [% IF ( loopcel.value ) %][% loopcel.value | html %]
59                                                                 [% ELSE %] &nbsp;
60                                                                 [% END %]
61                                                         </td>
62                                                 [% END %]
63                                                 [% IF ( loopro.hilighted ) %]<td>[% ELSE %]<td>[% END %]
64                                                         [% loopro.totalrow | html %]
65                                                 </td>
66                                         </tr>
67                                 [% END %]
68                                 <tr >
69                                         <th>TOTAL</th>
70                                         [% FOREACH loopfoote IN mainloo.loopfooter %]
71                                                 <th>
72                                                         [% loopfoote.totalcol | html %]
73                                                 </th>
74                                         [% END %]
75                                         <th>[% mainloo.total | html %]</th>
76                                 </tr>
77                 </table>
78         [% END %]
79 [% ELSE %]
80         <form method="post" action="/cgi-bin/koha/reports/acquisitions_stats.pl">
81         <fieldset class="rows">
82         <legend>Acquisitions statistics</legend>
83         <table>
84                 <thead>
85                         <tr>
86                         <th>Title</th>
87                         <th>Row</th>
88                         <th>Column</th>
89                         <th>Filter</th>
90                         </tr>
91                 </thead>
92                 <tbody>
93                         <tr class="hilighted">
94                 <td>Placed on</td>
95                                 <td><input type="radio" name="Line" value="aqbasket.closedate" /></td>
96                                 <td><input type="radio" checked="checked" name="Column" value="aqbasket.closedate" /> </td>
97                                 <td> From <input type="text" size="10" id="from" name="Filter" value="" />
98                                 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
99                                         To <input size="10" id="to" name="Filter" type="text" value="" />
100                                 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
101                                 </td>
102                         </tr>
103                         <tr class="hilighted">
104                                 <td>&nbsp;</td>
105                                 <td colspan="2">group by <select name="PlacedOnDisplay">
106                                         <option value="">None</option>
107                                         <option value ="1">Day of week</option>
108                                         <option value ="2">Month</option>
109                                         <option value ="3">Year</option>
110                                         </select>
111
112                                 </td>
113                                 <td>&nbsp;</td>
114                         </tr>
115                         <tr>
116                 <td>Received on</td>
117                                 <td><input type="radio" name="Line" value="aqorders.datereceived" /></td>
118                                 <td><input type="radio" name="Column" value="aqorders.datereceived" /></td>
119                                 <td> From <input type="text" size="10" id="fromRO" name="Filter" value="" />
120                                 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
121                                         To <input type="text" size="10" id="toRO" name="Filter" value="" />
122                                 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
123                                 </td>
124                         </tr>
125                         <tr>
126                                 <td>&nbsp;</td>
127                                 <td colspan="2">group by <select name="ReceivedOnDisplay">
128                                         <option value="">None</option>
129                                         <option value ="1">Day of week</option>
130                                         <option value ="2">Month</option>
131                                         <option value ="3">Year</option>
132                                         </select>
133
134                                 </td>
135                                 <td>&nbsp;</td>
136                         </tr>
137                         <tr class="hilighted">
138                                 <td>Vendor</td>
139                                 <td><input type="radio" checked="checked" name="Line" value="aqbooksellers.name" /></td>
140                                 <td><input type="radio" name="Column" value="aqbooksellers.name" /></td>
141                 <td>
142                     <select name="Filter">
143                         <option value="">All vendors</option>
144                         [% FOREACH bookseller IN booksellers %]
145                             <option value="[% bookseller.name | html %]">[% bookseller.name | html %]</option>
146                         [% END %]
147                     </select>
148                 </td>
149             </tr>
150             <tr>
151                 <td>Home library</td>
152                 <td><input type="radio" name="Line" value="items.homebranch" /></td>
153                 <td><input type="radio" name="Column" value="items.homebranch" /></td>
154                 <td>
155                     <select name="Filter">
156                         <option value="" selected="selected">All libraries</option>
157                         [% FOREACH branch IN branches %]
158                             <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
159                         [% END %]
160                     </select>
161                 </td>
162             </tr>
163             <tr>
164                 <td>
165                     [% IF ccode_label %]
166                         [% ccode_label | html %]
167                     [% ELSE %]
168                         Collection
169                     [% END %]
170                 </td>
171                 <td><input type="radio" name="Line" value="items.ccode" /></td>
172                 <td><input type="radio" name="Column" value="items.ccode" /></td>
173                 <td>
174                     [% IF ccode_avlist.size %]
175                         <select name="Filter">
176                             <option value="" selected="selected">All</option>
177                             [% FOREACH ccode_av IN ccode_avlist %]
178                                 <option value="[% ccode_av.authorised_value | html %]">[% ccode_av.lib | html %]</option>
179                             [% END %]
180                         </select>
181                     [% ELSE %]
182                         <input type="text" name="Filter" />
183                     [% END %]
184                 </td>
185             </tr>
186                         <tr>
187                 <td>Item type</td>
188                                 <td><input type="radio" name="Line" value="biblioitems.itemtype" /></td>
189                                 <td><input type="radio" name="Column" value="biblioitems.itemtype" /></td>
190                 <td>
191                     <select name="Filter" size="1" id="itemtypes">
192                         <option value="">All item types</option>
193                         [% FOREACH itemtype IN itemtypes %]
194                         <option value="[% itemtype.itemtype | html %]">[% itemtype.translated_description | html %]</option>
195                         [% END %]
196                     </select>
197                 </td>
198                         </tr>
199
200                         <tr>
201                                 <td>Fund</td>
202                                 <td><input type="radio" name="Line" value="aqbudgets.budget_code" /></td>
203                                 <td><input type="radio" name="Column" value="aqbudgets.budget_code" /></td>
204                 <td>
205                     <select name="Filter" size="1" id="budget">
206                         <option value="">All funds</option>
207                         [% FOREACH value IN Budgets.values %]
208                         <option value="[% value | html %]">[% Budgets.labels.$value | html %]</option>
209                         [% END %]
210                     </select>
211                 </td>
212                         </tr>
213
214                         [% IF ( hassort1 ) %]
215                                 <tr class="hilighted">
216                                         <td>Sort1</td>
217                                         <td><input type="radio" name="Line" value="aqorders.sort1" /></td>
218                                         <td><input type="radio" name="Column" value="aqorders.sort1" /></td>
219                     <td>
220                         <select name="Filter" size="1" id="sort1">
221                             <option value="">All</option>
222                             [% FOREACH value IN Sort1.values %]
223                             <option value="[% value | html %]">[% Sort1.labels.$value | html %]</option>
224                             [% END %]
225                         </select>
226                     </td>
227                                 </tr>
228                         [% END %]
229                         [% IF ( hassort2 ) %]
230                                 [% IF ( HglghtSort2 ) %]<tr class="hilighted"> [% ELSE %]<tr>[% END %]
231                                         <td>Sort2</td>
232                                         <td><input type="radio" name="Line" value="aqorders.sort2" /></td>
233                                         <td><input type="radio" name="Column" value="aqorders.sort2" /></td>
234                     <td>
235                         <select name="Filter" size="1" id="sort2">
236                             <option value="">All</option>
237                             [% FOREACH value IN Sort2.values %]
238                             <option value="[% value | html %]">[% Sort2.labels.$value | html %]</option>
239                             [% END %]
240                         </select>
241                     </td>
242                                 </tr>
243                         [% END %]
244                 </tbody>
245         </table><br />
246         </fieldset>
247
248 <fieldset class="rows">
249     <legend> Cell value </legend>
250     <ol>
251         <li>
252             <label for="cellvalue1">Count items:</label><input type="radio" name="Cellvalue" id="cellvalue1" value="1" checked="checked" />
253         </li>
254         <li>
255             <label for="cellvalue2">Count unique bibliographic records:</label><input type="radio" name="Cellvalue" id="cellvalue2" value="2" />
256         </li>
257         <li>
258             <label for="cellvalue3">Amount:</label><input type="radio" name="Cellvalue" id="cellvalue3" value="3" />
259         </li>
260         <li>
261             <label for="cellvalue4">Ordered amount:</label><input type="radio" name="Cellvalue" id="cellvalue4" value="4" />
262         </li>
263         <li>
264             <label for="cellvalue5">Spent amount:</label><input type="radio" name="Cellvalue" id="cellvalue5" value="5" />
265         </li>
266     </ol>
267 </fieldset>
268
269         <fieldset class="rows">
270         <legend>Output</legend>
271     <ol>
272         <li>
273             <label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" />
274         </li>
275         <li>
276             <label for="outputfile">To a file:</label> <input type="radio" name="output" value="file" id="outputfile" />
277             <label class="inline" for="basename">Named: </label> <input type="text" name="basename" id="basename" value="Export" />
278             <label class="inline" for="MIME">Into an application:</label>
279             <select name="MIME" id="MIME" size="1">
280                 <option value="CSV">CSV</option>
281             </select>
282             <select name="sep" id="sep" size="1">
283             [% FOREACH value IN CGIsepChoice.values.sort() %]
284               [% IF ( value == CGIsepChoice.default ) %]
285                 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
286               [% ELSE %]
287                 <option value="[% value | html %]">[% value | html %]</option>
288               [% END %]
289             [% END %]
290             </select>
291         </li>
292     </ol>
293         </fieldset>
294
295         <fieldset class="action">
296         <input type="submit" value="Submit" />
297         <input type="hidden" name="report_name" value="[% report_name | html %]" />
298         <input type="hidden" name="do_it" value="1" />
299         </fieldset>
300         </form>
301 [% END %]
302
303             </main>
304         </div> <!-- /.col-sm-10.col-sm-push-2 -->
305
306         <div class="col-sm-2 col-sm-pull-10">
307             <aside>
308                 [% INCLUDE 'reports-menu.inc' %]
309             </aside>
310         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
311      </div> <!-- /.row -->
312
313 [% MACRO jsinclude BLOCK %]
314     [% INCLUDE 'calendar.inc' %]
315     <script>
316         $(document).ready(function() {
317             // http://jqueryui.com/demos/datepicker/#date-range
318             var dates = $( "#from, #to" ).datepicker({
319                 changeMonth: true,
320                 numberOfMonths: 1,
321                 onSelect: function( selectedDate ) {
322                     var option = this.id == "from" ? "minDate" : "maxDate",
323                         instance = $( this ).data( "datepicker" );
324                         date = $.datepicker.parseDate(
325                             instance.settings.dateFormat ||
326                             $.datepicker._defaults.dateFormat,
327                             selectedDate, instance.settings );
328                     dates.not( this ).datepicker( "option", option, date );
329                 }
330             });
331             var datesRO = $( "#fromRO, #toRO" ).datepicker({
332                 changeMonth: true,
333                 numberOfMonths: 1,
334                 onSelect: function( selectedDate ) {
335                     var option = this.id == "fromRO" ? "minDate" : "maxDate",
336                         instance = $( this ).data( "datepicker" );
337                         date = $.datepicker.parseDate(
338                             instance.settings.dateFormat ||
339                             $.datepicker._defaults.dateFormat,
340                             selectedDate, instance.settings );
341                     datesRO.not( this ).datepicker( "option", option, date );
342                 }
343             });
344         });
345     </script>
346 [% END %]
347
348 [% INCLUDE 'intranet-bottom.inc' %]