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