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