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