Bug 25744: Replace <i> with <em> in staff interface
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / pendingreserves.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE KohaDates %]
5 [% USE TablesSettings %]
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 id="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</th>
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><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% reserveloo.borrowernumber | uri %]">[% reserveloo.firstname | html %] [% reserveloo.surname | html %]</a></td>
77             <td>
78             <p>
79                 [% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %]
80                     [% INCLUDE 'biblio-title.inc' biblio=reserveloo %]
81                 </a></p>
82                 [% IF ( reserveloo.author ) %]<p> by [% reserveloo.author | html %]</p>[% END %]
83                 [% IF ( reserveloo.editionstatement ) %]<p>[% reserveloo.editionstatement | html %]</p>[% END %]
84                 [% IF ( reserveloo.publicationyear ) %]<p>[% reserveloo.publicationyear | html %]</p>[% END %]
85             </td>
86         [% ELSE %]
87             <td>"</td>
88             <td>"</td>
89             <td>"</td>
90             <td>"</td>
91             <td>"</td>
92         [% END %]
93         <td>
94             [% IF ( reserveloo.holdingbranches ) %]
95                <ul>
96                     [% FOREACH holdingbranch IN reserveloo.holdingbranches %]
97                         <li>
98                             [% Branches.GetName ( holdingbranch ) | html %]
99                         </li>
100                     [% END %]
101                </ul>
102             [% END %]
103         </td>
104         <td>
105             [% IF ( reserveloo.itemcallnumber ) %]
106                 <ul>
107                     [% FOREACH itemcallnumber IN reserveloo.itemcallnumber  %]
108                         <li>
109                             [% itemcallnumber | html %]
110                         </li>
111                     [% END %]
112                 </ul>
113             [% END %]
114         </td>
115         <td>
116             [% IF ( reserveloo.copyno ) %]
117                 <ul>
118                     [% FOREACH copyno IN reserveloo.copyno %]
119                         <li>
120                             [% copyno | html %]
121                         </li>
122                     [% END %]
123                 </ul>
124             [% END %]
125         </td>
126         <td>
127             [% IF ( reserveloo.enumchron ) %]
128                 <ul>
129                     [% FOREACH enumchron IN reserveloo.enumchron %]
130                         <li>
131                             [% enumchron | html %]
132                         </li>
133                     [% END %]
134                 </ul>
135             [% END %]
136         </td>
137         <td>
138         [% FOREACH itemType IN reserveloo.itemTypes %]
139             [% ItemTypes.GetDescription( itemType ) | html %]
140         [% END %]
141         </td>
142         <td>
143         [% FOREACH loc IN reserveloo.locations %]
144             [% AuthorisedValues.GetByCode('LOC', loc) | html %]
145         [% END %]
146         </td>
147         <td>
148             <span title="[% reserveloo.reservedate | html %]">[% reserveloo.reservedate | $KohaDates %] in [% Branches.GetName ( reserveloo.branch ) | html %]</span>
149         </td>
150         <td>
151             <form name="cancelReserve" action="/cgi-bin/koha/circ/pendingreserves.pl" method="post">
152                 <input type="hidden" name="op" value="cancel_reserve" />
153                 <input type="hidden" name="reserve_id" value="[% reserveloo.reserve_id | html %]" />
154
155                 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
156                 [% IF hold_cancellation %]
157                     <div class="form-group">
158                         <label for="cancellation-reason">Cancellation reason:</label>
159                         <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
160                             <option value="">No reason given</option>
161                             [% FOREACH reason IN hold_cancellation %]
162                                 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
163                             [% END %]
164                         </select>
165                     </div>
166                 [% END %]
167
168                 [% IF reserveloo.holdingbranch != reserveloo.homebranch %]
169                     <input class="btn btn-default" type="submit" value="Cancel hold and return to : [% Branches.GetName( reserveloo.homebranch ) | html %]" />
170                 [% ELSE %]
171                     <input class="btn btn-default" type="submit" value="Cancel hold" />
172                 [% END %]
173             </form>
174
175         [% IF Koha.Preference('CanMarkHoldsToPullAsLost') != 'do_not_allow' %]
176             [% IF reserveloo.itemnumber %]
177                 <form name="cancelReserve" action="/cgi-bin/koha/circ/pendingreserves.pl" method="post">
178                     <input type="hidden" name="reserve_id" value="[% reserveloo.reserve_id | html %]" />
179                     [% IF Koha.Preference('CanMarkHoldsToPullAsLost') == 'allow' %]
180                         <input type="hidden" name="op" value="mark_as_lost" />
181                         <input type="submit" value="Mark item as lost" />
182                     [% ELSIF Koha.Preference('CanMarkHoldsToPullAsLost') == 'allow_and_notify' %]
183                         <input type="hidden" name="op" value="mark_as_lost_and_notify" />
184                         <input type="submit" value="Mark lost and notify patron" />
185                     [% END %]
186                 </form>
187             [% ELSE %]
188                 <span>Biblio level hold.</span>
189             [% END %]
190         [% END %]
191             </td>
192         </tr>
193         [% END %]
194     </tbody>
195     <tfoot>
196         <tr>
197         <td><input type="text" class="filter" data-column_num="0" placeholder="Pull this many items" style="width:95%"/></td>
198         <td><input type="text" class="filter" data-column_num="1" placeholder="Items available" style="width:95%"/></td>
199         <td><input type="text" class="filter" data-column_num="2" placeholder="Patron holds" style="width:95%"/></td>
200         <td><input type="text" class="filter" data-column_num="3" placeholder="Patron name" style="width:95%"/></td>
201         <td><input type="text" class="filter" data-column_num="4" placeholder="Title" style="width:95%"/></td>
202         <td id="homebranchfilter"></td>
203         <td><input type="text" class="filter" data-column_num="6" placeholder="Call number" style="width:95%"/></td>
204         <td><input type="text" class="filter" data-column_num="7" placeholder="Available copy" style="width:95%"/></td>
205         <td><input type="text" class="filter" data-column_num="8" placeholder="Available enumeration" style="width:95%"/></td>
206         <td id="itemtype-filter"></td>
207         <td id="locationfilter"></td>
208         <td></td>
209         <td></td>
210         </tr>
211     </tfoot>
212     </table>
213     [% ELSE %]
214         <b>No items found.</b>
215     [% END %]
216 </div>
217
218
219             </main>
220         </div> <!-- /.col-sm-10.col-sm-push-2 -->
221
222         <div class="col-sm-2 col-sm-pull-10">
223             <aside>
224
225 <div id="filters">
226
227 <form action="/cgi-bin/koha/circ/pendingreserves.pl" method="post" >
228 <fieldset class="brief">
229 <h4>Refine results</h4>
230 <ol>
231 <li>
232 <label for="from">
233     Start date:
234 </label>
235 <input type="text" size="10" id="from" name="from" value="[% from | $KohaDates %]" class="datepickerfrom" />
236 </li>
237 <li><label for="to">
238     End date:
239 </label>
240 <input type="text" size="10" id="to" name="to" value="[% to | $KohaDates %]" class="datepickerto" />
241 </li>
242 </ol>
243
244 [% IF ( HoldsToPullEndDate ) %]
245     <p><em>(Inclusive, default is [% HoldsToPullStartDate | html %] days ago to [% HoldsToPullEndDate | html %] days ahead. Set other date ranges as needed.)</em></p>
246 [% ELSE %]
247     <p><em>(Inclusive, default is [% HoldsToPullStartDate | html %] days ago to today. Set other date ranges as needed.)</em></p>
248 [% END %]
249
250 <fieldset class="action"><input type="submit" name="run_report" value="Submit" class="submit"/></fieldset>
251 </fieldset>
252 </form>
253
254 </div>
255             </aside>
256         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
257      </div> <!-- /.row -->
258
259 [% MACRO jsinclude BLOCK %]
260     [% INCLUDE 'calendar.inc' %]
261     [% INCLUDE 'datatables.inc' %]
262     [% INCLUDE 'columns_settings.inc' %]
263     <script>
264         $(document).ready(function() {
265           var columns_settings = [% TablesSettings.GetColumns('circ', 'holds', 'holds-to-pull', 'json') | $raw %];
266           var holdst = KohaTable("holdst", {
267             "sPaginationType": "full_numbers"
268           }, columns_settings);
269           holdst.fnAddFilters("filter");
270           [%# add separateData function to cleanse jQuery select lists by breaking apart strings glued with BR tags and then de-duplicating any repeated library codes %]
271           function separateData ( ColumnData ){
272             var cD = ColumnData;
273             var new_array = new Array();
274             for ( j=0 ; j<cD.length ; j++ ) {
275                 var split_array = cD[j].split(/\n/gi);
276                 for ( k=0 ; k<split_array.length ; k++ ){
277                     var str = $.trim(split_array[k].replace(/[\n\r]/g, ''));
278                     if ($.inArray(str, new_array) == -1 && str.length > 0 ) {
279                         new_array.push(str);
280                     }
281                 }
282             }
283             new_array.sort();
284             return new_array;
285           }
286           [%# add SeparateData function into createSelect function, so that it does the createSelect on clean data %]
287           function createSelect( data ) {
288               data = separateData(data);
289               var r='<select style="width:99%"><option value="">' + _("None") + '</option>', i, len=data.length;
290               var regex = /(<([^>]+)>)/ig; // Remove html tags
291               for ( i=0 ; i<len ; i++ ) {
292                   var cell_val = data[i].replace(regex, '');
293                   if ( cell_val.length < 1 ) continue;
294                   r += '<option value="'+cell_val+'">'+cell_val+'</option>';
295               }
296               return r+'</select>';
297           }
298           $("#homebranchfilter").each( function () {
299               $(this).html( createSelect( holdst.fnGetColumnData(5) ) );
300               $('select', this).change( function () {
301                   var filter_value = $(this).val();
302                   holdst.fnFilter( filter_value, 5, true );
303               });
304           });
305           $("#itemtype-filter").each( function () {
306               $(this).html( createSelect( holdst.fnGetColumnData(9) ) );
307               $('select', this).change( function () {
308                   holdst.fnFilter( $(this).val(), 9 );
309               });
310           });
311           $("#locationfilter").each( function () {
312               $(this).html( createSelect( holdst.fnGetColumnData(10) ) );
313               $('select', this).change( function () {
314                   holdst.fnFilter( $(this).val(), 10 );
315               });
316           });
317         });
318     </script>
319 [% END %]
320
321 [% INCLUDE 'intranet-bottom.inc' %]