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