Bug 24953: Minor corrections to hold ratios report sidebar
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / reserveratios.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% USE AuthorisedValues %]
5 [% USE Branches %]
6 [% USE ItemTypes %]
7 [% USE ColumnsSettings %]
8 [% SET footerjs = 1 %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Koha &rsaquo; Circulation &rsaquo; Hold ratios</title>
11 [% INCLUDE 'doc-head-close.inc' %]
12 <style>
13     .sql { display: none; }
14     .ulined { text-decoration: underline; }
15     .ratiolimit:link { color: blue; cursor: pointer; }
16     .ratiolimit:hover { color: blue; text-decoration: underline; }
17     #holdst ul li {  list-style: outside url("[% interface | html %]/[% theme | html %]/img/item-bullet.gif") disc; }
18 </style>
19 </head>
20
21 <body id="circ_reserveratios" class="circ">
22 [% INCLUDE 'header.inc' %]
23 [% INCLUDE 'circ-search.inc' %]
24
25 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo; Hold ratios</div>
26
27 <div class="main container-fluid">
28     <div class="row">
29         <div class="col-sm-10 col-sm-push-2">
30             <main>
31
32 <h1>Hold ratios to calculate items needed</h1>
33    <h3>Calculated on [% todaysdate | $KohaDates %]. From [% from | $KohaDates %]
34     to [% to | $KohaDates %]</h3>
35 <p>These items have a hold ratio &ge; [% ratio | html %].</p>
36 <div class="sql">[% sql | html %]</div>
37
38 [% IF ( reserveloop ) %]
39     <table id="holdst">
40       <thead>
41         <tr>
42           <th>Holds</th>
43           <th>Items</th>
44           <th>Hold ratio</th>
45           <th>Title</th>
46           <th>Home libraries</th>
47           <th>Holding libraries</th>
48           <th>Location</th>
49           <th>Itype</th>
50           <th>Call numbers</th>
51           <th>Items needed</th>
52         </tr>
53       </thead>
54       <tbody>
55       [% FOREACH reserveloo IN reserveloop %]
56         <tr>
57             <td><p>[% reserveloo.reservecount | html %]</p></td>
58             <td><p>[% reserveloo.itemcount | html %]</p></td>
59             <td><a href="#" class="ratiolimit">[% reserveloo.thisratio | html %]</a></td>
60             <td> [% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %][% INCLUDE 'biblio-title.inc' biblio=reserveloo %]</a>[% IF ( reserveloo.author ) %] by [% reserveloo.author | html %][% END %]
61             </td>
62             <td>
63                   <ul>
64                       [% FOREACH homebranch IN reserveloo.homebranch_list %]
65                           <li>[% Branches.GetName ( homebranch ) | html %]</li>
66                       [% END %]
67                   </ul>
68             </td>
69             <td>
70                   <ul>
71                       [% FOREACH holdingbranch IN reserveloo.holdingbranch_list %]
72                           <li>[% Branches.GetName ( holdingbranch ) | html %]</li>
73                       [% END %]
74                   </ul>
75             </td>
76             <td>
77                   <ul>
78                       [% FOREACH location IN reserveloo.location %]
79                           <li>[% AuthorisedValues.GetByCode( 'LOC', location ) | html %]</li>
80                       [% END %]
81                   </ul>
82             </td>
83             <td>
84                   <ul>
85                       [% FOREACH itype IN reserveloo.itype %]
86                           <li>[% ItemTypes.GetDescription( itype ) | html %]</li>
87                       [% END %]
88                   </ul>
89             </td>
90             <td>
91                   <ul>
92                       [% FOREACH listcall IN reserveloo.listcall %]
93                           <li>[% listcall | html %]</li>
94                       [% END %]
95                   </ul>
96             </td>
97             <td class="actions">
98                 <p>
99                     [% IF ( reserveloo.thisratio_atleast1 ) %]
100                         [% IF ( CAN_user_acquisition && basketno && booksellerid ) %]<!-- [% reserveloo.ratiocalc | html %] -->
101                             <a href="/cgi-bin/koha/acqui/neworderempty.pl?biblionumber=[% reserveloo.biblionumber | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]&amp;rr_quantity_to_order=[% reserveloo.ratiocalc | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> [% reserveloo.ratiocalc | html %] to order</a>
102                         [% ELSE %]
103                             <b>[% reserveloo.ratiocalc | html %] to order</b>
104                         [% END %]
105                         [% IF ( reserveloo.pendingorders ) %]<br><b>[% reserveloo.pendingorders | html %] pending</b>[% END %]
106                     [% ELSE %]
107                         0 to order
108                     [% END %]
109                 </p>
110             </td>
111         </tr>
112       [% END %]
113       </tbody>
114     </table>
115     [% ELSE %]
116         <b>No items found.</b>
117     [% END %]
118
119             </main>
120         </div> <!-- /.col-sm-10.col-sm-push-2 -->
121
122         <div class="col-sm-2 col-sm-pull-10">
123             <aside>
124
125 <form action="/cgi-bin/koha/circ/reserveratios.pl" method="post" >
126 <fieldset class="brief">
127 <h4>Refine results:</h4>
128 <ol>
129     <li>
130         <label for="ratio">Hold ratio:</label>
131         <input type="text" size="5" id="ratio" name="ratio" value="[% ratio | html %]" />
132     </li>
133
134     <li class="checkbox">
135         [% IF include_ordered %]
136             <input id="include_ordered" name="include_ordered" type="checkbox" checked="checked"/>
137         [% ELSE %]
138             <input id="include_ordered" name="include_ordered" type="checkbox"/>
139         [% END %]
140         <label for="include_ordered">Include ordered</label>
141     </li>
142
143     <li class="checkbox">
144         [% IF include_suspended %]
145             <input id="include_suspended" name="include_suspended" type="checkbox" checked="checked"/>
146         [% ELSE %]
147             <input id="include_suspended" name="include_suspended" type="checkbox"/>
148         [% END %]
149         <label for="include_suspended">Include suspended</label>
150     </li>
151
152     <li>
153         <label for="from">Start date:</label>
154         <input type="text" size="10" id="from" name="from" value="[% from | $KohaDates %]" class="datepickerfrom" />
155     </li>
156
157     <li>
158         <label for="to">End date:</label>
159         <input size="10" id="to" name="to" value="[% to | $KohaDates %]" type="text" class="datepickerto" />
160     </li>
161 </ol>
162 (inclusive)
163
164 <fieldset class="action"><input type="submit" value="Go" class="submit"/></fieldset>
165 </fieldset>
166 [% IF ( CAN_user_acquisition && basketno && booksellerid ) %]
167 <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
168 <input type="hidden" name="basketno" value="[% basketno | html %]" />
169 [% END %]
170 </form>
171
172             </aside>
173         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
174      </div> <!-- /.row -->
175
176 [% MACRO jsinclude BLOCK %]
177     [% INCLUDE 'calendar.inc' %]
178     [% INCLUDE 'datatables.inc' %]
179     [% INCLUDE 'columns_settings.inc' %]
180     <script>
181         var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'holdsratios', 'holds-ratios', 'json' ) | $raw %];
182         $(document).ready(function() {
183             $(".ratiolimit").on("click", function(e) {
184                 e.preventDefault();
185                 $("#ratio").val($(this).html());
186             });
187             KohaTable("holdst", {
188                 "aaSorting": [ [2,'desc'], [3,'asc'] ],
189                   "aoColumnDefs": [
190                       { "aTargets": [ 0,1,2,8 ], "sType": "natural" },
191                       { "aTargets": [ 3 ], "sType": "anti-the" },
192                     ],
193                 "sPaginationType": "full",
194                 "autoWidth": false
195             }, columns_settings);
196        });
197   </script>
198 [% END %]
199
200 [% INCLUDE 'intranet-bottom.inc' %]