Bug 7896: Acq statistics wizard: add filters and cell values
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / reports / acquisitions_stats.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Reports [% IF ( do_it ) %]&rsaquo; Acquisitions statistics &rsaquo; Results[% ELSE %]&rsaquo; Acquisitions statistics[% END %]</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% INCLUDE 'calendar.inc' %]
5 <script type="text/javascript">
6 //<![CDATA[
7         $(document).ready(function() {
8         // http://jqueryui.com/demos/datepicker/#date-range
9         var dates = $( "#from, #to" ).datepicker({
10             changeMonth: true,
11             numberOfMonths: 1,
12             onSelect: function( selectedDate ) {
13                 var option = this.id == "from" ? "minDate" : "maxDate",
14                     instance = $( this ).data( "datepicker" );
15                     date = $.datepicker.parseDate(
16                         instance.settings.dateFormat ||
17                         $.datepicker._defaults.dateFormat,
18                         selectedDate, instance.settings );
19                 dates.not( this ).datepicker( "option", option, date );
20             }
21         });
22         var datesRO = $( "#fromRO, #toRO" ).datepicker({
23             changeMonth: true,
24             numberOfMonths: 1,
25             onSelect: function( selectedDate ) {
26                 var option = this.id == "fromRO" ? "minDate" : "maxDate",
27                     instance = $( this ).data( "datepicker" );
28                     date = $.datepicker.parseDate(
29                         instance.settings.dateFormat ||
30                         $.datepicker._defaults.dateFormat,
31                         selectedDate, instance.settings );
32                 datesRO.not( this ).datepicker( "option", option, date );
33             }
34         });
35         });
36 //]]>
37 </script>
38 </head>
39 <body id="rep_acquisitions_stats" class="rep">
40 [% INCLUDE 'header.inc' %]
41 [% INCLUDE 'cat-search.inc' %]
42
43 <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>
44
45 <div id="doc3" class="yui-t2">
46
47    <div id="bd">
48         <div id="yui-main">
49         <div class="yui-b">
50
51 [% IF ( do_it ) %]
52         [% FOREACH mainloo IN mainloop %]
53                 <h1>Acquisitions statistics </h1>
54             [% IF ( mainloo.loopfilter.size ) %]
55                         <p><b>Filtered on:</b></p>
56                         [% FOREACH loopfilte IN mainloo.loopfilter %]
57                                         <p>[% loopfilte.crit %]: [% loopfilte.filter %]</p>
58                         [% END %]
59                 [% END %]
60
61                 <table>
62                         <tr >
63                                 <th>[% mainloo.line %] / [% mainloo.column %]</th>
64                                 [% FOREACH loopco IN mainloo.loopcol %]
65                                         <th>[% loopco.coltitle %]</th>
66                                 [% END %]
67                                 <th>TOTAL</th>
68                         </tr>
69                                 [% FOREACH loopro IN mainloo.looprow %]
70                                         <tr>
71                                                 [% IF ( loopro.hilighted ) %]<td class="hilighted">[% ELSE %]<td>[% END %]
72                                                 [% loopro.rowtitle %]</td>
73                                                 [% FOREACH loopcel IN loopro.loopcell %]
74                                                         [% IF ( loopcel.hilighted ) %]<td>[% ELSE %]<td>[% END %]
75                                                                 [% IF ( loopcel.value ) %][% loopcel.value %]
76                                                                 [% ELSE %] &nbsp;
77                                                                 [% END %]
78                                                         </td>
79                                                 [% END %]
80                                                 [% IF ( loopro.hilighted ) %]<td>[% ELSE %]<td>[% END %]
81                                                         [% loopro.totalrow %]
82                                                 </td>
83                                         </tr>
84                                 [% END %]
85                                 <tr >
86                                         <th>TOTAL</th>
87                                         [% FOREACH loopfoote IN mainloo.loopfooter %]
88                                                 <th>
89                                                         [% loopfoote.totalcol %]
90                                                 </th>
91                                         [% END %]
92                                         <th>[% mainloo.total %]</th>
93                                 </tr>
94                 </table>
95         [% END %]
96 [% ELSE %]
97         <form method="post" action="/cgi-bin/koha/reports/acquisitions_stats.pl">
98         <fieldset class="rows">
99         <legend>Acquisitions 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 class="hilighted">
111                 <td>Placed on</td>
112                                 <td><input type="radio" name="Line" value="aqbasket.closedate" /></td>
113                                 <td><input type="radio" checked="checked" name="Column" value="aqbasket.closedate" /> </td>
114                                 <td> From <input type="text" size="10" id="from" name="Filter" value="" />
115                                 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
116                                         To <input size="10" id="to" name="Filter" type="text" value="" />
117                                 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
118                                 </td>
119                         </tr>
120                         <tr class="hilighted">
121                                 <td>&nbsp;</td>
122                                 <td colspan="2">group by <select name="PlacedOnDisplay">
123                                         <option value="">None</option>
124                                         <option value ="1">Day of week</option>
125                                         <option value ="2">Month</option>
126                                         <option value ="3">Year</option>
127                                         </select>
128
129                                 </td>
130                                 <td>&nbsp;</td>
131                         </tr>
132                         <tr>
133                 <td>Received on</td>
134                                 <td><input type="radio" name="Line" value="aqorders.datereceived" /></td>
135                                 <td><input type="radio" name="Column" value="aqorders.datereceived" /></td>
136                                 <td> From <input type="text" size="10" id="fromRO" name="Filter" value="" />
137                                 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
138                                         To <input type="text" size="10" id="toRO" name="Filter" value="" />
139                                 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
140                                 </td>
141                         </tr>
142                         <tr>
143                                 <td>&nbsp;</td>
144                                 <td colspan="2">group by <select name="ReceivedOnDisplay">
145                                         <option value="">None</option>
146                                         <option value ="1">Day of week</option>
147                                         <option value ="2">Month</option>
148                                         <option value ="3">Year</option>
149                                         </select>
150
151                                 </td>
152                                 <td>&nbsp;</td>
153                         </tr>
154                         <tr class="hilighted">
155                                 <td>Vendor</td>
156                                 <td><input type="radio" checked="checked" name="Line" value="aqbooksellers.name" /></td>
157                                 <td><input type="radio" name="Column" value="aqbooksellers.name" /></td>
158                                 <td>[% CGIBookSeller %]</td>
159                         </tr>
160             <tr>
161                 <td>Home branch</td>
162                 <td><input type="radio" name="Line" value="items.homebranch" /></td>
163                 <td><input type="radio" name="Column" value="items.homebranch" /></td>
164                 <td>
165                     <select name="Filter">
166                         <option value="" selected="selected">All branches</option>
167                         [% FOREACH branch IN branches %]
168                             <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
169                         [% END %]
170                     </select>
171                 </td>
172             </tr>
173             <tr>
174                 <td>
175                     [% IF ccode_label %]
176                         [% ccode_label %]
177                     [% ELSE %]
178                         Collection
179                     [% END %]
180                 </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>
184                     [% IF ccode_avlist.size %]
185                         <select name="Filter">
186                             <option value="" selected="selected">All</option>
187                             [% FOREACH ccode_av IN ccode_avlist %]
188                                 <option value="[% ccode_av.value %]">[% ccode_av.lib %]</option>
189                             [% END %]
190                         </select>
191                     [% ELSE %]
192                         <input type="text" name="Filter" />
193                     [% END %]
194                 </td>
195             </tr>
196                         <tr>
197                                 <td>Item Type</td>
198                                 <td><input type="radio" name="Line" value="biblioitems.itemtype" /></td>
199                                 <td><input type="radio" name="Column" value="biblioitems.itemtype" /></td>
200                                 <td>[% CGIItemType %]</td>
201                         </tr>
202
203                         <tr>
204                                 <td>Budget</td>
205                                 <td><input type="radio" name="Line" value="aqbudgets.budget_code" /></td>
206                                 <td><input type="radio" name="Column" value="aqbudgets.budget_code" /></td>
207                                 <td>[% CGIBudget %]</td>
208                         </tr>
209
210                         [% IF ( hassort1 ) %]
211                                 <tr class="hilighted">
212                                         <td>Sort1</td>
213                                         <td><input type="radio" name="Line" value="aqorders.sort1" /></td>
214                                         <td><input type="radio" name="Column" value="aqorders.sort1" /></td>
215                                         <td>[% CGISort1 %] </td>
216                                 </tr>
217                         [% END %]
218                         [% IF ( hassort2 ) %]
219                                 [% IF ( HglghtSort2 ) %]<tr class="hilighted"> [% ELSE %]<tr>[% END %]
220                                         <td>Sort2</td>
221                                         <td><input type="radio" name="Line" value="aqorders.sort2" /></td>
222                                         <td><input type="radio" name="Column" value="aqorders.sort2" /></td>
223                                         <td>[% CGISort2 %] </td>
224                                 </tr>
225                         [% END %]
226                 </tbody>
227         </table><br />
228         </fieldset>
229
230 <fieldset class="rows">
231     <legend> Cell value </legend>
232     <ol>
233         <li>
234             <label for="cellvalue1">Count items</label><input type="radio" name="Cellvalue" id="cellvalue1" value="1" checked="checked" />
235         </li>
236         <li>
237             <label for="cellvalue2">Count unique biblios</label><input type="radio" name="Cellvalue" id="cellvalue2" value="2" />
238         </li>
239         <li>
240             <label for="cellvalue3">Amount</label><input type="radio" name="Cellvalue" id="cellvalue3" value="3" />
241         </li>
242         <li>
243             <label for="cellvalue4">Ordered amount</label><input type="radio" name="Cellvalue" id="cellvalue4" value="4" />
244         </li>
245         <li>
246             <label for="cellvalue5">Spent amount</label><input type="radio" name="Cellvalue" id="cellvalue5" value="5" />
247         </li>
248     </ol>
249 </fieldset>
250
251         <fieldset class="rows">
252         <legend>Output</legend>
253 <ol><li><label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" /> </li>
254 <li><label for="outputfile">To a file:</label>          <input type="radio" name="output" value="file" id="outputfile" /> <label class="inline" for="basename">Named: </label><input type="text" name="basename" id="basename" value="Export" /> <label class="inline" for="MIME">Into an application
255                 </label>[% CGIextChoice %]
256                 [% CGIsepChoice %]</li></ol>
257         </fieldset>
258
259         <fieldset class="action">
260         <input type="submit" value="Submit" />
261         <input type="hidden" name="report_name" value="[% report_name %]" />
262         <input type="hidden" name="do_it" value="1" />
263         </fieldset>
264         </form>
265 [% END %]
266 </div>
267 </div>
268 <div class="yui-b">
269 [% INCLUDE 'reports-menu.inc' %]
270 </div>
271 </div>
272 [% INCLUDE 'intranet-bottom.inc' %]