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 ( patron.is_expired ) %]
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 member.amount_outstanding && Koha.Preference('maxoutstanding') && member.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"
490 data-biblio-id="[% biblio.biblionumber | html %]"
491 data-patron-id="[% patron.borrowernumber | html %]"
492 data-pickup-location-source="biblio">
493 [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
495 <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
496 <option value="" selected="selected"></option>
497 [% FOREACH pickup_location IN multi_pickup_locations %]
498 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
504 [% UNLESS ( multi_hold ) %]
505 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
507 <label for="itemtype">Request specific item type:</label>
508 <select name="itemtype" id="itemtype">
509 <option value="">Any item type</option>
510 [%- FOREACH itemtype IN available_itemtypes %]
511 <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
516 [% END # /UNLESS multi_hold %]
518 [% IF ( reserve_in_future ) %]
520 <label for="from">Hold starts on date:</label>
521 <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" data-date_to="expiration_date" class="flatpickr" data-flatpickr-futuredate="true" />
526 <label for="to">Hold expires on date:</label>
527 <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
530 [% UNLESS ( multi_hold ) %]
532 <label for="requestany">Hold next available item </label>
533 [% IF force_hold_level == 'item' %]
534 <input type="checkbox" id="requestany" name="request" disabled="true" />
535 [% ELSIF force_hold_level == 'record' %]
536 <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
537 <input type="hidden" name="request" value="Any"/>
539 <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
541 <input type="hidden" name="biblioitem" value="[% biblioitemnumber | html %]" />
542 <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
545 [% IF remaining_holds_for_record > 1 %]
547 <label for="holds_to_place_count">Holds to place (count)</label>
548 <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" />
551 <input type="hidden" name="holds_to_place_count" value="1" />
553 [% END # /UNLESS multi_hold %]
555 <li id="non_priority_list_item">
556 <label for="non_priority">Non priority hold:</label>
557 <input name="non_priority" id="non_priority" type="checkbox" />
558 <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
562 [% UNLESS ( multi_hold ) %]
563 <fieldset class="action">
564 [% IF ( patron.borrowernumber ) %]
565 [% IF ( override_required ) %]
566 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
567 [% ELSIF ( none_available ) %]
568 <button type="submit" disabled="disabled" class="btn btn-default btn-disabled">Place hold</button>
570 <button type="submit" class="btn btn-default">Place hold</button>
575 [% FOREACH bibitemloo IN bibitemloop %]
577 [% UNLESS ( item_level_itypes ) %]
579 <span class="label">Item type:</span>
580 [% bibitemloo.description | html %]
584 [% IF ( bibitemloo.publicationyear ) %]
586 <span class="label">Publication year:</span>
587 [% bibitemloo.publicationyear | html %]
592 <h2 style="padding: 0 1em;">
593 Place a hold on a specific item
594 [% IF bibitemloo.force_hold_level == 'item' %]
595 <span class="error"><em>(Required)</em></span>
599 <table id="requestspecific">
603 [% IF ( item_level_itypes ) %]
607 <th>Home library</th>
608 <th>Last location</th>
609 [% IF itemdata_ccode %]
614 [% IF itemdata_enumchron %]
618 <th>Allowed pickup locations</th>
622 [% SET selected = 0 %]
623 [% FOREACH itemloo IN bibitemloo.itemloop %]
624 [% UNLESS ( itemloo.hide ) %]
625 <tr class="[% itemloo.backgroundcolor | html %]">
627 [% IF itemloo.force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
629 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
630 Hold must be record level
632 [% ELSIF ( itemloo.available ) %]
633 <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
634 [% ELSIF ( itemloo.override ) %]
635 <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
636 <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
639 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
640 [% IF itemloo.not_holdable %]
641 [% IF itemloo.not_holdable == 'damaged' %]
643 [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
645 [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
646 Exceeded max holds per record
647 [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
648 Daily hold limit reached for patron
649 [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
651 [% ELSIF itemloo.not_holdable == 'notReservable' %]
653 [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
654 Patron is from different library
655 [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
656 Cannot place hold from patron's library
657 [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
658 Patron already has hold for this item
659 [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
660 Cannot be transferred to pickup library
661 [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
662 Only pickup locations within the same hold group are allowed
663 [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
664 No reserves are allowed on this item
665 [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %]
666 Library is not a pickup location
667 [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
668 No valid pickup location
670 [% itemloo.not_holdable | html %]
674 [% END # /IF itemloo.force_hold_level %]
676 [% IF ( item_level_itypes ) %]
678 [% UNLESS ( noItemTypeImages ) %]
679 [% IF ( itemloo.imageurl ) %]<img src="[% itemloo.imageurl | html %]" alt="" /> <br /> [% END %]
681 [% itemloo.itypename | html %]
685 [% itemloo.barcode | html %]
688 [% Branches.GetName( itemloo.homebranch ) | html %]
691 [% Branches.GetName( itemloo.holdingbranch ) | html %]
693 [% IF itemdata_ccode %]
695 [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
699 [% itemloo.itemcallnumber | html %]
702 [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %]
704 [% IF itemdata_enumchron %]
706 [% itemloo.enumchron | html %]
709 [% IF ( itemloo.onloan ) %]
710 <td data-order="[% itemloo.date_due | html %]">
711 <span class="checkedout">Due [% itemloo.date_due | $KohaDates as_due_date => 1 %]</span>
714 [% IF ( itemloo.transfertwhen ) %]
715 In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
716 to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %]
720 [% IF ( itemloo.reservedate ) %]
721 [% IF ( itemloo.nocancel ) %]
722 Can't be cancelled when item is in transit
724 [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %]
725 [% IF ( itemloo.canreservefromotherbranches ) %]
726 for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedFor.borrowernumber | uri %]">[% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %]</a>
728 [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %]
729 [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since
730 [% IF ( itemloo.waitingdate ) %]
731 [% itemloo.waitingdate | $KohaDates %]
733 [% IF ( itemloo.reservedate ) %]
734 [% itemloo.reservedate | html %]
737 <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
738 [% END # /IF itemloo.nocancel %]
741 [% END # /IF itemloo.reservedate %]
743 [% IF itemloo.item_level_holds == "N" %]
744 <br/>Item level hold not allowed from OPAC
745 [% ELSIF itemloo.item_level_holds == "F" %]
746 <br/>Item level hold forced from OPAC
749 [% IF ( itemloo.itemlost ) %]
750 <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
753 [% IF ( itemloo.damaged ) %]
754 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
757 [% IF ( itemloo.withdrawn ) %]
758 <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
761 [% IF ( itemloo.notforloan ) %]
762 <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
766 [% IF (itemloo.pickup_locations_count > 0) %]
767 <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations"
768 data-item-id="[% itemloo.itemnumber | html %]"
769 data-patron-id="[% patron.borrowernumber | html %]"
770 data-pickup-location-source="item">
771 [% IF (itemloo.default_pickup_location) %]
772 <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option>
778 [% END # / UNLESS itemloo.hide %]
779 [% END # /FOREACH itemloo %]
781 </table> <!-- /#requestspecific -->
783 [% IF ( bibitemloo.hiddencount ) %]
785 <p class="hiddencount">
786 <a href="request.pl?biblionumber=[% bibitemloo.biblionumber | uri %]&borrowernumber=[% bibitemloo.borrowernumber | uri %]&showallitems=1">Show all items ([% bibitemloo.hiddencount | html %] hidden)</a>
789 [% END # /IF bibitemloo.hiddencount %]
790 [% END # /FOREACH bibitemloo %]
792 [% ELSE # /UNLESS multi_hold %]
794 <table id="requesttitles">
798 [% UNLESS ( item_level_itypes ) %]
803 <th>Pickup location</th>
805 [% FOREACH biblioloo IN biblioloop %]
806 [% IF ( biblioloo.warn ) %]
812 [% UNLESS ( biblioloo.warn ) %]
813 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
819 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
821 [% IF ( biblioloo.publicationyear ) %]
823 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
827 [% IF ( biblioloo.warn ) %]
828 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
831 [% UNLESS ( item_level_itypes ) %]
833 <img src="[% biblioloo.imageurl | html %]" alt="[% biblioloo.itypename | html %]" title="[% biblioloo.itypename | html %]" />
836 <td>[% biblioloo.rank | html %]</td>
838 [% IF ( biblioloo.checked_previously ) %]
839 <span>Patron has previously checked out this title</span><br/>
841 [% IF ( biblioloo.alreadyres ) %]
844 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
849 [% IF ( biblioloo.alreadyres ) %]
851 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
852 <strong>already has a hold</strong> on this item
855 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
856 <li> <strong>No items are available</strong> to be placed on hold</li>
859 [% IF ( biblioloo.alreadyres ) %]
862 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
868 [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %]
869 <select name="pickup_[% biblioloo.biblionumber | html %]"
870 class="multi_pickup_select"
871 data-biblio-id="[% biblioloo.biblionumber | html %]"
872 data-patron-id="[% patron.borrowernumber | html %]"
873 data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
874 <option value=""></option>
875 [% FOREACH pickup_location IN biblioloo.pickup_locations %]
876 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
882 [% END # /FOREACH biblioloo %]
883 </table> <!-- /#requesttitles -->
885 [% END # /UNLESS multi_hold %]
887 <fieldset class="action">
888 [% IF ( patron AND patron.borrowernumber ) %]
889 [% IF ( override_required ) %]
890 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
891 [% ELSIF ( none_available ) %]
892 <button class="btn btn-default" type="submit">Place holds</button>
894 [% IF ( multi_hold ) %]
895 <button type="submit" class="btn btn-default" id="multi_hold_submit">Place holds</button>
897 <button type="submit" class="btn btn-default">Place hold</button>
900 [% END # /IF patron %]
901 </fieldset> <!-- /.action -->
902 </form> <!-- /#hold-request-form -->
903 </fieldset> <!-- /.rows -->
906 [% UNLESS ( patron ) %]
907 [% IF ( reserveloop ) %]
908 <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
909 [% IF ( multi_hold ) %]
910 <input type = "hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
914 <div class="dialog message">
915 <p>The job has been enqueued! It will be processed as soon as possible.</p>
916 <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>
920 <h2>Existing holds</h2>
921 <div id="toolbar" class="btn-toolbar">
922 <input type="submit" name="submit" value="Update hold(s)" /> <button class="cancel_selected_holds" data-bulk="true"></button>
923 <fieldset id="cancellation-reason-fieldset" class="action">
924 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
925 [% IF hold_cancellation %]
926 <label for="cancellation-reason">Cancellation reason: </label>
927 <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
928 <option value="">No reason given</option>
929 [% FOREACH reason IN hold_cancellation %]
930 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
937 [% FOREACH biblioloo IN biblioloop %]
938 [% IF ( biblioloo.reserveloop ) %]
939 <div class="hold_title" id="hold_title_[% biblioloo.biblionumber | html %]">
940 [% IF ( multi_hold ) %]
942 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
943 [% biblioloo.title | html %]
944 </a> <span class="number_box"><span>[% biblioloo.reserveloop.size | html %] [% tn('Hold', 'Holds', biblioloo.reserveloop.size) | $raw %]</span></span>
948 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
950 [% SET branchcodes = [] %]
952 [% FOREACH h IN biblioloo.reserveloop %]
953 [% branchcodes.push( h.branchcode ) %]
955 [% branchcodes = branchcodes.unique %]
956 [% IF ( branchcodes.empty ) %]
958 There are no holds on this title.
962 [% FOREACH b IN branchcodes.sort %]
963 [% SET holds_by_branch = [] %]
964 [% FOREACH h IN biblioloo.reserveloop %]
965 [% IF h.branchcode == b %]
966 [% holds_by_branch.push( h ) %]
969 <div class="holds_by_library">
970 <h4>[% Branches.GetName( b ) | html %]</h4>
972 [% INCLUDE holds_table.inc holds=holds_by_branch %]
974 [% END # /FOREACh b %]
975 [% END # /IF ( branchcodes.empty ) %]
977 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
979 [% SET itemtypes = [] %]
981 [% FOREACH h IN biblioloo.reserveloop %]
982 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
983 [% itemtypes.push( hold_itemtype ) %]
985 [% itemtypes = itemtypes.unique %]
986 [% IF ( itemtypes.empty ) %]
988 There are no holds on this title.
992 [% FOREACH i IN itemtypes.sort %]
993 [% SET holds_by_itemtype = [] %]
994 [% FOREACH h IN biblioloo.reserveloop %]
995 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
996 [% IF hold_itemtype == i %]
997 [% holds_by_itemtype.push( h ) %]
1001 <div class="holds_by_itemtype">
1003 <h4>[% ItemTypes.GetDescription( i ) | html %]</h4>
1005 <h4>Any item type</h4>
1007 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1009 [% END # /FOREACH i %]
1010 [% END # /IF ( itemtypes.empty ) %]
1012 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
1013 [% SET branchcodes = [] %]
1015 [% FOREACH h IN biblioloo.reserveloop %]
1016 [% branchcodes.push( h.branchcode ) %]
1018 [% branchcodes = branchcodes.unique %]
1019 [% IF ( branchcodes.empty ) %]
1021 There are no holds on this title.
1025 [% FOREACH b IN branchcodes.sort %]
1026 <div class="holds_by_library">
1027 <h4 class="library_holds">[% Branches.GetName( b ) | html %]</h4>
1028 [% SET holds_by_branch = [] %]
1029 [% FOREACH h IN biblioloo.reserveloop %]
1030 [% IF h.branchcode == b %]
1031 [% holds_by_branch.push( h ) %]
1035 [% SET itemtypes = [] %]
1036 [% FOREACH h IN holds_by_branch %]
1037 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1038 [% itemtypes.push( hold_itemtype ) %]
1040 [% itemtypes = itemtypes.unique %]
1042 [% FOREACH i IN itemtypes.sort %]
1043 <div class="holds_by_itemtype">
1044 <h5 class="itemtype_holds">
1046 [% ItemTypes.GetDescription( i ) | html %]
1052 [% SET holds_by_itemtype = [] %]
1053 [% FOREACH h IN holds_by_branch %]
1054 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1055 [% IF hold_itemtype == i %]
1056 [% holds_by_itemtype.push( h ) %]
1059 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1060 </div> <!-- /.holds_by_itemtype -->
1062 </div> <!-- /.holds_by_library -->
1063 [% END # /FOREACH b %]
1064 [% END # /IF ( branchcodes.empty ) %]
1068 [% IF ( biblioloo.reserveloop.size ) %]
1069 [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
1072 There are no holds on this title.
1076 [% END # /IF HoldsSplitQueue %]
1077 </div> <!-- /hold_title -->
1078 [% END # /IF biblioloo.reserveloop %]
1079 [% END # FOREACH biblioloo %]
1080 </form> <!-- /#existing_holds -->
1081 [% END # IF reserveloop %]
1082 [% END # UNLESS patron %]
1086 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
1087 </div> <!-- /.col-md-10.col-md-offset-1 -->
1089 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1090 <div class="col-sm-2 col-sm-pull-10">
1092 [% INCLUDE 'biblio-view-menu.inc' %]
1094 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1096 </div> <!-- /.row -->
1098 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
1099 <div class="modal-dialog" role="document">
1100 <div class="modal-content">
1101 <div class="modal-header">
1102 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1103 <h3>Confirm deletion</h3>
1106 <div class="modal-body">
1107 <p>Are you sure you want to cancel this hold?</p>
1109 <fieldset class="action">
1110 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1111 [% IF hold_cancellation %]
1112 <label for="cancellation-reason">Cancellation reason: </label>
1113 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
1114 <option value="">No reason given</option>
1115 [% FOREACH reason IN hold_cancellation %]
1116 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1123 <div class="modal-footer">
1124 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
1125 <a href="#" data-dismiss="modal">Cancel</a>
1131 [% MACRO jsinclude BLOCK %]
1132 [% INCLUDE 'datatables.inc' %]
1133 [% INCLUDE 'calendar.inc' %]
1134 [% INCLUDE 'columns_settings.inc' %]
1135 [% Asset.js("lib/hc-sticky.js") | $raw %]
1136 [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1137 [% INCLUDE 'select2.inc' %]
1138 [% Asset.js("js/holds.js") | $raw%]
1141 var biblionumber = "[% biblionumber | $raw %]";
1142 var borrowernumber = "[% patron.borrowernumber | $raw %]";
1143 var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1144 var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo IN bibitemloo.itemloop %][% IF ( itemloo.override ) %]
1145 [% itemloo.itemnumber | html %]: {
1146 homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1147 holdallowed: "[% itemloo.holdallowed | html %]"
1149 [% END %][% END %][% END %]
1152 damaged: _("Item damaged"),
1153 ageRestricted: _("Age restricted"),
1154 tooManyHoldsForThisRecord: _("Exceeded max holds per record"),
1155 tooManyReservesToday: _("Daily hold limit reached for patron"),
1156 tooManyReserves: _("Too many holds"),
1157 notReservable: _("Not holdable"),
1158 noReservesAllowed: _("No reserves allowed"),
1159 cannotReserveFromOtherBranches: _("Patron is from different library"),
1160 itemAlreadyOnHold: _("Patron already has hold for this item"),
1161 cannotBeTransferred: _("Cannot be transferred to pickup library"),
1162 pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed")
1165 var MSG_CANCEL_SELECTED = _("Cancel selected (%s)");
1166 columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
1167 $.fn.select2.defaults.set("width", "100%" );
1168 $.fn.select2.defaults.set("dropdownAutoWidth", true );
1170 $(document).ready(function() {
1171 $('#cancellation-reason-fieldset').hide();
1172 $('.rank-request').on('change', function() {
1173 if ( $(".rank-request option:selected[value='del']").length ) {
1174 $('#cancellation-reason-fieldset').show();
1176 $('#cancellation-reason-fieldset').hide();
1180 [% SET active = clubs ? 1 : 0 %]
1181 $('#circ_holds_select').tabs({
1182 active: [% active | $raw %],
1183 activate: function(){
1184 $(this).find("input.focus").focus();
1187 $(this).find("input.focus").focus();
1190 function ToggleHoldsToPlace() {
1191 if ( $("#requestany").prop('checked') ) {
1192 $("#holds_to_place_count").prop('disabled', false);
1194 $("#holds_to_place_count").prop('disabled', true);
1197 ToggleHoldsToPlace();
1198 $("#requestany").on('change', function(){
1199 ToggleHoldsToPlace();
1202 [% IF Koha.Preference('UseBranchTransferLimits') %]
1203 $("#pickup").on('change', function(){
1204 var pickup = $("#pickup").val();
1205 var url = "?pickup=" + pickup;
1206 url += "&borrowernumber=" + borrowernumber;
1207 url += "&biblionumber=" + biblionumber;
1208 window.location.replace(url);
1212 var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1214 "sDom": '<"top pager"ilf>t',
1217 //Override fieldset styling for dataTables search box
1218 $("div.top.pager").css("margin-left","1em");
1219 $(".dataTables_filter label").css({
1221 "margin-right":"0em"
1224 $("#club-request-form").on("submit", function() {
1226 $('.clubalert, .holdalert').addClass('hide');
1227 let biblionumbers = [biblionumber];
1228 let biblionumbers_text;
1230 pickup_library_id: $('select[name="pickup"]').val()
1232 if($('input[name="checkitem"]:checked').length)
1233 data.item_id = $('input[name="checkitem"]:checked').val();
1234 if($('input[name="borrowernumber"]').length)
1235 data.patron_id = $('input[name="borrowernumber"]').val();
1236 if($('textarea[name="notes"]').length)
1237 data.notes = $('textarea[name="notes"]').val()||null;
1238 if($('input[name="itemtype"]').length) {
1239 data.item_type = $('input[name="itemtype"]').val()||null;
1241 if($('input[name="default_patron_home"]:checked').length) {
1242 data.default_patron_home = 1;
1244 if($('input[name="biblionumbers"]').length) {
1245 biblionumbers_text = $('input[name="biblionumbers"]').val();
1246 biblionumbers = biblionumbers_text.replace(/\/$/, '').split('/')
1249 const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1;
1250 biblionumbers.forEach(function(biblionumber) {
1251 data.biblio_id = biblionumber;
1253 url: $t.attr('action'),
1254 method: $t.attr('method').toUpperCase(),
1255 contentType: 'application/json',
1256 data: JSON.stringify(data)
1258 for(let i = 0; i < count; i++) {
1260 .then(function(result) {
1261 let url = 'request.pl?biblionumber='+biblionumber;
1262 if(biblionumbers_text) {
1263 url = 'request.pl?biblionumbers='+biblionumbers_text;
1265 document.location = url;
1267 .fail(function(err) {
1268 var message = err.responseJSON.error;
1269 var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/);
1270 if(match && ERROR_MAP[match[1]]) {
1271 message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>'
1273 $('.clubalert, .holdalert').removeClass('hide').html(message);
1281 [% UNLESS ( multi_hold ) %]
1282 $("#hold-request-form").on("submit", function(){
1283 return check($(this));
1286 $("#hold-request-form").on("submit", function(){
1287 return checkMultiHold();
1291 $(".pickup_location_dropdown").each( function () {
1292 $(this).pickup_locations_dropdown();
1295 $("#pickup_multi").select2({
1300 $('.multi_pickup_select').select2({
1305 $("#pickup_multi").on("change", function() {
1306 var selection = $(this).val();
1307 if ( selection != '' ) {
1308 $(".multi_pickup_select").each(function() {
1309 var valid_pickup_locations = $(this).data('pickup-locations');
1310 if ( valid_pickup_locations.includes(selection) ) {
1311 $(this).val(selection);
1312 $(this).trigger("change");
1318 $("#pickup").each( function () {
1319 $(this).pickup_locations_dropdown();
1322 $(".pickup_locations").each(function () {
1323 $(this).pickup_locations_dropdown();
1327 function check( table ) {
1331 if ( $("#requestany").attr("checked") !== "checked" ) {
1332 // requestany not selected, go through the item-specific cases
1333 if ( $('input[type="radio"]:checked').length > 0 ) {
1334 // got item-specific hold requests in the form!
1335 // verify they have a pickup location selected
1337 if (table.find('input[type="radio"]:checked')
1339 .find(".pickup_locations").val() === null) {
1341 msg = _("- Please select a pickup location for the item" + "\n")
1345 msg = (_("- Please select an item to place a hold") + "\n");
1350 $('#hold-request-form').preventDoubleFormSubmit();
1358 function checkMultiHold() {
1360 var biblionumbers = "";
1361 var selected_bibs = $(".multi_hold_item_checkbox:checked");
1362 if ( selected_bibs.length > 0 ) {
1363 // there are biblios selected in the form!
1364 // verify they have a pickup location selected
1366 var pickup_not_set = 0;
1367 selected_bibs.each(function() {
1368 if ( $(this).closest('tr').find(".multi_pickup_select").val() === "" ) {
1372 var bibnum = $(this).attr("title");
1373 biblionumbers += bibnum + "/";
1376 if ( pickup_not_set > 0 ) {
1377 alert( _("Please make sure all selected titles have a pickup location set" + "\n") );
1382 alert( _("Please select at least one title" + "\n") );
1386 var badSpans = $(".not_holdable");
1388 $(badSpans).each(function() {
1389 var bibnum = $(this).attr("title");
1390 badBibs += bibnum + "/";
1393 $("#multi_hold_bibs").val(biblionumbers);
1394 $("#bad_bibs").val(badBibs);
1396 $('#hold-request-form').preventDoubleFormSubmit();
1401 $(document).ready(function() {
1402 $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1403 var itemnumber = this.value;
1406 switch (override_items[itemnumber].holdallowed) {
1407 case "not_allowed": msg = _("This item normally cannot be put on hold."); break;
1408 case "from_home_library": msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
1411 msg += "\n\n" + _("Place hold on this item?");
1413 return confirm(msg);
1415 $("button.warning").click(function() {
1416 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1418 $("#requestany").click(function() {
1420 $("input[name=checkitem]").each(function() {
1421 $(this).prop("checked", false);
1425 $("input[name=checkitem]").click(function() {
1427 $("input[name=checkitem]").each(function() {
1432 if(onechecked == 1){
1433 $("#requestany").prop("checked", false);
1434 $("#holds_to_place_count").prop('disabled', true);
1436 $("#requestany").prop("checked",true);
1437 $("#holds_to_place_count").prop('disabled', false);
1440 var prev_rank_request;
1441 $("select[name=rank-request]").on("focus", function() {
1442 prev_rank_request = $(this).val();
1443 var row = $(this).parents("tr:first");
1444 }).change(function() {
1445 var row = $(this).parents("tr:first");
1446 var value = parseInt($(this).val());
1447 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
1448 if( !isNaN(value) ) { //If moved to 'del'
1449 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)
1450 if (prev_rank_request > value) {
1451 row.insertBefore(after);
1453 row.insertAfter(after);
1457 var next_priority = 1;
1458 $("select[name=rank-request]").each(function () {
1459 if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
1460 $(this).val(next_priority);
1465 $(".clear-date").on("click",function(e){
1467 var fieldID = this.id.replace("clear-date-","");
1468 $("#" + fieldID).val("");
1471 // Confirm cancellation of hold
1473 $(".cancel-hold").on("click",function(e) {
1475 cancel_link = $(this);
1476 $('#cancelModal').modal();
1479 $("#cancelModalConfirmBtn").on("click",function(e) {
1481 if(cancel_link.data('bulk')) {
1482 [% IF biblionumbers %]
1483 link = `request.pl?biblionumbers=[% biblionumbers | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1485 link = `request.pl?biblionumber=[% biblionumber | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1488 let borrowernumber = cancel_link.data('borrowernumber');
1489 let biblionumber = cancel_link.data('biblionumber');
1490 let reserve_id = cancel_link.data('id');
1491 link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`;
1493 let reason = $("#modal-cancellation-reason").val();
1495 link += "&cancellation-reason=" + reason
1497 window.location.href = link;
1501 [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems || nobiblio ) %]
1502 [% IF ( PatronAutoComplete ) %]
1503 $( "#patron" ).autocomplete({
1504 source: "/cgi-bin/koha/circ/ysearch.pl",
1506 select: function( event, ui ) {
1507 $( "#patron" ).val( ui.item.cardnumber );
1508 $( "#holds_patronsearch" ).submit();
1512 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
1513 return $( "<li></li>" )
1514 .data( "ui-autocomplete-item", item )
1517 + ( item.surname ? item.surname.escapeHtml() : "" )
1519 + ( item.firstname ? item.firstname.escapeHtml() : "" )
1520 + " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")"
1523 + ( item.address ? item.address.escapeHtml() : "" )
1525 + ( item.city ? item.city.escapeHtml() : "" )
1527 + ( item.zipcode ? item.zipcode.escapeHtml() : "" )
1529 + ( item.country ? item.country.escapeHtml() : "" )
1536 Sticky = $("#toolbar");
1538 stickTo: "#existing_holds",
1539 stickyClass: "floating"
1542 if(!localStorage.selectedHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) {
1543 localStorage.selectedHolds = [];
1546 $('.holds_table .select_hold').each(function() {
1547 if(localStorage.selectedHolds.includes($(this).data('id'))) {
1548 $(this).prop('checked', true);
1552 $('.holds_table .select_hold_all').each(function() {
1553 var table = $(this).parents('.holds_table');
1554 var count = $('.select_hold:not(:checked)', table).length;
1555 $('.select_hold_all', table).prop('checked', !count);
1558 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1560 $('.holds_table .select_hold_all').click(function() {
1561 var table = $(this).parents('.holds_table');
1562 var count = $('.select_hold:checked', table).length;
1563 $('.select_hold', table).prop('checked', !count);
1564 $(this).prop('checked', !count);
1565 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1566 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1569 $('.holds_table .select_hold').click(function() {
1570 var table = $(this).parents('.holds_table');
1571 var count = $('.select_hold:not(:checked)', table).length;
1572 $('.select_hold_all', table).prop('checked', !count);
1573 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1574 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1577 $('.cancel_selected_holds').click(function(e) {
1579 if($('.holds_table .select_hold:checked').length) {
1580 cancel_link = $(this);
1581 delete localStorage.selectedHolds;
1582 $('#cancelModal').modal();
1591 [% INCLUDE 'intranet-bottom.inc' %]