Merge remote-tracking branch 'origin/new/bug_5604'
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / reports / issues_stats.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Reports &rsaquo; Circulation statistics [% IF ( do_it ) %]&rsaquo; Results[% END %]</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% INCLUDE 'calendar.inc' %]
5 <style type="text/css">
6         .sql {display:none;}
7 </style>
8 </head>
9 <body>
10 [% INCLUDE 'header.inc' %]
11 [% INCLUDE 'cat-search.inc' %]
12
13 <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/issues_stats.pl">Circulation statistics</a> &rsaquo; Results [% ELSE %]&rsaquo; Circulation statistics[% END %]</div>
14
15 <div id="doc3" class="yui-t2">
16
17    <div id="bd">
18         <div id="yui-main">
19         <div class="yui-b">
20
21 [% IF ( do_it ) %]
22     [% FOREACH mainloo IN mainloop %]
23         <h1>Circulation statistics</h1>
24         [% IF ( mainloo.loopfilter ) %]
25             <p>Filtered on</p>
26             <ul>
27             [% FOREACH loopfilte IN mainloo.loopfilter %]
28                 [% IF ( loopfilte.err ) %]<li class="error">Error:
29                                 [% ELSIF ( loopfilte.sql ) %]<li class="sql">
30                                 [% ELSE %]<li>
31                                 [% END %]
32                                         [% loopfilte.crit %] [% loopfilte.filter %]
33                                 </li>
34             [% END %]
35             </ul>
36         [% END %]
37         
38         <table> 
39             <tr>
40                 <th>[% mainloo.line %] / [% mainloo.column %]</th>
41                 [% FOREACH loopco IN mainloo.loopcol %]
42                     <th>[% loopco.coltitle_display |html %]</th>
43                 [% END %]
44                 <th>TOTAL</th>
45                 </tr>
46                 [% FOREACH loopro IN mainloo.looprow %]
47                     [% IF ( loop.odd ) %]
48                     <tr>
49                     [% ELSE %]
50                     <tr class="highlight">
51                     [% END %]
52                         <td>[% loopro.rowtitle_display or "UNKNOWN VALUE" |html %]</td>
53                     [% FOREACH loopcel IN loopro.loopcell %]
54                                                 <td>[% loopcel.value %]</td>
55                     [% END %]
56                                                 <td>[% loopro.totalrow %]</td>
57                     </tr>
58                 [% END %]
59             <tr>
60                 <th>TOTAL</th>
61                 [% FOREACH loopfoote IN mainloo.loopfooter %]
62                 <th>[% loopfoote.totalcol %]</th>
63                 [% END %]
64                 <th>[% mainloo.total %]</th>
65             </tr>
66         </table>
67     [% END %]
68 [% ELSE %]
69
70     <form method="post" action="/cgi-bin/koha/reports/issues_stats.pl">
71     <fieldset class="rows">
72         <legend>Circulation statistics</legend><table>
73         <thead>
74             <tr>
75                 <th>Title</th>
76                 <th>Row</th>
77                 <th>Column</th>
78                 <th>Filter</th>
79             </tr>
80         </thead>
81         <tbody>
82             <tr>
83                 <td>Period</td>
84                 <td><input type="radio" name="Line" value="datetime" /></td>
85                 <td><input type="radio" name="Column" value="datetime" /></td>
86                 <td><label for="from">From</label> <input type="text" size="10" id="from" name="Filter" />
87                     <img src="[% themelang %]/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="openCalendarFrom" style="cursor: pointer;" />
88                    <script type="text/javascript">
89                                    //<![CDATA[ 
90                                    function validate1(date) {
91                         var day = date.getDate();
92                         var month = date.getMonth() + 1;
93                         var year = date.getFullYear();
94                         var weekDay = date.getDay();
95                         var dayMonth = month + '-' + day;
96                         var dateString = year + '-' + month + '-' + day;
97                         var dateTo = document.getElementById('to').value.split("-");
98                         var limitDate = new Date(dateTo[0], (dateTo[1] - 1), dateTo[2]);
99                         if (date > limitDate) {
100                              return true;
101                         } else {
102                              return false;
103                         }
104                     }
105                     Calendar.setup({
106                             inputField : "from",
107                             ifFormat : "[% DHTMLcalendar_dateformat %]",
108                             button : "openCalendarFrom",
109                             disableFunc : validate1,
110                             dateStatusFunc : validate1
111                     });
112                                         //]]>
113                                         </script>
114                     <label for="to">To</label> <input size="10" id="to" name="Filter" value="" type="text" />
115                     <img src="[% themelang %]/lib/calendar/cal.gif" alt="Show Calendar" id="openCalendarTo" style="cursor: pointer;" border="0" />
116                     <script type="text/javascript">
117                                         //<![CDATA[  
118                                         function validate2(date) {
119                          var day = date.getDate();
120                          var month = date.getMonth() + 1;
121                          var year = date.getFullYear();
122                          var weekDay = date.getDay();
123                          var dayMonth = month + '-' + day;
124                          var dateString = year + '-' + month + '-' + day;
125                          var dateFrom = document.getElementById('from').value.split("-");
126                          var limitDate = new Date(dateFrom[0], (dateFrom[1] - 1), dateFrom[2]);
127                          if (limitDate > date) {
128                               return true;
129                          } else {
130                               return false;
131                          }
132                      }
133                      Calendar.setup({
134                              inputField : "to",
135                              ifFormat : "[% DHTMLcalendar_dateformat %]",
136                              button : "openCalendarTo",
137                              disableFunc : validate2,
138                              dateStatusFunc : validate2
139                      });
140                                         //]]>
141                                         </script> <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
142                     </td>
143                 </tr>
144                 <tr class="highlight"> 
145                 <td><label for="PeriodTypeSel">Type:</label><select name="PeriodTypeSel" id="PeriodTypeSel">
146                     <option value ="issue">Checkout</option>
147                     <option value ="renew">Renewal</option>
148                     <option value ="return">Checkin</option>
149                     <option value ="localuse">Local Use</option>
150                     </select></td>
151                 <td colspan="2"><label for="DisplayBy">group by</label> <select name="DisplayBy" id="DisplayBy">
152                     <option value="">None</option>
153                     <option value ="1">Day of week</option>
154                     <option value ="2">Month</option>
155                     <option value ="3">Year</option>
156                     </select>
157                 </td>
158                 <td>
159                     <label for="PeriodDaySel">Select Day: </label><select name="PeriodDaySel" id="PeriodDaySel">
160                     <option value =""></option>
161                     <option value ="Monday">Monday</option>
162                     <option value ="Tuesday">Tuesday</option>
163                     <option value ="Wednesday">Wednesday</option>
164                     <option value ="Thursday">Thursday</option>
165                     <option value ="Friday">Friday</option>
166                     <option value ="Saturday">Saturday</option>
167                     <option value ="Sunday">Sunday</option>
168                     </select>
169                     <label for="PeriodMonthSel">Select Month:</label> <select name="PeriodMonthSel" id="PeriodMonthSel">
170                     <option value =""></option>
171                     <option value ="January">January</option>
172                     <option value ="February">February</option>
173                     <option value ="March">March</option>
174                     <option value ="April">April</option>
175                     <option value ="May">May</option>
176                     <option value ="June">June</option>
177                     <option value ="July">July</option>
178                     <option value ="August">August</option>
179                     <option value ="September">September</option>
180                     <option value ="October">October</option>
181                     <option value ="November">November</option>
182                     <option value ="December">December</option>
183                     </select>
184                 </td>
185         </tr>
186         <tr>
187             <td>Patron Category</td>
188             <td><input type="radio" name="Line" value="borrowers.categorycode" /></td>
189             <td><input type="radio" name="Column" value="borrowers.categorycode" /></td>
190            <td><select name="Filter" id="borcat">
191                <option value=""> </option>
192                [% FOREACH categoryloo IN categoryloop %]
193                  [% IF ( categoryloo.selected ) %]<option value="[% categoryloo.categorycode %]" selected="selected">[% categoryloo.description %]</option>[% ELSE %]<option value="[% categoryloo.categorycode %]">[% categoryloo.description %]</option>[% END %]
194                [% END %]
195                </select>
196              </td> 
197         </tr>
198         <tr class="highlight">
199             <td>Item Type</td>
200             <td><input type="radio" name="Line" value="itemtype" /></td>
201             <td><input type="radio" name="Column" value="itemtype" /></td>
202            <td><select name="Filter" id="itemtype">
203                <option value=""> </option>
204                [% FOREACH itemtypeloo IN itemtypeloop %]
205                  [% IF ( itemtypeloo.selected ) %]<option value="[% itemtypeloo.code %]" selected="selected">[% itemtypeloo.description %]</option>[% ELSE %]<option value="[% itemtypeloo.code %]">[% itemtypeloo.description %]</option>[% END %]
206                [% END %]
207                </select>
208              </td> 
209         </tr>
210         <tr>
211             <td>Library</td>
212             <td><input type="radio" name="Line" value="branch" /></td>
213             <td><input type="radio" name="Column" value="branch" /></td>
214             <td><select name="Filter" id="branch">
215                <option value=""> </option>
216                [% FOREACH branchloo IN branchloop %]
217 [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]
218                                 [% END %]
219                </select>
220              </td> 
221         </tr>
222         <tr class="highlight">
223             <td>Collection</td>
224             <td><input type="radio" name="Line"   value="items.ccode" /></td>
225             <td><input type="radio" name="Column" value="items.ccode" /></td>
226             <td><select name="Filter" id="ccode">
227                 <option value=""> </option>
228                 [% FOREACH ccodeloo IN ccodeloop %]
229                                         [% IF ( ccodeloo.selected ) %] <option value="[% ccodeloo.code %]" selected="selected">[% ccodeloo.description %]</option>[% ELSE %]<option value="[% ccodeloo.code %]">[% ccodeloo.description %]</option>[% END %]
230                 [% END %]
231                 </select>
232             </td>
233         </tr>
234         <tr>
235             <td>Shelving Location</td>
236             <td><input type="radio" name="Line" value="items.location" /></td>
237             <td><input type="radio" name="Column" value="items.location" /></td>
238             <td><select name="Filter" id="location">
239                 <option value=""> </option>
240                 [% FOREACH locationloo IN locationloop %]
241                                         [% IF ( locationloo.selected ) %]<option value="[% locationloo.code %]" selected="selected">[% locationloo.description %]</option>[% ELSE %]<option value="[% locationloo.code %]">[% locationloo.description %]</option>[% END %]
242                                 [% END %]
243                </select>
244             </td> 
245         </tr>
246         <tr class="highlight">
247             <td>Item Call Number</td>
248             <td></td>
249             <td></td>
250             <td>From <input type="text" name="Filter" size="10" /> (inclusive) to <input type="text" name="Filter" size="10" /> (exclusive) </td>
251         </tr>
252         [% IF ( hassort1 ) %]
253         <tr><td>Patron sort1</td>
254                         <td><input type="radio" name="Line" value="borrowers.sort1" /></td>
255                         <td><input type="radio" name="Column" value="borrowers.sort1" /></td>
256                         <td><select name="Filter" id="sort1">
257                <option value=""> </option>
258                [% FOREACH Bsort IN Bsort1 %]
259                            [% IF ( Bsort.selected ) %]<option value="[% Bsort.authorised_value %]" selected="selected">[% Bsort.lib %]</option>[% ELSE %]<option value="[% Bsort.authorised_value %]" >[% Bsort.lib %]</option>[% END %]
260                [% END %]
261                </select>
262             </td> 
263         </tr>
264         [% END %]
265         [% IF ( hassort2 ) %]
266         <tr class="highlight"><td>Patron sort2</td>
267             <td><input type="radio" name="Line" value="borrowers.sort2" /></td>
268             <td><input type="radio" name="Column" value="borrowers.sort2" /></td>
269                 <td><select name="Filter" id="sort2">
270                <option value=""> </option>
271                [% FOREACH Bsort IN Bsort2 %]
272                            [% IF ( Bsort.selected ) %]<option value="[% Bsort.authorised_value %]" selected="selected">[% Bsort.lib %]</option>[% ELSE %]<option value="[% Bsort.authorised_value %]" >[% Bsort.lib %]</option>[% END %]
273                [% END %]
274                </select>
275             </td> 
276         </tr>
277         [% END %]
278         <tr><td>Home branch</td>
279             <td><input type="radio" name="Line" value="items.homebranch" /></td>
280             <td><input type="radio" name="Column" value="items.homebranch" /></td>
281             <td><select name="Filter" id="homebranch">
282                     <option value=""> </option>
283                     [% FOREACH branchloo IN branchloop %]
284                         [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]
285                                     [% END %]
286                 </select>
287             </td>
288         </tr>
289
290         <tr><td>Holding branch</td>
291             <td><input type="radio" name="Line" value="items.holdingbranch" /></td>
292             <td><input type="radio" name="Column" value="items.holdingbranch" /></td>
293             <td><select name="Filter" id="holdingbranch">
294                     <option value=""> </option>
295                     [% FOREACH branchloo IN branchloop %]
296                         [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]
297                                     [% END %]
298                 </select>
299             </td>
300         </tr>
301
302         </tbody>
303     </table><br /></fieldset>
304
305 <fieldset class="rows"><legend>Cell value </legend><ol><li><label for="cellvalue1">Count total items</label> <input type="radio" name="Cellvalue" value="1" id="cellvalue1" checked="checked" /> </li>
306             <li><label for="cellvalue3">Count unique items</label> <input type="radio" name="Cellvalue" id="cellvalue3" value="3" /> </li></ol></fieldset>
307                         
308         <fieldset class="rows">
309         <legend>Output</legend>
310 <ol><li><label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" /> </li>
311 <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  
312                 </label>[% CGIextChoice %]
313                 [% CGIsepChoice %]</li></ol>
314         </fieldset>
315
316         <fieldset class="action">
317         <input type="submit" value="Submit" />
318         <input type="hidden" name="report_name" value="[% report_name %]" />
319         <input type="hidden" name="do_it" value="1" />
320         </fieldset>
321         </form>
322 [% END %]
323
324 </div>
325 </div>
326 <div class="yui-b">
327 [% INCLUDE 'reports-menu.inc' %]
328 </div>
329 </div>
330 [% INCLUDE 'intranet-bottom.inc' %]