Bug 6086 - adding a dynamic filter to pending holds
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / pendingreserves.tt
blob3aeb59223829954786bc87343803a11b6ddf22ab
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Circulation &rsaquo; Holds to Pull</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 <!-- Plugin datatables -->
11 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
12 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
13 <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
14 <script type="text/JavaScript" language="JavaScript">
15 //<![CDATA[
16 $(document).ready(function() {
17   var holdst = $("#holdst").dataTable($.extend(true, {}, dataTablesDefaults, {
18   }));
19   holdst.fnAddFilters("filter");
20   function createSelect( data ) {
21       var r='<select style="width:99%"><option value="">None</option>', i, len=data.length;
22       for ( i=0 ; i<len ; i++ ) {
23           r += '<option value="'+data[i]+'">'+data[i]+'</option>';
24       }
25       return r+'</select>';
26   }
27   $("#homebranchfilter").each( function () {
28       $(this).html( createSelect( holdst.fnGetColumnData(4) ) );
29       $('select', this).change( function () {
30           holdst.fnFilter( $(this).val(), 4 );
31       } );
32   } );
33   $("#itypefilter").each( function () {
34       $(this).html( createSelect( holdst.fnGetColumnData(8) ) );
35       $('select', this).change( function () {
36           holdst.fnFilter( $(this).val(), 8 );
37       } );
38   } );
39   $("#locationfilter").each( function () {
40       $(this).html( createSelect( holdst.fnGetColumnData(9) ) );
41       $('select', this).change( function () {
42           holdst.fnFilter( $(this).val(), 9 );
43       } );
44   } );
45 });
46 //]]>
47 </script>
48 </head>
49 <body>
50 [% INCLUDE 'header.inc' %]
51 [% INCLUDE 'circ-search.inc' %]
54 <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; Holds to Pull</div>
56 <div id="doc3" class="yui-t2">
57    
58    <div id="bd">
59         <div id="yui-main">
60         <div class="yui-b">
62 <h2>Holds to Pull[% IF ( run_report ) %] placed between [% from %] and [% to %][% END %]</h2>
63 [% IF ( run_report ) %]
64 <h3>Reported on [% todaysdate %]</h3>
65 <p>The following holds have not been filled. Please retrieve them and check them in.</p>
66 <div class="searchresults">
67     [% IF ( reserveloop ) %]
68     <table id="holdst">
69         <thead>
70             <tr>
71                 <th>Pull This Many Items</th>
72                 <th>Items Available</th>
73                 <th>Patrons with Holds</th>
74                 <th>Title</th>
75                 <th>Libraries</th>
76                 <th>Available Call Numbers</th>
77                 <th>Available Copy No</th>
78                 <th>Available Enumeration</th>
79                 <th>Available Itypes</th>
80                 <th>Available Locations</th>
81                 <th>Earliest Hold Date</th>
82             </tr>
83         </thead>
84         <tbody>
85             [% FOREACH reserveloo IN reserveloop %]
86             <tr>
87                 [% IF ( reserveloo.borrowernumber ) %]
88                     <td><p><b>[% reserveloo.pullcount %]</b></p></td>
89                     <td>[% reserveloo.count %]</td>
90                     <td>[% reserveloo.rcount %]</td>
91                     <td>
92                         <p>
93                 [% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %]
94                                     [% reserveloo.title |html %] [% reserveloo.subtitle %]
95                                 </a>
96                         </p>
97                     </td>
98                 [% ELSE %]
99                     <td>"</td>
100                     <td>"</td>
101                     <td>"</td>
102                     <td>"</td>
103                 [% END %]
104                 <td>[% reserveloo.holdingbranch %]</td>
105                 <td><p>[% reserveloo.itemcallnumber %]</p></td>
106                 <td><p>[% reserveloo.copyno %]</p></td>
107                 <td><p>[% reserveloo.enumchron %]</p></td>
108                 <td>[% reserveloo.itype %]</td>
109                 <td>[% reserveloo.location %]</td>
110                 <td width="15%">
111                     <p>[% reserveloo.reservedate %]</p>
112                     <p>in [% reserveloo.branch %]</p>
113                     [% IF ( reserveloo.statusw ) %]<p>Waiting</p>[% END %][% IF ( reserveloo.statusf ) %]<p>Fullfilled</p>[% END %]
114                 </td>
115             </tr>
116             [% END %]
117         </tbody>
118         <tfoot>
119             <tr>
120                 <td><input type="text" class="filter" data-column_num="0" placeholder="Pull This many items" style="width:95%"/></td>
121                 <td><input type="text" class="filter" data-column_num="1" placeholder="Items available" style="width:95%"/></td>
122                 <td><input type="text" class="filter" data-column_num="2" placeholder="Patron holds" style="width:95%"/></td>
123                 <td><input type="text" class="filter" data-column_num="3" placeholder="Title" style="width:95%"/></td>
124                 <td id="homebranchfilter"></td>
125                 <td><input type="text" class="filter" data-column_num="5" placeholder="Call number" style="width:95%"/></td>
126                 <td><input type="text" class="filter" data-column_num="6" placeholder="Available copy" style="width:95%"/></td>
127                 <td><input type="text" class="filter" data-column_num="7" placeholder="Available enumeration" style="width:95%"/></td>
128                 <td id="itypefilter"></td>
129                 <td id="locationfilter"></td>
130                 <td></td>
131             </tr>
132         </tfoot>
133     </table>
134     [% ELSE %]
135         <b>No items found.</b>
136     [% END %]
137 </div>
138 [% END %]
140 </div>
141 </div>
142 <div class="yui-b">
143 <div id="filters">
145 <form action="/cgi-bin/koha/circ/pendingreserves.pl" method="post" >
146 <fieldset class="brief">
147 <h4>Refine Results</h4>
148 <ol>
149 <li>
150 <label for="from">
151     Start date:
152 </label>
153 <input type="text" size="10" id="from" name="from" value="[% from %]" />
154 <img src="[% themelang %]/lib/calendar/cal.gif"  border="0" id="openCalendarFrom" style="cursor: pointer;" alt="" />
155 <script language="JavaScript" type="text/javascript">
156 function validate1(date) {
157     var day = date.getDate();
158     var month = date.getMonth() + 1;
159     var year = date.getFullYear();
160     var weekDay = date.getDay();
161     var dayMonth = month + '-' + day;
162     var dateString = year + '-' + month + '-' + day;
163     var dateTo = document.getElementById('to').value.split("-");
164     var limitDate = new Date(dateTo[0], (dateTo[1] - 1), dateTo[2]);
165     if (date > limitDate) {
166             return true;
167     } else {
168             return false;
169     }
171 Calendar.setup(
172         {
173         inputField : "from",
174         ifFormat : "[% DHTMLcalendar_dateformat %]",
175         button : "openCalendarFrom",
176         disableFunc : validate1,
177         dateStatusFunc : validate1
178         }
180 </script></li>
181 <li><label for="to">
182     End date:
183 </label>
184 <input size="10" id="to" name="to" value="[% to %]" type="text" />
185 <img src="[% themelang %]/lib/calendar/cal.gif" alt="" id="openCalendarTo" style="cursor: pointer;" border="0" />
186 <script type="text/javascript">
187         function validate2(date) {
188             var day = date.getDate();
189             var month = date.getMonth() + 1;
190             var year = date.getFullYear();
191             var weekDay = date.getDay();
192             var dayMonth = month + '-' + day;
193             var dateString = year + '-' + month + '-' + day;
194             var dateFrom = document.getElementById('from').value.split("-");
195             var limitDate = new Date(dateFrom[0], (dateFrom[1] - 1), dateFrom[2]);
196             if (limitDate > date) {
197                     return true;
198             } else {
199                     return false;
200             }
201         }
203         Calendar.setup(
204                 {
205                     inputField : "to",
206                     ifFormat : "[% DHTMLcalendar_dateformat %]",
207                     button : "openCalendarTo",
208                     disableFunc : validate2,
209                     dateStatusFunc : validate2
210                 }
211         );
212 </script></li>
213 </ol>
214 <p><i>(Inclusive, default is two days ago to today, set other date ranges as needed. )</i></p>
215 <fieldset class="action"><input type="submit" name="run_report" value="Submit" class="submit"/></fieldset>
216 </fieldset>
217 </form>
219 </div>
220 </div>
221 </div>
222 [% INCLUDE 'intranet-bottom.inc' %]