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