Bug 29609: Centralized code to build the link to a biblio detail page
[srvgit] / 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     <a href="[% PROCESS biblio_a_href biblionumber => loopcel.reference %]">
75  [% END %]                                        
76                                                                 [% IF ( loopcel.value ) %][% loopcel.value | html %][% END %]
77                                                                 [% IF ( loopcel.reference ) %]</a>[% END %]
78                                                         </td>
79                                                         <td>
80                                                                 [% IF ( loopcel.count ) %][% loopcel.count | html %][% END %]
81                                                         </td>
82                                                 [% END %]
83                                         </tr>
84                                 [% END %]
85                 </table>
86         [% END %]
87 [% ELSE %]
88     <h1>Most-circulated items</h1>
89         <form method="post" action="/cgi-bin/koha/reports/cat_issues_top.pl">
90         <fieldset class="rows">
91         <ol>
92         <li>
93             <label for="checkoutfrom">Checkout date from: </label>
94             <input type="text" size="10" id="checkoutfrom" name="Filter" data-date_to="checkoutto" class="flatpickr" />
95
96             <label for="checkoutto" class="inline">To:</label>
97             <input size="10" id="checkoutto" name="Filter" value="" type="text" class="flatpickr" />
98             <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
99         </li>
100         <li>
101             <label for="checkinfrom">Check-in date from</label>
102             <input type="text" size="10" id="checkinfrom" name="Filter" data-date_to="checkinto" class="flatpickr" />
103
104             <label for="checkinto" class="inline">To: </label>
105             <input type="text" size="10" id="checkinto" name="Filter" value="" class="flatpickr" />
106             <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
107         </li>
108         <li>
109             <label for="branch">Library: </label>
110             <select name="Filter" id="branch"><option value="" > Any library</option>
111                 [% PROCESS options_for_libraries libraries => Branches.all() %]
112             </select>
113         </li>
114       <li> 
115         <label for="documenttype">Item type: </label><select name="Filter" id="documenttype"><option value="" > Any item type</option>
116     [% FOREACH itemtype IN itemtypes %]
117         <option value="[% itemtype.itemtype | html %]" >[% itemtype.translated_description | html %] </option>
118      [% END %] 
119     </select>
120       </li>
121       <li> 
122         <label for="itemcallnumber">Call number: </label><input type="text" name="Filter" id="itemcallnumber" value="" />
123       </li>
124       <li>
125         <label for="ccode">Collection: </label><select name="Filter" id="ccode"><option value="" > Any collection</option>
126     [% FOREACH ccodeloo IN ccodeloop %]
127         <option value="[% ccodeloo.value | html %]" >[% ccodeloo.description | html %] </option>
128      [% END %]
129     </select>
130       </li>
131       <li>
132         <label for="shelvingloc">Shelving location: </label><select name="Filter" id="shelvingloc"><option value="" > Any shelving location</option>
133     [% FOREACH shelvinglocloo IN shelvinglocloop %]
134         <option value="[% shelvinglocloo.value | html %]" >[% shelvinglocloo.description | html %] </option>
135      [% END %]
136     </select>
137       </li>
138       <li>
139         <label for="patroncategory">Patron category: </label><select name="Filter" id="patroncategory"><option value="" > Any category code</option>
140     [% FOREACH patron_category IN patron_categories %]
141         <option value="[% patron_category.categorycode | html %]" >[% patron_category.description | html %] </option>
142      [% END %]
143     </select>
144         </li>
145                                 <li><label for="day">Day: </label> <input type="text" name="Filter" id="day" value="" /></li>
146                                 <li><label for="month">Month: </label> <input type="text" name="Filter" id="month" value="" /></li>
147                                 <li><label for="year">Year: </label> <input type="text" name="Filter" id="year" value="" /></li>
148         </ol>
149         </fieldset>
150         
151         <fieldset class="rows">
152         <legend>Limits</legend>
153         <ol><li><label for="numberlimit">Limit to:</label><select name="Limit" id="numberlimit">
154                         <option value ="" selected="selected">None</option>
155                                                 <option value="5" selected="selected"> 5</option>
156                                                 <option value ="10">10</option>
157                                                 <option value ="15">15</option>
158                                                 <option value ="20">20</option>
159                                                 <option value ="25">25</option>
160                                                 <option value ="40">40</option>
161                                                 <option value ="50">50</option>
162                                                 <option value ="100">100</option>
163                                         </select></li>
164         <li><label for="criteria">By: </label><select name="Criteria" id="criteria">
165                                                 <option value ="" selected="selected">None</option>
166                         <option value ="branch">Library</option>
167                                                 <option value ="categorycode">Categorycode</option>
168                                                 <option value ="itemtype">Itemtype</option>
169                                                 <option value ="Day">Day</option>
170                                                 <option value ="Week">Week</option>
171                                                 <option value ="Month">Month</option>
172                                                 <option value ="Year">Year</option>
173                                         </select></li></ol>
174         </fieldset>
175         
176         <fieldset class="rows">
177         <legend>Output</legend>
178     <ol>
179         <li>
180             <label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" />
181         </li>
182         <li>
183             <label for="outputfile">To a file:</label> <input type="radio" name="output" value="file" id="outputfile" />
184             <label class="inline" for="basename">Named: </label><input type="text" name="basename" id="basename" value="Export" />
185             <label class="inline" for="MIME">Into an application:</label>
186             <select name="MIME" id="MIME">
187             [% FOREACH value IN CGIextChoice %]
188                 <option value="[% value | html %]">[% value | html %]</option>
189             [% END %]
190             </select>
191             <select name="sep" id="sep">
192             [% FOREACH value IN CGIsepChoice.values.sort() %]
193               [% IF ( value == CGIsepChoice.default ) %]
194                 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
195               [% ELSE %]
196                 <option value="[% value | html %]">[% value | html %]</option>
197               [% END %]
198             [% END %]
199             </select>
200         </li>
201     </ol>
202         </fieldset>
203
204         <fieldset class="action">
205         <input type="submit" value="Submit" />
206         <input type="hidden" name="report_name" value="[% report_name | html %]" />
207         <input type="hidden" name="do_it" value="1" />
208         </fieldset>
209         </form>
210 [% END %]
211
212             </main>
213         </div> <!-- /.col-sm-10.col-sm-push-2 -->
214
215         <div class="col-sm-2 col-sm-pull-10">
216             <aside>
217                 [% INCLUDE 'reports-menu.inc' %]
218             </aside>
219         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
220      </div> <!-- /.row -->
221
222 [% MACRO jsinclude BLOCK %]
223     [% INCLUDE 'calendar.inc' %]
224 [% END %]
225
226 [% INCLUDE 'intranet-bottom.inc' %]