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