Bug 13618: Remove html filters at the intranet
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / pendingreserves.tt
1 [% USE KohaDates %]
2 [% USE AuthorisedValues %]
3 [%- USE Branches -%]
4 [%- USE ItemTypes -%]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Circulation &rsaquo; Holds to pull</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% INCLUDE 'calendar.inc' %]
9 <!-- Plugin datatables -->
10 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
11 [% INCLUDE 'datatables.inc' %]
12 <script type="text/JavaScript">
13 //<![CDATA[
14 $(document).ready(function() {
15   var holdst = $("#holdst").dataTable($.extend(true, {}, dataTablesDefaults, {
16     "aoColumnDefs": [
17         { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
18         { "sType": "title-string", "aTargets" : [ "title-string" ] },
19         { "sType": "string", "aTargets": [ "string-sort" ] } //Target columns that use <br> separators and pull-down menus.
20     ],
21     "sPaginationType": "full_numbers"
22   }));
23   holdst.fnAddFilters("filter");
24   [%# add separateData function to cleanse jQuery select lists by breaking apart strings glued with BR tags and then de-duplicating any repeated library codes %]
25   function separateData ( ColumnData ){
26     var cD = ColumnData;
27     var new_array = new Array();
28     for ( j=0 ; j<cD.length ; j++ ) {
29         var split_array = cD[j].split(/<br>/gi);
30         for ( k=0 ; k<split_array.length ; k++ ){
31             var check_array = $.inArray(split_array[k], new_array);
32             if (check_array == -1) {
33                 new_array.push(split_array[k]);
34             }
35         }
36     }
37     new_array.sort();
38     return new_array;
39   }
40   [%# add SeparateData function into createSelect function, so that it does the createSelect on clean data %]
41   function createSelect( data ) {
42       data = separateData(data);
43       var r='<select style="width:99%"><option value="">' + _("None") + '</option>', i, len=data.length;
44       for ( i=0 ; i<len ; i++ ) {
45           r += '<option value="'+data[i]+'">'+data[i]+'</option>';
46       }
47       return r+'</select>';
48   }
49   $("#homebranchfilter").each( function () {
50       $(this).html( createSelect( holdst.fnGetColumnData(4) ) );
51       $('select', this).change( function () {
52           var filter_value = $(this).val();
53           if(filter_value){
54                 filter_value = "(^|>)"+filter_value+"($|<)";
55           }
56           holdst.fnFilter( filter_value, 4, true );
57       } );
58   } );
59   $("#itypefilter").each( function () {
60       $(this).html( createSelect( holdst.fnGetColumnData(8) ) );
61       $('select', this).change( function () {
62           holdst.fnFilter( $(this).val(), 8 );
63       } );
64   } );
65   $("#locationfilter").each( function () {
66       $(this).html( createSelect( holdst.fnGetColumnData(9) ) );
67       $('select', this).change( function () {
68           holdst.fnFilter( $(this).val(), 9 );
69       } );
70   } );
71 });
72 //]]>
73 </script>
74 </head>
75 <body id="circ_pendingreserves" class="circ">
76 [% INCLUDE 'header.inc' %]
77 [% INCLUDE 'circ-search.inc' %]
78
79
80 <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>
81
82 <div id="doc3" class="yui-t2">
83
84    <div id="bd">
85     <div id="yui-main">
86     <div class="yui-b">
87
88 <h2>Holds to pull[% IF ( run_report ) %] placed between [% from | $KohaDates %] and [% to | $KohaDates %][% END %]</h2>
89 [% IF ( run_report ) %]
90 <h3>Reported on [% todaysdate | $KohaDates %]</h3>
91 <p>The following holds have not been filled. Please retrieve them and check them in.</p>
92 <div class="searchresults">
93     [% IF ( reserveloop ) %]
94     <table id="holdst">
95     <thead>
96         <tr>
97         <th>Pull this many items</th>
98         <th>Items available</th>
99         <th>Patrons with holds</th>
100         <th class="anti-the">Title</th>
101         <th class="string-sort">Libraries</th>
102         <th>Available call numbers</th>
103         <th>Available copy numbers</th>
104         <th>Available enumeration</th>
105         <th class="string-sort">Available itypes</th>
106         <th class="string-sort">Available locations</th>
107         <th class="title-string">Earliest hold date</th>
108         </tr>
109     </thead>
110     <tbody>
111         [% FOREACH reserveloo IN reserveloop %]
112         <tr>
113         [% IF ( reserveloo.borrowernumber ) %]
114             <td><p><b>[% reserveloo.pullcount %]</b></p></td>
115             <td>[% reserveloo.count %]</td>
116             <td>[% reserveloo.rcount %]</td>
117             <td>
118             <p>
119                 [% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %]
120                 [% reserveloo.title %]</a></p>
121                 [% IF ( reserveloo.author ) %]<p> by [% reserveloo.author %]</p>[% END %]
122             </td>
123         [% ELSE %]
124             <td>"</td>
125             <td>"</td>
126             <td>"</td>
127             <td>"</td>
128         [% END %]
129         <td>
130             [% FOREACH holdingbranch IN reserveloo.holdingbranches %]
131                 [% Branches.GetName ( holdingbranch ) %]<br>
132             [% END %]
133         </td>
134         <td><p>[% reserveloo.itemcallnumber %]</p></td>
135         <td><p>[% reserveloo.copyno %]</p></td>
136         <td><p>[% reserveloo.enumchron %]</p></td>
137         <td>
138         [% FOREACH itype IN reserveloo.itypes %]
139             [% ItemTypes.GetDescription( itype ) %]
140         [% END %]
141         </td>
142         <td>
143         [% FOREACH loc IN reserveloo.locations %]
144             [% AuthorisedValues.GetByCode('LOC', loc) %]<br>
145         [% END %]
146         </td>
147         <td>
148             <span title="[% reserveloo.reservedate %]">[% reserveloo.reservedate | $KohaDates %] in [% Branches.GetName ( reserveloo.branch ) %]</span>
149             [% IF ( reserveloo.statusw ) %]<p>Waiting</p>[% END %][% IF ( reserveloo.statusf ) %]<p>Fulfilled</p>[% END %]
150         </td>
151         </tr>
152         [% END %]
153     </tbody>
154     <tfoot>
155         <tr>
156         <td><input type="text" class="filter" data-column_num="0" placeholder="Pull this many items" style="width:95%"/></td>
157         <td><input type="text" class="filter" data-column_num="1" placeholder="Items available" style="width:95%"/></td>
158         <td><input type="text" class="filter" data-column_num="2" placeholder="Patron holds" style="width:95%"/></td>
159         <td><input type="text" class="filter" data-column_num="3" placeholder="Title" style="width:95%"/></td>
160         <td id="homebranchfilter"></td>
161         <td><input type="text" class="filter" data-column_num="5" placeholder="Call number" style="width:95%"/></td>
162         <td><input type="text" class="filter" data-column_num="6" placeholder="Available copy" style="width:95%"/></td>
163         <td><input type="text" class="filter" data-column_num="7" placeholder="Available enumeration" style="width:95%"/></td>
164         <td id="itypefilter"></td>
165         <td id="locationfilter"></td>
166         <td></td>
167         </tr>
168     </tfoot>
169     </table>
170     [% ELSE %]
171         <b>No items found.</b>
172     [% END %]
173 </div>
174 [% END %]
175
176 </div>
177 </div>
178 <div class="yui-b">
179 <div id="filters">
180
181 <form action="/cgi-bin/koha/circ/pendingreserves.pl" method="post" >
182 <fieldset class="brief">
183 <h4>Refine results</h4>
184 <ol>
185 <li>
186 <label for="from">
187     Start date:
188 </label>
189 <input type="text" size="10" id="from" name="from" value="[% from | $KohaDates %]" class="datepickerfrom" />
190 </li>
191 <li><label for="to">
192     End date:
193 </label>
194 <input type="text" size="10" id="to" name="to" value="[% to | $KohaDates %]" class="datepickerto" />
195 </li>
196 </ol>
197 <p><i>(Inclusive, default is [% HoldsToPullStartDate %] days ago to [% IF ( HoldsToPullEndDate ) %][% HoldsToPullEndDate %] days ahead[% ELSE %]today[% END %], set other date ranges as needed. )</i></p>
198 <fieldset class="action"><input type="submit" name="run_report" value="Submit" class="submit"/></fieldset>
199 </fieldset>
200 </form>
201
202 </div>
203 </div>
204 </div>
205 [% INCLUDE 'intranet-bottom.inc' %]