10 [% USE AuthorisedValues %]
12 [% USE TablesSettings %]
13 [% PROCESS 'i18n.inc' %]
14 [% SET footerjs = 1 %]
15 [% INCLUDE 'doc-head-open.inc' %]
16 [% UNLESS ( multi_hold ) %]
17 <title>Place a hold on [% INCLUDE 'biblio-title-head.inc' %] › Holds › Circulation › Koha</title>
19 <title>Confirm holds › Holds › Circulation › Koha</title>
21 [% INCLUDE 'doc-head-close.inc' %]
22 [% Asset.css("css/holds.css") | $raw %]
25 <body id="circ_request" class="catalog">
27 [% INCLUDE 'header.inc' %]
28 [% INCLUDE 'circ-search.inc' %]
30 [% UNLESS ( multi_hold ) %]
31 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
34 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
37 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
40 [% INCLUDE 'biblio-title.inc' link =1 %]
43 <a href="#" aria-current="page">
50 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
53 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
56 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
60 <a href="#" aria-current="page">
65 <a href="#" aria-current="page">
66 Search patrons or clubs
69 <a href="#" aria-current="page">
77 [% END # UNLESS multi_hold %]
79 <div class="main container-fluid">
81 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
82 <div class="col-md-10 col-md-offset-1">
84 <div class="col-sm-10 col-sm-push-2">
90 <div class="dialog alert">
92 <strong>Cannot place hold:</strong> one or more records don't exist.
94 <strong>Cannot place hold:</strong> this record doesn't exist.
99 <div class="dialog alert">
101 <strong>Cannot place hold:</strong> one or more records without items attached.
103 <strong>Cannot place hold:</strong> this record has no items attached.
108 [% IF ( messagetransfert ) %]
109 <div class="dialog message">
110 <h2>Hold found for ([% nextreservtitle | html %]), please transfer</h2>
111 <p>Hold placed by : <strong> [% nextreservsurname | html %] [% nextreservfirstname | html %]</strong> at : <strong> [% branchname | html %] </strong>, Please transfer this item.
113 <form name="cancelReservewithtransfert" action="branchreserves.pl" method="post">
114 <input type="submit" class="button" />
119 [% UNLESS ( multi_hold ) %]
120 <h1>Place a hold on [% INCLUDE 'biblio-title.inc' link = 1 %]</h1>
127 Search patrons or clubs
135 [% UNLESS club OR patron OR patron.borrowernumber OR noitems OR nobiblio %]
136 [% IF ( messageborrower ) %]
137 <div class="dialog alert">
138 <h3>Patron not found</h3>
139 <p>No patron with this name, please, try another</p>
143 [% IF ( messageclub ) %]
144 <div class="dialog alert">
145 <h3>Club not found</h3>
146 <p>No club with this name, please, try another</p>
149 <fieldset class="brief">
150 [% UNLESS multi_hold %]
152 <label>Search patrons or clubs</label>
154 <label>Search patrons</label>
157 <div id="circ_holds_select" class="toptabs">
159 <li><a href="#holds_patronsearch_pane">Patrons</a></li>
161 <li><a href="#holds_clubsearch_pane">Clubs</a></li>
164 <div id="holds_patronsearch_pane">
165 <form id="holds_patronsearch" action="request.pl?biblionumbers=[% biblionumbers | html %]" method="post">
166 <div class="hint">Enter patron card number or partial name:</div>
167 <input type="text" size="40" id="patron" class="focus" name="findborrower" autocomplete="off" />
168 <input type="submit" value="Search" />
170 <input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
172 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
175 </form> <!-- /#holds_patronsearch -->
177 [% INCLUDE 'circ-patron-search-results.inc' destination = "holds" %]
181 <div id="holds_clubsearch_pane">
182 <form id="holds_clubsearch" action="request.pl?biblionumbers=[% biblionumbers | html %]" method="post">
183 <div class="hint">Enter club ID or partial name:</div>
184 <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" />
185 <input type="submit" value="Search" />
187 <input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
189 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
192 </form> <!-- /#holds_patronsearch -->
194 [% INCLUDE 'clubs-table.inc' destination = "holds" %]
201 <div class="dialog alert hide clubalert">
203 <fieldset class="rows">
204 <legend>Hold details</legend>
205 <form action="/api/v1/clubs/[% club.id | html %]/holds" method="post" name="form" id="club-request-form">
207 [% IF ( multi_hold ) %]
208 <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
209 <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
210 <input type="hidden" name="request" value="any"/>
211 [% FOREACH biblioloo IN biblioloop %]
212 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
213 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
216 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
217 <input type="hidden" name="title" value="[% biblio.title | html %]" />
218 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
219 [% END # /IF multi_hold %]
222 <span class="label">Club: </span> [% club.name | html %]
225 <span class="label">Description: </span> [% club.description | html %]
228 <label for="pickup">Pickup at:</label>
229 <select name="pickup" id="pickup_club">
230 [% PROCESS options_for_libraries libraries => Branches.all({ selected => club.branchcode, search_params => { pickup_location => 1 } }) %]
234 <label for="default_patron_home">Pickup at patron's home library when possible:</label>
235 <input type="checkbox" id="default_patron_home" name="default_patron_home"/>
238 <h2 style="padding: 0 1em;">Members</h2>
240 [% FOREACH member IN members %]
241 [% SET patron = member.patron %]
242 <li style="padding: 0.5em 1em;">
243 <div><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a></div>
244 [% IF member.exceeded_maxreserves %]
246 <i class="fa fa-error"></i>
247 <strong>Too many holds: </strong> Patron can only place a maximum of [% maxreserves | html %] total holds.
250 [% IF ( member.expiry ) %]
252 <i class="fa fa-warning"></i>
253 <strong>Account has expired</strong>
256 [% IF patron.is_debarred %]
258 <i class="fa fa-warning"></i>
259 <strong>Patron has restrictions</strong>
262 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
264 <i class="fa fa-warning"></i>
265 <strong>Patron has outstanding fines: [% member.amount_outstanding | $Price %]</strong>
269 [% IF ( member.diffbranch ) %]
271 <i class="fa fa-warning"></i>
272 <strong>Pickup library is different.</strong> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )
277 [% UNLESS ( multi_hold ) %]
278 <fieldset class="action">
279 <input type="submit" value="Place hold" />
282 <table id="requesttitles">
286 [% UNLESS ( item_level_itypes ) %]
292 [% FOREACH biblioloo IN biblioloop %]
293 [% IF ( biblioloo.warn ) %]
299 [% UNLESS ( biblioloo.warn ) %]
300 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
306 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
308 [% IF ( biblioloo.publicationyear ) %]
310 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
314 [% IF ( biblioloo.warn ) %]
315 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
318 [% UNLESS ( item_level_itypes ) %]
320 <img src="[% biblioloo.imageurl | html %]" alt="[% biblioloo.itypename | html %]" title="[% biblioloo.itypename | html %]" />
323 <td>[% biblioloo.rank | html %]</td>
325 [% IF ( biblioloo.checked_previously ) %]
326 <span>Patron has previously checked out this title</span><br/>
328 [% IF ( biblioloo.alreadyres ) %]
331 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
336 [% IF ( biblioloo.alreadyres ) %]
338 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
339 <strong>already has a hold</strong> on this item
342 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
343 <li> <strong>No items are available</strong> to be placed on hold</li>
346 [% IF ( biblioloo.alreadyres ) %]
349 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
355 [% END # /FOREACH biblioloo %]
356 </table> <!-- /#requesttitles -->
360 [% ELSIF NOT ( noitems || nobiblio ) # /UNLESS patron %]
362 [% IF ( checked_previously && !multi_hold ) %]
363 <div class="dialog alert">
365 <li>Patron has previously checked out this title</li>
370 [% IF ( no_reserves_allowed || exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted ) %]
371 <div class="dialog alert">
373 [% UNLESS ( multi_hold ) %]
374 <h3>Cannot place hold</h3>
376 [% IF ( no_reserves_allowed ) %]
377 <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>
378 [% ELSIF ( exceeded_maxreserves ) %]
379 <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>
380 [% ELSIF ( exceeded_holds_per_record ) %]
381 <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>
382 [% ELSIF ( alreadypossession ) %]
383 <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>
384 [% ELSIF ( alreadyreserved ) %]
385 <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>
386 [% ELSIF ( ageRestricted ) %]
387 <li><strong>Age restricted</strong></li>
388 [% ELSIF ( none_available ) %]
389 <li> <strong>No items are available</strong> to be placed on hold.</li>
390 [% ELSIF ( maxreserves ) %]
391 <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>
392 [% END # /IF exceeded_maxreserves %]
394 [% ELSE # UNLESS multi_hold %]
395 <h3>Cannot place hold on some items</h3>
396 [% IF (no_reserves_allowed ) %]
397 <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>
398 [% ELSIF ( exceeded_maxreserves ) %]
399 <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>
400 [% ELSIF ( exceeded_holds_per_record ) %]
401 [% FOREACH biblioloo IN biblioloop %]
402 [% IF (biblioloo.tooManyHoldsForThisRecord) %]
403 <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>
406 [% END # /IF exceeded_maxreserves %]
407 [% END # /UNLESS multi_hold %]
409 [% END # /IF ( exceeded_maxreserves || ... %]
411 [% IF ( patron.is_expired || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
412 <div class="dialog message">
414 [% IF ( patron.is_expired ) %]
415 <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>
418 [% IF patron.is_debarred %]
419 <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>
422 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
423 <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>
426 [% IF ( diffbranch ) %]
427 <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>
429 </ul> <!-- /.dialog.message -->
431 [% END # /IF patron.is_expired || diffbranch ... %]
433 [% IF ( messageborrower ) %]
434 <div class="dialog alert">
435 <h3>Patron not found:</h3>
436 <p>Name or barcode not found. Please try an other </p>
440 <div class="dialog alert hide holdalert">
443 <fieldset class="rows">
444 <legend>Hold details</legend>
445 <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
447 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
448 <input type="hidden" name="type" value="str8" />
450 [% IF ( multi_hold ) %]
451 <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
452 <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
453 <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
454 <input type="hidden" name="request" value="any"/>
455 [% FOREACH biblioloo IN biblioloop %]
456 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
457 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
460 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
461 <input type="hidden" name="title" value="[% biblio.title | html %]" />
462 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
463 [% END # /IF multi_hold %]
467 <span class="label">Patron:</span>
468 [% IF ( patron.borrowernumber ) %]
469 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a>
475 [% UNLESS ( multi_hold ) %]
477 <span class="label">Estimated priority:</span>
478 <strong>[% fixedRank | html %]</strong>
483 <label for="holdnotes">Notes:</label>
484 <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
487 <label for="pickup">Pickup at:</label>
488 [% UNLESS ( multi_hold ) %]
489 <select name="pickup" id="pickup" data-biblio-id="[% biblio.biblionumber | html %]" data-patron-id="[% patron.borrowernumber | html %]">
490 [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
492 <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
493 <option value="" selected="selected"></option>
494 [% FOREACH pickup_location IN multi_pickup_locations %]
495 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
501 [% UNLESS ( multi_hold ) %]
502 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
504 <label for="itemtype">Request specific item type:</label>
505 <select name="itemtype" id="itemtype">
506 <option value="">Any item type</option>
507 [%- FOREACH itemtype IN available_itemtypes %]
508 <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
513 [% END # /UNLESS multi_hold %]
515 [% IF ( reserve_in_future ) %]
517 <label for="from">Hold starts on date:</label>
518 <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" data-start_for="expiration_date" class="flatpickr futuredate" />
523 <label for="to">Hold expires on date:</label>
524 <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" />
527 [% UNLESS ( multi_hold ) %]
529 <label for="requestany">Hold next available item </label>
530 [% IF force_hold_level == 'item' %]
531 <input type="checkbox" id="requestany" name="request" disabled="true" />
532 [% ELSIF force_hold_level == 'record' %]
533 <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
534 <input type="hidden" name="request" value="Any"/>
536 <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
538 <input type="hidden" name="biblioitem" value="[% biblioitemnumber | html %]" />
539 <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
542 [% IF remaining_holds_for_record > 1 %]
544 <label for="holds_to_place_count">Holds to place (count)</label>
545 <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" />
548 <input type="hidden" name="holds_to_place_count" value="1" />
550 [% END # /UNLESS multi_hold %]
552 <li id="non_priority_list_item">
553 <label for="non_priority">Non priority hold:</label>
554 <input name="non_priority" id="non_priority" type="checkbox" />
555 <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
559 [% UNLESS ( multi_hold ) %]
560 <fieldset class="action">
561 [% IF ( patron.borrowernumber ) %]
562 [% IF ( override_required ) %]
563 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
564 [% ELSIF ( none_available ) %]
565 <button type="submit" disabled="disabled" class="btn btn-default btn-disabled">Place hold</button>
567 <button type="submit" class="btn btn-default">Place hold</button>
572 [% FOREACH bibitemloo IN bibitemloop %]
574 [% UNLESS ( item_level_itypes ) %]
576 <span class="label">Item type:</span>
577 [% bibitemloo.description | html %]
581 [% IF ( bibitemloo.publicationyear ) %]
583 <span class="label">Publication year:</span>
584 [% bibitemloo.publicationyear | html %]
589 <h2 style="padding: 0 1em;">
590 Place a hold on a specific item
591 [% IF bibitemloo.force_hold_level == 'item' %]
592 <span class="error"><em>(Required)</em></span>
596 <table id="requestspecific">
600 [% IF ( item_level_itypes ) %]
604 <th>Home library</th>
605 <th>Last location</th>
606 [% IF itemdata_ccode %]
611 [% IF itemdata_enumchron %]
615 <th>Allowed pickup locations</th>
619 [% SET selected = 0 %]
620 [% FOREACH itemloo IN bibitemloo.itemloop %]
621 [% UNLESS ( itemloo.hide ) %]
622 <tr class="[% itemloo.backgroundcolor | html %]">
624 [% IF itemloo.force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
626 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
627 Hold must be record level
629 [% ELSIF ( itemloo.available ) %]
630 <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
631 [% ELSIF ( itemloo.override ) %]
632 <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
633 <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
636 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
637 [% IF itemloo.not_holdable %]
638 [% IF itemloo.not_holdable == 'damaged' %]
640 [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
642 [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
643 Exceeded max holds per record
644 [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
645 Daily hold limit reached for patron
646 [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
648 [% ELSIF itemloo.not_holdable == 'notReservable' %]
650 [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
651 Patron is from different library
652 [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
653 Cannot place hold from patron's library
654 [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
655 Patron already has hold for this item
656 [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
657 Cannot be transferred to pickup library
658 [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
659 Only pickup locations within the same hold group are allowed
660 [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
661 No reserves are allowed on this item
662 [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %]
663 Library is not a pickup location
664 [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
665 No valid pickup location
667 [% itemloo.not_holdable | html %]
671 [% END # /IF itemloo.force_hold_level %]
673 [% IF ( item_level_itypes ) %]
675 [% UNLESS ( noItemTypeImages ) %]
676 [% IF ( itemloo.imageurl ) %]<img src="[% itemloo.imageurl | html %]" alt="" /> <br /> [% END %]
678 [% itemloo.itypename | html %]
682 [% itemloo.barcode | html %]
685 [% Branches.GetName( itemloo.homebranch ) | html %]
688 [% Branches.GetName( itemloo.holdingbranch ) | html %]
690 [% IF itemdata_ccode %]
692 [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
696 [% itemloo.itemcallnumber | html %]
699 [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %]
701 [% IF itemdata_enumchron %]
703 [% itemloo.enumchron | html %]
706 [% IF ( itemloo.onloan ) %]
707 <td data-order="[% itemloo.date_due | html %]">
708 <span class="checkedout">Due [% itemloo.date_due | $KohaDates as_due_date => 1 %]</span>
711 [% IF ( itemloo.transfertwhen ) %]
712 In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
713 to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %]
717 [% IF ( itemloo.reservedate ) %]
718 [% IF ( itemloo.nocancel ) %]
719 Can't be cancelled when item is in transit
721 [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %]
722 [% IF ( itemloo.canreservefromotherbranches ) %]
723 for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedFor.borrowernumber | uri %]">[% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %]</a>
725 [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %]
726 [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since
727 [% IF ( itemloo.waitingdate ) %]
728 [% itemloo.waitingdate | $KohaDates %]
730 [% IF ( itemloo.reservedate ) %]
731 [% itemloo.reservedate | html %]
734 <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
735 [% END # /IF itemloo.nocancel %]
738 [% END # /IF itemloo.reservedate %]
740 [% IF itemloo.item_level_holds == "N" %]
741 <br/>Item level hold not allowed from OPAC
742 [% ELSIF itemloo.item_level_holds == "F" %]
743 <br/>Item level hold forced from OPAC
746 [% IF ( itemloo.itemlost ) %]
747 <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
750 [% IF ( itemloo.damaged ) %]
751 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
754 [% IF ( itemloo.withdrawn ) %]
755 <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
758 [% IF ( itemloo.notforloan ) %]
759 <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
763 [% IF (itemloo.pickup_locations_count > 0) %]
764 <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations"
765 data-item-id="[% itemloo.itemnumber | html %]"
766 data-patron-id="[% patron.borrowernumber | html %]">
767 [% IF (itemloo.default_pickup_location) %]
768 <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option>
774 [% END # / UNLESS itemloo.hide %]
775 [% END # /FOREACH itemloo %]
777 </table> <!-- /#requestspecific -->
779 [% IF ( bibitemloo.hiddencount ) %]
781 <p class="hiddencount">
782 <a href="request.pl?biblionumber=[% bibitemloo.biblionumber | uri %]&borrowernumber=[% bibitemloo.borrowernumber | uri %]&showallitems=1">Show all items ([% bibitemloo.hiddencount | html %] hidden)</a>
785 [% END # /IF bibitemloo.hiddencount %]
786 [% END # /FOREACH bibitemloo %]
788 [% ELSE # /UNLESS multi_hold %]
790 <table id="requesttitles">
794 [% UNLESS ( item_level_itypes ) %]
799 <th>Pickup location</th>
801 [% FOREACH biblioloo IN biblioloop %]
802 [% IF ( biblioloo.warn ) %]
808 [% UNLESS ( biblioloo.warn ) %]
809 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
815 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
817 [% IF ( biblioloo.publicationyear ) %]
819 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
823 [% IF ( biblioloo.warn ) %]
824 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
827 [% UNLESS ( item_level_itypes ) %]
829 <img src="[% biblioloo.imageurl | html %]" alt="[% biblioloo.itypename | html %]" title="[% biblioloo.itypename | html %]" />
832 <td>[% biblioloo.rank | html %]</td>
834 [% IF ( biblioloo.checked_previously ) %]
835 <span>Patron has previously checked out this title</span><br/>
837 [% IF ( biblioloo.alreadyres ) %]
840 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
845 [% IF ( biblioloo.alreadyres ) %]
847 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
848 <strong>already has a hold</strong> on this item
851 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
852 <li> <strong>No items are available</strong> to be placed on hold</li>
855 [% IF ( biblioloo.alreadyres ) %]
858 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
864 [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %]
865 <select name="pickup_[% biblioloo.biblionumber | html %]"
866 class="multi_pickup_select"
867 data-biblio-id="[% biblioloo.biblionumber | html %]"
868 data-patron-id="[% patron.borrowernumber | html %]"
869 data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
870 <option value=""></option>
871 [% FOREACH pickup_location IN biblioloo.pickup_locations %]
872 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
878 [% END # /FOREACH biblioloo %]
879 </table> <!-- /#requesttitles -->
881 [% END # /UNLESS multi_hold %]
883 <fieldset class="action">
884 [% IF ( patron AND patron.borrowernumber ) %]
885 [% IF ( override_required ) %]
886 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
887 [% ELSIF ( none_available ) %]
888 <button class="btn btn-default" type="submit">Place holds</button>
890 [% IF ( multi_hold ) %]
891 <button type="submit" class="btn btn-default" id="multi_hold_submit">Place holds</button>
893 <button type="submit" class="btn btn-default">Place hold</button>
896 [% END # /IF patron %]
897 </fieldset> <!-- /.action -->
898 </form> <!-- /#hold-request-form -->
899 </fieldset> <!-- /.rows -->
902 [% UNLESS ( patron ) %]
903 [% IF ( reserveloop ) %]
904 <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
905 [% IF ( multi_hold ) %]
906 <input type = "hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
910 <div class="dialog message">
911 <p>The job has been enqueued! It will be processed as soon as possible.</p>
912 <p><a href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=[% job_id | uri %]" title="View detail of the enqueued job">View detail of the enqueued job</a></p>
916 <h2>Existing holds</h2>
917 <div id="toolbar" class="btn-toolbar">
918 <input type="submit" name="submit" value="Update hold(s)" /> <button class="cancel_selected_holds" data-bulk="true"></button>
919 <fieldset id="cancellation-reason-fieldset" class="action">
920 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
921 [% IF hold_cancellation %]
922 <label for="cancellation-reason">Cancellation reason: </label>
923 <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
924 <option value="">No reason given</option>
925 [% FOREACH reason IN hold_cancellation %]
926 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
933 [% FOREACH biblioloo IN biblioloop %]
934 [% IF ( biblioloo.reserveloop ) %]
935 <div class="hold_title" id="hold_title_[% biblioloo.biblionumber | html %]">
936 [% IF ( multi_hold ) %]
938 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
939 [% biblioloo.title | html %]
940 </a> <span class="number_box"><span>[% biblioloo.reserveloop.size | html %] [% tn('Hold', 'Holds', biblioloo.reserveloop.size) | $raw %]</span></span>
944 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
946 [% SET branchcodes = [] %]
948 [% FOREACH h IN biblioloo.reserveloop %]
949 [% branchcodes.push( h.branchcode ) %]
951 [% branchcodes = branchcodes.unique %]
952 [% IF ( branchcodes.empty ) %]
954 There are no holds on this title.
958 [% FOREACH b IN branchcodes.sort %]
959 [% SET holds_by_branch = [] %]
960 [% FOREACH h IN biblioloo.reserveloop %]
961 [% IF h.branchcode == b %]
962 [% holds_by_branch.push( h ) %]
965 <div class="holds_by_library">
966 <h4>[% Branches.GetName( b ) | html %]</h4>
968 [% INCLUDE holds_table.inc holds=holds_by_branch %]
970 [% END # /FOREACh b %]
971 [% END # /IF ( branchcodes.empty ) %]
973 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
975 [% SET itemtypes = [] %]
977 [% FOREACH h IN biblioloo.reserveloop %]
978 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
979 [% itemtypes.push( hold_itemtype ) %]
981 [% itemtypes = itemtypes.unique %]
982 [% IF ( itemtypes.empty ) %]
984 There are no holds on this title.
988 [% FOREACH i IN itemtypes.sort %]
989 [% SET holds_by_itemtype = [] %]
990 [% FOREACH h IN biblioloo.reserveloop %]
991 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
992 [% IF hold_itemtype == i %]
993 [% holds_by_itemtype.push( h ) %]
997 <div class="holds_by_itemtype">
999 <h4>[% ItemTypes.GetDescription( i ) | html %]</h4>
1001 <h4>Any item type</h4>
1003 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1005 [% END # /FOREACH i %]
1006 [% END # /IF ( itemtypes.empty ) %]
1008 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
1009 [% SET branchcodes = [] %]
1011 [% FOREACH h IN biblioloo.reserveloop %]
1012 [% branchcodes.push( h.branchcode ) %]
1014 [% branchcodes = branchcodes.unique %]
1015 [% IF ( branchcodes.empty ) %]
1017 There are no holds on this title.
1021 [% FOREACH b IN branchcodes.sort %]
1022 <div class="holds_by_library">
1023 <h4 class="library_holds">[% Branches.GetName( b ) | html %]</h4>
1024 [% SET holds_by_branch = [] %]
1025 [% FOREACH h IN biblioloo.reserveloop %]
1026 [% IF h.branchcode == b %]
1027 [% holds_by_branch.push( h ) %]
1031 [% SET itemtypes = [] %]
1032 [% FOREACH h IN holds_by_branch %]
1033 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1034 [% itemtypes.push( hold_itemtype ) %]
1036 [% itemtypes = itemtypes.unique %]
1038 [% FOREACH i IN itemtypes.sort %]
1039 <div class="holds_by_itemtype">
1040 <h5 class="itemtype_holds">
1042 [% ItemTypes.GetDescription( i ) | html %]
1048 [% SET holds_by_itemtype = [] %]
1049 [% FOREACH h IN holds_by_branch %]
1050 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1051 [% IF hold_itemtype == i %]
1052 [% holds_by_itemtype.push( h ) %]
1055 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1056 </div> <!-- /.holds_by_itemtype -->
1058 </div> <!-- /.holds_by_library -->
1059 [% END # /FOREACH b %]
1060 [% END # /IF ( branchcodes.empty ) %]
1064 [% IF ( biblioloo.reserveloop.size ) %]
1065 [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
1068 There are no holds on this title.
1072 [% END # /IF HoldsSplitQueue %]
1073 </div> <!-- /hold_title -->
1074 [% END # /IF biblioloo.reserveloop %]
1075 [% END # FOREACH biblioloo %]
1076 </form> <!-- /#existing_holds -->
1077 [% END # IF reserveloop %]
1078 [% END # UNLESS patron %]
1082 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
1083 </div> <!-- /.col-md-10.col-md-offset-1 -->
1085 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1086 <div class="col-sm-2 col-sm-pull-10">
1088 [% INCLUDE 'biblio-view-menu.inc' %]
1090 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1092 </div> <!-- /.row -->
1094 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
1095 <div class="modal-dialog" role="document">
1096 <div class="modal-content">
1097 <div class="modal-header">
1098 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1099 <h3>Confirm deletion</h3>
1102 <div class="modal-body">
1103 <p>Are you sure you want to cancel this hold?</p>
1105 <fieldset class="action">
1106 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1107 [% IF hold_cancellation %]
1108 <label for="cancellation-reason">Cancellation reason: </label>
1109 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
1110 <option value="">No reason given</option>
1111 [% FOREACH reason IN hold_cancellation %]
1112 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1119 <div class="modal-footer">
1120 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
1121 <a href="#" data-dismiss="modal">Cancel</a>
1127 [% MACRO jsinclude BLOCK %]
1128 [% INCLUDE 'datatables.inc' %]
1129 [% INCLUDE 'calendar.inc' %]
1130 [% INCLUDE 'columns_settings.inc' %]
1131 [% Asset.js("lib/hc-sticky.js") | $raw %]
1132 [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1133 [% INCLUDE 'select2.inc' %]
1134 [% Asset.js("js/holds.js") | $raw%]
1137 var biblionumber = "[% biblionumber | $raw %]";
1138 var borrowernumber = "[% patron.borrowernumber | $raw %]";
1139 var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1140 var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo IN bibitemloo.itemloop %][% IF ( itemloo.override ) %]
1141 [% itemloo.itemnumber | html %]: {
1142 homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1143 holdallowed: "[% itemloo.holdallowed | html %]"
1145 [% END %][% END %][% END %]
1148 damaged: _("Item damaged"),
1149 ageRestricted: _("Age restricted"),
1150 tooManyHoldsForThisRecord: _("Exceeded max holds per record"),
1151 tooManyReservesToday: _("Daily hold limit reached for patron"),
1152 tooManyReserves: _("Too many holds"),
1153 notReservable: _("Not holdable"),
1154 noReservesAllowed: _("No reserves allowed"),
1155 cannotReserveFromOtherBranches: _("Patron is from different library"),
1156 itemAlreadyOnHold: _("Patron already has hold for this item"),
1157 cannotBeTransferred: _("Cannot be transferred to pickup library"),
1158 pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed")
1161 var MSG_CANCEL_SELECTED = _("Cancel selected (%s)");
1162 columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
1163 $.fn.select2.defaults.set("width", "100%" );
1164 $.fn.select2.defaults.set("dropdownAutoWidth", true );
1166 $(document).ready(function() {
1167 $('#cancellation-reason-fieldset').hide();
1168 $('.rank-request').on('change', function() {
1169 if ( $(".rank-request option:selected[value='del']").length ) {
1170 $('#cancellation-reason-fieldset').show();
1172 $('#cancellation-reason-fieldset').hide();
1176 [% SET active = clubs ? 1 : 0 %]
1177 $('#circ_holds_select').tabs({
1178 active: [% active | $raw %],
1179 activate: function(){
1180 $(this).find("input.focus").focus();
1183 $(this).find("input.focus").focus();
1186 function ToggleHoldsToPlace() {
1187 if ( $("#requestany").prop('checked') ) {
1188 $("#holds_to_place_count").prop('disabled', false);
1190 $("#holds_to_place_count").prop('disabled', true);
1193 ToggleHoldsToPlace();
1194 $("#requestany").on('change', function(){
1195 ToggleHoldsToPlace();
1198 [% IF Koha.Preference('UseBranchTransferLimits') %]
1199 $("#pickup").on('change', function(){
1200 var pickup = $("#pickup").val();
1201 var url = "?pickup=" + pickup;
1202 url += "&borrowernumber=" + borrowernumber;
1203 url += "&biblionumber=" + biblionumber;
1204 window.location.replace(url);
1208 [% IF AutoResumeSuspendedHolds %]
1209 $(".suspend_until_datepicker").flatpickr({
1210 minDate: new Date().fp_incr(1) /* Require that "until date" be in the future */
1215 var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1217 "sDom": '<"top pager"ilf>t',
1220 //Override fieldset styling for dataTables search box
1221 $("div.top.pager").css("margin-left","1em");
1222 $(".dataTables_filter label").css({
1224 "margin-right":"0em"
1227 $("#club-request-form").on("submit", function() {
1229 $('.clubalert, .holdalert').addClass('hide');
1230 let biblionumbers = [biblionumber];
1231 let biblionumbers_text;
1233 pickup_library_id: $('select[name="pickup"]').val()
1235 if($('input[name="checkitem"]:checked').length)
1236 data.item_id = $('input[name="checkitem"]:checked').val();
1237 if($('input[name="borrowernumber"]').length)
1238 data.patron_id = $('input[name="borrowernumber"]').val();
1239 if($('textarea[name="notes"]').length)
1240 data.notes = $('textarea[name="notes"]').val()||null;
1241 if($('input[name="itemtype"]').length) {
1242 data.item_type = $('input[name="itemtype"]').val()||null;
1244 if($('input[name="default_patron_home"]:checked').length) {
1245 data.default_patron_home = 1;
1247 if($('input[name="biblionumbers"]').length) {
1248 biblionumbers_text = $('input[name="biblionumbers"]').val();
1249 biblionumbers = biblionumbers_text.replace(/\/$/, '').split('/')
1252 const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1;
1253 biblionumbers.forEach(function(biblionumber) {
1254 data.biblio_id = biblionumber;
1256 url: $t.attr('action'),
1257 method: $t.attr('method').toUpperCase(),
1258 contentType: 'application/json',
1259 data: JSON.stringify(data)
1261 for(let i = 0; i < count; i++) {
1263 .then(function(result) {
1264 let url = 'request.pl?biblionumber='+biblionumber;
1265 if(biblionumbers_text) {
1266 url = 'request.pl?biblionumbers='+biblionumbers_text;
1268 document.location = url;
1270 .fail(function(err) {
1271 var message = err.responseJSON.error;
1272 var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/);
1273 if(match && ERROR_MAP[match[1]]) {
1274 message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>'
1276 $('.clubalert, .holdalert').removeClass('hide').html(message);
1284 [% UNLESS ( multi_hold ) %]
1285 $("#hold-request-form").on("submit", function(){
1286 return check($(this));
1289 $("#hold-request-form").on("submit", function(){
1290 return checkMultiHold();
1294 $(".pickup_location_dropdown").each( function () {
1295 var this_dropdown = $(this);
1296 var hold_id = $(this).data('hold_id');
1298 this_dropdown.select2({
1301 url: '/api/v1/holds/' + encodeURIComponent(hold_id) + '/pickup_locations',
1302 delay: 300, // wait 300 milliseconds before triggering the request
1304 data: function (params) {
1305 var search_term = (params.term === undefined) ? '' : params.term;
1307 "q": JSON.stringify({"name":{"-like":'%'+search_term+'%'}}),
1308 "_order_by": "name",
1309 "_page": params.page
1314 processResults: function (data, params) {
1316 data.results.forEach( function ( pickup_location ) {
1319 "id": pickup_location.library_id.escapeHtml(),
1320 "text": pickup_location.name.escapeHtml(),
1321 "needs_override": pickup_location.needs_override
1325 return { "results": results, "pagination": { "more": data.pagination.more } };
1327 transport: kohaSelect2Transport
1329 templateResult: display_pickup_location
1333 $("#pickup_multi").select2({
1338 $('.multi_pickup_select').select2({
1343 $("#pickup_multi").on("change", function() {
1344 var selection = $(this).val();
1345 if ( selection != '' ) {
1346 $(".multi_pickup_select").each(function() {
1347 var valid_pickup_locations = $(this).data('pickup-locations');
1348 if ( valid_pickup_locations.includes(selection) ) {
1349 $(this).val(selection);
1350 $(this).trigger("change");
1356 $("#pickup").each( function () {
1357 var this_dropdown = $(this);
1358 var patron_id = $(this).data('patron-id');
1359 var biblio_id = $(this).data('biblio-id');
1361 this_dropdown.select2({
1365 url: '/api/v1/biblios/' + encodeURIComponent(biblio_id) + '/pickup_locations',
1366 delay: 300, // wait 300 milliseconds before triggering the request
1368 data: function (params) {
1369 var search_term = (params.term === undefined) ? '' : params.term;
1371 "q": JSON.stringify({"name":{"-like":'%'+search_term+'%'}}),
1372 "_order_by": "name",
1373 "patron_id": patron_id,
1374 "_page": params.page
1378 processResults: function (data) {
1380 data.results.forEach( function ( pickup_location ) {
1383 "id": pickup_location.library_id.escapeHtml(),
1384 "text": pickup_location.name.escapeHtml(),
1385 "needs_override": pickup_location.needs_override
1389 return { "results": results, "pagination": { "more": data.pagination.more } };
1391 transport: kohaSelect2Transport,
1393 templateResult: display_pickup_location
1396 $(".pickup_locations").each( function () {
1397 var this_dropdown = $(this);
1398 var patron_id = $(this).data('patron-id');
1399 var item_id = $(this).data('item-id');
1401 this_dropdown.select2({
1404 url: '/api/v1/items/' + encodeURIComponent(item_id) + '/pickup_locations',
1405 delay: 300, // wait 300 milliseconds before triggering the request
1407 data: function (params) {
1408 var search_term = (params.term === undefined) ? '' : params.term;
1410 "q": JSON.stringify({"name":{"-like":'%'+search_term+'%'}}),
1411 "_order_by": "name",
1412 "patron_id": patron_id,
1413 "_page": params.page
1417 processResults: function (data) {
1419 data.results.forEach( function ( pickup_location ) {
1422 "id": pickup_location.library_id.escapeHtml(),
1423 "text": pickup_location.name.escapeHtml(),
1424 "needs_override": pickup_location.needs_override
1428 return { "results": results, "pagination": { "more": data.pagination.more } };
1430 transport: kohaSelect2Transport
1432 templateResult: display_pickup_location
1437 function check( table ) {
1441 if ( $("#requestany").attr("checked") !== "checked" ) {
1442 // requestany not selected, go through the item-specific cases
1443 if ( $('input[type="radio"]:checked').length > 0 ) {
1444 // got item-specific hold requests in the form!
1445 // verify they have a pickup location selected
1447 if (table.find('input[type="radio"]:checked')
1449 .find(".pickup_locations").val() === null) {
1451 msg = _("- Please select a pickup location for the item" + "\n")
1455 msg = (_("- Please select an item to place a hold") + "\n");
1460 $('#hold-request-form').preventDoubleFormSubmit();
1468 function checkMultiHold() {
1470 var biblionumbers = "";
1471 var selected_bibs = $(".multi_hold_item_checkbox:checked");
1472 if ( selected_bibs.length > 0 ) {
1473 // there are biblios selected in the form!
1474 // verify they have a pickup location selected
1476 var pickup_not_set = 0;
1477 selected_bibs.each(function() {
1478 if ( $(this).closest('tr').find(".multi_pickup_select").val() === "" ) {
1482 var bibnum = $(this).attr("title");
1483 biblionumbers += bibnum + "/";
1486 if ( pickup_not_set > 0 ) {
1487 alert( _("Please make sure all selected titles have a pickup location set" + "\n") );
1492 alert( _("Please select at least one title" + "\n") );
1496 var badSpans = $(".not_holdable");
1498 $(badSpans).each(function() {
1499 var bibnum = $(this).attr("title");
1500 badBibs += bibnum + "/";
1503 $("#multi_hold_bibs").val(biblionumbers);
1504 $("#bad_bibs").val(badBibs);
1506 $('#hold-request-form').preventDoubleFormSubmit();
1511 $(document).ready(function() {
1512 $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1513 var itemnumber = this.value;
1516 switch (override_items[itemnumber].holdallowed) {
1517 case "not_allowed": msg = _("This item normally cannot be put on hold."); break;
1518 case "from_home_library": msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
1521 msg += "\n\n" + _("Place hold on this item?");
1523 return confirm(msg);
1525 $("button.warning").click(function() {
1526 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1528 $("#requestany").click(function() {
1530 $("input[name=checkitem]").each(function() {
1531 $(this).prop("checked", false);
1535 $("input[name=checkitem]").click(function() {
1537 $("input[name=checkitem]").each(function() {
1542 if(onechecked == 1){
1543 $("#requestany").prop("checked", false);
1544 $("#holds_to_place_count").prop('disabled', true);
1546 $("#requestany").prop("checked",true);
1547 $("#holds_to_place_count").prop('disabled', false);
1550 var prev_rank_request;
1551 $("select[name=rank-request]").on("focus", function() {
1552 prev_rank_request = $(this).val();
1553 var row = $(this).parents("tr:first");
1554 }).change(function() {
1555 var row = $(this).parents("tr:first");
1556 var value = parseInt($(this).val());
1557 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
1558 if( !isNaN(value) ) { //If moved to 'del'
1559 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)
1560 if (prev_rank_request > value) {
1561 row.insertBefore(after);
1563 row.insertAfter(after);
1567 var next_priority = 1;
1568 $("select[name=rank-request]").each(function () {
1569 if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
1570 $(this).val(next_priority);
1575 $(".clear-date").on("click",function(e){
1577 var fieldID = this.id.replace("clear-date-","");
1578 $("#" + fieldID).val("");
1581 // Confirm cancellation of hold
1583 $(".cancel-hold").on("click",function(e) {
1585 cancel_link = $(this);
1586 $('#cancelModal').modal();
1589 $("#cancelModalConfirmBtn").on("click",function(e) {
1591 if(cancel_link.data('bulk')) {
1592 [% IF biblionumbers %]
1593 link = `request.pl?biblionumbers=[% biblionumbers | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1595 link = `request.pl?biblionumber=[% biblionumber | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1598 let borrowernumber = cancel_link.data('borrowernumber');
1599 let biblionumber = cancel_link.data('biblionumber');
1600 let reserve_id = cancel_link.data('id');
1601 link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`;
1603 let reason = $("#modal-cancellation-reason").val();
1605 link += "&cancellation-reason=" + reason
1607 window.location.href = link;
1611 [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems || nobiblio ) %]
1612 [% IF ( PatronAutoComplete ) %]
1613 $( "#patron" ).autocomplete({
1614 source: "/cgi-bin/koha/circ/ysearch.pl",
1616 select: function( event, ui ) {
1617 $( "#patron" ).val( ui.item.cardnumber );
1618 $( "#holds_patronsearch" ).submit();
1622 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
1623 return $( "<li></li>" )
1624 .data( "ui-autocomplete-item", item )
1627 + ( item.surname ? item.surname.escapeHtml() : "" )
1629 + ( item.firstname ? item.firstname.escapeHtml() : "" )
1630 + " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")"
1633 + ( item.address ? item.address.escapeHtml() : "" )
1635 + ( item.city ? item.city.escapeHtml() : "" )
1637 + ( item.zipcode ? item.zipcode.escapeHtml() : "" )
1639 + ( item.country ? item.country.escapeHtml() : "" )
1646 Sticky = $("#toolbar");
1648 stickTo: "#existing_holds",
1649 stickyClass: "floating"
1652 if(!localStorage.selectedHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) {
1653 localStorage.selectedHolds = [];
1656 $('.holds_table .select_hold').each(function() {
1657 if(localStorage.selectedHolds.includes($(this).data('id'))) {
1658 $(this).prop('checked', true);
1662 $('.holds_table .select_hold_all').each(function() {
1663 var table = $(this).parents('.holds_table');
1664 var count = $('.select_hold:not(:checked)', table).length;
1665 $('.select_hold_all', table).prop('checked', !count);
1668 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1670 $('.holds_table .select_hold_all').click(function() {
1671 var table = $(this).parents('.holds_table');
1672 var count = $('.select_hold:checked', table).length;
1673 $('.select_hold', table).prop('checked', !count);
1674 $(this).prop('checked', !count);
1675 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1676 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1679 $('.holds_table .select_hold').click(function() {
1680 var table = $(this).parents('.holds_table');
1681 var count = $('.select_hold:not(:checked)', table).length;
1682 $('.select_hold_all', table).prop('checked', !count);
1683 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1684 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1687 $('.cancel_selected_holds').click(function(e) {
1689 if($('.holds_table .select_hold:checked').length) {
1690 cancel_link = $(this);
1691 delete localStorage.selectedHolds;
1692 $('#cancelModal').modal();
1701 [% INCLUDE 'intranet-bottom.inc' %]