Bug 17835: Replace GetItemTypes with Koha::ItemTypes
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / reports / cat_issues_top.tt
1 [% USE Branches %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Reports &rsaquo; Most-circulated items[% IF ( do_it ) %] &rsaquo; Results[% END %]</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% INCLUDE 'calendar.inc' %]
6 <script type="text/javascript">
7 //<![CDATA[
8 [% IF ( do_it ) %]function Dopop(link) {
9         newin=window.open(link,'width=500,height=400,toolbar=false,scrollbars=yes');
10 }[% ELSE %]
11     $(document).ready(function() {
12         // http://jqueryui.com/demos/datepicker/#date-range
13         var dates = $( "#from, #to" ).datepicker({
14             changeMonth: true,
15             numberOfMonths: 1,
16             onSelect: function( selectedDate ) {
17                 var option = this.id == "from" ? "minDate" : "maxDate",
18                     instance = $( this ).data( "datepicker" );
19                     date = $.datepicker.parseDate(
20                         instance.settings.dateFormat ||
21                         $.datepicker._defaults.dateFormat,
22                         selectedDate, instance.settings );
23                 dates.not( this ).datepicker( "option", option, date );
24             }
25         });
26         var datesRO = $( "#fromRO, #toRO" ).datepicker({
27             changeMonth: true,
28             numberOfMonths: 1,
29             onSelect: function( selectedDate ) {
30                 var option = this.id == "fromRO" ? "minDate" : "maxDate",
31                     instance = $( this ).data( "datepicker" );
32                     date = $.datepicker.parseDate(
33                         instance.settings.dateFormat ||
34                         $.datepicker._defaults.dateFormat,
35                         selectedDate, instance.settings );
36                 datesRO.not( this ).datepicker( "option", option, date );
37             }
38         });
39     });[% END %]
40 //]]>
41 </script>
42 </head>
43 <body id="rep_cat_issues_top" class="rep">
44 [% INCLUDE 'header.inc' %]
45 [% INCLUDE 'cat-search.inc' %]
46
47 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a> &rsaquo; [% IF ( do_it ) %]<a href="/cgi-bin/koha/reports/cat_issues_top.pl">Most-circulated items</a> &rsaquo; Results[% ELSE %]Most-Circulated Items[% END %]</div>
48
49 <div id="doc3" class="yui-t2">
50    
51    <div id="bd">
52         <div id="yui-main">
53         <div class="yui-b">
54
55 [% IF ( do_it ) %]
56
57         [% FOREACH mainloo IN mainloop %]
58         <h1>Top [% mainloo.limit %] Most-circulated items</h1>
59                 [% IF ( mainloo.loopfilter ) %]
60             <p>Filtered on:</p>
61                         [% FOREACH loopfilte IN mainloo.loopfilter %]
62                                         <p>[% IF ( loopfilte.err ) %]  [% END %] [% loopfilte.crit %] =[% loopfilte.filter %][% IF ( loopfilte.err ) %]  [% END %]</p>
63                         [% END %]
64                 [% END %]
65                 
66                 <table>
67 <tr>                            <th>Rank/Biblioitemnumbers</th>
68                                 [% FOREACH loopco IN mainloo.loopcol %]
69                                         <th colspan="2">[% loopco.coltitle %]</th>
70                                 [% END %]</tr>
71         <tr>
72                                 <th>&nbsp;</th>
73                                 [% FOREACH loopco IN mainloo.loopcol %]
74                                         <th>Item</th>
75                     <th>Count of checkouts</th>
76                                 [% END %]
77                           </tr>
78                                 [% FOREACH loopro IN mainloo.looprow %]
79                     <tr>
80                                                 <td>[% loopro.rowtitle %]</td>
81                                                 [% FOREACH loopcel IN loopro.loopcell %]
82                                                         <td>
83
84 [% IF ( loopcel.reference ) %]
85 [% IF ( loopcel.BiblioDefaultViewmarc ) %]
86         <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% loopcel.reference |url %]">
87 [% ELSIF ( loopcel.BiblioDefaultViewisbd ) %]
88         <a href="/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=[% loopcel.reference |url %]">
89 [% ELSE %]
90         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopcel.reference |url %]">
91  [% END %]
92  [% END %]                                        
93                                                                 [% IF ( loopcel.value ) %][% loopcel.value %][% END %]
94                                                                 [% IF ( loopcel.reference ) %]</a>[% END %]
95                                                         </td>
96                                                         <td>
97                                                                 [% IF ( loopcel.count ) %][% loopcel.count %][% END %]
98                                                         </td>
99                                                 [% END %]
100                                         </tr>
101                                 [% END %]
102                 </table>
103         [% END %]
104 [% ELSE %]
105     <h1>Most-circulated items</h1>
106         <form method="post" action="/cgi-bin/koha/reports/cat_issues_top.pl">
107         <fieldset class="rows">
108         <ol>
109         <li><label for="from">Checkout date from: </label> <input type="text" size="10" id="from" name="Filter" />
110         <label for="to" class="inline">To:</label> <input size="10" id="to" name="Filter" value="" type="text" />
111                     <span class="hint">[% INCLUDE 'date-format.inc' %]</span></li>
112         <li><label for="fromRO">Check-in date from</label> <input type="text" size="10" id="fromRO" name="Filter" />
113         <label for="toRO" class="inline">To: </label> <input type="text" size="10" id="toRO" name="Filter" value="" />
114                     <span class="hint">[% INCLUDE 'date-format.inc' %]</span></li>
115         <li>
116             <label for="branch">Library: </label>
117             <select name="Filter" id="branch"><option value="" > Any library</option>
118                 [% PROCESS options_for_libraries libraries => Branches.all() %]
119             </select>
120         </li>
121       <li> 
122         <label for="documenttype">Item type: </label><select name="Filter" id="documenttype"><option value="" > Any item type</option>
123     [% FOREACH itemtype IN itemtypes %]
124         <option value="[% itemtype.itemtype %]" >[% itemtype.translated_description %] </option>
125      [% END %] 
126     </select>
127       </li>
128       <li> 
129         <label for="itemcallnumber">Call number: </label><input type="text" name="Filter" id="itemcallnumber" value="" />
130       </li>
131       <li>
132         <label for="ccode">Collection: </label><select name="Filter" id="ccode"><option value="" > Any collection</option>
133     [% FOREACH ccodeloo IN ccodeloop %]
134         <option value="[% ccodeloo.value %]" >[% ccodeloo.description %] </option>
135      [% END %]
136     </select>
137       </li>
138       <li>
139         <label for="shelvingloc">Shelving location: </label><select name="Filter" id="shelvingloc"><option value="" > Any shelving location</option>
140     [% FOREACH shelvinglocloo IN shelvinglocloop %]
141         <option value="[% shelvinglocloo.value %]" >[% shelvinglocloo.description %] </option>
142      [% END %]
143     </select>
144       </li>
145       <li>
146         <label for="patroncategory">Patron category: </label><select name="Filter" id="patroncategory"><option value="" > Any category code</option>
147     [% FOREACH patron_category IN patron_categories %]
148         <option value="[% patron_category.categorycode %]" >[% patron_category.description %] </option>
149      [% END %]
150     </select>
151         </li>
152                                 <li><label for="day">Day: </label> <input type="text" name="Filter" id="day" value="" /></li>
153                                 <li><label for="month">Month: </label> <input type="text" name="Filter" id="month" value="" /></li>
154                                 <li><label for="year">Year: </label> <input type="text" name="Filter" id="year" value="" /></li>
155         </ol>
156         </fieldset>
157         
158         <fieldset class="rows">
159         <legend>Limits</legend>
160         <ol><li><label for="numberlimit">Limit to:</label><select name="Limit" id="numberlimit">
161                         <option value ="" selected="selected">None</option>
162                                                 <option value="5" selected="selected"> 5</option>
163                                                 <option value ="10">10</option>
164                                                 <option value ="15">15</option>
165                                                 <option value ="20">20</option>
166                                                 <option value ="25">25</option>
167                                                 <option value ="40">40</option>
168                                                 <option value ="50">50</option>
169                                                 <option value ="100">100</option>
170                                         </select></li>
171         <li><label for="criteria">By: </label><select name="Criteria" id="criteria">
172                                                 <option value ="" selected="selected">None</option>
173                         <option value ="branch">Library</option>
174                                                 <option value ="categorycode">Categorycode</option>
175                                                 <option value ="itemtype">Itemtype</option>
176                                                 <option value ="Day">Day</option>
177                                                 <option value ="Week">Week</option>
178                                                 <option value ="Month">Month</option>
179                                                 <option value ="Year">Year</option>
180                                         </select></li></ol>
181         </fieldset>
182         
183         <fieldset class="rows">
184         <legend>Output</legend>
185     <ol>
186         <li>
187             <label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" />
188         </li>
189         <li>
190             <label for="outputfile">To a file:</label> <input type="radio" name="output" value="file" id="outputfile" />
191             <label class="inline" for="basename">Named: </label><input type="text" name="basename" id="basename" value="Export" />
192             <label class="inline" for="MIME">Into an application:</label>
193             <select name="MIME" id="MIME" size="1">
194             [% FOREACH value IN CGIextChoice %]
195                 <option value="[% value %]">[% value %]</option>
196             [% END %]
197             </select>
198             <select name="sep" id="sep" size="1">
199             [% FOREACH value IN CGIsepChoice.values.sort() %]
200               [% IF ( value == CGIsepChoice.default ) %]
201                 <option value="[% value %]" selected="selected">[% value %]</option>
202               [% ELSE %]
203                 <option value="[% value %]">[% value %]</option>
204               [% END %]
205             [% END %]
206             </select>
207         </li>
208     </ol>
209         </fieldset>
210
211         <fieldset class="action">
212         <input type="submit" value="Submit" />
213         <input type="hidden" name="report_name" value="[% report_name %]" />
214         <input type="hidden" name="do_it" value="1" />
215         </fieldset>
216         </form>
217 [% END %]
218
219 </div>
220 </div>
221 <div class="yui-b">
222 [% INCLUDE 'reports-menu.inc' %]
223 </div>
224 </div>
225 [% INCLUDE 'intranet-bottom.inc' %]