11 [% USE AuthorisedValues %]
13 [% USE TablesSettings %]
14 [% PROCESS 'i18n.inc' %]
15 [% SET footerjs = 1 %]
16 [% INCLUDE 'doc-head-open.inc' %]
17 [% UNLESS ( multi_hold ) %]
18 <title>Place a hold on [% INCLUDE 'biblio-title-head.inc' %] › Holds › Circulation › Koha</title>
20 <title>Confirm holds › Holds › Circulation › Koha</title>
22 [% INCLUDE 'doc-head-close.inc' %]
23 [% Asset.css("css/holds.css") | $raw %]
26 <body id="circ_request" class="catalog">
28 [% INCLUDE 'header.inc' %]
29 [% INCLUDE 'circ-search.inc' %]
31 [% UNLESS ( multi_hold ) %]
32 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
35 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
38 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
41 [% INCLUDE 'biblio-title.inc' link =1 %]
44 <a href="#" aria-current="page">
51 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
54 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
57 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
61 <a href="#" aria-current="page">
66 <a href="#" aria-current="page">
67 Search patrons or clubs
70 <a href="#" aria-current="page">
78 [% END # UNLESS multi_hold %]
80 <div class="main container-fluid">
82 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
83 <div class="col-md-10 col-md-offset-1">
85 <div class="col-sm-10 col-sm-push-2">
91 <div class="dialog alert">
93 <strong>Cannot place hold:</strong> one or more records don't exist.
95 <strong>Cannot place hold:</strong> this record doesn't exist.
100 <div class="dialog alert">
102 <strong>Cannot place hold:</strong> one or more records without items attached.
104 <strong>Cannot place hold:</strong> this record has no items attached.
109 [% IF ( messagetransfert ) %]
110 <div class="dialog message">
111 <h2>Hold found for ([% nextreservtitle | html %]), please transfer</h2>
112 <p>Hold placed by : <strong> [% nextreservsurname | html %] [% nextreservfirstname | html %]</strong> at : <strong> [% branchname | html %] </strong>, Please transfer this item.
114 <form name="cancelReservewithtransfert" action="branchreserves.pl" method="post">
115 <input type="submit" class="button" />
120 [% UNLESS ( multi_hold ) %]
121 <h1>Place a hold on [% INCLUDE 'biblio-title.inc' link = 1 %] [% IF biblio.author %] by [% biblio.author | html %][% END %]</h1>
128 Search patrons or clubs
136 [% UNLESS club OR patron OR patron.borrowernumber OR noitems OR nobiblio %]
137 [% IF ( messageborrower ) %]
138 <div class="dialog alert">
139 <h3>Patron not found</h3>
140 <p>No patron with this name, please, try another</p>
144 [% IF ( messageclub ) %]
145 <div class="dialog alert">
146 <h3>Club not found</h3>
147 <p>No club with this name, please, try another</p>
150 <fieldset class="brief">
151 [% UNLESS multi_hold %]
153 <label>Search patrons or clubs</label>
155 <label>Search patrons</label>
158 <div id="circ_holds_select" class="toptabs">
160 <li><a href="#holds_patronsearch_pane">Patrons</a></li>
162 <li><a href="#holds_clubsearch_pane">Clubs</a></li>
165 <div id="holds_patronsearch_pane">
166 <form id="holds_patronsearch" action="request.pl?biblionumbers=[% biblionumbers | html %]" method="post">
167 <div class="hint">Enter patron card number or partial name:</div>
168 <input type="text" size="40" id="patron" class="focus" name="findborrower" autocomplete="off" />
169 <input type="submit" value="Search" />
171 <input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
173 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
176 </form> <!-- /#holds_patronsearch -->
178 [% INCLUDE 'circ-patron-search-results.inc' destination = "holds" %]
182 <div id="holds_clubsearch_pane">
183 <form id="holds_clubsearch" action="request.pl?biblionumbers=[% biblionumbers | html %]" method="post">
184 <div class="hint">Enter club ID or partial name:</div>
185 <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" />
186 <input type="submit" value="Search" />
188 <input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
190 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
193 </form> <!-- /#holds_patronsearch -->
195 [% INCLUDE 'clubs-table.inc' destination = "holds" %]
202 <div class="dialog alert hide clubalert">
204 <fieldset class="rows">
205 <legend>Hold details</legend>
206 <form action="/api/v1/clubs/[% club.id | html %]/holds" method="post" name="form" id="club-request-form">
208 [% IF ( multi_hold ) %]
209 <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
210 <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
211 <input type="hidden" name="request" value="any"/>
212 [% FOREACH biblioloo IN biblioloop %]
213 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
214 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
217 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
218 <input type="hidden" name="title" value="[% biblio.title | html %]" />
219 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
220 [% END # /IF multi_hold %]
223 <span class="label">Club: </span> [% club.name | html %]
226 <span class="label">Description: </span> [% club.description | html %]
229 <label for="pickup">Pickup at:</label>
230 <select name="pickup" id="pickup_club">
231 [% PROCESS options_for_libraries libraries => Branches.all({ selected => club.branchcode, search_params => { pickup_location => 1 } }) %]
235 <label for="default_patron_home">Pickup at patron's home library when possible:</label>
236 <input type="checkbox" id="default_patron_home" name="default_patron_home"/>
239 <h2 style="padding: 0 1em;">Members</h2>
241 [% FOREACH member IN members %]
242 [% SET patron = member.patron %]
243 <li style="padding: 0.5em 1em;">
244 <div><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a></div>
245 [% IF member.exceeded_maxreserves %]
247 <i class="fa fa-error"></i>
248 <strong>Too many holds: </strong> Patron can only place a maximum of [% maxreserves | html %] total holds.
251 [% IF ( patron.is_expired ) %]
253 <i class="fa fa-warning"></i>
254 <strong>Account has expired</strong>
257 [% IF patron.is_debarred %]
259 <i class="fa fa-warning"></i>
260 <strong>Patron has restrictions</strong>
263 [% IF member.amount_outstanding && Koha.Preference('maxoutstanding') && member.amount_outstanding > Koha.Preference('maxoutstanding') %]
265 <i class="fa fa-warning"></i>
266 <strong>Patron has outstanding fines: [% member.amount_outstanding | $Price %]</strong>
270 [% IF ( member.diffbranch ) %]
272 <i class="fa fa-warning"></i>
273 <strong>Pickup library is different.</strong> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )
278 [% UNLESS ( multi_hold ) %]
279 <fieldset class="action">
280 <input type="submit" value="Place hold" />
283 <table id="requesttitles">
287 [% UNLESS ( item_level_itypes ) %]
293 [% FOREACH biblioloo IN biblioloop %]
294 [% IF ( biblioloo.warn ) %]
300 [% UNLESS ( biblioloo.warn ) %]
301 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
307 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
309 [% IF ( biblioloo.publicationyear ) %]
311 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
315 [% IF ( biblioloo.warn ) %]
316 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
319 [% UNLESS ( item_level_itypes ) %]
321 <img src="[% biblioloo.imageurl | html %]" alt="[% biblioloo.itypename | html %]" title="[% biblioloo.itypename | html %]" />
324 <td>[% biblioloo.rank | html %]</td>
326 [% IF ( biblioloo.checked_previously ) %]
327 <span>Patron has previously checked out this title</span><br/>
329 [% IF ( biblioloo.alreadyres ) %]
332 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
337 [% IF ( biblioloo.alreadyres ) %]
339 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
340 <strong>already has a hold</strong> on this item
343 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
344 <li> <strong>No items are available</strong> to be placed on hold</li>
347 [% IF ( biblioloo.alreadyres ) %]
350 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
356 [% END # /FOREACH biblioloo %]
357 </table> <!-- /#requesttitles -->
361 [% ELSIF NOT ( noitems || nobiblio ) # /UNLESS patron %]
363 [% IF ( checked_previously && !multi_hold ) %]
364 <div class="dialog alert">
366 <li>Patron has previously checked out this title</li>
371 [% IF ( no_reserves_allowed || exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted ) %]
372 <div class="dialog alert">
374 [% UNLESS ( multi_hold ) %]
375 <h3>Cannot place hold</h3>
377 [% IF ( no_reserves_allowed ) %]
378 <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>
379 [% ELSIF ( exceeded_maxreserves ) %]
380 <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>
381 [% ELSIF ( exceeded_holds_per_record ) %]
382 <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>
383 [% ELSIF ( alreadypossession ) %]
384 <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>
385 [% ELSIF ( alreadyreserved ) %]
386 <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>
387 [% ELSIF ( ageRestricted ) %]
388 <li><strong>Age restricted</strong></li>
389 [% ELSIF ( none_available ) %]
390 <li> <strong>No items are available</strong> to be placed on hold.</li>
391 [% ELSIF ( maxreserves ) %]
392 <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>
393 [% END # /IF exceeded_maxreserves %]
395 [% ELSE # UNLESS multi_hold %]
396 <h3>Cannot place hold on some items</h3>
397 [% IF (no_reserves_allowed ) %]
398 <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>
399 [% ELSIF ( exceeded_maxreserves ) %]
400 <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>
401 [% ELSIF ( exceeded_holds_per_record ) %]
402 [% FOREACH biblioloo IN biblioloop %]
403 [% IF (biblioloo.tooManyHoldsForThisRecord) %]
404 <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>
407 [% END # /IF exceeded_maxreserves %]
408 [% END # /UNLESS multi_hold %]
410 [% END # /IF ( exceeded_maxreserves || ... %]
412 [% IF ( patron.is_expired || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
413 <div class="dialog message">
415 [% IF ( patron.is_expired ) %]
416 <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>
419 [% IF patron.is_debarred %]
420 <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>
423 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
424 <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>
427 [% IF ( diffbranch ) %]
428 <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>
430 </ul> <!-- /.dialog.message -->
432 [% END # /IF patron.is_expired || diffbranch ... %]
434 [% IF ( messageborrower ) %]
435 <div class="dialog alert">
436 <h3>Patron not found:</h3>
437 <p>Name or barcode not found. Please try an other </p>
441 <div class="dialog alert hide holdalert">
444 <fieldset class="rows">
445 <legend>Hold details</legend>
446 <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
448 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
449 <input type="hidden" name="type" value="str8" />
451 [% IF ( multi_hold ) %]
452 <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
453 <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
454 <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
455 <input type="hidden" name="request" value="any"/>
456 [% FOREACH biblioloo IN biblioloop %]
457 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
458 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
461 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
462 <input type="hidden" name="title" value="[% biblio.title | html %]" />
463 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
464 [% END # /IF multi_hold %]
468 <span class="label">Patron:</span>
469 [% IF ( patron.borrowernumber ) %]
470 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a>
476 [% UNLESS ( multi_hold ) %]
478 <span class="label">Estimated priority:</span>
479 <strong>[% fixedRank | html %]</strong>
484 <label for="holdnotes">Notes:</label>
485 <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
488 <label for="pickup">Pickup at:</label>
489 [% UNLESS ( multi_hold ) %]
490 <select name="pickup" id="pickup"
491 data-biblio-id="[% biblio.biblionumber | html %]"
492 data-patron-id="[% patron.borrowernumber | html %]"
493 data-pickup-location-source="biblio">
494 [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
496 <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
497 <option value="" selected="selected"></option>
498 [% FOREACH pickup_location IN multi_pickup_locations %]
499 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
505 [% UNLESS ( multi_hold ) %]
506 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
508 <label for="itemtype">Request specific item type:</label>
509 <select name="itemtype" id="itemtype">
510 <option value="">Any item type</option>
511 [%- FOREACH itemtype IN available_itemtypes %]
512 <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
517 [% END # /UNLESS multi_hold %]
519 [% IF ( reserve_in_future ) %]
521 <label for="from">Hold starts on date:</label>
522 <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" data-date_to="expiration_date" class="flatpickr" data-flatpickr-futuredate="true" />
527 <label for="to">Hold expires on date:</label>
528 <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
531 [% UNLESS ( multi_hold ) %]
533 <label for="requestany">Hold next available item </label>
534 [% IF force_hold_level == 'item' %]
535 <input type="checkbox" id="requestany" name="request" disabled="true" />
536 [% ELSIF force_hold_level == 'record' %]
537 <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
538 <input type="hidden" name="request" value="Any"/>
540 <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
542 <input type="hidden" name="biblioitem" value="[% biblioitemnumber | html %]" />
543 <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
546 [% IF remaining_holds_for_record > 1 %]
548 <label for="holds_to_place_count">Holds to place (count)</label>
549 <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" />
552 <input type="hidden" name="holds_to_place_count" value="1" />
554 [% END # /UNLESS multi_hold %]
556 <li id="non_priority_list_item">
557 <label for="non_priority">Non priority hold:</label>
558 <input name="non_priority" id="non_priority" type="checkbox" />
559 <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
563 [% UNLESS ( multi_hold ) %]
564 <fieldset class="action">
565 [% IF ( patron.borrowernumber ) %]
566 [% IF ( override_required ) %]
567 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
568 [% ELSIF ( none_available ) %]
569 <button type="submit" disabled="disabled" class="btn btn-default btn-disabled">Place hold</button>
571 <button type="submit" class="btn btn-default">Place hold</button>
576 [% FOREACH bibitemloo IN bibitemloop %]
578 [% UNLESS ( item_level_itypes ) %]
580 <span class="label">Item type:</span>
581 [% bibitemloo.description | html %]
585 [% IF ( bibitemloo.publicationyear ) %]
587 <span class="label">Publication year:</span>
588 [% bibitemloo.publicationyear | html %]
593 <h2 style="padding: 0 1em;">
594 Place a hold on a specific item
595 [% IF bibitemloo.force_hold_level == 'item' %]
596 <span class="error"><em>(Required)</em></span>
600 <table id="requestspecific">
604 [% IF ( item_level_itypes ) %]
608 <th>Home library</th>
609 <th>Last location</th>
610 [% IF itemdata_ccode %]
615 [% IF itemdata_enumchron %]
619 <th>Allowed pickup locations</th>
623 [% SET selected = 0 %]
624 [% FOREACH itemloo IN bibitemloo.itemloop %]
625 [% UNLESS ( itemloo.hide ) %]
626 <tr class="[% itemloo.backgroundcolor | html %]">
628 [% IF itemloo.force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
630 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
631 Hold must be record level
633 [% ELSIF ( itemloo.available ) %]
634 <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
635 [% ELSIF ( itemloo.override ) %]
636 <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
637 <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
640 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
641 [% IF itemloo.not_holdable %]
642 [% IF itemloo.not_holdable == 'damaged' %]
644 [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
646 [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
647 Exceeded max holds per record
648 [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
649 Daily hold limit reached for patron
650 [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
652 [% ELSIF itemloo.not_holdable == 'notReservable' %]
654 [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
655 Patron is from different library
656 [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
657 Cannot place hold from patron's library
658 [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
659 Patron already has hold for this item
660 [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
661 Cannot be transferred to pickup library
662 [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
663 Only pickup locations within the same hold group are allowed
664 [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
665 No reserves are allowed on this item
666 [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %]
667 Library is not a pickup location
668 [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
669 No valid pickup location
671 [% itemloo.not_holdable | html %]
675 [% END # /IF itemloo.force_hold_level %]
677 [% IF ( item_level_itypes ) %]
679 [% UNLESS ( noItemTypeImages ) %]
680 [% IF ( itemloo.imageurl ) %]<img src="[% itemloo.imageurl | html %]" alt="" /> <br /> [% END %]
682 [% itemloo.itypename | html %]
686 [% itemloo.barcode | html %]
689 [% Branches.GetName( itemloo.homebranch ) | html %]
692 [% Branches.GetName( itemloo.holdingbranch ) | html %]
694 [% IF itemdata_ccode %]
696 [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
700 [% itemloo.itemcallnumber | html %]
703 [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %]
705 [% IF itemdata_enumchron %]
707 [% itemloo.enumchron | html %]
710 [% IF ( itemloo.onloan ) %]
711 <td data-order="[% itemloo.date_due | html %]">
712 <span class="checkedout">Due [% itemloo.date_due | $KohaDates as_due_date => 1 %]</span>
715 [% IF ( itemloo.transfertwhen ) %]
716 In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
717 to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %]
721 [% IF ( itemloo.reservedate ) %]
722 [% IF ( itemloo.nocancel ) %]
723 Can't be cancelled when item is in transit
725 [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %]
726 [% IF ( itemloo.canreservefromotherbranches ) %]
727 for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedFor.borrowernumber | uri %]">[% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %]</a>
729 [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %]
730 [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since
731 [% IF ( itemloo.waitingdate ) %]
732 [% itemloo.waitingdate | $KohaDates %]
734 [% IF ( itemloo.reservedate ) %]
735 [% itemloo.reservedate | html %]
738 <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
739 [% END # /IF itemloo.nocancel %]
742 [% END # /IF itemloo.reservedate %]
744 [% IF itemloo.item_level_holds == "N" %]
745 <br/>Item level hold not allowed from OPAC
746 [% ELSIF itemloo.item_level_holds == "F" %]
747 <br/>Item level hold forced from OPAC
750 [% IF ( itemloo.itemlost ) %]
751 <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
754 [% IF ( itemloo.damaged ) %]
755 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
758 [% IF ( itemloo.withdrawn ) %]
759 <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
762 [% IF ( itemloo.notforloan ) %]
763 <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
767 [% IF (itemloo.pickup_locations_count > 0) %]
768 <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations" style="width:100%;"
769 data-item-id="[% itemloo.itemnumber | html %]"
770 data-patron-id="[% patron.borrowernumber | html %]"
771 data-pickup-location-source="item">
772 [% IF (itemloo.default_pickup_location) %]
773 <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option>
779 [% END # / UNLESS itemloo.hide %]
780 [% END # /FOREACH itemloo %]
782 </table> <!-- /#requestspecific -->
784 [% IF ( bibitemloo.hiddencount ) %]
786 <p class="hiddencount">
787 <a href="request.pl?biblionumber=[% bibitemloo.biblionumber | uri %]&borrowernumber=[% bibitemloo.borrowernumber | uri %]&showallitems=1">Show all items ([% bibitemloo.hiddencount | html %] hidden)</a>
790 [% END # /IF bibitemloo.hiddencount %]
791 [% END # /FOREACH bibitemloo %]
793 [% ELSE # /UNLESS multi_hold %]
795 <table id="requesttitles">
799 [% UNLESS ( item_level_itypes ) %]
804 <th>Pickup location</th>
806 [% FOREACH biblioloo IN biblioloop %]
807 [% IF ( biblioloo.warn ) %]
813 [% UNLESS ( biblioloo.warn ) %]
814 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
820 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
822 [% IF ( biblioloo.publicationyear ) %]
824 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
828 [% IF ( biblioloo.warn ) %]
829 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
832 [% UNLESS ( item_level_itypes ) %]
834 <img src="[% biblioloo.imageurl | html %]" alt="[% biblioloo.itypename | html %]" title="[% biblioloo.itypename | html %]" />
837 <td>[% biblioloo.rank | html %]</td>
839 [% IF ( biblioloo.checked_previously ) %]
840 <span>Patron has previously checked out this title</span><br/>
842 [% IF ( biblioloo.alreadyres ) %]
845 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
850 [% IF ( biblioloo.alreadyres ) %]
852 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
853 <strong>already has a hold</strong> on this item
856 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
857 <li> <strong>No items are available</strong> to be placed on hold</li>
860 [% IF ( biblioloo.alreadyres ) %]
863 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
869 [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %]
870 <select name="pickup_[% biblioloo.biblionumber | html %]"
871 class="multi_pickup_select"
872 data-biblio-id="[% biblioloo.biblionumber | html %]"
873 data-patron-id="[% patron.borrowernumber | html %]"
874 data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
875 <option value=""></option>
876 [% FOREACH pickup_location IN biblioloo.pickup_locations %]
877 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
883 [% END # /FOREACH biblioloo %]
884 </table> <!-- /#requesttitles -->
886 [% END # /UNLESS multi_hold %]
888 <fieldset class="action">
889 [% IF ( patron AND patron.borrowernumber ) %]
890 [% IF ( override_required ) %]
891 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
892 [% ELSIF ( none_available ) %]
893 <button class="btn btn-default" type="submit">Place holds</button>
895 [% IF ( multi_hold ) %]
896 <button type="submit" class="btn btn-default" id="multi_hold_submit">Place holds</button>
898 <button type="submit" class="btn btn-default">Place hold</button>
901 [% END # /IF patron %]
902 </fieldset> <!-- /.action -->
903 </form> <!-- /#hold-request-form -->
904 </fieldset> <!-- /.rows -->
907 [% UNLESS ( patron ) %]
908 [% UNLESS borrowers %]
909 [% SET hold_count = Biblio.HoldsCount( biblio.biblionumber ) | html %]
911 <label for ="always_show_holds">Always show holds</label>
912 [% IF always_show_holds == 'DONT' %]
913 <input type="checkbox" name="always_show_holds" id="always_show_holds" value="DO">
914 [% UNLESS reserveloop %]
915 <a class="btn btn-default" value="Show holds" id="show_holds_now" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber | uri %]&show_holds_now=1">Show holds ([% hold_count | html %])</a>
918 <input type="checkbox" name="always_show_holds" value="DO" id="always_show_holds" checked="checked">
922 [% IF ( reserveloop ) %]
923 <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
924 [% IF ( multi_hold ) %]
925 <input type = "hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
929 <div class="dialog message">
930 <p>The job has been enqueued! It will be processed as soon as possible.</p>
931 <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>
935 <h2>Existing holds</h2>
936 <div id="toolbar" class="btn-toolbar">
937 <input type="submit" name="submit" value="Update hold(s)" /> <button class="cancel_selected_holds" data-bulk="true"></button>
938 <fieldset id="cancellation-reason-fieldset" class="action">
939 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
940 [% IF hold_cancellation %]
941 <label for="cancellation-reason">Cancellation reason: </label>
942 <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
943 <option value="">No reason given</option>
944 [% FOREACH reason IN hold_cancellation %]
945 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
952 [% FOREACH biblioloo IN biblioloop %]
953 [% IF ( biblioloo.reserveloop ) %]
954 <div class="hold_title" id="hold_title_[% biblioloo.biblionumber | html %]">
955 [% IF ( multi_hold ) %]
957 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
958 [% biblioloo.title | html %]
959 </a> <span class="number_box"><span>[% biblioloo.reserveloop.size | html %] [% tn('Hold', 'Holds', biblioloo.reserveloop.size) | $raw %]</span></span>
963 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
965 [% SET branchcodes = [] %]
967 [% FOREACH h IN biblioloo.reserveloop %]
968 [% branchcodes.push( h.branchcode ) %]
970 [% branchcodes = branchcodes.unique %]
971 [% IF ( branchcodes.empty ) %]
973 There are no holds on this title.
977 [% FOREACH b IN branchcodes.sort %]
978 [% SET holds_by_branch = [] %]
979 [% FOREACH h IN biblioloo.reserveloop %]
980 [% IF h.branchcode == b %]
981 [% holds_by_branch.push( h ) %]
984 <div class="holds_by_library">
985 <h4>[% Branches.GetName( b ) | html %]</h4>
987 [% INCLUDE holds_table.inc holds=holds_by_branch %]
989 [% END # /FOREACh b %]
990 [% END # /IF ( branchcodes.empty ) %]
992 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
994 [% SET itemtypes = [] %]
996 [% FOREACH h IN biblioloo.reserveloop %]
997 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
998 [% itemtypes.push( hold_itemtype ) %]
1000 [% itemtypes = itemtypes.unique %]
1001 [% IF ( itemtypes.empty ) %]
1003 There are no holds on this title.
1007 [% FOREACH i IN itemtypes.sort %]
1008 [% SET holds_by_itemtype = [] %]
1009 [% FOREACH h IN biblioloo.reserveloop %]
1010 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1011 [% IF hold_itemtype == i %]
1012 [% holds_by_itemtype.push( h ) %]
1016 <div class="holds_by_itemtype">
1018 <h4>[% ItemTypes.GetDescription( i ) | html %]</h4>
1020 <h4>Any item type</h4>
1022 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1024 [% END # /FOREACH i %]
1025 [% END # /IF ( itemtypes.empty ) %]
1027 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
1028 [% SET branchcodes = [] %]
1030 [% FOREACH h IN biblioloo.reserveloop %]
1031 [% branchcodes.push( h.branchcode ) %]
1033 [% branchcodes = branchcodes.unique %]
1034 [% IF ( branchcodes.empty ) %]
1036 There are no holds on this title.
1040 [% FOREACH b IN branchcodes.sort %]
1041 <div class="holds_by_library">
1042 <h4 class="library_holds">[% Branches.GetName( b ) | html %]</h4>
1043 [% SET holds_by_branch = [] %]
1044 [% FOREACH h IN biblioloo.reserveloop %]
1045 [% IF h.branchcode == b %]
1046 [% holds_by_branch.push( h ) %]
1050 [% SET itemtypes = [] %]
1051 [% FOREACH h IN holds_by_branch %]
1052 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1053 [% itemtypes.push( hold_itemtype ) %]
1055 [% itemtypes = itemtypes.unique %]
1057 [% FOREACH i IN itemtypes.sort %]
1058 <div class="holds_by_itemtype">
1059 <h5 class="itemtype_holds">
1061 [% ItemTypes.GetDescription( i ) | html %]
1067 [% SET holds_by_itemtype = [] %]
1068 [% FOREACH h IN holds_by_branch %]
1069 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1070 [% IF hold_itemtype == i %]
1071 [% holds_by_itemtype.push( h ) %]
1074 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1075 </div> <!-- /.holds_by_itemtype -->
1077 </div> <!-- /.holds_by_library -->
1078 [% END # /FOREACH b %]
1079 [% END # /IF ( branchcodes.empty ) %]
1083 [% IF ( biblioloo.reserveloop.size ) %]
1084 [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
1087 There are no holds on this title.
1091 [% END # /IF HoldsSplitQueue %]
1092 </div> <!-- /hold_title -->
1093 [% END # /IF biblioloo.reserveloop %]
1094 [% END # FOREACH biblioloo %]
1095 </form> <!-- /#existing_holds -->
1096 [% END # IF reserveloop %]
1097 [% END # UNLESS patron %]
1101 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
1102 </div> <!-- /.col-md-10.col-md-offset-1 -->
1104 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1105 <div class="col-sm-2 col-sm-pull-10">
1107 [% INCLUDE 'biblio-view-menu.inc' %]
1109 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1111 </div> <!-- /.row -->
1113 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
1114 <div class="modal-dialog" role="document">
1115 <div class="modal-content">
1116 <div class="modal-header">
1117 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1118 <h3>Confirm deletion</h3>
1121 <div class="modal-body">
1122 <p>Are you sure you want to cancel this hold?</p>
1124 <fieldset class="action">
1125 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1126 [% IF hold_cancellation %]
1127 <label for="cancellation-reason">Cancellation reason: </label>
1128 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
1129 <option value="">No reason given</option>
1130 [% FOREACH reason IN hold_cancellation %]
1131 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1138 <div class="modal-footer">
1139 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
1140 <a href="#" data-dismiss="modal">Cancel</a>
1146 [% MACRO jsinclude BLOCK %]
1147 [% INCLUDE 'datatables.inc' %]
1148 [% INCLUDE 'columns_settings.inc' %]
1149 [% Asset.js("lib/hc-sticky.js") | $raw %]
1150 [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1151 [% INCLUDE 'select2.inc' %]
1152 [% Asset.js("js/holds.js") | $raw%]
1153 [% INCLUDE 'calendar.inc' %]
1156 var biblionumber = "[% biblionumber | $raw %]";
1157 var borrowernumber = "[% patron.borrowernumber | $raw %]";
1158 var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1159 var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo IN bibitemloo.itemloop %][% IF ( itemloo.override ) %]
1160 [% itemloo.itemnumber | html %]: {
1161 homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1162 holdallowed: "[% itemloo.holdallowed | html %]"
1164 [% END %][% END %][% END %]
1167 damaged: _("Item damaged"),
1168 ageRestricted: _("Age restricted"),
1169 tooManyHoldsForThisRecord: _("Exceeded max holds per record"),
1170 tooManyReservesToday: _("Daily hold limit reached for patron"),
1171 tooManyReserves: _("Too many holds"),
1172 notReservable: _("Not holdable"),
1173 noReservesAllowed: _("No reserves allowed"),
1174 cannotReserveFromOtherBranches: _("Patron is from different library"),
1175 itemAlreadyOnHold: _("Patron already has hold for this item"),
1176 cannotBeTransferred: _("Cannot be transferred to pickup library"),
1177 pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed")
1180 var MSG_CANCEL_SELECTED = _("Cancel selected (%s)");
1181 columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
1182 $.fn.select2.defaults.set("width", "100%" );
1183 $.fn.select2.defaults.set("dropdownAutoWidth", true );
1185 $(document).ready(function() {
1186 $('#cancellation-reason-fieldset').hide();
1187 $('.rank-request').on('change', function() {
1188 if ( $(".rank-request option:selected[value='del']").length ) {
1189 $('#cancellation-reason-fieldset').show();
1191 $('#cancellation-reason-fieldset').hide();
1195 [% SET active = clubs ? 1 : 0 %]
1196 $('#circ_holds_select').tabs({
1197 active: [% active | $raw %],
1198 activate: function(){
1199 $(this).find("input.focus").focus();
1202 $(this).find("input.focus").focus();
1205 function ToggleHoldsToPlace() {
1206 if ( $("#requestany").prop('checked') ) {
1207 $("#holds_to_place_count").prop('disabled', false);
1209 $("#holds_to_place_count").prop('disabled', true);
1212 ToggleHoldsToPlace();
1213 $("#requestany").on('change', function(){
1214 ToggleHoldsToPlace();
1217 [% IF Koha.Preference('UseBranchTransferLimits') %]
1218 $("#pickup").on('change', function(){
1219 var pickup = $("#pickup").val();
1220 var url = "?pickup=" + pickup;
1221 url += "&borrowernumber=" + borrowernumber;
1222 url += "&biblionumber=" + biblionumber;
1223 window.location.replace(url);
1227 var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1229 "sDom": '<"top pager"ilf>t',
1232 //Override fieldset styling for dataTables search box
1233 $("div.top.pager").css("margin-left","1em");
1234 $(".dataTables_filter label").css({
1236 "margin-right":"0em"
1239 $("#club-request-form").on("submit", function() {
1241 $('.clubalert, .holdalert').addClass('hide');
1242 let biblionumbers = [biblionumber];
1243 let biblionumbers_text;
1245 pickup_library_id: $('select[name="pickup"]').val()
1247 if($('input[name="checkitem"]:checked').length)
1248 data.item_id = $('input[name="checkitem"]:checked').val();
1249 if($('input[name="borrowernumber"]').length)
1250 data.patron_id = $('input[name="borrowernumber"]').val();
1251 if($('textarea[name="notes"]').length)
1252 data.notes = $('textarea[name="notes"]').val()||null;
1253 if($('input[name="itemtype"]').length) {
1254 data.item_type = $('input[name="itemtype"]').val()||null;
1256 if($('input[name="default_patron_home"]:checked').length) {
1257 data.default_patron_home = 1;
1259 if($('input[name="biblionumbers"]').length) {
1260 biblionumbers_text = $('input[name="biblionumbers"]').val();
1261 biblionumbers = biblionumbers_text.replace(/\/$/, '').split('/')
1264 const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1;
1265 biblionumbers.forEach(function(biblionumber) {
1266 data.biblio_id = biblionumber;
1268 url: $t.attr('action'),
1269 method: $t.attr('method').toUpperCase(),
1270 contentType: 'application/json',
1271 data: JSON.stringify(data)
1273 for(let i = 0; i < count; i++) {
1275 .then(function(result) {
1276 let url = 'request.pl?biblionumber='+biblionumber;
1277 if(biblionumbers_text) {
1278 url = 'request.pl?biblionumbers='+biblionumbers_text;
1280 document.location = url;
1282 .fail(function(err) {
1283 var message = err.responseJSON.error;
1284 var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/);
1285 if(match && ERROR_MAP[match[1]]) {
1286 message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>'
1288 $('.clubalert, .holdalert').removeClass('hide').html(message);
1296 [% UNLESS ( multi_hold ) %]
1297 $("#hold-request-form").on("submit", function(){
1298 return check($(this));
1301 $("#hold-request-form").on("submit", function(){
1302 return checkMultiHold();
1306 $(".pickup_location_dropdown").each( function () {
1307 $(this).pickup_locations_dropdown();
1310 $("#pickup_multi").select2({
1315 $('.multi_pickup_select').select2({
1320 $("#pickup_multi").on("change", function() {
1321 var selection = $(this).val();
1322 if ( selection != '' ) {
1323 $(".multi_pickup_select").each(function() {
1324 var valid_pickup_locations = $(this).data('pickup-locations');
1325 if ( valid_pickup_locations.includes(selection) ) {
1326 $(this).val(selection);
1327 $(this).trigger("change");
1333 $("#pickup").each( function () {
1334 $(this).pickup_locations_dropdown();
1337 $(".pickup_locations").each(function () {
1338 $(this).pickup_locations_dropdown();
1342 function check( table ) {
1346 if ( $("#requestany").attr("checked") !== "checked" ) {
1347 // requestany not selected, go through the item-specific cases
1348 if ( $('input[type="radio"]:checked').length > 0 ) {
1349 // got item-specific hold requests in the form!
1350 // verify they have a pickup location selected
1352 if (table.find('input[type="radio"]:checked')
1354 .find(".pickup_locations").val() === null) {
1356 msg = _("- Please select a pickup location for the item" + "\n")
1360 msg = (_("- Please select an item to place a hold") + "\n");
1365 $('#hold-request-form').preventDoubleFormSubmit();
1373 function checkMultiHold() {
1375 var biblionumbers = "";
1376 var selected_bibs = $(".multi_hold_item_checkbox:checked");
1377 if ( selected_bibs.length > 0 ) {
1378 // there are biblios selected in the form!
1379 // verify they have a pickup location selected
1381 var pickup_not_set = 0;
1382 selected_bibs.each(function() {
1383 if ( $(this).closest('tr').find(".multi_pickup_select").val() === "" ) {
1387 var bibnum = $(this).attr("title");
1388 biblionumbers += bibnum + "/";
1391 if ( pickup_not_set > 0 ) {
1392 alert( _("Please make sure all selected titles have a pickup location set" + "\n") );
1397 alert( _("Please select at least one title" + "\n") );
1401 var badSpans = $(".not_holdable");
1403 $(badSpans).each(function() {
1404 var bibnum = $(this).attr("title");
1405 badBibs += bibnum + "/";
1408 $("#multi_hold_bibs").val(biblionumbers);
1409 $("#bad_bibs").val(badBibs);
1411 $('#hold-request-form').preventDoubleFormSubmit();
1416 $(document).ready(function() {
1417 $("#always_show_holds").change(function(){
1418 if( $(this).prop('checked') ){
1419 document.cookie = 'always_show_holds=DO';
1421 document.cookie = 'always_show_holds=DONT';
1424 $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1425 var itemnumber = this.value;
1428 switch (override_items[itemnumber].holdallowed) {
1429 case "not_allowed": msg = _("This item normally cannot be put on hold."); break;
1430 case "from_home_library": msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
1433 msg += "\n\n" + _("Place hold on this item?");
1435 return confirm(msg);
1437 $("button.warning").click(function() {
1438 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1440 $("#requestany").click(function() {
1442 $("input[name=checkitem]").each(function() {
1443 $(this).prop("checked", false);
1447 $("input[name=checkitem]").click(function() {
1449 $("input[name=checkitem]").each(function() {
1454 if(onechecked == 1){
1455 $("#requestany").prop("checked", false);
1456 $("#holds_to_place_count").prop('disabled', true);
1458 $("#requestany").prop("checked",true);
1459 $("#holds_to_place_count").prop('disabled', false);
1462 var prev_rank_request;
1463 $("select[name=rank-request]").on("focus", function() {
1464 prev_rank_request = $(this).val();
1465 var row = $(this).parents("tr:first");
1466 }).change(function() {
1467 var row = $(this).parents("tr:first");
1468 var value = parseInt($(this).val());
1469 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
1470 if( !isNaN(value) ) { //If moved to 'del'
1471 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)
1472 if (prev_rank_request > value) {
1473 row.insertBefore(after);
1475 row.insertAfter(after);
1479 var next_priority = 1;
1480 $("select[name=rank-request]").each(function () {
1481 if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
1482 $(this).val(next_priority);
1487 $(".clear-date").on("click",function(e){
1489 var fieldID = this.id.replace("clear-date-","");
1490 $("#" + fieldID).val("");
1493 // Confirm cancellation of hold
1495 $(".cancel-hold").on("click",function(e) {
1497 cancel_link = $(this);
1498 $('#cancelModal').modal();
1501 $("#cancelModalConfirmBtn").on("click",function(e) {
1503 if(cancel_link.data('bulk')) {
1504 [% IF biblionumbers %]
1505 link = `request.pl?biblionumbers=[% biblionumbers | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1507 link = `request.pl?biblionumber=[% biblionumber | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1510 let borrowernumber = cancel_link.data('borrowernumber');
1511 let biblionumber = cancel_link.data('biblionumber');
1512 let reserve_id = cancel_link.data('id');
1513 link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`;
1515 let reason = $("#modal-cancellation-reason").val();
1517 link += "&cancellation-reason=" + reason
1519 window.location.href = link;
1523 [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems || nobiblio ) %]
1524 [% IF ( PatronAutoComplete ) %]
1525 $( "#patron" ).autocomplete({
1526 source: "/cgi-bin/koha/circ/ysearch.pl",
1528 select: function( event, ui ) {
1529 $( "#patron" ).val( ui.item.cardnumber );
1530 $( "#holds_patronsearch" ).submit();
1534 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
1535 return $( "<li></li>" )
1536 .data( "ui-autocomplete-item", item )
1539 + ( item.surname ? item.surname.escapeHtml() : "" )
1541 + ( item.firstname ? item.firstname.escapeHtml() : "" )
1542 + " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")"
1545 + ( item.address ? item.address.escapeHtml() : "" )
1547 + ( item.city ? item.city.escapeHtml() : "" )
1549 + ( item.zipcode ? item.zipcode.escapeHtml() : "" )
1551 + ( item.country ? item.country.escapeHtml() : "" )
1558 Sticky = $("#toolbar");
1560 stickTo: "#existing_holds",
1561 stickyClass: "floating"
1564 if(!localStorage.selectedHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) {
1565 localStorage.selectedHolds = [];
1568 $('.holds_table .select_hold').each(function() {
1569 if(localStorage.selectedHolds.includes($(this).data('id'))) {
1570 $(this).prop('checked', true);
1574 $('.holds_table .select_hold_all').each(function() {
1575 var table = $(this).parents('.holds_table');
1576 var count = $('.select_hold:not(:checked)', table).length;
1577 $('.select_hold_all', table).prop('checked', !count);
1580 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1582 $('.holds_table .select_hold_all').click(function() {
1583 var table = $(this).parents('.holds_table');
1584 var count = $('.select_hold:checked', table).length;
1585 $('.select_hold', table).prop('checked', !count);
1586 $(this).prop('checked', !count);
1587 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1588 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1591 $('.holds_table .select_hold').click(function() {
1592 var table = $(this).parents('.holds_table');
1593 var count = $('.select_hold:not(:checked)', table).length;
1594 $('.select_hold_all', table).prop('checked', !count);
1595 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1596 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1599 $('.cancel_selected_holds').click(function(e) {
1601 if($('.holds_table .select_hold:checked').length) {
1602 cancel_link = $(this);
1603 delete localStorage.selectedHolds;
1604 $('#cancelModal').modal();
1613 [% INCLUDE 'intranet-bottom.inc' %]