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