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