Merge remote-tracking branch 'origin/new/bug_7016'
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / reserveratios.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Circulation &rsaquo; Hold ratios</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <!-- Additions to enable Calendar system -->
5 <link rel="stylesheet" type="text/css" href="[% themelang %]/lib/calendar/calendar-system.css" />
6 <!-- End of additions --><!-- Additions to enable Calendar system -->
7 <script type="text/javascript" src="[% themelang %]/lib/calendar/calendar.js"></script>
8 <script type="text/javascript" src="[% themelang %]/lib/calendar/calendar-en.js"></script>
9 <script type="text/javascript" src="[% themelang %]/lib/calendar/calendar-setup.js"></script>
10 <!-- End of additions -->
11 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
12 <script type="text/javascript">
13 //<![CDATA[
14 $.tablesorter.addParser({
15     id: 'articles', 
16     is: function(s) {return false;  }, 
17     format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, 
18     type: 'text' 
19 });
20          $(document).ready(function() {
21                 $("th a").hide();
22                 $(".ratiolimit").click(function () {
23             $("#ratio").val($(this).html());
24         });
25                 $(".ratiolimit").hover(
26             function () { $(this).toggleClass("ulined") },
27             function () { $(this).toggleClass("ulined") }
28         );
29                 $.tablesorter.defaults.widgets = ['zebra']; 
30                 $("#holdst:has(tbody tr)").tablesorter({    // only add sort if the table has a body and rows
31                         sortList: [[0,1]],
32                         headers: { 1: { sorter: 'articles' }}
33                 }); 
34          });
35 //]]>
36 </script>
37 <style type="text/css">
38     .sql { display: none; }
39     .ulined { text-decoration: underline; }
40     .ratiolimit { color: blue; cursor: pointer; }
41 </style>
42 </head>
43 <body id="circ_reserveratios" class="circ">
44 [% INCLUDE 'header.inc' %]
45 [% INCLUDE 'circ-search.inc' %]
46
47 <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>
48
49 <div id="doc3" class="yui-t2">
50    
51    <div id="bd">
52         <div id="yui-main">
53         <div class="yui-b">
54 <h1>Hold ratios to calculate items needed</h1>
55    <h3>Calculated on [% todaysdate %]. From [% from %]
56         to [% to %]</h3>
57 <p>These items have a hold ratio &ge; [% ratio %].</p>
58 <div class="sql">[% sql %]</div>
59
60 [% IF ( reserveloop ) %]
61     <table id="holdst">
62 <thead>    <tr>
63         <th>Holds
64         <a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&amp;order=reservecount&amp;from=[% from %]&amp;to=[% to %]">Sort</a>
65         </th>
66         <th>Items
67         <a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&amp;order=itemcount&amp;from=[% from %]&amp;to=[% to %]">Sort</a>
68         </th>
69         <th>Hold ratio</th>
70         <th>Title
71         <a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&amp;order=biblio&amp;from=[% from %]&amp;to=[% to %]">Sort</a>
72         </th>
73         <th>Holding libraries
74         <a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&amp;order=branch&amp;from=[% from %]&amp;to=[% to %]">Sort</a>
75         </th>
76         <th>Location
77         <a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&amp;order=location&amp;from=[% from %]&amp;to=[% to %]">Sort</a>
78         </th>
79         <th>Itype
80         <a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&amp;order=itype&amp;from=[% from %]&amp;to=[% to %]">Sort</a>
81         </th>
82         <th>Call numbers
83         <a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&amp;order=callnumber&amp;from=[% from %]&amp;to=[% to %]">Sort</a>
84         </th>
85         <th>Items needed
86         </th>
87     </tr></thead>
88     
89     <tbody>[% FOREACH reserveloo IN reserveloop %]
90         <tr>
91                 <td><p>[% reserveloo.reservecount %]</p></td>
92                 <td><p>[% reserveloo.itemcount %]</p></td>
93                 <td><p class="ratiolimit">[% reserveloo.thisratio %]</p></td>
94             <td> [% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %][% reserveloo.title |html %] [% IF ( reserveloo.subtitle ) %][% FOREACH subtitl IN reserveloo.subtitle %][% subtitl.subfield %][% END %][% END %]</a>[% IF ( reserveloo.author ) %] by [% reserveloo.author %][% END %]
95             </td>
96             <td><p>[% reserveloo.listbranch %]</p></td>
97             <td><p>[% reserveloo.location %]</p></td>
98             <td><p>[% reserveloo.itype %]</p></td>
99             <td><p>[% reserveloo.listcall %]</p></td>
100             <td>[% IF ( reserveloo.thisratio_atleast1 ) %]<p><b>[% reserveloo.ratiocalc %] to order</b></p>[% END %]</td>
101         </tr>
102     [% END %]</tbody>
103     </table>
104     [% ELSE %]
105         <b>No items found.</b>
106     [% END %]
107 </div>
108 </div>
109 <div class="yui-b">
110 <form action="/cgi-bin/koha/circ/reserveratios.pl" method="post" >
111 <fieldset class="brief">
112 <h4>Refine results:</h4>
113 <ol><li><label for="ratio">
114     Hold ratio:
115 </label>
116 <input type="text" size="5" id="ratio" name="ratio" value="[% ratio %]" /></li>
117 <li><label for="from">
118     Start date:
119 </label>
120 <input type="text" size="10" id="from" name="from" value="[% from %]" />
121 <img src="[% themelang %]/lib/calendar/cal.gif"  border="0" id="openCalendarFrom" style="cursor: pointer;" alt="" />
122 <script language="JavaScript" type="text/javascript">
123 function validate1(date) {
124     var day = date.getDate();
125     var month = date.getMonth() + 1;
126     var year = date.getFullYear();
127     var weekDay = date.getDay();
128     var dayMonth = month + '-' + day;
129     var dateString = year + '-' + month + '-' + day;
130     var dateTo = document.getElementById('to').value.split("-");
131     var limitDate = new Date(dateTo[0], (dateTo[1] - 1), dateTo[2]);
132     if (date > limitDate) {
133             return true;
134     } else {
135             return false;
136     }
137 }
138 Calendar.setup(
139         {
140         inputField : "from",
141         ifFormat : "[% DHTMLcalendar_dateformat %]",
142         button : "openCalendarFrom",
143         disableFunc : validate1,
144         dateStatusFunc : validate1
145         }
146 );
147 </script></li>
148 <li><label for="to" >
149     End date:
150 </label>
151 <input size="10" id="to" name="to" value="[% to %]" type="text" />
152 <img src="[% themelang %]/lib/calendar/cal.gif" alt="" id="openCalendarTo" style="cursor: pointer;" border="0" />
153 <script type="text/javascript">
154         function validate2(date) {
155             var day = date.getDate();
156             var month = date.getMonth() + 1;
157             var year = date.getFullYear();
158             var weekDay = date.getDay();
159             var dayMonth = month + '-' + day;
160             var dateString = year + '-' + month + '-' + day;
161             var dateFrom = document.getElementById('from').value.split("-");
162             var limitDate = new Date(dateFrom[0], (dateFrom[1] - 1), dateFrom[2]);
163             if (limitDate > date) {
164                     return true;
165             } else {
166                     return false;
167             }
168         }
169
170         Calendar.setup(
171                 {
172                     inputField : "to",
173                     ifFormat : "[% DHTMLcalendar_dateformat %]",
174                     button : "openCalendarTo",
175                     disableFunc : validate2,
176                     dateStatusFunc : validate2
177                 }
178         );
179 </script></li></ol>
180 (inclusive)
181
182 <fieldset class="action"><input type="submit" value="Go" class="submit"/></fieldset>
183 </fieldset>
184 </form>
185
186 </div>
187 </div>
188 [% INCLUDE 'intranet-bottom.inc' %]