10 [% USE AuthorisedValues %]
12 [% USE TablesSettings %]
13 [% SET footerjs = 1 %]
14 [% INCLUDE 'doc-head-open.inc' %]
15 [% UNLESS ( multi_hold ) %]
16 <title>Place a hold on [% INCLUDE 'biblio-title-head.inc' %] › Holds › Circulation › Koha</title>
18 <title>Confirm holds › Holds › Circulation › Koha</title>
20 [% INCLUDE 'doc-head-close.inc' %]
23 <body id="circ_request" class="catalog">
25 [% INCLUDE 'header.inc' %]
26 [% INCLUDE 'circ-search.inc' %]
28 [% UNLESS ( multi_hold ) %]
29 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
32 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
35 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
38 [% INCLUDE 'biblio-title.inc' link =1 %]
41 <a href="#" aria-current="page">
48 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
51 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
54 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
57 <a href="#" aria-current="page">
63 [% END # UNLESS multi_hold %]
65 <div class="main container-fluid">
67 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
68 <div class="col-md-10 col-md-offset-1">
70 <div class="col-sm-10 col-sm-push-2">
76 <div class="dialog alert">
78 <strong>Cannot place hold:</strong> one or more records don't exist.
80 <strong>Cannot place hold:</strong> this record doesn't exist.
85 <div class="dialog alert">
87 <strong>Cannot place hold:</strong> one or more records without items attached.
89 <strong>Cannot place hold:</strong> this record has no items attached.
94 [% IF ( messagetransfert ) %]
95 <div class="dialog message">
96 <h2>Hold found for ([% nextreservtitle | html %]), please transfer</h2>
97 <p>Hold placed by : <strong> [% nextreservsurname | html %] [% nextreservfirstname | html %]</strong> at : <strong> [% branchname | html %] </strong>, Please transfer this item.
99 <form name="cancelReservewithtransfert" action="branchreserves.pl" method="post">
100 <input type="submit" class="button" />
105 [% UNLESS ( nobiblio ) %]
106 [% UNLESS ( multi_hold ) %]
107 <h1>Place a hold on [% INCLUDE 'biblio-title.inc' link = 1 %]</h1>
109 <h1>Confirm holds</h1>
113 [% UNLESS club OR patron OR patron.borrowernumber OR noitems OR nobiblio %]
114 [% IF ( messageborrower ) %]
115 <div class="dialog alert">
116 <h3>Patron not found</h3>
117 <p>No patron with this name, please, try another</p>
121 [% IF ( messageclub ) %]
122 <div class="dialog alert">
123 <h3>Club not found</h3>
124 <p>No club with this name, please, try another</p>
127 <fieldset class="brief">
129 <label>Search patrons or clubs</label>
131 <label>Search patrons</label>
133 <div id="circ_holds_select" class="toptabs">
135 <li><a href="#holds_patronsearch_pane">Patrons</a></li>
137 <li><a href="#holds_clubsearch_pane">Clubs</a></li>
140 <div id="holds_patronsearch_pane">
141 <form id="holds_patronsearch" action="request.pl?biblionumbers=[% biblionumbers | html %]" method="post">
142 <div class="hint">Enter patron card number or partial name:</div>
143 <input type="text" size="40" id="patron" class="focus" name="findborrower" autocomplete="off" />
144 <input type="submit" value="Search" />
146 <input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
148 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
151 </form> <!-- /#holds_patronsearch -->
153 [% INCLUDE 'circ-patron-search-results.inc' destination = "holds" %]
157 <div id="holds_clubsearch_pane">
158 <form id="holds_clubsearch" action="request.pl?biblionumbers=[% biblionumbers | html %]" method="post">
159 <div class="hint">Enter club ID or partial name:</div>
160 <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" />
161 <input type="submit" value="Search" />
163 <input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
165 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
168 </form> <!-- /#holds_patronsearch -->
170 [% INCLUDE 'clubs-table.inc' destination = "holds" %]
177 <div class="dialog alert hide clubalert">
179 <fieldset class="rows">
180 <legend>Hold details</legend>
181 <form action="/api/v1/clubs/[% club.id | html %]/holds" method="post" name="form" id="club-request-form">
183 [% IF ( multi_hold ) %]
184 <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
185 <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
186 <input type="hidden" name="request" value="any"/>
187 [% FOREACH biblioloo IN biblioloop %]
188 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
189 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
192 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
193 <input type="hidden" name="title" value="[% biblio.title | html %]" />
194 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
195 [% END # /IF multi_hold %]
198 <span class="label">Club: </span> [% club.name | html %]
201 <span class="label">Description: </span> [% club.description | html %]
204 <label for="pickup">Pickup at:</label>
205 <select name="pickup" id="pickup_club">
206 [% PROCESS options_for_libraries libraries => Branches.all({ selected => club.branchcode, search_params => { pickup_location => 1 } }) %]
210 <label for="default_patron_home">Pickup at patron's home library when possible:</label>
211 <input type="checkbox" id="default_patron_home" name="default_patron_home"/>
214 <h2 style="padding: 0 1em;">Members</h2>
216 [% FOREACH member IN members %]
217 [% SET patron = member.patron %]
218 <li style="padding: 0.5em 1em;">
219 <div><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a></div>
220 [% IF member.exceeded_maxreserves %]
222 <i class="fa fa-error"></i>
223 <strong>Too many holds: </strong> Patron can only place a maximum of [% maxreserves | html %] total holds.
226 [% IF ( member.expiry ) %]
228 <i class="fa fa-warning"></i>
229 <strong>Account has expired</strong>
232 [% IF patron.is_debarred %]
234 <i class="fa fa-warning"></i>
235 <strong>Patron has restrictions</strong>
238 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
240 <i class="fa fa-warning"></i>
241 <strong>Patron has outstanding fines: [% member.amount_outstanding | $Price %]</strong>
245 [% IF ( member.diffbranch ) %]
247 <i class="fa fa-warning"></i>
248 <strong>Pickup library is different.</strong> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )
254 [% UNLESS ( multi_hold ) %]
255 <fieldset class="action">
256 <input type="submit" value="Place hold" />
259 <table id="requesttitles">
263 [% UNLESS ( item_level_itypes ) %]
269 [% FOREACH biblioloo IN biblioloop %]
270 [% IF ( biblioloo.warn ) %]
276 [% UNLESS ( biblioloo.warn ) %]
277 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
283 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
285 [% IF ( biblioloo.publicationyear ) %]
287 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
291 [% IF ( biblioloo.warn ) %]
292 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
295 [% UNLESS ( item_level_itypes ) %]
297 <img src="[% biblioloo.imageurl | html %]" alt="[% biblioloo.itypename | html %]" title="[% biblioloo.itypename | html %]" />
300 <td>[% biblioloo.rank | html %]</td>
302 [% IF ( biblioloo.checked_previously ) %]
303 <span>Patron has previously checked out this title</span><br/>
305 [% IF ( biblioloo.alreadyres ) %]
308 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
313 [% IF ( biblioloo.alreadyres ) %]
315 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
316 <strong>already has a hold</strong> on this item
319 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
320 <li> <strong>No items are available</strong> to be placed on hold</li>
323 [% IF ( biblioloo.alreadyres ) %]
326 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
332 [% END # /FOREACH biblioloo %]
333 </table> <!-- /#requesttitles -->
337 [% ELSIF NOT ( noitems || nobiblio ) # /UNLESS patron %]
339 [% IF ( checked_previously && !multi_hold ) %]
340 <div class="dialog alert">
342 <li>Patron has previously checked out this title</li>
347 [% IF ( no_reserves_allowed || exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted ) %]
348 <div class="dialog alert">
350 [% UNLESS ( multi_hold ) %]
351 <h3>Cannot place hold</h3>
353 [% IF ( no_reserves_allowed ) %]
354 <li><strong>No holds allowed: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> cannot place a hold on any of these items.</li>
355 [% ELSIF ( exceeded_maxreserves ) %]
356 <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> can only place a maximum of [% maxreserves | html %] total holds.</li>
357 [% ELSIF ( exceeded_holds_per_record ) %]
358 <li><strong>Too many holds for this record: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> can only place a maximum of [% max_holds_for_record | html %] hold(s) on this record.</li>
359 [% ELSIF ( alreadypossession ) %]
360 <li> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a> <strong>is already in possession</strong> of one item.</li>
361 [% ELSIF ( alreadyreserved ) %]
362 <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a> <strong>already has a hold</strong> on this item.</li>
363 [% ELSIF ( ageRestricted ) %]
364 <li><strong>Age restricted</strong></li>
365 [% ELSIF ( none_available ) %]
366 <li> <strong>No items are available</strong> to be placed on hold.</li>
367 [% ELSIF ( maxreserves ) %]
368 <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> has too many holds.</li>
369 [% END # /IF exceeded_maxreserves %]
371 [% ELSE # UNLESS multi_hold %]
372 <h3>Cannot place hold on some items</h3>
373 [% IF (no_reserves_allowed ) %]
374 <li><strong>No holds allowed: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> cannot place holds on some of these title's items.</li>
375 [% ELSIF ( exceeded_maxreserves ) %]
376 <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> can place [% new_reserves_allowed | html %] of the requested [% new_reserves_count | html %] holds for a maximum of [% maxreserves | html %] total holds.</li>
377 [% ELSIF ( exceeded_holds_per_record ) %]
378 [% FOREACH biblioloo IN biblioloop %]
379 [% IF (biblioloo.tooManyHoldsForThisRecord) %]
380 <li><strong>Too many holds for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]"> [% biblioloo.title | html %]</a>: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | html %]">[% patron.firstname | html %] [% patron.surname | html %] </a> can only place a maximum of [% max_holds_for_record | html %] hold(s) on this record.</li>
383 [% END # /IF exceeded_maxreserves %]
384 [% END # /UNLESS multi_hold %]
386 [% END # /IF ( exceeded_maxreserves || ... %]
388 [% IF ( patron.is_expired || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
389 <div class="dialog message">
391 [% IF ( patron.is_expired ) %]
392 <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>: <strong>Account has expired</strong></li>
395 [% IF patron.is_debarred %]
396 <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]#reldebarments">[% patron.firstname | html %] [% patron.surname | html %]</a>: <strong>Patron has restrictions</strong></li>
399 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
400 <li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>: <strong>Patron has outstanding fines: [% amount_outstanding | $Price %]</strong></li>
403 [% IF ( diffbranch ) %]
404 <li> <strong>Pickup library is different. </strong>Patron: <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )</li>
406 </ul> <!-- /.dialog.message -->
408 [% END # /IF patron.is_expired || diffbranch ... %]
410 [% IF ( messageborrower ) %]
411 <div class="dialog alert">
412 <h3>Patron not found:</h3>
413 <p>Name or barcode not found. Please try an other </p>
417 <div class="dialog alert hide holdalert">
420 <fieldset class="rows">
421 <legend>Hold details</legend>
422 <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
424 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
425 <input type="hidden" name="type" value="str8" />
427 [% IF ( multi_hold ) %]
428 <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
429 <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
430 <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
431 <input type="hidden" name="request" value="any"/>
432 [% FOREACH biblioloo IN biblioloop %]
433 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
434 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
437 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
438 <input type="hidden" name="title" value="[% biblio.title | html %]" />
439 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
440 [% END # /IF multi_hold %]
444 <span class="label">Patron:</span>
445 [% IF ( patron.borrowernumber ) %]
446 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a>
452 [% UNLESS ( multi_hold ) %]
454 <span class="label">Estimated priority:</span>
455 <strong>[% fixedRank | html %]</strong>
460 <label for="holdnotes">Notes:</label>
461 <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
464 <label for="pickup">Pickup at:</label>
465 [% UNLESS ( multi_hold ) %]
466 <select name="pickup" id="pickup" data-biblio-id="[% biblio.biblionumber | html %]" data-patron-id="[% patron.borrowernumber | html %]">
467 [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
469 <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
470 <option value="" selected="selected"></option>
471 [% FOREACH pickup_location IN multi_pickup_locations %]
472 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
478 [% UNLESS ( multi_hold ) %]
479 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
481 <label for="itemtype">Request specific item type:</label>
482 <select name="itemtype" id="itemtype">
483 <option value="">Any item type</option>
484 [%- FOREACH itemtype IN available_itemtypes %]
485 <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
490 [% END # /UNLESS multi_hold %]
492 [% IF ( reserve_in_future ) %]
494 <label for="from">Hold starts on date:</label>
495 <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" >
496 <input type="hidden" class="datepickerfrom_hidden" />
501 <label for="to">Hold expires on date:</label>
502 <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" />
503 <input type="hidden" class="datepickerto_hidden" />
506 [% UNLESS ( multi_hold ) %]
508 <label for="requestany">Hold next available item </label>
509 [% IF force_hold_level == 'item' %]
510 <input type="checkbox" id="requestany" name="request" disabled="true" />
511 [% ELSIF force_hold_level == 'record' %]
512 <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
513 <input type="hidden" name="request" value="Any"/>
515 <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
517 <input type="hidden" name="biblioitem" value="[% biblioitemnumber | html %]" />
518 <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
521 [% IF remaining_holds_for_record > 1 %]
523 <label for="holds_to_place_count">Holds to place (count)</label>
524 <input type="text" inputmode="numeric" pattern="[0-9]*" id="holds_to_place_count" name="holds_to_place_count" maxlength="[% remaining_holds_for_record | html %]" value="1" />
527 <input type="hidden" name="holds_to_place_count" value="1" />
529 [% END # /UNLESS multi_hold %]
531 <li id="non_priority_list_item">
532 <label for="non_priority">Non priority hold:</label>
533 <input name="non_priority" id="non_priority" type="checkbox" />
534 <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
538 [% UNLESS ( multi_hold ) %]
539 <fieldset class="action">
540 [% IF ( patron.borrowernumber ) %]
541 [% IF ( override_required ) %]
542 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
543 [% ELSIF ( none_available ) %]
544 <button type="submit" disabled="disabled" class="btn btn-default btn-disabled">Place hold</button>
546 <button type="submit" class="btn btn-default">Place hold</button>
551 [% FOREACH bibitemloo IN bibitemloop %]
553 [% UNLESS ( item_level_itypes ) %]
555 <span class="label">Item type:</span>
556 [% bibitemloo.description | html %]
560 [% IF ( bibitemloo.publicationyear ) %]
562 <span class="label">Publication year:</span>
563 [% bibitemloo.publicationyear | html %]
568 <h2 style="padding: 0 1em;">
569 Place a hold on a specific item
570 [% IF bibitemloo.force_hold_level == 'item' %]
571 <span class="error"><em>(Required)</em></span>
575 <table id="requestspecific">
579 [% IF ( item_level_itypes ) %]
583 <th>Home library</th>
584 <th>Last location</th>
585 [% IF itemdata_ccode %]
590 [% IF itemdata_enumchron %]
594 <th>Allowed pickup locations</th>
598 [% SET selected = 0 %]
599 [% FOREACH itemloo IN bibitemloo.itemloop %]
600 [% UNLESS ( itemloo.hide ) %]
601 <tr class="[% itemloo.backgroundcolor | html %]">
603 [% IF itemloo.force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
605 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
606 Hold must be record level
608 [% ELSIF ( itemloo.available ) %]
609 <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
610 [% ELSIF ( itemloo.override ) %]
611 <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
612 <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
615 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
616 [% IF itemloo.not_holdable %]
617 [% IF itemloo.not_holdable == 'damaged' %]
619 [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
621 [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
622 Exceeded max holds per record
623 [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
624 Daily hold limit reached for patron
625 [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
627 [% ELSIF itemloo.not_holdable == 'notReservable' %]
629 [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
630 Patron is from different library
631 [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
632 Cannot place hold from patron's library
633 [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
634 Patron already has hold for this item
635 [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
636 Cannot be transferred to pickup library
637 [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
638 Only pickup locations within the same hold group are allowed
639 [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
640 No reserves are allowed on this item
641 [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %]
642 Library is not a pickup location
643 [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
644 No valid pickup location
646 [% itemloo.not_holdable | html %]
650 [% END # /IF itemloo.force_hold_level %]
652 [% IF ( item_level_itypes ) %]
654 [% UNLESS ( noItemTypeImages ) %]
655 [% IF ( itemloo.imageurl ) %]<img src="[% itemloo.imageurl | html %]" alt="" /> <br /> [% END %]
657 [% itemloo.itypename | html %]
661 [% itemloo.barcode | html %]
664 [% Branches.GetName( itemloo.homebranch ) | html %]
667 [% Branches.GetName( itemloo.holdingbranch ) | html %]
669 [% IF itemdata_ccode %]
671 [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
675 [% itemloo.itemcallnumber | html %]
678 [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %]
680 [% IF itemdata_enumchron %]
682 [% itemloo.enumchron | html %]
685 [% IF ( itemloo.onloan ) %]
686 <td data-order="[% itemloo.date_due | html %]">
687 <span class="checkedout">Due [% itemloo.date_due | $KohaDates as_due_date => 1 %]</span>
690 [% IF ( itemloo.transfertwhen ) %]
691 In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
692 to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %]
696 [% IF ( itemloo.reservedate ) %]
697 [% IF ( itemloo.nocancel ) %]
698 Can't be cancelled when item is in transit
700 [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %]
701 [% IF ( itemloo.canreservefromotherbranches ) %]
702 for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedFor.borrowernumber | uri %]">[% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %]</a>
704 [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %]
705 [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since
706 [% IF ( itemloo.waitingdate ) %]
707 [% itemloo.waitingdate | $KohaDates %]
709 [% IF ( itemloo.reservedate ) %]
710 [% itemloo.reservedate | html %]
713 <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
714 [% END # /IF itemloo.nocancel %]
717 [% END # /IF itemloo.reservedate %]
719 [% IF itemloo.item_level_holds == "N" %]
720 <br/>Item level hold not allowed from OPAC
721 [% ELSIF itemloo.item_level_holds == "F" %]
722 <br/>Item level hold forced from OPAC
725 [% IF ( itemloo.itemlost ) %]
726 <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
729 [% IF ( itemloo.damaged ) %]
730 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
733 [% IF ( itemloo.withdrawn ) %]
734 <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
737 [% IF ( itemloo.notforloan ) %]
738 <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
742 [% IF (itemloo.pickup_locations_count > 0) %]
743 <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations"
744 data-item-id="[% itemloo.itemnumber | html %]"
745 data-patron-id="[% patron.borrowernumber | html %]">
746 [% IF (itemloo.default_pickup_location) %]
747 <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option>
753 [% END # / UNLESS itemloo.hide %]
754 [% END # /FOREACH itemloo %]
756 </table> <!-- /#requestspecific -->
758 [% IF ( bibitemloo.hiddencount ) %]
760 <p class="hiddencount">
761 <a href="request.pl?biblionumber=[% bibitemloo.biblionumber | uri %]&borrowernumber=[% bibitemloo.borrowernumber | uri %]&showallitems=1">Show all items ([% bibitemloo.hiddencount | html %] hidden)</a>
764 [% END # /IF bibitemloo.hiddencount %]
765 [% END # /FOREACH bibitemloo %]
767 [% ELSE # /UNLESS multi_hold %]
769 <table id="requesttitles">
773 [% UNLESS ( item_level_itypes ) %]
778 <th>Pickup location</th>
780 [% FOREACH biblioloo IN biblioloop %]
781 [% IF ( biblioloo.warn ) %]
787 [% UNLESS ( biblioloo.warn ) %]
788 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
794 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
796 [% IF ( biblioloo.publicationyear ) %]
798 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
802 [% IF ( biblioloo.warn ) %]
803 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
806 [% UNLESS ( item_level_itypes ) %]
808 <img src="[% biblioloo.imageurl | html %]" alt="[% biblioloo.itypename | html %]" title="[% biblioloo.itypename | html %]" />
811 <td>[% biblioloo.rank | html %]</td>
813 [% IF ( biblioloo.checked_previously ) %]
814 <span>Patron has previously checked out this title</span><br/>
816 [% IF ( biblioloo.alreadyres ) %]
819 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
824 [% IF ( biblioloo.alreadyres ) %]
826 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
827 <strong>already has a hold</strong> on this item
830 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
831 <li> <strong>No items are available</strong> to be placed on hold</li>
834 [% IF ( biblioloo.alreadyres ) %]
837 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
843 [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %]
844 <select name="pickup_[% biblioloo.biblionumber | html %]"
845 class="multi_pickup_select"
846 data-biblio-id="[% biblioloo.biblionumber | html %]"
847 data-patron-id="[% patron.borrowernumber | html %]"
848 data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
849 <option value=""></option>
850 [% FOREACH pickup_location IN biblioloo.pickup_locations %]
851 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
857 [% END # /FOREACH biblioloo %]
858 </table> <!-- /#requesttitles -->
860 [% END # /UNLESS multi_hold %]
862 <fieldset class="action">
863 [% IF ( patron AND patron.borrowernumber ) %]
864 [% IF ( override_required ) %]
865 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
866 [% ELSIF ( none_available ) %]
867 <button class="btn btn-default" type="submit">Place holds</button>
869 [% IF ( multi_hold ) %]
870 <button type="submit" class="btn btn-default" id="multi_hold_submit">Place holds</button>
872 <button type="submit" class="btn btn-default">Place hold</button>
875 [% END # /IF patron %]
876 </fieldset> <!-- /.action -->
877 </form> <!-- /#hold-request-form -->
878 </fieldset> <!-- /.rows -->
881 [% UNLESS ( patron ) %]
882 [% IF ( reserveloop ) %]
883 <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
884 [% IF ( multi_hold ) %]
885 <input type = "hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
889 <div class="dialog message">
890 <p>The job has been enqueued! It will be processed as soon as possible.</p>
891 <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>
895 <h2>Existing holds</h2>
896 <div id="toolbar" class="btn-toolbar">
897 <input type="submit" name="submit" value="Update hold(s)" /> <button class="cancel_selected_holds" data-bulk="true"></button>
898 <fieldset id="cancellation-reason-fieldset" class="action">
899 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
900 [% IF hold_cancellation %]
901 <label for="cancellation-reason">Cancellation reason: </label>
902 <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
903 <option value="">No reason given</option>
904 [% FOREACH reason IN hold_cancellation %]
905 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
912 [% FOREACH biblioloo IN biblioloop %]
913 [% IF ( biblioloo.reserveloop ) %]
914 [% IF ( multi_hold ) %]
916 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
917 [% biblioloo.title | html %]
922 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
923 [% SET branchcodes = [] %]
925 [% FOREACH h IN biblioloo.reserveloop %]
926 [% branchcodes.push( h.branchcode ) %]
928 [% branchcodes = branchcodes.unique %]
930 [% FOREACH b IN branchcodes.sort %]
931 [% SET holds_by_branch = [] %]
932 [% FOREACH h IN biblioloo.reserveloop %]
933 [% IF h.branchcode == b %]
934 [% holds_by_branch.push( h ) %]
938 <legend>[% Branches.GetName( b ) | html %]</legend>
939 [% INCLUDE holds_table.inc holds=holds_by_branch %]
941 [% END # /FOREACh b %]
942 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
943 [% SET itemtypes = [] %]
945 [% FOREACH h IN biblioloo.reserveloop %]
946 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
947 [% itemtypes.push( hold_itemtype ) %]
949 [% itemtypes = itemtypes.unique %]
951 [% FOREACH i IN itemtypes.sort %]
952 [% SET holds_by_itemtype = [] %]
953 [% FOREACH h IN biblioloo.reserveloop %]
954 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
955 [% IF hold_itemtype == i %]
956 [% holds_by_itemtype.push( h ) %]
962 <legend>[% ItemTypes.GetDescription( i ) | html %]</legend>
964 <legend>Any item type</legend>
966 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
968 [% END # /FOREACH i %]
969 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
970 [% SET branchcodes = [] %]
972 [% FOREACH h IN biblioloo.reserveloop %]
973 [% branchcodes.push( h.branchcode ) %]
975 [% branchcodes = branchcodes.unique %]
977 [% FOREACH b IN branchcodes.sort %]
979 <legend>[% Branches.GetName( b ) | html %]</legend>
980 [% SET holds_by_branch = [] %]
981 [% FOREACH h IN biblioloo.reserveloop %]
982 [% IF h.branchcode == b %]
983 [% holds_by_branch.push( h ) %]
987 [% SET itemtypes = [] %]
988 [% FOREACH h IN holds_by_branch %]
989 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
990 [% itemtypes.push( hold_itemtype ) %]
992 [% itemtypes = itemtypes.unique %]
994 [% FOREACH i IN itemtypes.sort %]
996 <h3>[% ItemTypes.GetDescription( i ) | html %]</h3>
998 <h3>Any item type</h3>
1001 [% SET holds_by_itemtype = [] %]
1002 [% FOREACH h IN holds_by_branch %]
1003 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1004 [% IF hold_itemtype == i %]
1005 [% holds_by_itemtype.push( h ) %]
1008 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1011 [% END # /FOREACH b %]
1013 [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
1014 [% END # /IF HoldsSplitQueue %]
1016 [% END # /IF biblioloo.reserveloop %]
1017 [% END # FOREACH biblioloo %]
1018 </fieldset> <!-- /.rows -->
1019 </form> <!-- /name=TTime -->
1020 [% END # IF reserveloop %]
1021 [% END # UNLESS patron %]
1025 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
1026 </div> <!-- /.col-md-10.col-md-offset-1 -->
1028 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1029 <div class="col-sm-2 col-sm-pull-10">
1031 [% INCLUDE 'biblio-view-menu.inc' %]
1033 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1035 </div> <!-- /.row -->
1037 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
1038 <div class="modal-dialog" role="document">
1039 <div class="modal-content">
1040 <div class="modal-header">
1041 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1042 <h3>Confirm deletion</h3>
1045 <div class="modal-body">
1046 <p>Are you sure you want to cancel this hold?</p>
1048 <fieldset class="action">
1049 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1050 [% IF hold_cancellation %]
1051 <label for="cancellation-reason">Cancellation reason: </label>
1052 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
1053 <option value="">No reason given</option>
1054 [% FOREACH reason IN hold_cancellation %]
1055 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1062 <div class="modal-footer">
1063 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
1064 <a href="#" data-dismiss="modal">Cancel</a>
1070 [% MACRO jsinclude BLOCK %]
1071 [% INCLUDE 'datatables.inc' %]
1072 [% INCLUDE 'calendar.inc' %]
1073 [% INCLUDE 'columns_settings.inc' %]
1074 [% Asset.js("lib/hc-sticky.js") | $raw %]
1075 [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1076 [% INCLUDE 'select2.inc' %]
1079 var biblionumber = "[% biblionumber | $raw %]";
1080 var borrowernumber = "[% patron.borrowernumber | $raw %]";
1081 var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1082 var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo IN bibitemloo.itemloop %][% IF ( itemloo.override ) %]
1083 [% itemloo.itemnumber | html %]: {
1084 homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1085 holdallowed: "[% itemloo.holdallowed | html %]"
1087 [% END %][% END %][% END %]
1090 damaged: _("Item damaged"),
1091 ageRestricted: _("Age restricted"),
1092 tooManyHoldsForThisRecord: _("Exceeded max holds per record"),
1093 tooManyReservesToday: _("Daily hold limit reached for patron"),
1094 tooManyReserves: _("Too many holds"),
1095 notReservable: _("Not holdable"),
1096 noReservesAllowed: _("No reserves allowed"),
1097 cannotReserveFromOtherBranches: _("Patron is from different library"),
1098 itemAlreadyOnHold: _("Patron already has hold for this item"),
1099 cannotBeTransferred: _("Cannot be transferred to pickup library"),
1100 pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed")
1103 var MSG_CANCEL_SELECTED = _("Cancel selected (%s)");
1104 columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
1105 $.fn.select2.defaults.set("width", "100%" );
1106 $.fn.select2.defaults.set("dropdownAutoWidth", true );
1108 $(document).ready(function() {
1109 $('#cancellation-reason-fieldset').hide();
1110 $('.rank-request').on('change', function() {
1111 if ( $(".rank-request option:selected[value='del']").length ) {
1112 $('#cancellation-reason-fieldset').show();
1114 $('#cancellation-reason-fieldset').hide();
1118 [% SET active = clubs ? 1 : 0 %]
1119 $('#circ_holds_select').tabs({
1120 active: [% active | $raw %],
1121 activate: function(){
1122 $(this).find("input.focus").focus();
1125 $(this).find("input.focus").focus();
1128 function ToggleHoldsToPlace() {
1129 if ( $("#requestany").prop('checked') ) {
1130 $("#holds_to_place_count").prop('disabled', false);
1132 $("#holds_to_place_count").prop('disabled', true);
1135 ToggleHoldsToPlace();
1136 $("#requestany").on('change', function(){
1137 ToggleHoldsToPlace();
1140 [% IF Koha.Preference('UseBranchTransferLimits') %]
1141 $("#pickup").on('change', function(){
1142 var pickup = $("#pickup").val();
1143 var url = "?pickup=" + pickup;
1144 url += "&borrowernumber=" + borrowernumber;
1145 url += "&biblionumber=" + biblionumber;
1146 window.location.replace(url);
1150 [% IF AutoResumeSuspendedHolds %]
1151 $(".suspend_until_datepicker").flatpickr({
1152 minDate: new Date().fp_incr(1) /* Require that "until date" be in the future */
1157 var startPicker = $("#reserve_date").flatpickr({
1158 minDate: new Date().fp_incr(1), /* Require that "Hold starts on date" be in the future */
1159 onChange: function(selectedDates, dateStr, instance) {
1160 altFormat = instance.formatDate(selectedDates[0], "Y-m-d");
1161 $(".datepickerfrom_hidden").val( altFormat ); /* Populate hidden field with ISO-formatted date */
1163 onClose: function( selectedDates, dateText, instance) {
1164 validate_date( selectedDates, instance );
1165 endPicker.set('minDate', selectedDates[0]);
1169 var endPicker = $("#expiration_date").flatpickr({
1170 minDate: new Date().fp_incr(1), // Require that "Hold expires on date" be in the future
1171 onChange: function(selectedDates, dateStr, instance) {
1172 altFormat = instance.formatDate(selectedDates[0], "Y-m-d");
1173 $(".datepickerto_hidden").val( altFormat ); /* Populate hidden field with ISO-formatted date */
1175 onClose: function( selectedDates, dateText, instance) {
1176 validate_date( selectedDates, instance );
1180 var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1182 "sDom": '<"top pager"ilf>t',
1185 //Override fieldset styling for dataTables search box
1186 $("div.top.pager").css("margin-left","1em");
1187 $(".dataTables_filter label").css({
1189 "margin-right":"0em"
1192 $("#club-request-form").on("submit", function() {
1194 $('.clubalert, .holdalert').addClass('hide');
1195 let biblionumbers = [biblionumber];
1196 let biblionumbers_text;
1198 pickup_library_id: $('select[name="pickup"]').val()
1200 if($('input[name="checkitem"]:checked').length)
1201 data.item_id = $('input[name="checkitem"]:checked').val();
1202 if($('input[name="borrowernumber"]').length)
1203 data.patron_id = $('input[name="borrowernumber"]').val();
1204 if($('textarea[name="notes"]').length)
1205 data.notes = $('textarea[name="notes"]').val()||null;
1206 if($('.datepickerto_hidden').length)
1207 data.expiration_date = $('.datepickerto_hidden').val()||null;
1208 if($('.datepickerfrom_hidden').length)
1209 data.hold_date = $('.datepickerfrom_hidden').val()||null;
1210 if($('input[name="itemtype"]').length) {
1211 data.item_type = $('input[name="itemtype"]').val()||null;
1213 if($('input[name="default_patron_home"]:checked').length) {
1214 data.default_patron_home = 1;
1216 if($('input[name="biblionumbers"]').length) {
1217 biblionumbers_text = $('input[name="biblionumbers"]').val();
1218 biblionumbers = biblionumbers_text.replace(/\/$/, '').split('/')
1221 const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1;
1222 biblionumbers.forEach(function(biblionumber) {
1223 data.biblio_id = biblionumber;
1225 url: $t.attr('action'),
1226 method: $t.attr('method').toUpperCase(),
1227 contentType: 'application/json',
1228 data: JSON.stringify(data)
1230 for(let i = 0; i < count; i++) {
1232 .then(function(result) {
1233 let url = 'request.pl?biblionumber='+biblionumber;
1234 if(biblionumbers_text) {
1235 url = 'request.pl?biblionumbers='+biblionumbers_text;
1237 document.location = url;
1239 .fail(function(err) {
1240 var message = err.responseJSON.error;
1241 var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/);
1242 if(match && ERROR_MAP[match[1]]) {
1243 message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>'
1245 $('.clubalert, .holdalert').removeClass('hide').html(message);
1253 [% UNLESS ( multi_hold ) %]
1254 $("#hold-request-form").on("submit", function(){
1255 return check($(this));
1258 $("#hold-request-form").on("submit", function(){
1259 return checkMultiHold();
1263 function display_pickup_location (state) {
1265 if ( state.needs_override === true ) {
1267 '<span>' + state.text + '</span> <span style="float:right;" title="' +
1268 _("This pickup location is not allowed according to circulation rules") +
1269 '"><i class="fa fa-exclamation-circle" aria-hidden="true"></i></span>'
1273 $text = $('<span>'+state.text+'</span>');
1279 $(".pickup_location_dropdown").each( function () {
1280 var this_dropdown = $(this);
1281 var hold_id = $(this).data('hold_id');
1283 this_dropdown.select2({
1286 url: '/api/v1/holds/' + encodeURIComponent(hold_id) + '/pickup_locations',
1287 delay: 300, // wait 300 milliseconds before triggering the request
1289 data: function (params) {
1290 var search_term = (params.term === undefined) ? '' : params.term;
1292 "q": JSON.stringify({"name":{"-like":search_term+'%'}}),
1297 processResults: function (data) {
1299 data.forEach( function ( pickup_location ) {
1302 "id": pickup_location.library_id.escapeHtml(),
1303 "text": pickup_location.name.escapeHtml(),
1304 "needs_override": pickup_location.needs_override
1308 return { "results": results };
1311 templateResult: display_pickup_location
1315 $("#pickup_multi").select2({
1320 $('.multi_pickup_select').select2({
1325 $("#pickup_multi").on("change", function() {
1326 var selection = $(this).val();
1327 if ( selection != '' ) {
1328 $(".multi_pickup_select").each(function() {
1329 var valid_pickup_locations = $(this).data('pickup-locations');
1330 if ( valid_pickup_locations.includes(selection) ) {
1331 $(this).val(selection);
1332 $(this).trigger("change");
1338 $("#pickup").each( function () {
1339 var this_dropdown = $(this);
1340 var patron_id = $(this).data('patron-id');
1341 var biblio_id = $(this).data('biblio-id');
1343 this_dropdown.select2({
1347 url: '/api/v1/biblios/' + encodeURIComponent(biblio_id) + '/pickup_locations',
1348 delay: 300, // wait 300 milliseconds before triggering the request
1350 data: function (params) {
1351 var search_term = (params.term === undefined) ? '' : params.term;
1353 "q": JSON.stringify({"name":{"-like":search_term+'%'}}),
1354 "_order_by": "name",
1355 "patron_id": patron_id
1359 processResults: function (data) {
1361 data.forEach( function ( pickup_location ) {
1364 "id": pickup_location.library_id.escapeHtml(),
1365 "text": pickup_location.name.escapeHtml(),
1366 "needs_override": pickup_location.needs_override
1370 return { "results": results };
1373 templateResult: display_pickup_location
1376 $(".pickup_locations").each( function () {
1377 var this_dropdown = $(this);
1378 var patron_id = $(this).data('patron-id');
1379 var item_id = $(this).data('item-id');
1381 this_dropdown.select2({
1384 url: '/api/v1/items/' + encodeURIComponent(item_id) + '/pickup_locations',
1385 delay: 300, // wait 300 milliseconds before triggering the request
1387 data: function (params) {
1388 var search_term = (params.term === undefined) ? '' : params.term;
1390 "q": JSON.stringify({"name":{"-like":search_term+'%'}}),
1391 "_order_by": "name",
1392 "patron_id": patron_id
1396 processResults: function (data) {
1398 data.forEach( function ( pickup_location ) {
1401 "id": pickup_location.library_id.escapeHtml(),
1402 "text": pickup_location.name.escapeHtml(),
1403 "needs_override": pickup_location.needs_override
1407 return { "results": results };
1410 templateResult: display_pickup_location
1415 function check( table ) {
1419 if ( $("#requestany").attr("checked") !== "checked" ) {
1420 // requestany not selected, go through the item-specific cases
1421 if ( $('input[type="radio"]:checked').length > 0 ) {
1422 // got item-specific hold requests in the form!
1423 // verify they have a pickup location selected
1425 if (table.find('input[type="radio"]:checked')
1427 .find(".pickup_locations").val() === null) {
1429 msg = _("- Please select a pickup location for the item" + "\n")
1433 msg = (_("- Please select an item to place a hold") + "\n");
1438 $('#hold-request-form').preventDoubleFormSubmit();
1446 function checkMultiHold() {
1448 var biblionumbers = "";
1449 var selected_bibs = $(".multi_hold_item_checkbox:checked");
1450 if ( selected_bibs.length > 0 ) {
1451 // there are biblios selected in the form!
1452 // verify they have a pickup location selected
1454 var pickup_not_set = 0;
1455 selected_bibs.each(function() {
1456 if ( $(this).closest('tr').find(".multi_pickup_select").val() === "" ) {
1460 var bibnum = $(this).attr("title");
1461 biblionumbers += bibnum + "/";
1464 if ( pickup_not_set > 0 ) {
1465 alert( _("Please make sure all selected titles have a pickup location set" + "\n") );
1470 alert( _("Please select at least one title" + "\n") );
1474 var badSpans = $(".not_holdable");
1476 $(badSpans).each(function() {
1477 var bibnum = $(this).attr("title");
1478 badBibs += bibnum + "/";
1481 $("#multi_hold_bibs").val(biblionumbers);
1482 $("#bad_bibs").val(badBibs);
1484 $('#hold-request-form').preventDoubleFormSubmit();
1489 $(document).ready(function() {
1490 $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1491 var itemnumber = this.value;
1494 switch (override_items[itemnumber].holdallowed) {
1495 case "not_allowed": msg = _("This item normally cannot be put on hold."); break;
1496 case "from_home_library": msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
1499 msg += "\n\n" + _("Place hold on this item?");
1501 return confirm(msg);
1503 $("button.warning").click(function() {
1504 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1506 $("#requestany").click(function() {
1508 $("input[name=checkitem]").each(function() {
1509 $(this).prop("checked", false);
1513 $("input[name=checkitem]").click(function() {
1515 $("input[name=checkitem]").each(function() {
1520 if(onechecked == 1){
1521 $("#requestany").prop("checked", false);
1522 $("#holds_to_place_count").prop('disabled', true);
1524 $("#requestany").prop("checked",true);
1525 $("#holds_to_place_count").prop('disabled', false);
1528 var prev_rank_request;
1529 $("select[name=rank-request]").on("focus", function() {
1530 prev_rank_request = $(this).val();
1531 var row = $(this).parents("tr:first");
1532 }).change(function() {
1533 var row = $(this).parents("tr:first");
1534 var value = parseInt($(this).val());
1535 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
1536 if( !isNaN(value) ) { //If moved to 'del'
1537 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)
1538 if (prev_rank_request > value) {
1539 row.insertBefore(after);
1541 row.insertAfter(after);
1545 var next_priority = 1;
1546 $("select[name=rank-request]").each(function () {
1547 if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
1548 $(this).val(next_priority);
1553 $(".clear-date").on("click",function(e){
1555 var fieldID = this.id.replace("clear-date-","");
1556 $("#" + fieldID).val("");
1559 // Confirm cancellation of hold
1561 $(".cancel-hold").on("click",function(e) {
1563 cancel_link = $(this);
1564 $('#cancelModal').modal();
1567 $("#cancelModalConfirmBtn").on("click",function(e) {
1569 if(cancel_link.data('bulk')) {
1570 [% IF biblionumbers %]
1571 link = `request.pl?biblionumbers=[% biblionumbers | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1573 link = `request.pl?biblionumber=[% biblionumber | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1576 let borrowernumber = cancel_link.data('borrowernumber');
1577 let biblionumber = cancel_link.data('biblionumber');
1578 let reserve_id = cancel_link.data('id');
1579 link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`;
1581 let reason = $("#modal-cancellation-reason").val();
1583 link += "&cancellation-reason=" + reason
1585 window.location.href = link;
1589 [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems || nobiblio ) %]
1590 [% IF ( PatronAutoComplete ) %]
1591 $( "#patron" ).autocomplete({
1592 source: "/cgi-bin/koha/circ/ysearch.pl",
1594 select: function( event, ui ) {
1595 $( "#patron" ).val( ui.item.cardnumber );
1596 $( "#holds_patronsearch" ).submit();
1600 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
1601 return $( "<li></li>" )
1602 .data( "ui-autocomplete-item", item )
1605 + ( item.surname ? item.surname.escapeHtml() : "" )
1607 + ( item.firstname ? item.firstname.escapeHtml() : "" )
1608 + " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")"
1611 + ( item.address ? item.address.escapeHtml() : "" )
1613 + ( item.city ? item.city.escapeHtml() : "" )
1615 + ( item.zipcode ? item.zipcode.escapeHtml() : "" )
1617 + ( item.country ? item.country.escapeHtml() : "" )
1624 Sticky = $("#toolbar");
1626 stickTo: "#existing_holds",
1627 stickyClass: "floating"
1630 if(!localStorage.selectedHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) {
1631 localStorage.selectedHolds = [];
1634 $('.holds_table .select_hold').each(function() {
1635 if(localStorage.selectedHolds.includes($(this).data('id'))) {
1636 $(this).prop('checked', true);
1640 $('.holds_table .select_hold_all').each(function() {
1641 var table = $(this).parents('.holds_table');
1642 var count = $('.select_hold:not(:checked)', table).length;
1643 $('.select_hold_all', table).prop('checked', !count);
1646 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1648 $('.holds_table .select_hold_all').click(function() {
1649 var table = $(this).parents('.holds_table');
1650 var count = $('.select_hold:checked', table).length;
1651 $('.select_hold', table).prop('checked', !count);
1652 $(this).prop('checked', !count);
1653 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1654 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1657 $('.holds_table .select_hold').click(function() {
1658 var table = $(this).parents('.holds_table');
1659 var count = $('.select_hold:not(:checked)', table).length;
1660 $('.select_hold_all', table).prop('checked', !count);
1661 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1662 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1665 $('.cancel_selected_holds').click(function(e) {
1667 if($('.holds_table .select_hold:checked').length) {
1668 cancel_link = $(this);
1669 delete localStorage.selectedHolds;
1670 $('#cancelModal').modal();
1679 [% INCLUDE 'intranet-bottom.inc' %]