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 %]</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 [% SET hold_count = Biblio.HoldsCount( biblio.biblionumber ) | html %]
910 <label for ="always_show_holds">Always show holds</label>
911 [% IF always_show_holds == 'DONT' %]
912 <input type="checkbox" name="always_show_holds" id="always_show_holds" value="DO">
913 <a class="btn btn-default" value="Show holds" id="show_holds_now" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber %]&show_holds_now=1">Show holds ([% hold_count %])</a>
915 <input type="checkbox" name="always_show_holds" value="DO" id="always_show_holds" checked="checked">
918 [% IF ( reserveloop ) %]
919 <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
920 [% IF ( multi_hold ) %]
921 <input type = "hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
925 <div class="dialog message">
926 <p>The job has been enqueued! It will be processed as soon as possible.</p>
927 <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>
931 <h2>Existing holds</h2>
932 <div id="toolbar" class="btn-toolbar">
933 <input type="submit" name="submit" value="Update hold(s)" /> <button class="cancel_selected_holds" data-bulk="true"></button>
934 <fieldset id="cancellation-reason-fieldset" class="action">
935 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
936 [% IF hold_cancellation %]
937 <label for="cancellation-reason">Cancellation reason: </label>
938 <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
939 <option value="">No reason given</option>
940 [% FOREACH reason IN hold_cancellation %]
941 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
948 [% FOREACH biblioloo IN biblioloop %]
949 [% IF ( biblioloo.reserveloop ) %]
950 <div class="hold_title" id="hold_title_[% biblioloo.biblionumber | html %]">
951 [% IF ( multi_hold ) %]
953 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
954 [% biblioloo.title | html %]
955 </a> <span class="number_box"><span>[% biblioloo.reserveloop.size | html %] [% tn('Hold', 'Holds', biblioloo.reserveloop.size) | $raw %]</span></span>
959 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
961 [% SET branchcodes = [] %]
963 [% FOREACH h IN biblioloo.reserveloop %]
964 [% branchcodes.push( h.branchcode ) %]
966 [% branchcodes = branchcodes.unique %]
967 [% IF ( branchcodes.empty ) %]
969 There are no holds on this title.
973 [% FOREACH b IN branchcodes.sort %]
974 [% SET holds_by_branch = [] %]
975 [% FOREACH h IN biblioloo.reserveloop %]
976 [% IF h.branchcode == b %]
977 [% holds_by_branch.push( h ) %]
980 <div class="holds_by_library">
981 <h4>[% Branches.GetName( b ) | html %]</h4>
983 [% INCLUDE holds_table.inc holds=holds_by_branch %]
985 [% END # /FOREACh b %]
986 [% END # /IF ( branchcodes.empty ) %]
988 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
990 [% SET itemtypes = [] %]
992 [% FOREACH h IN biblioloo.reserveloop %]
993 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
994 [% itemtypes.push( hold_itemtype ) %]
996 [% itemtypes = itemtypes.unique %]
997 [% IF ( itemtypes.empty ) %]
999 There are no holds on this title.
1003 [% FOREACH i IN itemtypes.sort %]
1004 [% SET holds_by_itemtype = [] %]
1005 [% FOREACH h IN biblioloo.reserveloop %]
1006 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1007 [% IF hold_itemtype == i %]
1008 [% holds_by_itemtype.push( h ) %]
1012 <div class="holds_by_itemtype">
1014 <h4>[% ItemTypes.GetDescription( i ) | html %]</h4>
1016 <h4>Any item type</h4>
1018 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1020 [% END # /FOREACH i %]
1021 [% END # /IF ( itemtypes.empty ) %]
1023 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
1024 [% SET branchcodes = [] %]
1026 [% FOREACH h IN biblioloo.reserveloop %]
1027 [% branchcodes.push( h.branchcode ) %]
1029 [% branchcodes = branchcodes.unique %]
1030 [% IF ( branchcodes.empty ) %]
1032 There are no holds on this title.
1036 [% FOREACH b IN branchcodes.sort %]
1037 <div class="holds_by_library">
1038 <h4 class="library_holds">[% Branches.GetName( b ) | html %]</h4>
1039 [% SET holds_by_branch = [] %]
1040 [% FOREACH h IN biblioloo.reserveloop %]
1041 [% IF h.branchcode == b %]
1042 [% holds_by_branch.push( h ) %]
1046 [% SET itemtypes = [] %]
1047 [% FOREACH h IN holds_by_branch %]
1048 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1049 [% itemtypes.push( hold_itemtype ) %]
1051 [% itemtypes = itemtypes.unique %]
1053 [% FOREACH i IN itemtypes.sort %]
1054 <div class="holds_by_itemtype">
1055 <h5 class="itemtype_holds">
1057 [% ItemTypes.GetDescription( i ) | html %]
1063 [% SET holds_by_itemtype = [] %]
1064 [% FOREACH h IN holds_by_branch %]
1065 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1066 [% IF hold_itemtype == i %]
1067 [% holds_by_itemtype.push( h ) %]
1070 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1071 </div> <!-- /.holds_by_itemtype -->
1073 </div> <!-- /.holds_by_library -->
1074 [% END # /FOREACH b %]
1075 [% END # /IF ( branchcodes.empty ) %]
1079 [% IF ( biblioloo.reserveloop.size ) %]
1080 [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
1083 There are no holds on this title.
1087 [% END # /IF HoldsSplitQueue %]
1088 </div> <!-- /hold_title -->
1089 [% END # /IF biblioloo.reserveloop %]
1090 [% END # FOREACH biblioloo %]
1091 </form> <!-- /#existing_holds -->
1092 [% END # IF reserveloop %]
1093 [% END # UNLESS patron %]
1097 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
1098 </div> <!-- /.col-md-10.col-md-offset-1 -->
1100 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1101 <div class="col-sm-2 col-sm-pull-10">
1103 [% INCLUDE 'biblio-view-menu.inc' %]
1105 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1107 </div> <!-- /.row -->
1109 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
1110 <div class="modal-dialog" role="document">
1111 <div class="modal-content">
1112 <div class="modal-header">
1113 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1114 <h3>Confirm deletion</h3>
1117 <div class="modal-body">
1118 <p>Are you sure you want to cancel this hold?</p>
1120 <fieldset class="action">
1121 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1122 [% IF hold_cancellation %]
1123 <label for="cancellation-reason">Cancellation reason: </label>
1124 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
1125 <option value="">No reason given</option>
1126 [% FOREACH reason IN hold_cancellation %]
1127 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1134 <div class="modal-footer">
1135 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
1136 <a href="#" data-dismiss="modal">Cancel</a>
1142 [% MACRO jsinclude BLOCK %]
1143 [% INCLUDE 'datatables.inc' %]
1144 [% INCLUDE 'columns_settings.inc' %]
1145 [% Asset.js("lib/hc-sticky.js") | $raw %]
1146 [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1147 [% INCLUDE 'select2.inc' %]
1148 [% Asset.js("js/holds.js") | $raw%]
1149 [% INCLUDE 'calendar.inc' %]
1152 var biblionumber = "[% biblionumber | $raw %]";
1153 var borrowernumber = "[% patron.borrowernumber | $raw %]";
1154 var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1155 var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo IN bibitemloo.itemloop %][% IF ( itemloo.override ) %]
1156 [% itemloo.itemnumber | html %]: {
1157 homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1158 holdallowed: "[% itemloo.holdallowed | html %]"
1160 [% END %][% END %][% END %]
1163 damaged: _("Item damaged"),
1164 ageRestricted: _("Age restricted"),
1165 tooManyHoldsForThisRecord: _("Exceeded max holds per record"),
1166 tooManyReservesToday: _("Daily hold limit reached for patron"),
1167 tooManyReserves: _("Too many holds"),
1168 notReservable: _("Not holdable"),
1169 noReservesAllowed: _("No reserves allowed"),
1170 cannotReserveFromOtherBranches: _("Patron is from different library"),
1171 itemAlreadyOnHold: _("Patron already has hold for this item"),
1172 cannotBeTransferred: _("Cannot be transferred to pickup library"),
1173 pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed")
1176 var MSG_CANCEL_SELECTED = _("Cancel selected (%s)");
1177 columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
1178 $.fn.select2.defaults.set("width", "100%" );
1179 $.fn.select2.defaults.set("dropdownAutoWidth", true );
1181 $(document).ready(function() {
1182 $('#cancellation-reason-fieldset').hide();
1183 $('.rank-request').on('change', function() {
1184 if ( $(".rank-request option:selected[value='del']").length ) {
1185 $('#cancellation-reason-fieldset').show();
1187 $('#cancellation-reason-fieldset').hide();
1191 [% SET active = clubs ? 1 : 0 %]
1192 $('#circ_holds_select').tabs({
1193 active: [% active | $raw %],
1194 activate: function(){
1195 $(this).find("input.focus").focus();
1198 $(this).find("input.focus").focus();
1201 function ToggleHoldsToPlace() {
1202 if ( $("#requestany").prop('checked') ) {
1203 $("#holds_to_place_count").prop('disabled', false);
1205 $("#holds_to_place_count").prop('disabled', true);
1208 ToggleHoldsToPlace();
1209 $("#requestany").on('change', function(){
1210 ToggleHoldsToPlace();
1213 [% IF Koha.Preference('UseBranchTransferLimits') %]
1214 $("#pickup").on('change', function(){
1215 var pickup = $("#pickup").val();
1216 var url = "?pickup=" + pickup;
1217 url += "&borrowernumber=" + borrowernumber;
1218 url += "&biblionumber=" + biblionumber;
1219 window.location.replace(url);
1223 var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1225 "sDom": '<"top pager"ilf>t',
1228 //Override fieldset styling for dataTables search box
1229 $("div.top.pager").css("margin-left","1em");
1230 $(".dataTables_filter label").css({
1232 "margin-right":"0em"
1235 $("#club-request-form").on("submit", function() {
1237 $('.clubalert, .holdalert').addClass('hide');
1238 let biblionumbers = [biblionumber];
1239 let biblionumbers_text;
1241 pickup_library_id: $('select[name="pickup"]').val()
1243 if($('input[name="checkitem"]:checked').length)
1244 data.item_id = $('input[name="checkitem"]:checked').val();
1245 if($('input[name="borrowernumber"]').length)
1246 data.patron_id = $('input[name="borrowernumber"]').val();
1247 if($('textarea[name="notes"]').length)
1248 data.notes = $('textarea[name="notes"]').val()||null;
1249 if($('input[name="itemtype"]').length) {
1250 data.item_type = $('input[name="itemtype"]').val()||null;
1252 if($('input[name="default_patron_home"]:checked').length) {
1253 data.default_patron_home = 1;
1255 if($('input[name="biblionumbers"]').length) {
1256 biblionumbers_text = $('input[name="biblionumbers"]').val();
1257 biblionumbers = biblionumbers_text.replace(/\/$/, '').split('/')
1260 const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1;
1261 biblionumbers.forEach(function(biblionumber) {
1262 data.biblio_id = biblionumber;
1264 url: $t.attr('action'),
1265 method: $t.attr('method').toUpperCase(),
1266 contentType: 'application/json',
1267 data: JSON.stringify(data)
1269 for(let i = 0; i < count; i++) {
1271 .then(function(result) {
1272 let url = 'request.pl?biblionumber='+biblionumber;
1273 if(biblionumbers_text) {
1274 url = 'request.pl?biblionumbers='+biblionumbers_text;
1276 document.location = url;
1278 .fail(function(err) {
1279 var message = err.responseJSON.error;
1280 var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/);
1281 if(match && ERROR_MAP[match[1]]) {
1282 message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>'
1284 $('.clubalert, .holdalert').removeClass('hide').html(message);
1292 [% UNLESS ( multi_hold ) %]
1293 $("#hold-request-form").on("submit", function(){
1294 return check($(this));
1297 $("#hold-request-form").on("submit", function(){
1298 return checkMultiHold();
1302 $(".pickup_location_dropdown").each( function () {
1303 $(this).pickup_locations_dropdown();
1306 $("#pickup_multi").select2({
1311 $('.multi_pickup_select').select2({
1316 $("#pickup_multi").on("change", function() {
1317 var selection = $(this).val();
1318 if ( selection != '' ) {
1319 $(".multi_pickup_select").each(function() {
1320 var valid_pickup_locations = $(this).data('pickup-locations');
1321 if ( valid_pickup_locations.includes(selection) ) {
1322 $(this).val(selection);
1323 $(this).trigger("change");
1329 $("#pickup").each( function () {
1330 $(this).pickup_locations_dropdown();
1333 $(".pickup_locations").each(function () {
1334 $(this).pickup_locations_dropdown();
1338 function check( table ) {
1342 if ( $("#requestany").attr("checked") !== "checked" ) {
1343 // requestany not selected, go through the item-specific cases
1344 if ( $('input[type="radio"]:checked').length > 0 ) {
1345 // got item-specific hold requests in the form!
1346 // verify they have a pickup location selected
1348 if (table.find('input[type="radio"]:checked')
1350 .find(".pickup_locations").val() === null) {
1352 msg = _("- Please select a pickup location for the item" + "\n")
1356 msg = (_("- Please select an item to place a hold") + "\n");
1361 $('#hold-request-form').preventDoubleFormSubmit();
1369 function checkMultiHold() {
1371 var biblionumbers = "";
1372 var selected_bibs = $(".multi_hold_item_checkbox:checked");
1373 if ( selected_bibs.length > 0 ) {
1374 // there are biblios selected in the form!
1375 // verify they have a pickup location selected
1377 var pickup_not_set = 0;
1378 selected_bibs.each(function() {
1379 if ( $(this).closest('tr').find(".multi_pickup_select").val() === "" ) {
1383 var bibnum = $(this).attr("title");
1384 biblionumbers += bibnum + "/";
1387 if ( pickup_not_set > 0 ) {
1388 alert( _("Please make sure all selected titles have a pickup location set" + "\n") );
1393 alert( _("Please select at least one title" + "\n") );
1397 var badSpans = $(".not_holdable");
1399 $(badSpans).each(function() {
1400 var bibnum = $(this).attr("title");
1401 badBibs += bibnum + "/";
1404 $("#multi_hold_bibs").val(biblionumbers);
1405 $("#bad_bibs").val(badBibs);
1407 $('#hold-request-form').preventDoubleFormSubmit();
1412 $(document).ready(function() {
1413 $("#always_show_holds").change(function(){
1414 if( $(this).prop('checked') ){
1415 document.cookie = 'always_show_holds=DO';
1417 document.cookie = 'always_show_holds=DONT';
1420 $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1421 var itemnumber = this.value;
1424 switch (override_items[itemnumber].holdallowed) {
1425 case "not_allowed": msg = _("This item normally cannot be put on hold."); break;
1426 case "from_home_library": msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
1429 msg += "\n\n" + _("Place hold on this item?");
1431 return confirm(msg);
1433 $("button.warning").click(function() {
1434 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1436 $("#requestany").click(function() {
1438 $("input[name=checkitem]").each(function() {
1439 $(this).prop("checked", false);
1443 $("input[name=checkitem]").click(function() {
1445 $("input[name=checkitem]").each(function() {
1450 if(onechecked == 1){
1451 $("#requestany").prop("checked", false);
1452 $("#holds_to_place_count").prop('disabled', true);
1454 $("#requestany").prop("checked",true);
1455 $("#holds_to_place_count").prop('disabled', false);
1458 var prev_rank_request;
1459 $("select[name=rank-request]").on("focus", function() {
1460 prev_rank_request = $(this).val();
1461 var row = $(this).parents("tr:first");
1462 }).change(function() {
1463 var row = $(this).parents("tr:first");
1464 var value = parseInt($(this).val());
1465 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
1466 if( !isNaN(value) ) { //If moved to 'del'
1467 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)
1468 if (prev_rank_request > value) {
1469 row.insertBefore(after);
1471 row.insertAfter(after);
1475 var next_priority = 1;
1476 $("select[name=rank-request]").each(function () {
1477 if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
1478 $(this).val(next_priority);
1483 $(".clear-date").on("click",function(e){
1485 var fieldID = this.id.replace("clear-date-","");
1486 $("#" + fieldID).val("");
1489 // Confirm cancellation of hold
1491 $(".cancel-hold").on("click",function(e) {
1493 cancel_link = $(this);
1494 $('#cancelModal').modal();
1497 $("#cancelModalConfirmBtn").on("click",function(e) {
1499 if(cancel_link.data('bulk')) {
1500 [% IF biblionumbers %]
1501 link = `request.pl?biblionumbers=[% biblionumbers | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1503 link = `request.pl?biblionumber=[% biblionumber | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1506 let borrowernumber = cancel_link.data('borrowernumber');
1507 let biblionumber = cancel_link.data('biblionumber');
1508 let reserve_id = cancel_link.data('id');
1509 link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`;
1511 let reason = $("#modal-cancellation-reason").val();
1513 link += "&cancellation-reason=" + reason
1515 window.location.href = link;
1519 [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems || nobiblio ) %]
1520 [% IF ( PatronAutoComplete ) %]
1521 $( "#patron" ).autocomplete({
1522 source: "/cgi-bin/koha/circ/ysearch.pl",
1524 select: function( event, ui ) {
1525 $( "#patron" ).val( ui.item.cardnumber );
1526 $( "#holds_patronsearch" ).submit();
1530 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
1531 return $( "<li></li>" )
1532 .data( "ui-autocomplete-item", item )
1535 + ( item.surname ? item.surname.escapeHtml() : "" )
1537 + ( item.firstname ? item.firstname.escapeHtml() : "" )
1538 + " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")"
1541 + ( item.address ? item.address.escapeHtml() : "" )
1543 + ( item.city ? item.city.escapeHtml() : "" )
1545 + ( item.zipcode ? item.zipcode.escapeHtml() : "" )
1547 + ( item.country ? item.country.escapeHtml() : "" )
1554 Sticky = $("#toolbar");
1556 stickTo: "#existing_holds",
1557 stickyClass: "floating"
1560 if(!localStorage.selectedHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) {
1561 localStorage.selectedHolds = [];
1564 $('.holds_table .select_hold').each(function() {
1565 if(localStorage.selectedHolds.includes($(this).data('id'))) {
1566 $(this).prop('checked', true);
1570 $('.holds_table .select_hold_all').each(function() {
1571 var table = $(this).parents('.holds_table');
1572 var count = $('.select_hold:not(:checked)', table).length;
1573 $('.select_hold_all', table).prop('checked', !count);
1576 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1578 $('.holds_table .select_hold_all').click(function() {
1579 var table = $(this).parents('.holds_table');
1580 var count = $('.select_hold:checked', table).length;
1581 $('.select_hold', table).prop('checked', !count);
1582 $(this).prop('checked', !count);
1583 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1584 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1587 $('.holds_table .select_hold').click(function() {
1588 var table = $(this).parents('.holds_table');
1589 var count = $('.select_hold:not(:checked)', table).length;
1590 $('.select_hold_all', table).prop('checked', !count);
1591 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1592 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1595 $('.cancel_selected_holds').click(function(e) {
1597 if($('.holds_table .select_hold:checked').length) {
1598 cancel_link = $(this);
1599 delete localStorage.selectedHolds;
1600 $('#cancelModal').modal();
1609 [% INCLUDE 'intranet-bottom.inc' %]