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