Bug 7703: Don't block bulk hold action on search results if some items can't be place...
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / reserve / request.tt
1 [% USE raw %]
2 [% USE To %]
3 [% USE Asset %]
4 [% USE JSON.Escape %]
5 [% USE Koha %]
6 [% USE KohaDates %]
7 [% USE Branches %]
8 [% USE Categories %]
9 [% USE ItemTypes %]
10 [% USE AuthorisedValues %]
11 [% USE Price %]
12 [% USE TablesSettings %]
13 [% SET footerjs = 1 %]
14 [% INCLUDE 'doc-head-open.inc' %]
15 [% UNLESS ( multi_hold ) %]
16     <title>Place a hold on [% INCLUDE 'biblio-title-head.inc' %] &rsaquo; Holds &rsaquo; Circulation &rsaquo; Koha</title>
17 [% ELSE %]
18     <title>Confirm holds &rsaquo; Holds &rsaquo; Circulation &rsaquo; Koha</title>
19 [% END %]
20 [% INCLUDE 'doc-head-close.inc' %]
21 </head>
22
23 <body id="circ_request" class="catalog">
24
25 [% INCLUDE 'header.inc' %]
26 [% INCLUDE 'circ-search.inc' %]
27
28 [% UNLESS ( multi_hold ) %]
29     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
30         <ol>
31             <li>
32                 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
33             </li>
34             <li>
35                 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
36             </li>
37             <li>
38                 [% INCLUDE 'biblio-title.inc' link =1 %]
39             </li>
40             <li>
41                 <a href="#" aria-current="page">
42                     Place a hold
43                 </a>
44             </li>
45         </ol>
46     </nav>
47 [% ELSE %]
48     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
49         <ol>
50             <li>
51                 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
52             </li>
53             <li>
54                 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
55             </li>
56             <li>
57                 <a href="#" aria-current="page">
58                     Confirm holds
59                 </a>
60             </li>
61         </ol>
62     </nav>
63 [% END # UNLESS multi_hold %]
64
65 <div class="main container-fluid">
66     <div class="row">
67         [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
68             <div class="col-md-10 col-md-offset-1">
69         [% ELSE %]
70             <div class="col-sm-10 col-sm-push-2">
71         [% END %]
72
73         <main>
74
75             [% IF ( nobiblio ) %]
76                 <div class="dialog alert">
77                 [%IF (multi_hold) %]
78                     <strong>Cannot place hold:</strong> one or more records don't exist.
79                 [% ELSE %]
80                     <strong>Cannot place hold:</strong> this record doesn't exist.
81                 [% END %]
82                 </div>
83             [% END %]
84             [% IF ( noitems ) %]
85                 <div class="dialog alert">
86                 [%IF (multi_hold) %]
87                     <strong>Cannot place hold:</strong> one or more records without items attached.
88                 [% ELSE %]
89                     <strong>Cannot place hold:</strong> this record has no items attached.
90                 [% END %]
91                 </div>
92             [% END %]
93
94             [% IF ( messagetransfert ) %]
95                 <div class="dialog message">
96                     <h2>Hold found for ([% nextreservtitle | html %]), please transfer</h2>
97                     <p>Hold placed by : <strong> [% nextreservsurname | html %] [% nextreservfirstname | html %]</strong> at : <strong> [% branchname | html %] </strong>, Please transfer this item.
98                     </p>
99                     <form name="cancelReservewithtransfert" action="branchreserves.pl" method="post">
100                         <input type="submit" class="button" />
101                     </form>
102                 </div>
103             [% END %]
104
105             [% UNLESS ( nobiblio ) %]
106                 [% UNLESS ( multi_hold ) %]
107                         <h1>Place a hold on [% INCLUDE 'biblio-title.inc' link = 1 %]</h1>
108                 [% ELSE %]
109                     <h1>Confirm holds</h1>
110                 [% END %]
111             [% END %]
112
113             [% UNLESS club OR patron OR patron.borrowernumber OR noitems OR nobiblio %]
114                 [% IF ( messageborrower ) %]
115                     <div class="dialog alert">
116                         <h3>Patron not found</h3>
117                         <p>No patron with this name, please, try another</p>
118                     </div>
119                 [% END %]
120
121                 [% IF ( messageclub ) %]
122                     <div class="dialog alert">
123                         <h3>Club not found</h3>
124                         <p>No club with this name, please, try another</p>
125                     </div>
126                 [% END %]
127                 <fieldset class="brief">
128                     [% IF clubcount %]
129                         <label>Search patrons or clubs</label>
130                     [% ELSE %]
131                         <label>Search patrons</label>
132                     [% END %]
133                     <div id="circ_holds_select" class="toptabs">
134                         <ul>
135                             <li><a href="#holds_patronsearch_pane">Patrons</a></li>
136                             [% IF clubcount %]
137                                 <li><a href="#holds_clubsearch_pane">Clubs</a></li>
138                             [% END %]
139                         </ul>
140                         <div id="holds_patronsearch_pane">
141                             <form id="holds_patronsearch" action="request.pl?biblionumbers=[% biblionumbers | html %]" method="post">
142                                 <div class="hint">Enter patron card number or partial name:</div>
143                                 <input type="text" size="40" id="patron" class="focus" name="findborrower" autocomplete="off" />
144                                 <input type="submit" value="Search" />
145                                 [% IF multi_hold %]
146                                     <input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
147                                 [% ELSE %]
148                                     <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
149                                 [% END %]
150
151                             </form> <!-- /#holds_patronsearch -->
152                             [% IF borrowers %]
153                                 [% INCLUDE 'circ-patron-search-results.inc' destination = "holds" %]
154                             [% END %]
155                         </div>
156                         [% IF clubcount %]
157                             <div id="holds_clubsearch_pane">
158                                 <form id="holds_clubsearch" action="request.pl?biblionumbers=[% biblionumbers | html %]" method="post">
159                                     <div class="hint">Enter club ID or partial name:</div>
160                                     <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" />
161                                     <input type="submit" value="Search" />
162                                     [% IF multi_hold %]
163                                         <input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
164                                     [% ELSE %]
165                                         <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
166                                     [% END %]
167
168                                 </form> <!-- /#holds_patronsearch -->
169                                 [% IF clubs %]
170                                     [% INCLUDE 'clubs-table.inc' destination = "holds" %]
171                                 [% END %]
172                             </div>
173                         [% END %]
174                     </div>
175                 </fieldset>
176             [% ELSIF club %]
177                 <div class="dialog alert hide clubalert">
178                 </div>
179                 <fieldset class="rows">
180                     <legend>Hold details</legend>
181                     <form action="/api/v1/clubs/[% club.id | html %]/holds" method="post" name="form" id="club-request-form">
182
183                         [% IF ( multi_hold ) %]
184                             <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
185                             <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
186                             <input type="hidden" name="request" value="any"/>
187                             [% FOREACH biblioloo IN biblioloop %]
188                                 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
189                                 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
190                             [% END %]
191                         [% ELSE %]
192                             <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
193                             <input type="hidden" name="title" value="[% biblio.title | html %]" />
194                             <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
195                         [% END # /IF multi_hold %]
196                         <ol>
197                             <li>
198                                 <span class="label">Club: </span> [% club.name | html %]
199                             </li>
200                             <li>
201                                 <span class="label">Description: </span> [% club.description | html %]
202                             </li>
203                             <li>
204                                 <label for="pickup">Pickup at:</label>
205                                 <select name="pickup" id="pickup_club">
206                                     [% PROCESS options_for_libraries libraries => Branches.all({ selected => club.branchcode, search_params => { pickup_location => 1 } }) %]
207                                 </select>
208                             </li>
209                             <li>
210                                 <label for="default_patron_home">Pickup at patron's home library when possible:</label>
211                                 <input type="checkbox" id="default_patron_home" name="default_patron_home"/>
212                             </li>
213                         </ol>
214                         <h2 style="padding: 0 1em;">Members</h2>
215                         <ol>
216                             [% FOREACH member IN members %]
217                                 [% SET patron = member.patron %]
218                                 <li style="padding: 0.5em 1em;">
219                                     <div><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a></div>
220                                     [% IF member.exceeded_maxreserves %]
221                                         <div>
222                                             <i class="fa fa-error"></i>
223                                             <strong>Too many holds: </strong> Patron can only place a maximum of [% maxreserves | html %] total holds.
224                                         </div>
225                                     [% END %]
226                                     [% IF ( member.expiry ) %]
227                                         <div>
228                                             <i class="fa fa-warning"></i>
229                                             <strong>Account has expired</strong>
230                                         </div>
231                                     [% END %]
232                                     [% IF patron.is_debarred %]
233                                         <div>
234                                             <i class="fa fa-warning"></i>
235                                             <strong>Patron has restrictions</strong>
236                                         </div>
237                                     [% END %]
238                                     [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
239                                         <div>
240                                             <i class="fa fa-warning"></i>
241                                             <strong>Patron has outstanding fines: [% member.amount_outstanding | $Price %]</strong>
242                                         </div>
243                                     [% END %]
244
245                                     [% IF ( member.diffbranch ) %]
246                                         <div>
247                                             <i class="fa fa-warning"></i>
248                                             <strong>Pickup library is different.</strong> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )
249                                         </div>
250                                     [% END %]
251                                 </li>
252                             [% END %]
253                         </ol>
254                         [% UNLESS ( multi_hold ) %]
255                             <fieldset class="action">
256                                 <input type="submit" value="Place hold" />
257                             </fieldset>
258                         [% ELSE %]
259                             <table id="requesttitles">
260                                 <tr>
261                                     <th>&nbsp;</th>
262                                     <th>Title</th>
263                                     [% UNLESS ( item_level_itypes ) %]
264                                         <th>Item type</th>
265                                     [% END %]
266                                     <th>Priority</th>
267                                     <th>Information</th>
268                                 </tr>
269                                 [% FOREACH biblioloo IN biblioloop %]
270                                     [% IF ( biblioloo.warn ) %]
271                                         <tr class="onissue">
272                                     [% ELSE %]
273                                         <tr>
274                                     [% END %]
275                                         <td>
276                                             [% UNLESS ( biblioloo.warn ) %]
277                                                     <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
278                                                 </td>
279                                             [% END %]
280                                         <td>
281                                             <ul>
282                                                 <li>
283                                                     <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
284                                                 </li>
285                                                 [% IF ( biblioloo.publicationyear ) %]
286                                                     <li>
287                                                         <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
288                                                     </li>
289                                                 [% END %]
290                                             </ul>
291                                             [% IF ( biblioloo.warn ) %]
292                                                 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
293                                             [% END %]
294                                         </td>
295                                         [% UNLESS ( item_level_itypes ) %]
296                                             <td>
297                                                 <img src="[% biblioloo.imageurl | html %]" alt="[% biblioloo.itypename | html %]" title="[% biblioloo.itypename | html %]" />
298                                             </td>
299                                         [% END %]
300                                         <td>[% biblioloo.rank | html %]</td>
301                                         <td>
302                                             [% IF ( biblioloo.checked_previously ) %]
303                                                 <span>Patron has previously checked out this title</span><br/>
304                                             [% END %]
305                                             [% IF ( biblioloo.alreadyres ) %]
306                                                 <ul>
307                                             [% ELSE %]
308                                                 [% IF ( biblioloo.none_avail ) %]
309                                                     <ul>
310                                                 [% END %]
311                                             [% END %]
312
313                                             [% IF ( biblioloo.alreadyres ) %]
314                                                 <li>
315                                                     <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
316                                                     <strong>already has a hold</strong> on this item
317                                                 </li>
318                                             [% END %]
319                                             [% IF ( biblioloo.none_avail ) %]
320                                                 <li> <strong>No items are available</strong> to be placed on hold</li>
321                                             [% END %]
322
323                                             [% IF ( biblioloo.alreadyres ) %]
324                                                 </ul>
325                                             [% ELSE %]
326                                                 [% IF ( biblioloo.none_avail ) %]
327                                                     </ul>
328                                                 [% END %]
329                                             [% END %]
330                                         </td>
331                                     </tr>
332                                 [% END # /FOREACH biblioloo %]
333                             </table> <!-- /#requesttitles -->
334                         [% END %]
335                     </form>
336                 </fieldset>
337             [% ELSIF NOT ( noitems || nobiblio ) # /UNLESS patron %]
338
339                 [% IF ( checked_previously && !multi_hold ) %]
340                     <div class="dialog alert">
341                         <ul>
342                             <li>Patron has previously checked out this title</li>
343                         </ul>
344                     </div>
345                 [% END %]
346
347                 [% IF ( no_reserves_allowed || exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted ) %]
348                     <div class="dialog alert">
349
350                         [% UNLESS ( multi_hold ) %]
351                             <h3>Cannot place hold</h3>
352                             <ul>
353                                 [% IF ( no_reserves_allowed ) %]
354                                     <li><strong>No holds allowed: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> cannot place a hold on any of these items.</li>
355                                 [% ELSIF ( exceeded_maxreserves ) %]
356                                     <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> can only place a maximum of [% maxreserves | html %] total holds.</li>
357                                 [% ELSIF ( exceeded_holds_per_record ) %]
358                                     <li><strong>Too many holds for this record: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> can only place a maximum of [% max_holds_for_record | html %] hold(s) on this record.</li>
359                                 [% ELSIF ( alreadypossession ) %]
360                                     <li> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a> <strong>is already in possession</strong> of one item.</li>
361                                 [% ELSIF ( alreadyreserved ) %]
362                                     <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a> <strong>already has a hold</strong> on this item.</li>
363                                 [% ELSIF ( ageRestricted ) %]
364                                     <li><strong>Age restricted</strong></li>
365                                 [% ELSIF ( none_available ) %]
366                                     <li> <strong>No items are available</strong> to be placed on hold.</li>
367                                 [% ELSIF ( maxreserves ) %]
368                                     <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> has too many holds.</li>
369                                 [% END # /IF exceeded_maxreserves %]
370                             </ul>
371                         [% ELSE # UNLESS multi_hold %]
372                             <h3>Cannot place hold on some items</h3>
373                             [% IF (no_reserves_allowed ) %]
374                                 <li><strong>No holds allowed: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> cannot place holds on some of these title's items.</li>
375                             [% ELSIF ( exceeded_maxreserves ) %]
376                                 <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> can place [% new_reserves_allowed | html %] of the requested [% new_reserves_count | html %] holds for a maximum of [% maxreserves | html %] total holds.</li>
377                             [% ELSIF ( exceeded_holds_per_record ) %]
378                                 [% FOREACH biblioloo IN biblioloop %]
379                                     [% IF (biblioloo.tooManyHoldsForThisRecord) %]
380                                         <li><strong>Too many holds for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]"> [% biblioloo.title | html %]</a>: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | html %]">[% patron.firstname | html %] [% patron.surname | html %] </a> can only place a maximum of [% max_holds_for_record | html %] hold(s) on this record.</li>
381                                     [% END %]
382                                 [% END %]
383                             [% END # /IF exceeded_maxreserves %]
384                         [% END # /UNLESS multi_hold %]
385                     </div>
386                 [% END # /IF ( exceeded_maxreserves || ... %]
387
388                 [% IF ( expiry || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
389                     <div class="dialog message">
390                         <ul>
391                             [% IF ( expiry ) %]
392                                 <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>: <strong>Account has expired</strong></li>
393                             [% END %]
394
395                             [% IF patron.is_debarred %]
396                                 <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]#reldebarments">[% patron.firstname | html %] [% patron.surname | html %]</a>: <strong>Patron has restrictions</strong></li>
397                             [% END %]
398
399                             [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
400                                 <li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>: <strong>Patron has outstanding fines: [% amount_outstanding | $Price %]</strong></li>
401                             [% END %]
402
403                             [% IF ( diffbranch ) %]
404                                 <li> <strong>Pickup library is different. </strong>Patron: <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )</li>
405                             [% END %]
406                         </ul> <!-- /.dialog.message -->
407                     </div>
408                 [% END # /IF expiry || diffbranch ... %]
409
410                 [% IF ( messageborrower ) %]
411                     <div class="dialog alert">
412                         <h3>Patron not found:</h3>
413                         <p>Name or barcode not found. Please try an other </p>
414                     </div>
415                 [% END %]
416
417                 <div class="dialog alert hide holdalert">
418                 </div>
419
420                 <fieldset class="rows">
421                     <legend>Hold details</legend>
422                     <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
423
424                         <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
425                         <input type="hidden" name="type" value="str8" />
426
427                         [% IF ( multi_hold ) %]
428                             <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
429                             <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
430                             <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
431                             <input type="hidden" name="request" value="any"/>
432                             [% FOREACH biblioloo IN biblioloop %]
433                                 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
434                                 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
435                             [% END %]
436                         [% ELSE %]
437                             <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
438                             <input type="hidden" name="title" value="[% biblio.title | html %]" />
439                             <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
440                         [% END # /IF multi_hold %]
441
442                         <ol>
443                             <li>
444                                 <span class="label">Patron:</span>
445                                 [% IF ( patron.borrowernumber ) %]
446                                     <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a>
447                                 [% ELSE %]
448                                     Not defined yet
449                                 [% END %]
450                             </li>
451
452                             [% UNLESS ( multi_hold ) %]
453                                 <li>
454                                     <span class="label">Estimated priority:</span>
455                                     <strong>[% fixedRank | html %]</strong>
456                                 </li>
457                             [% END %]
458
459                             <li>
460                                 <label for="holdnotes">Notes:</label>
461                                 <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
462                             </li>
463                             <li>
464                                 <label for="pickup">Pickup at:</label>
465                             [% UNLESS ( multi_hold ) %]
466                                 <select name="pickup" id="pickup" data-biblio-id="[% biblio.biblionumber | html %]" data-patron-id="[% patron.borrowernumber | html %]">
467                                     [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
468                             [% ELSE %]
469                                 <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
470                                     <option value="" selected="selected"></option>
471                                 [% FOREACH pickup_location IN multi_pickup_locations %]
472                                     <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
473                                 [% END %]
474                             [% END %]
475                                 </select>
476                             </li>
477
478                             [% UNLESS ( multi_hold ) %]
479                                 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
480                                     <li>
481                                         <label for="itemtype">Request specific item type:</label>
482                                         <select name="itemtype" id="itemtype">
483                                             <option value="">Any item type</option>
484                                             [%- FOREACH itemtype IN available_itemtypes %]
485                                                 <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
486                                             [%- END %]
487                                         </select>
488                                     </li>
489                                 [% END %]
490                             [% END # /UNLESS multi_hold %]
491
492                             [% IF ( reserve_in_future ) %]
493                                 <li>
494                                     <label for="from">Hold starts on date:</label>
495                                     <input name="reserve_date" id="from" size="10" class="datepickerfrom" type="text" >
496                                     <input type="hidden" class="datepickerfrom_hidden" />
497                                     <a href="#" id="clear-date-from" class="clear-date">Clear date</a>
498                                 </li>
499                             [% END %]
500
501                             <li>
502                                 <label for="to">Hold expires on date:</label>
503                                 <input name="expiration_date" id="to" size="10" class="datepickerto" type="text" />
504                                 <input type="hidden" class="datepickerto_hidden" />
505                                 <a href="#" id="clear-date-to" class="clear-date">Clear date</a>
506                             </li>
507
508                             [% UNLESS ( multi_hold ) %]
509                                 <li>
510                                     <label for="requestany">Hold next available item </label>
511                                     [% IF force_hold_level == 'item' %]
512                                         <input type="checkbox" id="requestany" name="request" disabled="true" />
513                                     [% ELSIF force_hold_level == 'record' %]
514                                         <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
515                                         <input type="hidden" name="request" value="Any"/>
516                                     [% ELSE %]
517                                         <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
518                                     [% END %]
519                                     <input type="hidden" name="biblioitem" value="[% biblioitemnumber | html %]" />
520                                     <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
521                                 </li>
522
523                                 [% IF remaining_holds_for_record > 1 %]
524                                     <li>
525                                         <label for="holds_to_place_count">Holds to place (count)</label>
526                                         <input type="text" inputmode="numeric" pattern="[0-9]*" id="holds_to_place_count" name="holds_to_place_count" maxlength="[% remaining_holds_for_record | html %]" value="1" />
527                                     </li>
528                                 [% ELSE %]
529                                     <input type="hidden" name="holds_to_place_count" value="1" />
530                                 [% END %]
531                             [% END # /UNLESS multi_hold %]
532
533                             <li id="non_priority_list_item">
534                                 <label for="non_priority">Non priority hold:</label>
535                                 <input name="non_priority" id="non_priority" type="checkbox" />
536                                 <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
537                             </li>
538                         </ol>
539
540                         [% UNLESS ( multi_hold ) %]
541                             <fieldset class="action">
542                                 [% IF ( patron.borrowernumber ) %]
543                                     [% IF ( override_required ) %]
544                                         <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
545                                     [% ELSIF ( none_available ) %]
546                                         <button type="submit" disabled="disabled" class="btn btn-default btn-disabled">Place hold</button>
547                                     [% ELSE %]
548                                         <button type="submit" class="btn btn-default">Place hold</button>
549                                     [% END %]
550                                 [% END %]
551                             </fieldset>
552
553                             [% FOREACH bibitemloo IN bibitemloop %]
554                                 <ol>
555                                     [% UNLESS ( item_level_itypes ) %]
556                                         <li>
557                                             <span class="label">Item type:</span>
558                                             [% bibitemloo.description | html %]
559                                         </li>
560                                     [% END %]
561
562                                     [% IF ( bibitemloo.publicationyear ) %]
563                                         <li>
564                                             <span class="label">Publication year:</span>
565                                             [% bibitemloo.publicationyear | html %]
566                                         </li>
567                                     [% END %]
568                                 </ol>
569
570                                 <h2 style="padding: 0 1em;">
571                                     Place a hold on a specific item
572                                     [% IF bibitemloo.force_hold_level == 'item' %]
573                                          <span class="error"><em>(Required)</em></span>
574                                     [% END %]
575                                 </h2>
576
577                                 <table id="requestspecific">
578                                     <thead>
579                                         <tr>
580                                             <th>Hold</th>
581                                             [% IF ( item_level_itypes ) %]
582                                                 <th>Item type</th>
583                                             [% END %]
584                                             <th>Barcode</th>
585                                             <th>Home library</th>
586                                             <th>Last location</th>
587                                             [% IF itemdata_ccode %]
588                                                 <th>Collection</th>
589                                             [% END %]
590                                             <th>Call number</th>
591                                             <th>Copy number</th>
592                                             [% IF itemdata_enumchron %]
593                                                 <th>Vol no.</th>
594                                             [% END %]
595                                             <th>Information</th>
596                                             <th>Allowed pickup locations</th>
597                                         </tr>
598                                     </thead>
599                                     <tbody>
600                                         [% SET selected = 0 %]
601                                         [% FOREACH itemloo IN bibitemloo.itemloop %]
602                                             [% UNLESS ( itemloo.hide ) %]
603                                                 <tr class="[% itemloo.backgroundcolor | html %]">
604                                                     <td>
605                                                         [% IF itemloo.force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
606                                                             <span class="error">
607                                                                 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
608                                                                 Hold must be record level
609                                                             </span>
610                                                         [% ELSIF ( itemloo.available ) %]
611                                                             <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
612                                                         [% ELSIF ( itemloo.override ) %]
613                                                             <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
614                                                             <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
615                                                         [% ELSE %]
616                                                             <span class="error">
617                                                                 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
618                                                                 [% IF itemloo.not_holdable %]
619                                                                     [% IF itemloo.not_holdable == 'damaged' %]
620                                                                         Item damaged
621                                                                     [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
622                                                                         Age restricted
623                                                                     [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
624                                                                         Exceeded max holds per record
625                                                                     [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
626                                                                         Daily hold limit reached for patron
627                                                                     [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
628                                                                         Too many holds
629                                                                     [% ELSIF itemloo.not_holdable == 'notReservable' %]
630                                                                         Not holdable
631                                                                     [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
632                                                                         Patron is from different library
633                                                                     [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
634                                                                         Cannot place hold from patron's library
635                                                                     [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
636                                                                         Patron already has hold for this item
637                                                                     [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
638                                                                         Cannot be transferred to pickup library
639                                                                     [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
640                                                                         Only pickup locations within the same hold group are allowed
641                                                                     [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
642                                                                         No reserves are allowed on this item
643                                                                     [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %]
644                                                                         Library is not a pickup location
645                                                                     [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
646                                                                         No valid pickup location
647                                                                     [% ELSE %]
648                                                                         [% itemloo.not_holdable | html %]
649                                                                     [% END %]
650                                                                 [% END %]
651                                                             </span>
652                                                         [% END # /IF itemloo.force_hold_level %]
653                                                     </td>
654                                                     [% IF ( item_level_itypes ) %]
655                                                         <td>
656                                                             [% UNLESS ( noItemTypeImages ) %]
657                                                                 [% IF ( itemloo.imageurl ) %]<img src="[% itemloo.imageurl | html %]" alt="" /> <br /> [% END %]
658                                                             [% END %]
659                                                             [% itemloo.itypename | html %]
660                                                         </td>
661                                                     [% END %]
662                                                     <td>
663                                                         [% itemloo.barcode | html %]
664                                                     </td>
665                                                     <td>
666                                                         [% Branches.GetName( itemloo.homebranch ) | html %]
667                                                     </td>
668                                                     <td>
669                                                         [% Branches.GetName( itemloo.holdingbranch ) | html %]
670                                                     </td>
671                                                     [% IF itemdata_ccode %]
672                                                         <td>
673                                                             [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
674                                                         </td>
675                                                     [% END %]
676                                                     <td>
677                                                         [% itemloo.itemcallnumber | html %]
678                                                     </td>
679                                                     <td>
680                                                         [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %]&nbsp;[% END %]
681                                                     </td>
682                                                     [% IF itemdata_enumchron %]
683                                                         <td>
684                                                             [% itemloo.enumchron | html %]
685                                                         </td>
686                                                     [% END %]
687                                                     [% IF ( itemloo.onloan ) %]
688                                                         <td data-order="[% itemloo.date_due | html %]">
689                                                             <span class="checkedout">Due [% itemloo.date_due | $KohaDates  as_due_date => 1 %]</span>
690                                                     [% ELSE %]
691                                                         <td>
692                                                             [% IF ( itemloo.transfertwhen ) %]
693                                                                 In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
694                                                                 to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %]
695                                                             [% END %]
696                                                     [% END %]
697
698                                                         [% IF ( itemloo.reservedate ) %]
699                                                             [% IF ( itemloo.nocancel ) %]
700                                                                     Can't be cancelled when item is in transit
701                                                             [% ELSE %]
702                                                                 [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %]
703                                                                 [% IF ( itemloo.canreservefromotherbranches ) %]
704                                                                     for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedFor.borrowernumber | uri %]">[% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %]</a>
705                                                                 [% END %]
706                                                                 [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %]
707                                                                 [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since
708                                                                 [% IF ( itemloo.waitingdate ) %]
709                                                                     [% itemloo.waitingdate | $KohaDates %]
710                                                                 [% ELSE %]
711                                                                     [% IF ( itemloo.reservedate ) %]
712                                                                         [% itemloo.reservedate | html %]
713                                                                     [% END %]
714                                                                 [% END %].
715                                                                 <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&amp;CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&amp;CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
716                                                             [% END # /IF itemloo.nocancel %]
717                                                         [% ELSE %]
718                                                             Not on hold
719                                                         [% END # /IF itemloo.reservedate %]
720
721                                                         [% IF itemloo.item_level_holds == "N" %]
722                                                             <br/>Item level hold not allowed from OPAC
723                                                         [% ELSIF itemloo.item_level_holds == "F" %]
724                                                             <br/>Item level hold forced from OPAC
725                                                         [% END %]
726
727                                                         [% IF ( itemloo.itemlost ) %]
728                                                            <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
729                                                         [% END %]
730
731                                                         [% IF ( itemloo.damaged ) %]
732                                                             <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
733                                                         [% END %]
734
735                                                         [% IF ( itemloo.withdrawn ) %]
736                                                            <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
737                                                         [% END %]
738
739                                                         [% IF ( itemloo.notforloan ) %]
740                                                            <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
741                                                         [% END %]
742                                                     </td>
743                                                     <td>
744                                                     [% IF (itemloo.pickup_locations_count > 0) %]
745                                                         <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations"
746                                                                 data-item-id="[% itemloo.itemnumber | html %]"
747                                                                 data-patron-id="[% patron.borrowernumber | html %]">
748                                                         [% IF (itemloo.default_pickup_location) %]
749                                                             <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option>
750                                                         [% END %]
751                                                         </select>
752                                                     [% END %]
753                                                     </td>
754                                                 </tr>
755                                             [% END # / UNLESS itemloo.hide %]
756                                         [% END # /FOREACH itemloo %]
757                                     </tbody>
758                                 </table> <!-- /#requestspecific -->
759
760                                 [% IF ( bibitemloo.hiddencount ) %]
761                                     <form>
762                                         <p class="hiddencount">
763                                             <a href="request.pl?biblionumber=[% bibitemloo.biblionumber | uri %]&amp;borrowernumber=[% bibitemloo.borrowernumber | uri %]&amp;showallitems=1">Show all items ([% bibitemloo.hiddencount | html %] hidden)</a>
764                                         </p>
765                                     </form>
766                                 [% END # /IF bibitemloo.hiddencount %]
767                             [% END # /FOREACH bibitemloo %]
768
769                         [% ELSE # /UNLESS multi_hold %]
770
771                             <table id="requesttitles">
772                                 <tr>
773                                     <th>&nbsp;</th>
774                                     <th>Title</th>
775                                     [% UNLESS ( item_level_itypes ) %]
776                                         <th>Item type</th>
777                                     [% END %]
778                                     <th>Priority</th>
779                                     <th>Information</th>
780                                     <th>Pickup location</th>
781                                 </tr>
782                                 [% FOREACH biblioloo IN biblioloop %]
783                                     [% IF ( biblioloo.warn ) %]
784                                         <tr class="onissue">
785                                     [% ELSE %]
786                                         <tr>
787                                     [% END %]
788                                         <td>
789                                             [% UNLESS ( biblioloo.warn ) %]
790                                                     <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
791                                                 </td>
792                                             [% END %]
793                                         <td>
794                                             <ul>
795                                                 <li>
796                                                     <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
797                                                 </li>
798                                                 [% IF ( biblioloo.publicationyear ) %]
799                                                     <li>
800                                                         <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
801                                                     </li>
802                                                 [% END %]
803                                             </ul>
804                                             [% IF ( biblioloo.warn ) %]
805                                                 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
806                                             [% END %]
807                                         </td>
808                                         [% UNLESS ( item_level_itypes ) %]
809                                             <td>
810                                                 <img src="[% biblioloo.imageurl | html %]" alt="[% biblioloo.itypename | html %]" title="[% biblioloo.itypename | html %]" />
811                                             </td>
812                                         [% END %]
813                                         <td>[% biblioloo.rank | html %]</td>
814                                         <td>
815                                             [% IF ( biblioloo.checked_previously ) %]
816                                                 <span>Patron has previously checked out this title</span><br/>
817                                             [% END %]
818                                             [% IF ( biblioloo.alreadyres ) %]
819                                                 <ul>
820                                             [% ELSE %]
821                                                 [% IF ( biblioloo.none_avail ) %]
822                                                     <ul>
823                                                 [% END %]
824                                             [% END %]
825
826                                             [% IF ( biblioloo.alreadyres ) %]
827                                                 <li>
828                                                     <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
829                                                     <strong>already has a hold</strong> on this item
830                                                 </li>
831                                             [% END %]
832                                             [% IF ( biblioloo.none_avail ) %]
833                                                 <li> <strong>No items are available</strong> to be placed on hold</li>
834                                             [% END %]
835
836                                             [% IF ( biblioloo.alreadyres ) %]
837                                                 </ul>
838                                             [% ELSE %]
839                                                 [% IF ( biblioloo.none_avail ) %]
840                                                     </ul>
841                                                 [% END %]
842                                             [% END %]
843                                         </td>
844                                         <td>
845                                             [% UNLESS ( biblioloo.none_avail ) %]
846                                                 <select name="pickup_[% biblioloo.biblionumber | html %]"
847                                                         class="multi_pickup_select"
848                                                         data-biblio-id="[% biblioloo.biblionumber | html %]"
849                                                         data-patron-id="[% patron.borrowernumber | html %]"
850                                                         data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
851                                                     <option value=""></option>
852                                                     [% FOREACH pickup_location IN biblioloo.pickup_locations %]
853                                                         <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
854                                                     [% END %]
855                                                 </select>
856                                             [% END %]
857                                         </td>
858                                     </tr>
859                                 [% END # /FOREACH biblioloo %]
860                             </table> <!-- /#requesttitles -->
861
862                         [% END # /UNLESS multi_hold %]
863
864                         <fieldset class="action">
865                             [% IF ( patron AND patron.borrowernumber ) %]
866                                 [% IF ( override_required ) %]
867                                     <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
868                                 [% ELSIF ( none_available ) %]
869                                     <button type="submit" disabled="disabled" class="btn btn-default btn-disabled">Place hold</button>
870                                 [% ELSE %]
871                                     [% IF ( multi_hold ) %]
872                                         <button type="submit" class="btn btn-default" id="multi_hold_submit">Place hold</button>
873                                     [% ELSE %]
874                                         <button type="submit" class="btn btn-default">Place hold</button>
875                                     [% END %]
876                                 [% END %]
877                             [% END # /IF patron %]
878                         </fieldset> <!-- /.action -->
879                     </form> <!-- /#hold-request-form -->
880                 </fieldset> <!-- /.rows -->
881             [% END %]
882
883             [% UNLESS ( patron ) %]
884                 [% IF ( reserveloop ) %]
885                     <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
886                         [% IF ( multi_hold ) %]
887                             <input type = "hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
888                         [% END %]
889
890                         <h2>Existing holds</h2>
891                         <div id="toolbar" class="btn-toolbar">
892                             <input type="submit" name="submit" value="Update hold(s)" />
893                         <fieldset id="cancellation-reason-fieldset" class="action">
894                             [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
895                             [% IF hold_cancellation %]
896                                 <label for="cancellation-reason">Cancellation reason: </label>
897                                 <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
898                                     <option value="">No reason given</option>
899                                     [% FOREACH reason IN hold_cancellation %]
900                                         <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
901                                     [% END %]
902                                 </select>
903                             [% END %]
904                         </fieldset>
905                         </div>
906
907                         [% FOREACH biblioloo IN biblioloop %]
908                             [% IF ( biblioloo.reserveloop ) %]
909                                 [% IF ( multi_hold ) %]
910                                     <h3>
911                                         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
912                                             [% biblioloo.title | html %]
913                                         </a>
914                                     </h3>
915                                 [% END %]
916
917                                 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
918                                     [% SET branchcodes = [] %]
919
920                                     [% FOREACH h IN biblioloo.reserveloop %]
921                                         [% branchcodes.push( h.branchcode ) %]
922                                     [% END %]
923                                     [% branchcodes = branchcodes.unique %]
924
925                                     [% FOREACH b IN branchcodes.sort %]
926                                         [% SET holds_by_branch = [] %]
927                                         [% FOREACH h IN biblioloo.reserveloop %]
928                                             [% IF h.branchcode == b %]
929                                                 [% holds_by_branch.push( h ) %]
930                                             [% END %]
931                                         [% END %]
932                                         <fieldset>
933                                             <legend>[% Branches.GetName( b ) | html %]</legend>
934                                             [% INCLUDE holds_table.inc holds=holds_by_branch %]
935                                         </fieldset>
936                                     [% END # /FOREACh b %]
937                                 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
938                                     [% SET itemtypes = [] %]
939
940                                     [% FOREACH h IN biblioloo.reserveloop %]
941                                         [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
942                                         [% itemtypes.push( hold_itemtype ) %]
943                                     [% END %]
944                                     [% itemtypes = itemtypes.unique %]
945
946                                     [% FOREACH i IN itemtypes.sort %]
947                                         [% SET holds_by_itemtype = [] %]
948                                         [% FOREACH h IN biblioloo.reserveloop %]
949                                             [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
950                                             [% IF hold_itemtype == i %]
951                                                 [% holds_by_itemtype.push( h ) %]
952                                             [% END %]
953                                         [% END %]
954
955                                         <fieldset>
956                                             [% IF i %]
957                                                 <legend>[% ItemTypes.GetDescription( i ) | html %]</legend>
958                                             [% ELSE %]
959                                                 <legend>Any item type</legend>
960                                             [% END %]
961                                             [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
962                                         </fieldset>
963                                     [% END # /FOREACH i %]
964                                 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
965                                     [% SET branchcodes = [] %]
966
967                                     [% FOREACH h IN biblioloo.reserveloop %]
968                                         [% branchcodes.push( h.branchcode ) %]
969                                     [% END %]
970                                     [% branchcodes = branchcodes.unique %]
971
972                                     [% FOREACH b IN branchcodes.sort %]
973                                         <fieldset>
974                                             <legend>[% Branches.GetName( b ) | html %]</legend>
975                                             [% SET holds_by_branch = [] %]
976                                             [% FOREACH h IN biblioloo.reserveloop %]
977                                                 [% IF h.branchcode == b %]
978                                                     [% holds_by_branch.push( h ) %]
979                                                 [% END %]
980                                             [% END %]
981
982                                             [% SET itemtypes = [] %]
983                                             [% FOREACH h IN holds_by_branch %]
984                                                 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
985                                                 [% itemtypes.push( hold_itemtype ) %]
986                                             [% END %]
987                                             [% itemtypes = itemtypes.unique %]
988
989                                             [% FOREACH i IN itemtypes.sort %]
990                                                 [% IF i %]
991                                                     <h3>[% ItemTypes.GetDescription( i ) | html %]</h3>
992                                                 [% ELSE %]
993                                                     <h3>Any item type</h3>
994                                                 [% END %]
995
996                                                 [% SET holds_by_itemtype = [] %]
997                                                 [% FOREACH h IN holds_by_branch %]
998                                                     [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
999                                                     [% IF hold_itemtype == i %]
1000                                                         [% holds_by_itemtype.push( h ) %]
1001                                                     [% END %]
1002                                                 [% END %]
1003                                                 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1004                                             [% END %]
1005                                         </fieldset>
1006                                     [% END # /FOREACH b %]
1007                                 [% ELSE %]
1008                                     [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
1009                                 [% END # /IF HoldsSplitQueue %]
1010
1011                             [% END # /IF biblioloo.reserveloop %]
1012                         [% END # FOREACH biblioloo %]
1013                         </fieldset> <!-- /.rows -->
1014                     </form> <!-- /name=TTime -->
1015                 [% END # IF reserveloop %]
1016             [% END # UNLESS patron %]
1017
1018         </main>
1019
1020         [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
1021             </div> <!-- /.col-md-10.col-md-offset-1 -->
1022         [% ELSE %]
1023             </div> <!-- /.col-sm-10.col-sm-push-2 -->
1024                 <div class="col-sm-2 col-sm-pull-10">
1025                     <aside>
1026                         [% INCLUDE 'biblio-view-menu.inc' %]
1027                     </aside>
1028                 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1029         [% END %]
1030     </div> <!-- /.row -->
1031
1032     <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
1033         <div class="modal-dialog" role="document">
1034             <div class="modal-content">
1035                 <div class="modal-header">
1036                     <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1037                     <h3>Confirm deletion</h3>
1038                 </div>
1039
1040                 <div class="modal-body">
1041                     <p>Are you sure you want to cancel this hold?</p>
1042
1043                     <fieldset class="action">
1044                         [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1045                         [% IF hold_cancellation %]
1046                             <label for="cancellation-reason">Cancellation reason: </label>
1047                             <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
1048                                 <option value="">No reason given</option>
1049                                 [% FOREACH reason IN hold_cancellation %]
1050                                     <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1051                                 [% END %]
1052                             </select>
1053                         [% END %]
1054                     </fieldset>
1055                 </div>
1056
1057                 <div class="modal-footer">
1058                     <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
1059                     <a href="#" data-dismiss="modal">Cancel</a>
1060                 </div>
1061             </div>
1062         </div>
1063     </div>
1064
1065 [% MACRO jsinclude BLOCK %]
1066     [% INCLUDE 'datatables.inc' %]
1067     [% INCLUDE 'calendar.inc' %]
1068     [% INCLUDE 'columns_settings.inc' %]
1069     [% Asset.js("lib/hc-sticky.js") | $raw %]
1070     [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1071     [% INCLUDE 'select2.inc' %]
1072     <script>
1073         var Sticky;
1074         var biblionumber = "[% biblionumber | $raw %]";
1075         var borrowernumber = "[% patron.borrowernumber | $raw %]";
1076         var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1077         var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo IN bibitemloo.itemloop %][% IF ( itemloo.override ) %]
1078         [% itemloo.itemnumber | html %]: {
1079             homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1080             holdallowed: "[% itemloo.holdallowed | html %]"
1081             },
1082             [% END %][% END %][% END %]
1083         };
1084         var ERROR_MAP = {
1085             damaged: _("Item damaged"),
1086             ageRestricted: _("Age restricted"),
1087             tooManyHoldsForThisRecord: _("Exceeded max holds per record"),
1088             tooManyReservesToday: _("Daily hold limit reached for patron"),
1089             tooManyReserves: _("Too many holds"),
1090             notReservable: _("Not holdable"),
1091             noReservesAllowed: _("No reserves allowed"),
1092             cannotReserveFromOtherBranches: _("Patron is from different library"),
1093             itemAlreadyOnHold: _("Patron already has hold for this item"),
1094             cannotBeTransferred: _("Cannot be transferred to pickup library"),
1095             pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed")
1096         }
1097         columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
1098         $.fn.select2.defaults.set("width", "100%" );
1099         $.fn.select2.defaults.set("dropdownAutoWidth", true );
1100
1101         $(document).ready(function() {
1102             $('#cancellation-reason-fieldset').hide();
1103             $('.rank-request').on('change', function() {
1104                 if ( $(".rank-request option:selected[value='del']").length ) {
1105                     $('#cancellation-reason-fieldset').show();
1106                 } else {
1107                     $('#cancellation-reason-fieldset').hide();
1108                 }
1109             });
1110
1111             [% SET active = clubs ? 1 : 0 %]
1112             $('#circ_holds_select').tabs({
1113                 active: [% active | $raw %],
1114                 activate: function(){
1115                     $(this).find("input.focus").focus();
1116                 },
1117                 create: function(){
1118                     $(this).find("input.focus").focus();
1119                 }
1120             });
1121             function ToggleHoldsToPlace() {
1122                 if ( $("#requestany").prop('checked') ) {
1123                     $("#holds_to_place_count").prop('disabled', false);
1124                 } else {
1125                     $("#holds_to_place_count").prop('disabled', true);
1126                 }
1127             }
1128             ToggleHoldsToPlace();
1129             $("#requestany").on('change', function(){
1130                 ToggleHoldsToPlace();
1131             });
1132
1133             [% IF Koha.Preference('UseBranchTransferLimits') %]
1134                 $("#pickup").on('change', function(){
1135                     var pickup = $("#pickup").val();
1136                     var url = "?pickup=" + pickup;
1137                     url += "&borrowernumber=" + borrowernumber;
1138                     url += "&biblionumber=" + biblionumber;
1139                     window.location.replace(url);
1140                 });
1141             [% END %]
1142
1143             [% IF AutoResumeSuspendedHolds %]
1144                 $(".suspend_until_datepicker, .datepickerfrom, .datepickerto").datepicker("option", "minDate", 1);
1145             [% END %]
1146
1147             $(".datepickerto").datepicker("option", "altField", ".datepickerto_hidden");
1148             $(".datepickerto").datepicker("option", "altFormat", "yy-mm-dd");
1149
1150             $(".datepickerfrom").datepicker("option", "altField", ".datepickerfrom_hidden");
1151             $(".datepickerfrom").datepicker("option", "altFormat", "yy-mm-dd");
1152
1153             var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1154                 'bPaginate': false,
1155                 "sDom": '<"top pager"ilf>t',
1156             }));
1157
1158             //Override fieldset styling for dataTables search box
1159             $("div.top.pager").css("margin-left","1em");
1160             $(".dataTables_filter label").css({
1161                 "width":"auto",
1162                 "margin-right":"0em"
1163             });
1164
1165             $("#club-request-form").on("submit", function() {
1166                 let $t = $(this);
1167                 $('.clubalert, .holdalert').addClass('hide');
1168                 let biblionumbers = [biblionumber];
1169                 let biblionumbers_text;
1170                 const data = {
1171                     pickup_library_id: $('select[name="pickup"]').val()
1172                 };
1173                 if($('input[name="checkitem"]:checked').length)
1174                     data.item_id = $('input[name="checkitem"]:checked').val();
1175                 if($('input[name="borrowernumber"]').length)
1176                     data.patron_id = $('input[name="borrowernumber"]').val();
1177                 if($('textarea[name="notes"]').length)
1178                     data.notes = $('textarea[name="notes"]').val()||null;
1179                 if($('.datepickerto_hidden').length)
1180                     data.expiration_date = $('.datepickerto_hidden').val()||null;
1181                 if($('.datepickerfrom_hidden').length)
1182                     data.hold_date = $('.datepickerfrom_hidden').val()||null;
1183                 if($('input[name="itemtype"]').length) {
1184                     data.item_type = $('input[name="itemtype"]').val()||null;
1185                 }
1186                 if($('input[name="default_patron_home"]:checked').length) {
1187                     data.default_patron_home = 1;
1188                 }
1189                 if($('input[name="biblionumbers"]').length) {
1190                     biblionumbers_text = $('input[name="biblionumbers"]').val();
1191                     biblionumbers = biblionumbers_text.replace(/\/$/, '').split('/')
1192                 }
1193
1194                 const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1;
1195                 biblionumbers.forEach(function(biblionumber) {
1196                     data.biblio_id = biblionumber;
1197                     let options = {
1198                         url: $t.attr('action'),
1199                         method: $t.attr('method').toUpperCase(),
1200                         contentType: 'application/json',
1201                         data: JSON.stringify(data)
1202                     };
1203                     for(let i = 0; i < count; i++) {
1204                         $.ajax(options)
1205                         .then(function(result) {
1206                             let url = 'request.pl?biblionumber='+biblionumber;
1207                             if(biblionumbers_text) {
1208                                 url = 'request.pl?biblionumbers='+biblionumbers_text;
1209                             }
1210                             document.location = url;
1211                         })
1212                         .fail(function(err) {
1213                             var message = err.responseJSON.error;
1214                             var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/);
1215                             if(match && ERROR_MAP[match[1]]) {
1216                                 message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>'
1217                             }
1218                             $('.clubalert, .holdalert').removeClass('hide').html(message);
1219                         });
1220                     }
1221                 });
1222
1223                 return false;
1224             });
1225
1226             [% UNLESS ( multi_hold ) %]
1227                 $("#hold-request-form").on("submit", function(){
1228                     return check($(this));
1229                 });
1230             [% ELSE %]
1231                 $("#hold-request-form").on("submit", function(){
1232                     return checkMultiHold();
1233                 });
1234             [% END %]
1235
1236             function display_pickup_location (state) {
1237                 var $text;
1238                 if ( state.needs_override === true ) {
1239                     $text = $(
1240                         '<span>' + state.text + '</span> <span style="float:right;" title="' +
1241                         _("This pickup location is not allowed according to circulation rules") +
1242                         '"><i class="fa fa-exclamation-circle" aria-hidden="true"></i></span>'
1243                     );
1244                 }
1245                 else {
1246                     $text = $('<span>'+state.text+'</span>');
1247                 }
1248
1249                 return $text;
1250             };
1251
1252             $(".pickup_location_dropdown").each( function () {
1253                 var this_dropdown = $(this);
1254                 var hold_id = $(this).data('hold_id');
1255
1256                 this_dropdown.select2({
1257                     allowClear: false,
1258                     ajax: {
1259                         url: '/api/v1/holds/' + encodeURIComponent(hold_id) + '/pickup_locations',
1260                         delay: 300, // wait 300 milliseconds before triggering the request
1261                         dataType: 'json',
1262                         data: function (params) {
1263                             var search_term = (params.term === undefined) ? '' : params.term;
1264                             var query = {
1265                                 "q": JSON.stringify({"name":{"-like":search_term+'%'}}),
1266                                 "_order_by": "name"
1267                             };
1268                             return query;
1269                         },
1270                         processResults: function (data) {
1271                             var results = [];
1272                             data.forEach( function ( pickup_location ) {
1273                                 results.push(
1274                                     {
1275                                         "id": pickup_location.library_id.escapeHtml(),
1276                                         "text": pickup_location.name.escapeHtml(),
1277                                         "needs_override": pickup_location.needs_override
1278                                     }
1279                                 );
1280                             });
1281                             return { "results": results };
1282                         }
1283                     },
1284                     templateResult: display_pickup_location
1285                 });
1286             });
1287
1288             $("#pickup_multi").select2({
1289                 width: '30%',
1290                 allowClear: true
1291             });
1292
1293             $('.multi_pickup_select').select2({
1294                 width: '100%',
1295                 allowClear: true
1296             });
1297
1298             $("#pickup_multi").on("change", function() {
1299                 var selection = $(this).val();
1300                 if ( selection != '' ) {
1301                     $(".multi_pickup_select").each(function() {
1302                         var valid_pickup_locations = $(this).data('pickup-locations');
1303                         if ( valid_pickup_locations.includes(selection) ) {
1304                             $(this).val(selection);
1305                             $(this).trigger("change");
1306                         }
1307                     });
1308                 }
1309             });
1310
1311             $("#pickup").each( function () {
1312                 var this_dropdown = $(this);
1313                 var patron_id = $(this).data('patron-id');
1314                 var biblio_id = $(this).data('biblio-id');
1315
1316                 this_dropdown.select2({
1317                     width: 'style',
1318                     allowClear: false,
1319                     ajax: {
1320                         url: '/api/v1/biblios/' + encodeURIComponent(biblio_id) + '/pickup_locations',
1321                         delay: 300, // wait 300 milliseconds before triggering the request
1322                         dataType: 'json',
1323                         data: function (params) {
1324                             var search_term = (params.term === undefined) ? '' : params.term;
1325                             var query = {
1326                                 "q": JSON.stringify({"name":{"-like":search_term+'%'}}),
1327                                 "_order_by": "name",
1328                                 "patron_id": patron_id
1329                             };
1330                             return query;
1331                         },
1332                         processResults: function (data) {
1333                             var results = [];
1334                             data.forEach( function ( pickup_location ) {
1335                                 results.push(
1336                                     {
1337                                         "id": pickup_location.library_id.escapeHtml(),
1338                                         "text": pickup_location.name.escapeHtml(),
1339                                         "needs_override": pickup_location.needs_override
1340                                     }
1341                                 );
1342                             });
1343                             return { "results": results };
1344                         }
1345                     },
1346                     templateResult: display_pickup_location
1347                 });
1348             });
1349             $(".pickup_locations").each( function () {
1350                 var this_dropdown = $(this);
1351                 var patron_id = $(this).data('patron-id');
1352                 var item_id   = $(this).data('item-id');
1353
1354                 this_dropdown.select2({
1355                     allowClear: true,
1356                     ajax: {
1357                         url: '/api/v1/items/' + encodeURIComponent(item_id) + '/pickup_locations',
1358                         delay: 300, // wait 300 milliseconds before triggering the request
1359                         dataType: 'json',
1360                         data: function (params) {
1361                             var search_term = (params.term === undefined) ? '' : params.term;
1362                             var query = {
1363                                 "q": JSON.stringify({"name":{"-like":search_term+'%'}}),
1364                                 "_order_by": "name",
1365                                 "patron_id": patron_id
1366                             };
1367                             return query;
1368                         },
1369                         processResults: function (data) {
1370                             var results = [];
1371                             data.forEach( function ( pickup_location ) {
1372                                 results.push(
1373                                     {
1374                                         "id": pickup_location.library_id.escapeHtml(),
1375                                         "text": pickup_location.name.escapeHtml(),
1376                                         "needs_override": pickup_location.needs_override
1377                                     }
1378                                 );
1379                             });
1380                             return { "results": results };
1381                         }
1382                     },
1383                     templateResult: display_pickup_location
1384                 });
1385             });
1386         });
1387
1388         function check( table ) {
1389
1390             var msg = "";
1391
1392             if ( $("#requestany").attr("checked") !== "checked" ) {
1393                 // requestany not selected, go through the item-specific cases
1394                 if ( $('input[type="radio"]:checked').length > 0 ) {
1395                     // got item-specific hold requests in the form!
1396                     // verify they have a pickup location selected
1397
1398                     if (table.find('input[type="radio"]:checked')
1399                                 .closest('tr')
1400                                 .find(".pickup_locations").val() === null) {
1401
1402                         msg = _("- Please select a pickup location for the item" + "\n")
1403                     }
1404                 }
1405                 else {
1406                     msg = (_("- Please select an item to place a hold") + "\n");
1407                 }
1408             }
1409
1410             if (msg == "") {
1411                 $('#hold-request-form').preventDoubleFormSubmit();
1412                 return(true);
1413             } else {
1414                 alert(msg);
1415                 return(false);
1416             }
1417         }
1418
1419         function checkMultiHold() {
1420
1421             var biblionumbers = "";
1422             var selected_bibs = $(".multi_hold_item_checkbox:checked");
1423             if ( selected_bibs.length > 0 ) {
1424                 // there are biblios selected in the form!
1425                 // verify they have a pickup location selected
1426
1427                 var pickup_not_set = 0;
1428                 selected_bibs.each(function() {
1429                     if ( $(this).closest('tr').find(".multi_pickup_select").val() === "" ) {
1430                         pickup_not_set++;
1431                     }
1432                     else {
1433                         var bibnum = $(this).attr("title");
1434                         biblionumbers += bibnum + "/";
1435                     }
1436                 });
1437                 if ( pickup_not_set > 0 ) {
1438                     alert( _("Please make sure all selected titles have a pickup location set" + "\n") );
1439                     return false;
1440                 }
1441             }
1442             else {
1443                 alert( _("Please select at least one title" + "\n") );
1444                 return false;
1445             }
1446
1447             var badSpans = $(".not_holdable");
1448             var badBibs = "";
1449             $(badSpans).each(function() {
1450                 var bibnum = $(this).attr("title");
1451                 badBibs += bibnum + "/";
1452             });
1453
1454             $("#multi_hold_bibs").val(biblionumbers);
1455             $("#bad_bibs").val(badBibs);
1456
1457             $('#hold-request-form').preventDoubleFormSubmit();
1458
1459             return true;
1460         }
1461
1462          $(document).ready(function() {
1463             $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1464                 var itemnumber = this.value;
1465                 var msg = '';
1466
1467                 switch (override_items[itemnumber].holdallowed) {
1468                     case "not_allowed": msg = _("This item normally cannot be put on hold."); break;
1469                     case "from_home_library": msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
1470                 }
1471
1472                 msg += "\n\n" + _("Place hold on this item?");
1473
1474                 return confirm(msg);
1475             });
1476             $("button.warning").click(function() {
1477                 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1478             });
1479             $("#requestany").click(function() {
1480                 if(this.checked){
1481                     $("input[name=checkitem]").each(function() {
1482                         $(this).prop("checked", false);
1483                     });
1484                 }
1485             });
1486             $("input[name=checkitem]").click(function() {
1487                 onechecked = 0;
1488                 $("input[name=checkitem]").each(function() {
1489                     if(this.checked){
1490                         onechecked = 1;
1491                     }
1492                 });
1493                 if(onechecked == 1){
1494                     $("#requestany").prop("checked", false);
1495                     $("#holds_to_place_count").prop('disabled', true);
1496                 } else {
1497                     $("#requestany").prop("checked",true);
1498                     $("#holds_to_place_count").prop('disabled', false);
1499                 }
1500             });
1501             var prev_rank_request;
1502             $("select[name=rank-request]").on("focus", function() {
1503                 prev_rank_request = $(this).val();
1504                 var row = $(this).parents("tr:first");
1505             }).change(function() {
1506                 var row = $(this).parents("tr:first");
1507                 var value = parseInt($(this).val());
1508                 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
1509                 if( !isNaN(value) ) {  //If moved to 'del'
1510                     var after = row.parent().find("tr:nth-child("+(value+1+found_holds )+")"); //Go to the row 1 after the new value (and skip found holds)
1511                     if (prev_rank_request > value) {
1512                         row.insertBefore(after);
1513                     } else {
1514                         row.insertAfter(after);
1515                     }
1516                 }
1517
1518                 var next_priority = 1;
1519                 $("select[name=rank-request]").each(function () {
1520                     if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
1521                     $(this).val(next_priority);
1522                     next_priority++;
1523                 });
1524             });
1525
1526             $(".clear-date").on("click",function(e){
1527                 e.preventDefault();
1528                 var fieldID = this.id.replace("clear-date-","");
1529                 $("#" + fieldID).val("");
1530             });
1531
1532             // Confirm cancellation of hold
1533             let cancel_link;
1534             $(".cancel-hold").on("click",function(e) {
1535                 e.preventDefault;
1536                 cancel_link = $(this);
1537                 $('#cancelModal').modal();
1538                 return false;
1539             });
1540             $("#cancelModalConfirmBtn").on("click",function(e) {
1541                 let borrowernumber = cancel_link.data('borrowernumber');
1542                 let biblionumber = cancel_link.data('biblionumber');
1543                 let reserve_id = cancel_link.data('id');
1544                 let reason = $("#modal-cancellation-reason").val();
1545                 let link = `request.pl?action=cancel&amp;borrowernumber=${ borrowernumber }&amp;biblionumber=${ biblionumber }&amp;reserve_id=${ reserve_id }`;
1546                 if ( reason ) {
1547                     link += "&amp;cancellation-reason=" + reason
1548                 }
1549                 window.location.href = link;
1550                 return false;
1551             });
1552
1553             [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems || nobiblio ) %]
1554                 [% IF ( PatronAutoComplete ) %]
1555                 $( "#patron" ).autocomplete({
1556                     source: "/cgi-bin/koha/circ/ysearch.pl",
1557                     minLength: 3,
1558                     select: function( event, ui ) {
1559                         $( "#patron" ).val( ui.item.cardnumber );
1560                         $( "#holds_patronsearch" ).submit();
1561                         return false;
1562                     }
1563                 })
1564                 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
1565                     return $( "<li></li>" )
1566                     .data( "ui-autocomplete-item", item )
1567                     .append(
1568                         "<a>"
1569                             + ( item.surname ? item.surname.escapeHtml() : "" )
1570                             + ", "
1571                             + ( item.firstname ? item.firstname.escapeHtml() : "" )
1572                             + " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")"
1573                             + " "
1574                             + "<small>"
1575                                 + ( item.address ? item.address.escapeHtml() : "" )
1576                                 + " "
1577                                 + ( item.city ? item.city.escapeHtml() : "" )
1578                                 + " "
1579                                 + ( item.zipcode ? item.zipcode.escapeHtml() : "" )
1580                                 + " "
1581                                 + ( item.country ? item.country.escapeHtml() : "" )
1582                             + "</small>"
1583                         + "</a>" )
1584                     .appendTo( ul );
1585                 };
1586                 [% END %]
1587             [% END %]
1588             Sticky = $("#toolbar");
1589             Sticky.hcSticky({
1590                 stickTo: "#existing_holds",
1591                 stickyClass: "floating"
1592             });
1593         });
1594     </script>
1595 [% END %]
1596
1597 [% INCLUDE 'intranet-bottom.inc' %]