FFZG HNB rate export changed to list / exchange istead of *
[koha_ffzg] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / pendingreserves.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE KohaDates %]
5 [% USE ColumnsSettings %]
6 [% USE AuthorisedValues %]
7 [%- USE Branches -%]
8 [%- USE ItemTypes -%]
9 [% SET footerjs = 1 %]
10 [% INCLUDE 'doc-head-open.inc' %]
11 <title>Koha &rsaquo; Circulation &rsaquo; Holds to pull</title>
12 [% INCLUDE 'doc-head-close.inc' %]
13 </head>
14
15 <body id="circ_pendingreserves" class="circ">
16 [% INCLUDE 'header.inc' %]
17 [% INCLUDE 'circ-search.inc' %]
18
19
20 <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>
21
22 <div class="main container-fluid">
23     <div class="row">
24         <div class="col-sm-10 col-sm-push-2">
25             <main>
26
27         [% FOR m IN messages %]
28             <div class="dialog [% m.type | html %]">
29                 [% SWITCH m.code %]
30                 [% CASE 'letter_enqueued' %]
31                     <span>The notice has been correctly enqueued.</span>
32                 [% CASE 'no_email_address' %]
33                     <span>The patron does not have an email address defined.</span>
34                 [% CASE 'no_template_notice' %]
35                     <span>There is no notice template with a code 'CANCEL_HOLD_ON_LOST' defined in your system.</span>
36                 [% CASE 'hold_cancelled' %]
37                     <span>The hold has been correctly cancelled.</span>
38                 [% CASE 'hold_placed_at_biblio_level' %]
39                     <span>The hold has been placed on biblio level. It is not possible to determine the item to mark as lost.</span>
40                 [% CASE %]
41                     [% m.code | html %]
42                 [% END %]
43             </div>
44         [% END %]
45
46 <h2>Holds to pull placed between [% from | $KohaDates %] and [% to | $KohaDates %]</h2>
47 <h3>Reported on [% todaysdate | $KohaDates %]</h3>
48 <p>The following holds have not been filled. Please retrieve them and check them in.</p>
49 <div class="searchresults">
50     [% IF ( reserveloop ) %]
51     <table id="holdst">
52     <thead>
53         <tr>
54         <th>Pull this many items</th>
55         <th>Items available</th>
56         <th>Patrons with holds</th>
57         <th>First patron</td>
58         <th class="anti-the">Title</th>
59         <th class="string-sort">Libraries</th>
60         <th>Available call numbers</th>
61         <th>Available copy numbers</th>
62         <th>Available enumeration</th>
63         <th class="string-sort">Available item types</th>
64         <th class="string-sort">Available locations</th>
65         <th class="title-string">Earliest hold date</th>
66         <th>Action</th>
67         </tr>
68     </thead>
69     <tbody>
70         [% FOREACH reserveloo IN reserveloop %]
71         <tr>
72         [% IF ( reserveloo.borrowernumber ) %]
73             <td><p><b>[% reserveloo.pullcount | html %]</b></p></td>
74             <td>[% reserveloo.count | html %]</td>
75             <td>[% reserveloo.rcount | html %]</td>
76             <td>
77                                 [% reserveloo.timestamp | $KohaDates with_hours => 1 %]
78                                 <br>
79                                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% reserveloo.borrowernumber | uri %]">[% reserveloo.firstname | html %] [% reserveloo.surname | html %]</a>
80                                 <br>
81                                 <em>[% reserveloo.reservenotes | html %]</em>
82                         </td>
83
84             <td>
85             <p>
86                 [% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %]
87                 [% reserveloo.title | html %] [% FOREACH s IN reserveloo.subtitle %] [% s | html %][% END %]</a></p>
88                 [% IF ( reserveloo.author ) %]<p> by [% reserveloo.author | html %]</p>[% END %]
89             </td>
90         [% ELSE %]
91             <td>"</td>
92             <td>"</td>
93             <td>"</td>
94             <td>"</td>
95             <td>"</td>
96         [% END %]
97         <td>
98             [% FOREACH holdingbranch IN reserveloo.holdingbranches %]
99                 [% Branches.GetName ( holdingbranch ) | html %]
100             [% END %]
101         </td>
102         <td><p>[% reserveloo.itemcallnumber %]</p></td>
103         <td><p>[% reserveloo.copyno %]</p></td>
104         <td><p>[% reserveloo.enumchron %]</p></td>
105         <td>
106         [% FOREACH itemType IN reserveloo.itemTypes %]
107             [% ItemTypes.GetDescription( itemType ) | html %]
108         [% END %]
109         </td>
110         <td>
111         [% FOREACH loc IN reserveloo.locations %]
112             [% AuthorisedValues.GetByCode_FFZG('LOC', loc) | html %]
113         [% END %]
114         </td>
115         <td>
116             <span title="[% reserveloo.reservedate | html %]">[% reserveloo.reservedate | $KohaDates %] in [% Branches.GetName ( reserveloo.branch ) | html %]</span>
117         </td>
118         <td>
119             <form name="cancelReserve" action="/cgi-bin/koha/circ/pendingreserves.pl" method="post">
120                 <input type="hidden" name="op" value="cancel_reserve" />
121                 <input type="hidden" name="reserve_id" value="[% reserveloo.reserve_id | html %]" />
122                 [% IF reserveloo.holdingbranch != reserveloo.homebranch %]
123                     <input type="submit" value="Cancel hold and return to : [% Branches.GetName( reserveloo.homebranch ) | html %]" />
124                 [% ELSE %]
125                     <input type="submit" value="Cancel hold" />
126                 [% END %]
127             </form>
128
129         [% IF Koha.Preference('CanMarkHoldsToPullAsLost') != 'do_not_allow' %]
130             [% IF reserveloo.itemnumber %]
131                 <form name="cancelReserve" action="/cgi-bin/koha/circ/pendingreserves.pl" method="post">
132                     <input type="hidden" name="reserve_id" value="[% reserveloo.reserve_id | html %]" />
133                     [% IF Koha.Preference('CanMarkHoldsToPullAsLost') == 'allow' %]
134                         <input type="hidden" name="op" value="mark_as_lost" />
135                         <input type="submit" value="Mark item as lost" />
136                     [% ELSIF Koha.Preference('CanMarkHoldsToPullAsLost') == 'allow_and_notify' %]
137                         <input type="hidden" name="op" value="mark_as_lost_and_notify" />
138                         <input type="submit" value="Mark lost and notify patron" />
139                     [% END %]
140                 </form>
141             [% ELSE %]
142                 <span>Biblio level hold.</span>
143             [% END %]
144         [% END %]
145         </tr>
146         [% END %]
147     </tbody>
148     <tfoot>
149         <tr>
150         <td><input type="text" class="filter" data-column_num="0" placeholder="Pull this many items" style="width:95%"/></td>
151         <td><input type="text" class="filter" data-column_num="1" placeholder="Items available" style="width:95%"/></td>
152         <td><input type="text" class="filter" data-column_num="2" placeholder="Patron holds" style="width:95%"/></td>
153         <td><input type="text" class="filter" data-column_num="3" placeholder="Patron name" style="width:95%"/></td>
154         <td><input type="text" class="filter" data-column_num="4" placeholder="Title" style="width:95%"/></td>
155         <td id="homebranchfilter"></td>
156         <td><input type="text" class="filter" data-column_num="6" placeholder="Call number" style="width:95%"/></td>
157         <td><input type="text" class="filter" data-column_num="7" placeholder="Available copy" style="width:95%"/></td>
158         <td><input type="text" class="filter" data-column_num="8" placeholder="Available enumeration" style="width:95%"/></td>
159         <td id="itemtype-filter"></td>
160         <td id="locationfilter"></td>
161         <td></td>
162         <td></td>
163         </tr>
164     </tfoot>
165     </table>
166     [% ELSE %]
167         <b>No items found.</b>
168     [% END %]
169 </div>
170
171
172             </main>
173         </div> <!-- /.col-sm-10.col-sm-push-2 -->
174
175         <div class="col-sm-2 col-sm-pull-10">
176             <aside>
177
178 <div id="filters">
179
180 <form action="/cgi-bin/koha/circ/pendingreserves.pl" method="post" >
181 <fieldset class="brief">
182 <h4>Refine results</h4>
183 <ol>
184 <li>
185 <label for="from">
186     Start date:
187 </label>
188 <input type="text" size="10" id="from" name="from" value="[% from | $KohaDates %]" class="datepickerfrom" />
189 </li>
190 <li><label for="to">
191     End date:
192 </label>
193 <input type="text" size="10" id="to" name="to" value="[% to | $KohaDates %]" class="datepickerto" />
194 </li>
195 </ol>
196
197 [% IF ( HoldsToPullEndDate ) %]
198     <p><i>(Inclusive, default is [% HoldsToPullStartDate | html %] days ago to [% HoldsToPullEndDate | html %] days ahead. Set other date ranges as needed.)</i></p>
199 [% ELSE %]
200     <p><i>(Inclusive, default is [% HoldsToPullStartDate | html %] days ago to today. Set other date ranges as needed.)</i></p>
201 [% END %]
202
203 <fieldset class="action"><input type="submit" name="run_report" value="Submit" class="submit"/></fieldset>
204 </fieldset>
205 </form>
206
207 </div>
208             </aside>
209         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
210      </div> <!-- /.row -->
211
212 [% MACRO jsinclude BLOCK %]
213     [% INCLUDE 'calendar.inc' %]
214     [% INCLUDE 'datatables.inc' %]
215     [% INCLUDE 'columns_settings.inc' %]
216     <script>
217         $(document).ready(function() {
218           var columns_settings = [% ColumnsSettings.GetColumns('circ', 'holds', 'holds-to-pull', 'json') | $raw %];
219           var holdst = KohaTable("holdst", {
220             "aoColumnDefs": [
221                 { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
222                 { "sType": "title-string", "aTargets" : [ "title-string" ] },
223                 { "sType": "string", "aTargets": [ "string-sort" ] }
224             ],
225             "sPaginationType": "full_numbers"
226           }, columns_settings);
227           holdst.fnAddFilters("filter");
228           [%# add separateData function to cleanse jQuery select lists by breaking apart strings glued with BR tags and then de-duplicating any repeated library codes %]
229           function separateData ( ColumnData ){
230             var cD = ColumnData;
231             var new_array = new Array();
232             for ( j=0 ; j<cD.length ; j++ ) {
233                 var split_array = cD[j].split(/\n/gi);
234                 for ( k=0 ; k<split_array.length ; k++ ){
235                     var str = $.trim(split_array[k].replace(/[\n\r]/g, ''));
236                     if ($.inArray(str, new_array) == -1 && str.length > 0 ) {
237                         new_array.push(str);
238                     }
239                 }
240             }
241             new_array.sort();
242             return new_array;
243           }
244           [%# add SeparateData function into createSelect function, so that it does the createSelect on clean data %]
245           function createSelect( data ) {
246               data = separateData(data);
247               var r='<select style="width:99%"><option value="">' + _("None") + '</option>', i, len=data.length;
248               for ( i=0 ; i<len ; i++ ) {
249                   r += '<option value="'+data[i]+'">'+data[i]+'</option>';
250               }
251               return r+'</select>';
252           }
253           $("#homebranchfilter").each( function () {
254               $(this).html( createSelect( holdst.fnGetColumnData(5) ) );
255               $('select', this).change( function () {
256                   var filter_value = $(this).val();
257                   holdst.fnFilter( filter_value, 5, true );
258               });
259           });
260           $("#itemtype-filter").each( function () {
261               $(this).html( createSelect( holdst.fnGetColumnData(9) ) );
262               $('select', this).change( function () {
263                   holdst.fnFilter( $(this).val(), 9 );
264               });
265           });
266           $("#locationfilter").each( function () {
267               $(this).html( createSelect( holdst.fnGetColumnData(10) ) );
268               $('select', this).change( function () {
269                   holdst.fnFilter( $(this).val(), 10 );
270               });
271           });
272         });
273     </script>
274 [% END %]
275
276 [% INCLUDE 'intranet-bottom.inc' %]