11 [% USE AuthorisedValues %]
13 [% USE TablesSettings %]
14 [% PROCESS 'i18n.inc' %]
15 [% SET footerjs = 1 %]
16 [% INCLUDE 'doc-head-open.inc' %]
17 [% UNLESS ( multi_hold ) %]
18 <title>Place a hold on [% INCLUDE 'biblio-title-head.inc' %] › Holds › Circulation › Koha</title>
20 <title>Confirm holds › Holds › Circulation › Koha</title>
22 [% INCLUDE 'doc-head-close.inc' %]
23 [% Asset.css("css/holds.css") | $raw %]
26 <body id="circ_request" class="catalog">
28 [% INCLUDE 'header.inc' %]
29 [% INCLUDE 'circ-search.inc' %]
31 [% UNLESS ( multi_hold ) %]
32 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
35 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
38 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
41 [% INCLUDE 'biblio-title.inc' link =1 %]
44 <a href="#" aria-current="page">
51 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
54 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
57 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
61 <a href="#" aria-current="page">
66 <a href="#" aria-current="page">
67 Search patrons or clubs
70 <a href="#" aria-current="page">
78 [% END # UNLESS multi_hold %]
80 <div class="main container-fluid">
82 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
83 <div class="col-md-10 col-md-offset-1">
85 <div class="col-sm-10 col-sm-push-2">
91 <div class="dialog alert">
93 <strong>Cannot place hold:</strong> one or more records don't exist.
95 <strong>Cannot place hold:</strong> this record doesn't exist.
100 <div class="dialog alert">
102 <strong>Cannot place hold:</strong> one or more records without items attached.
104 <strong>Cannot place hold:</strong> this record has no items attached.
109 [% IF ( messagetransfert ) %]
110 <div class="dialog message">
111 <h2>Hold found for ([% nextreservtitle | html %]), please transfer</h2>
112 <p>Hold placed by : <strong> [% nextreservsurname | html %] [% nextreservfirstname | html %]</strong> at : <strong> [% branchname | html %] </strong>, Please transfer this item.
114 <form name="cancelReservewithtransfert" action="branchreserves.pl" method="post">
115 <input type="submit" class="button" />
120 [% UNLESS ( multi_hold ) %]
121 <h1>Place a hold on [% INCLUDE 'biblio-title.inc' link = 1 %] [% IF biblio.author %] by [% biblio.author | html %][% END %]</h1>
128 Search patrons or clubs
136 [% UNLESS club OR patron OR patron.borrowernumber OR noitems OR nobiblio %]
137 [% IF ( messageborrower ) %]
138 <div class="dialog alert">
139 <h3>Patron not found</h3>
140 <p>No patron with this name, please, try another</p>
144 [% IF ( messageclub ) %]
145 <div class="dialog alert">
146 <h3>Club not found</h3>
147 <p>No club with this name, please, try another</p>
150 <fieldset class="brief">
151 [% UNLESS multi_hold %]
153 <label>Search patrons or clubs</label>
155 <label>Search patrons</label>
158 <div id="circ_holds_select" class="toptabs">
160 <li><a href="#holds_patronsearch_pane">Patrons</a></li>
162 <li><a href="#holds_clubsearch_pane">Clubs</a></li>
165 <div id="holds_patronsearch_pane">
166 <form id="holds_patronsearch" method="get">
167 <div class="hint">Enter patron card number or partial name:</div>
168 <input type="text" size="40" id="patron" class="focus" autocomplete="off" />
169 <input type="submit" value="Search" />
170 [% FOREACH biblionumber IN biblionumbers %]
171 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
173 </form> <!-- /#holds_patronsearch -->
175 <table id="table_borrowers" class="selections-table" style="display: none;">
181 <th>Date of birth</th>
184 <th>Primary phone</th>
192 <div id="holds_clubsearch_pane">
193 <form id="holds_clubsearch" action="request.pl" method="post">
194 <div class="hint">Enter club ID or partial name:</div>
195 <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" />
196 <input type="submit" value="Search" />
197 [% FOREACH biblionumber IN biblionumbers %]
198 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
201 </form> <!-- /#holds_patronsearch -->
203 [% INCLUDE 'clubs-table.inc' destination = "holds" %]
210 <div class="dialog alert hide clubalert">
212 <fieldset class="rows">
213 <legend>Hold details</legend>
214 <form action="/api/v1/clubs/[% club.id | html %]/holds" method="post" name="form" id="club-request-form">
216 [% IF ( multi_hold ) %]
217 <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
218 <input type="hidden" name="request" value="any"/>
219 [% FOREACH biblioloo IN biblioloop %]
220 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
221 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
224 <input type="hidden" name="title" value="[% biblio.title | html %]" />
225 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
226 [% END # /IF multi_hold %]
229 <span class="label">Club: </span> [% club.name | html %]
232 <span class="label">Description: </span> [% club.description | html %]
235 <label for="pickup">Pickup at:</label>
236 <select name="pickup" id="pickup_club">
237 [% PROCESS options_for_libraries libraries => Branches.all({ selected => club.branchcode, search_params => { pickup_location => 1 } }) %]
241 <label for="default_patron_home">Pickup at patron's home library when possible:</label>
242 <input type="checkbox" id="default_patron_home" name="default_patron_home"/>
245 <h2 style="padding: 0 1em;">Members</h2>
247 [% FOREACH member IN members %]
248 [% SET patron = member.patron %]
249 <li style="padding: 0.5em 1em;">
250 <div><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a></div>
251 [% IF member.exceeded_maxreserves %]
253 <i class="fa fa-error"></i>
254 <strong>Too many holds: </strong> Patron can only place a maximum of [% maxreserves | html %] total holds.
257 [% IF ( patron.is_expired ) %]
259 <i class="fa fa-warning"></i>
260 <strong>Account has expired</strong>
263 [% IF patron.is_debarred %]
265 <i class="fa fa-warning"></i>
266 <strong>Patron has restrictions</strong>
269 [% IF member.amount_outstanding && Koha.Preference('maxoutstanding') && member.amount_outstanding > Koha.Preference('maxoutstanding') %]
271 <i class="fa fa-warning"></i>
272 <strong>Patron has outstanding fines: [% member.amount_outstanding | $Price %]</strong>
276 [% IF ( member.diffbranch ) %]
278 <i class="fa fa-warning"></i>
279 <strong>Pickup library is different.</strong> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )
284 [% UNLESS ( multi_hold ) %]
285 <fieldset class="action">
286 <input type="submit" value="Place hold" />
289 <table id="requesttitles">
293 [% UNLESS Koha.Preference('item-level_itypes') %]
299 [% FOREACH biblioloo IN biblioloop %]
300 [% IF ( biblioloo.warn ) %]
306 [% UNLESS ( biblioloo.warn ) %]
307 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
313 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
314 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
316 [% IF ( biblioloo.publicationyear ) %]
318 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
322 [% IF ( biblioloo.warn ) %]
323 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
326 [% UNLESS Koha.Preference('item-level_itypes') %]
328 <img src="[% biblioloo.itemtype.image_location| html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
331 <td>[% biblioloo.rank | html %]</td>
333 [% IF ( biblioloo.checked_previously ) %]
334 <span>Patron has previously checked out this title</span><br/>
336 [% IF ( biblioloo.alreadyres ) %]
339 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
344 [% IF ( biblioloo.alreadyres ) %]
346 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
347 <strong>already has a hold</strong> on this item
350 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
351 <li> <strong>No items are available</strong> to be placed on hold</li>
354 [% IF ( biblioloo.alreadyres ) %]
357 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
363 [% END # /FOREACH biblioloo %]
364 </table> <!-- /#requesttitles -->
368 [% ELSIF NOT ( noitems || nobiblio ) # /UNLESS patron %]
370 [% IF ( checked_previously && !multi_hold ) %]
371 <div class="dialog alert">
373 <li>Patron has previously checked out this title</li>
378 [% IF ( no_reserves_allowed || exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted ) %]
379 <div class="dialog alert">
381 [% UNLESS ( multi_hold ) %]
382 <h3>Cannot place hold</h3>
384 [% IF ( no_reserves_allowed ) %]
385 <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>
386 [% ELSIF ( exceeded_maxreserves ) %]
387 <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>
388 [% ELSIF ( exceeded_holds_per_record ) %]
389 <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>
390 [% ELSIF ( alreadypossession ) %]
391 <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>
392 [% ELSIF ( alreadyreserved ) %]
393 <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>
394 [% ELSIF ( ageRestricted ) %]
395 <li><strong>Age restricted</strong></li>
396 [% ELSIF ( none_available ) %]
397 <li> <strong>No items are available</strong> to be placed on hold.</li>
398 [% ELSIF ( maxreserves ) %]
399 <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> has too many holds.</li>
400 [% END # /IF exceeded_maxreserves %]
402 [% ELSE # UNLESS multi_hold %]
403 <h3>Cannot place hold on some items</h3>
404 [% IF (no_reserves_allowed ) %]
405 <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>
406 [% ELSIF ( exceeded_maxreserves ) %]
407 <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>
408 [% ELSIF ( exceeded_holds_per_record ) %]
409 [% FOREACH biblioloo IN biblioloop %]
410 [% IF (biblioloo.tooManyHoldsForThisRecord) %]
411 <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>
414 [% END # /IF exceeded_maxreserves %]
415 [% END # /UNLESS multi_hold %]
417 [% END # /IF ( exceeded_maxreserves || ... %]
419 [% IF ( patron.is_expired || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
420 <div class="dialog message">
422 [% IF ( patron.is_expired ) %]
423 <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>
426 [% IF patron.is_debarred %]
427 <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>
430 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
431 <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>
434 [% IF ( diffbranch ) %]
435 <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>
437 </ul> <!-- /.dialog.message -->
439 [% END # /IF patron.is_expired || diffbranch ... %]
441 [% IF ( messageborrower ) %]
442 <div class="dialog alert">
443 <h3>Patron not found:</h3>
444 <p>Name or barcode not found. Please try an other </p>
448 <div class="dialog alert hide holdalert">
451 <fieldset class="rows">
452 <legend>Hold details</legend>
453 <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
455 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
456 <input type="hidden" name="type" value="str8" />
458 [% FOREACH biblionumber IN biblionumbers %]
459 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
461 [% IF ( multi_hold ) %]
462 <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
463 <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
464 <input type="hidden" name="request" value="any"/>
465 [% FOREACH biblioloo IN biblioloop %]
466 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
467 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
470 <input type="hidden" name="title" value="[% biblio.title | html %]" />
471 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
472 [% END # /IF multi_hold %]
476 <span class="label">Patron:</span>
477 [% IF ( patron.borrowernumber ) %]
478 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a>
484 [% UNLESS ( multi_hold ) %]
486 <span class="label">Estimated priority:</span>
487 <strong>[% fixedRank | html %]</strong>
492 <label for="holdnotes">Notes:</label>
493 <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
496 <label for="pickup">Pickup at:</label>
497 [% UNLESS ( multi_hold ) %]
498 <select name="pickup" id="pickup"
499 data-biblio-id="[% biblio.biblionumber | html %]"
500 data-patron-id="[% patron.borrowernumber | html %]"
501 data-pickup-location-source="biblio">
502 [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
504 <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
505 <option value="" selected="selected"></option>
506 [% FOREACH pickup_location IN multi_pickup_locations %]
507 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
513 [% UNLESS ( multi_hold ) %]
514 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
516 <label for="itemtype">Request specific item type:</label>
517 <select name="itemtype" id="itemtype">
518 <option value="">Any item type</option>
519 [%- FOREACH itemtype IN available_itemtypes %]
520 <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
525 [% END # /UNLESS multi_hold %]
527 [% IF ( reserve_in_future ) %]
529 <label for="from">Hold starts on date:</label>
530 <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" data-date_to="expiration_date" class="flatpickr" data-flatpickr-futuredate="true" />
535 <label for="to">Hold expires on date:</label>
536 <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
539 [% UNLESS ( multi_hold ) %]
541 <label for="requestany">Hold next available item </label>
542 [% IF force_hold_level == 'item' %]
543 <input type="checkbox" id="requestany" name="request" disabled="true" />
544 [% ELSIF force_hold_level == 'record' %]
545 <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
546 <input type="hidden" name="request" value="Any"/>
548 <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
550 <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
553 [% IF remaining_holds_for_record > 1 %]
555 <label for="holds_to_place_count">Holds to place (count)</label>
556 <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" />
559 <input type="hidden" name="holds_to_place_count" value="1" />
561 [% END # /UNLESS multi_hold %]
563 <li id="non_priority_list_item">
564 <label for="non_priority">Non priority hold:</label>
565 <input name="non_priority" id="non_priority" type="checkbox" />
566 <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
570 [% UNLESS ( multi_hold ) %]
571 <fieldset class="action">
572 [% IF ( patron.borrowernumber ) %]
573 [% IF ( override_required ) %]
574 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
575 [% ELSIF ( none_available ) %]
576 <button type="submit" disabled="disabled" class="btn btn-default btn-disabled">Place hold</button>
578 <button type="submit" class="btn btn-default">Place hold</button>
583 [% biblio = biblioloop.0 %]
586 [% UNLESS Koha.Preference('item-level_itypes') %]
588 <span class="label">Item typeX:</span>
589 [% biblio.itemtype.translated_description | html %]
593 [% IF ( biblio.biblioitem.publicationyear ) %]
595 <span class="label">Publication year:</span>
596 [% biblio.biblioitem.publicationyear | $KohaDates %]
601 <h2 style="padding: 0 1em;">
602 Place a hold on a specific item
603 [% IF force_hold_level == 'item' %]
604 <span class="error"><em>(Required)</em></span>
608 <table id="requestspecific">
612 [% IF Koha.Preference('item-level_itypes') %]
616 <th>Home library</th>
617 <th>Last location</th>
618 [% IF itemdata_ccode %]
623 [% IF itemdata_enumchron %]
627 <th>Allowed pickup locations</th>
631 [% SET selected = 0 %]
632 [% FOREACH itemloo IN biblio.itemloop %]
633 [% UNLESS ( itemloo.hide ) %]
634 <tr class="[% itemloo.backgroundcolor | html %]">
636 [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
638 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
639 Hold must be record level
641 [% ELSIF ( itemloo.available ) %]
642 <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
643 [% ELSIF ( itemloo.override ) %]
644 <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
645 <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
648 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
649 [% IF itemloo.not_holdable %]
650 [% IF itemloo.not_holdable == 'damaged' %]
652 [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
654 [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
655 Exceeded max holds per record
656 [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
657 Daily hold limit reached for patron
658 [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
660 [% ELSIF itemloo.not_holdable == 'notReservable' %]
662 [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
663 Patron is from different library
664 [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
665 Cannot place hold from patron's library
666 [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
667 Patron already has hold for this item
668 [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
669 Cannot be transferred to pickup library
670 [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
671 Only pickup locations within the same hold group are allowed
672 [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
673 No reserves are allowed on this item
674 [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %]
675 Library is not a pickup location
676 [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
677 No valid pickup location
679 [% itemloo.not_holdable | html %]
683 [% END # /IF force_hold_level %]
685 [% IF Koha.Preference('item-level_itypes') %]
687 [% UNLESS ( noItemTypeImages ) %]
688 [% IF ( itemloo.itemtype.image_location) %]<img src="[% itemloo.itemtype.image_location | html %]" alt="" /> <br /> [% END %]
690 [% itemloo.itemtype.translated_description | html %]
694 [% itemloo.barcode | html %]
697 [% Branches.GetName( itemloo.homebranch ) | html %]
700 [% Branches.GetName( itemloo.holdingbranch ) | html %]
702 [% IF itemdata_ccode %]
704 [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
708 [% itemloo.itemcallnumber | html %]
711 [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %]
713 [% IF itemdata_enumchron %]
715 [% itemloo.enumchron | html %]
718 [% IF ( itemloo.onloan ) %]
719 <td data-order="[% itemloo.date_due | html %]">
720 <span class="checkedout">Due [% itemloo.date_due | $KohaDates as_due_date => 1 %]</span>
723 [% IF ( itemloo.transfertwhen ) %]
724 In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
725 to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %]
729 [% IF ( itemloo.reservedate ) %]
730 [% IF ( itemloo.nocancel ) %]
731 Can't be cancelled when item is in transit
733 [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %]
734 [% IF ( itemloo.canreservefromotherbranches ) %]
735 for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedFor.borrowernumber | uri %]">[% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %]</a>
737 [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %]
738 [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since
739 [% IF ( itemloo.waitingdate ) %]
740 [% itemloo.waitingdate | $KohaDates %]
742 [% IF ( itemloo.reservedate ) %]
743 [% itemloo.reservedate | html %]
746 <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
747 [% END # /IF itemloo.nocancel %]
750 [% END # /IF itemloo.reservedate %]
752 [% IF itemloo.item_level_holds == "N" %]
753 <br/>Item level hold not allowed from OPAC
754 [% ELSIF itemloo.item_level_holds == "F" %]
755 <br/>Item level hold forced from OPAC
758 [% IF ( itemloo.itemlost ) %]
759 <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
762 [% IF ( itemloo.damaged ) %]
763 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
766 [% IF ( itemloo.withdrawn ) %]
767 <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
770 [% IF ( itemloo.notforloan ) %]
771 <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
775 [% IF (itemloo.pickup_locations_count > 0) %]
776 <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations" style="width:100%;"
777 data-item-id="[% itemloo.itemnumber | html %]"
778 data-patron-id="[% patron.borrowernumber | html %]"
779 data-pickup-location-source="item">
780 [% IF (itemloo.default_pickup_location) %]
781 <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option>
787 [% END # / UNLESS itemloo.hide %]
788 [% END # /FOREACH itemloo %]
790 </table> <!-- /#requestspecific -->
794 <p class="hiddencount">
795 <a href="request.pl?biblionumber=[% biblio.biblionumber | uri %]&borrowernumber=[% borrowernumber | uri %]&showallitems=1">Show all items ([% biblio.hiddencount | html %] hidden)</a>
798 [% END # /IF hiddencount %]
800 [% ELSE # /UNLESS multi_hold %]
802 <table id="requesttitles">
806 [% UNLESS Koha.Preference('item-level_itypes') %]
811 <th>Pickup location</th>
813 [% FOREACH biblioloo IN biblioloop %]
814 [% IF ( biblioloo.warn ) %]
820 [% UNLESS ( biblioloo.warn ) %]
821 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
827 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
828 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
830 [% IF ( biblioloo.publicationyear ) %]
832 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
836 [% IF ( biblioloo.warn ) %]
837 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
840 [% UNLESS Koha.Preference('item-level_itypes') %]
842 <img src="[% biblioloo.itemtype.image_location | html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
845 <td>[% biblioloo.rank | html %]</td>
847 [% IF ( biblioloo.checked_previously ) %]
848 <span>Patron has previously checked out this title</span><br/>
850 [% IF ( biblioloo.alreadyres ) %]
853 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
858 [% IF ( biblioloo.alreadyres ) %]
860 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
861 <strong>already has a hold</strong> on this item
864 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
865 <li> <strong>No items are available</strong> to be placed on hold</li>
868 [% IF ( biblioloo.alreadyres ) %]
871 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
877 [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %]
878 <select name="pickup_[% biblioloo.biblionumber | html %]"
879 class="multi_pickup_select"
880 data-biblio-id="[% biblioloo.biblionumber | html %]"
881 data-patron-id="[% patron.borrowernumber | html %]"
882 data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
883 <option value=""></option>
884 [% FOREACH pickup_location IN biblioloo.pickup_locations %]
885 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
891 [% END # /FOREACH biblioloo %]
892 </table> <!-- /#requesttitles -->
894 [% END # /UNLESS multi_hold %]
896 <fieldset class="action">
897 [% IF ( patron AND patron.borrowernumber ) %]
898 [% IF ( override_required ) %]
899 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
900 [% ELSIF ( none_available ) %]
901 <button class="btn btn-default" type="submit">Place holds</button>
903 [% IF ( multi_hold ) %]
904 <button type="submit" class="btn btn-default" id="multi_hold_submit">Place holds</button>
906 <button type="submit" class="btn btn-default">Place hold</button>
909 [% END # /IF patron %]
910 </fieldset> <!-- /.action -->
911 </form> <!-- /#hold-request-form -->
912 </fieldset> <!-- /.rows -->
915 [% UNLESS ( patron ) %]
916 [% UNLESS borrowers %]
917 [% SET hold_count = Biblio.HoldsCount( biblio.biblionumber ) | html %]
919 <label for ="always_show_holds">Always show holds</label>
920 [% IF always_show_holds == 'DONT' %]
921 <input type="checkbox" name="always_show_holds" id="always_show_holds" value="DO">
922 [% UNLESS reserveloop %]
923 <a class="btn btn-default" value="Show holds" id="show_holds_now" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber | uri %]&show_holds_now=1">Show holds ([% hold_count | html %])</a>
926 <input type="checkbox" name="always_show_holds" value="DO" id="always_show_holds" checked="checked">
930 [% IF ( reserveloop ) %]
931 <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
932 [% IF ( multi_hold ) %]
933 [% FOREACH biblionumber IN biblionumbers %]
934 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
939 <div class="dialog message">
940 <p>The job has been enqueued! It will be processed as soon as possible.</p>
941 <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>
945 <h2>Existing holds</h2>
946 <div id="toolbar" class="btn-toolbar">
947 <input type="submit" name="submit" value="Update hold(s)" /> <button class="cancel_selected_holds" data-bulk="true"></button>
948 <fieldset id="cancellation-reason-fieldset" class="action">
949 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
950 [% IF hold_cancellation %]
951 <label for="cancellation-reason">Cancellation reason: </label>
952 <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
953 <option value="">No reason given</option>
954 [% FOREACH reason IN hold_cancellation %]
955 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
962 [% FOREACH biblioloo IN biblioloop %]
963 [% IF ( biblioloo.reserveloop ) %]
964 <div class="hold_title" id="hold_title_[% biblioloo.biblionumber | html %]">
965 [% IF ( multi_hold ) %]
967 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
968 [% biblioloo.title | html %]
969 </a> <span class="number_box"><span>[% biblioloo.reserveloop.size | html %] [% tn('Hold', 'Holds', biblioloo.reserveloop.size) | $raw %]</span></span>
973 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
975 [% SET branchcodes = [] %]
977 [% FOREACH h IN biblioloo.reserveloop %]
978 [% branchcodes.push( h.branchcode ) %]
980 [% branchcodes = branchcodes.unique %]
981 [% IF ( branchcodes.empty ) %]
983 There are no holds on this title.
987 [% FOREACH b IN branchcodes.sort %]
988 [% SET holds_by_branch = [] %]
989 [% FOREACH h IN biblioloo.reserveloop %]
990 [% IF h.branchcode == b %]
991 [% holds_by_branch.push( h ) %]
994 <div class="holds_by_library">
995 <h4>[% Branches.GetName( b ) | html %]</h4>
997 [% INCLUDE holds_table.inc holds=holds_by_branch %]
999 [% END # /FOREACh b %]
1000 [% END # /IF ( branchcodes.empty ) %]
1002 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
1004 [% SET itemtypes = [] %]
1006 [% FOREACH h IN biblioloo.reserveloop %]
1007 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1008 [% itemtypes.push( hold_itemtype ) %]
1010 [% itemtypes = itemtypes.unique %]
1011 [% IF ( itemtypes.empty ) %]
1013 There are no holds on this title.
1017 [% FOREACH i IN itemtypes.sort %]
1018 [% SET holds_by_itemtype = [] %]
1019 [% FOREACH h IN biblioloo.reserveloop %]
1020 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1021 [% IF hold_itemtype == i %]
1022 [% holds_by_itemtype.push( h ) %]
1026 <div class="holds_by_itemtype">
1028 <h4>[% ItemTypes.GetDescription( i ) | html %]</h4>
1030 <h4>Any item type</h4>
1032 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1034 [% END # /FOREACH i %]
1035 [% END # /IF ( itemtypes.empty ) %]
1037 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
1038 [% SET branchcodes = [] %]
1040 [% FOREACH h IN biblioloo.reserveloop %]
1041 [% branchcodes.push( h.branchcode ) %]
1043 [% branchcodes = branchcodes.unique %]
1044 [% IF ( branchcodes.empty ) %]
1046 There are no holds on this title.
1050 [% FOREACH b IN branchcodes.sort %]
1051 <div class="holds_by_library">
1052 <h4 class="library_holds">[% Branches.GetName( b ) | html %]</h4>
1053 [% SET holds_by_branch = [] %]
1054 [% FOREACH h IN biblioloo.reserveloop %]
1055 [% IF h.branchcode == b %]
1056 [% holds_by_branch.push( h ) %]
1060 [% SET itemtypes = [] %]
1061 [% FOREACH h IN holds_by_branch %]
1062 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1063 [% itemtypes.push( hold_itemtype ) %]
1065 [% itemtypes = itemtypes.unique %]
1067 [% FOREACH i IN itemtypes.sort %]
1068 <div class="holds_by_itemtype">
1069 <h5 class="itemtype_holds">
1071 [% ItemTypes.GetDescription( i ) | html %]
1077 [% SET holds_by_itemtype = [] %]
1078 [% FOREACH h IN holds_by_branch %]
1079 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1080 [% IF hold_itemtype == i %]
1081 [% holds_by_itemtype.push( h ) %]
1084 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1085 </div> <!-- /.holds_by_itemtype -->
1087 </div> <!-- /.holds_by_library -->
1088 [% END # /FOREACH b %]
1089 [% END # /IF ( branchcodes.empty ) %]
1093 [% IF ( biblioloo.reserveloop.size ) %]
1094 [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
1097 There are no holds on this title.
1101 [% END # /IF HoldsSplitQueue %]
1102 </div> <!-- /hold_title -->
1103 [% END # /IF biblioloo.reserveloop %]
1104 [% END # FOREACH biblioloo %]
1105 </form> <!-- /#existing_holds -->
1106 [% END # IF reserveloop %]
1107 [% END # UNLESS patron %]
1111 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
1112 </div> <!-- /.col-md-10.col-md-offset-1 -->
1114 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1115 <div class="col-sm-2 col-sm-pull-10">
1117 [% INCLUDE 'biblio-view-menu.inc' %]
1119 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1121 </div> <!-- /.row -->
1123 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
1124 <div class="modal-dialog" role="document">
1125 <div class="modal-content">
1126 <div class="modal-header">
1127 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1128 <h3>Confirm deletion</h3>
1131 <div class="modal-body">
1132 <p>Are you sure you want to cancel this hold?</p>
1134 <fieldset class="action">
1135 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1136 [% IF hold_cancellation %]
1137 <label for="cancellation-reason">Cancellation reason: </label>
1138 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
1139 <option value="">No reason given</option>
1140 [% FOREACH reason IN hold_cancellation %]
1141 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1148 <div class="modal-footer">
1149 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
1150 <a href="#" data-dismiss="modal">Cancel</a>
1156 [% MACRO jsinclude BLOCK %]
1157 [% INCLUDE 'datatables.inc' %]
1158 [% INCLUDE 'calendar.inc' %]
1159 [% INCLUDE 'columns_settings.inc' %]
1160 [% Asset.js("lib/hc-sticky.js") | $raw %]
1161 [% INCLUDE 'select2.inc' %]
1162 [% Asset.js("js/holds.js") | $raw%]
1165 var biblionumbers = [[% biblionumbers.join(', ') | $raw %]];
1166 var borrowernumber = "[% patron.borrowernumber | $raw %]";
1167 var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1168 var override_items = {[% FOREACH biblio IN biblioloop %][% FOREACH itemloo IN biblio.itemloop %][% IF ( itemloo.override ) %]
1169 [% itemloo.itemnumber | html %]: {
1170 homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1171 holdallowed: "[% itemloo.holdallowed | html %]"
1173 [% END %][% END %][% END %]
1176 damaged: _("Item damaged"),
1177 ageRestricted: _("Age restricted"),
1178 tooManyHoldsForThisRecord: _("Exceeded max holds per record"),
1179 tooManyReservesToday: _("Daily hold limit reached for patron"),
1180 tooManyReserves: _("Too many holds"),
1181 notReservable: _("Not holdable"),
1182 noReservesAllowed: _("No reserves allowed"),
1183 cannotReserveFromOtherBranches: _("Patron is from different library"),
1184 itemAlreadyOnHold: _("Patron already has hold for this item"),
1185 cannotBeTransferred: _("Cannot be transferred to pickup library"),
1186 pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed")
1189 var MSG_CANCEL_SELECTED = _("Cancel selected (%s)");
1190 columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
1191 $.fn.select2.defaults.set("width", "100%" );
1192 $.fn.select2.defaults.set("dropdownAutoWidth", true );
1194 $(document).ready(function() {
1195 $('#cancellation-reason-fieldset').hide();
1196 $('.rank-request').on('change', function() {
1197 if ( $(".rank-request option:selected[value='del']").length ) {
1198 $('#cancellation-reason-fieldset').show();
1200 $('#cancellation-reason-fieldset').hide();
1204 [% SET active = clubs ? 1 : 0 %]
1205 $('#circ_holds_select').tabs({
1206 active: [% active | $raw %],
1207 activate: function(){
1208 $(this).find("input.focus").focus();
1211 $(this).find("input.focus").focus();
1214 function ToggleHoldsToPlace() {
1215 if ( $("#requestany").prop('checked') ) {
1216 $("#holds_to_place_count").prop('disabled', false);
1218 $("#holds_to_place_count").prop('disabled', true);
1221 ToggleHoldsToPlace();
1222 $("#requestany").on('change', function(){
1223 ToggleHoldsToPlace();
1226 [% IF Koha.Preference('UseBranchTransferLimits') %]
1227 $("#pickup").on('change', function(){
1228 var pickup = $("#pickup").val();
1229 var url = "?pickup=" + pickup;
1230 url += "&borrowernumber=" + borrowernumber;
1231 url += "&biblionumber=" + biblionumbers[0];
1232 window.location.replace(url);
1236 var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1238 "sDom": '<"top pager"ilf>t',
1241 //Override fieldset styling for dataTables search box
1242 $("div.top.pager").css("margin-left","1em");
1243 $(".dataTables_filter label").css({
1245 "margin-right":"0em"
1248 $("#club-request-form").on("submit", function() {
1250 $('.clubalert, .holdalert').addClass('hide');
1252 pickup_library_id: $('select[name="pickup"]').val()
1254 if($('input[name="checkitem"]:checked').length)
1255 data.item_id = $('input[name="checkitem"]:checked').val();
1256 if($('input[name="borrowernumber"]').length)
1257 data.patron_id = $('input[name="borrowernumber"]').val();
1258 if($('textarea[name="notes"]').length)
1259 data.notes = $('textarea[name="notes"]').val()||null;
1260 if($('input[name="itemtype"]').length) {
1261 data.item_type = $('input[name="itemtype"]').val()||null;
1263 if($('input[name="default_patron_home"]:checked').length) {
1264 data.default_patron_home = 1;
1267 const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1;
1268 var newloc = 'request.pl?';
1269 biblionumbers.forEach(function (biblionumber) {
1270 newloc += '&biblionumber=' + biblionumber;
1273 biblionumbers.forEach(function(biblionumber) {
1274 data.biblio_id = biblionumber;
1276 url: $t.attr('action'),
1277 method: $t.attr('method').toUpperCase(),
1278 contentType: 'application/json',
1279 data: JSON.stringify(data)
1281 for(let i = 0; i < count; i++) {
1283 .then(function(result) {
1284 document.location = newloc;
1286 .fail(function(err) {
1287 var message = err.responseJSON.error;
1288 var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/);
1289 if(match && ERROR_MAP[match[1]]) {
1290 message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>'
1292 $('.clubalert, .holdalert').removeClass('hide').html(message);
1300 [% UNLESS ( multi_hold ) %]
1301 $("#hold-request-form").on("submit", function(){
1302 return check($(this));
1305 $("#hold-request-form").on("submit", function(){
1306 return checkMultiHold();
1310 $(".pickup_location_dropdown").each( function () {
1311 $(this).pickup_locations_dropdown();
1314 $("#pickup_multi").select2({
1319 $('.multi_pickup_select').select2({
1324 $("#pickup_multi").on("change", function() {
1325 var selection = $(this).val();
1326 if ( selection != '' ) {
1327 $(".multi_pickup_select").each(function() {
1328 var valid_pickup_locations = $(this).data('pickup-locations');
1329 if ( valid_pickup_locations.includes(selection) ) {
1330 $(this).val(selection);
1331 $(this).trigger("change");
1337 $("#pickup").each( function () {
1338 $(this).pickup_locations_dropdown();
1341 $(".pickup_locations").each(function () {
1342 $(this).pickup_locations_dropdown();
1346 function check( table ) {
1350 if ( $("#requestany").attr("checked") !== "checked" ) {
1351 // requestany not selected, go through the item-specific cases
1352 if ( $('input[type="radio"]:checked').length > 0 ) {
1353 // got item-specific hold requests in the form!
1354 // verify they have a pickup location selected
1356 if (table.find('input[type="radio"]:checked')
1358 .find(".pickup_locations").val() === null) {
1360 msg = _("- Please select a pickup location for the item" + "\n")
1364 msg = (_("- Please select an item to place a hold") + "\n");
1369 $('#hold-request-form').preventDoubleFormSubmit();
1377 function checkMultiHold() {
1379 var selected_bibs = $(".multi_hold_item_checkbox:checked");
1380 if ( selected_bibs.length > 0 ) {
1381 // there are biblios selected in the form!
1382 // verify they have a pickup location selected
1384 var pickup_not_set = 0;
1385 selected_bibs.each(function() {
1386 if ( $(this).closest('tr').find(".multi_pickup_select").val() === "" ) {
1390 var bibnum = $(this).attr("title");
1393 if ( pickup_not_set > 0 ) {
1394 alert( _("Please make sure all selected titles have a pickup location set" + "\n") );
1399 alert( _("Please select at least one title" + "\n") );
1403 var badSpans = $(".not_holdable");
1405 $(badSpans).each(function() {
1406 var bibnum = $(this).attr("title");
1407 badBibs += bibnum + "/";
1410 $("#bad_bibs").val(badBibs);
1412 $('#hold-request-form').preventDoubleFormSubmit();
1417 $(document).ready(function() {
1419 $("#always_show_holds").change(function(){
1420 if( $(this).prop('checked') ){
1421 document.cookie = 'always_show_holds=DO';
1423 document.cookie = 'always_show_holds=DONT';
1426 $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1427 var itemnumber = this.value;
1430 switch (override_items[itemnumber].holdallowed) {
1431 case "not_allowed": msg = _("This item normally cannot be put on hold."); break;
1432 case "from_home_library": msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
1435 msg += "\n\n" + _("Place hold on this item?");
1437 return confirm(msg);
1439 $("button.warning").click(function() {
1440 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1442 $("#requestany").click(function() {
1444 $("input[name=checkitem]").each(function() {
1445 $(this).prop("checked", false);
1449 $("input[name=checkitem]").click(function() {
1451 $("input[name=checkitem]").each(function() {
1456 if(onechecked == 1){
1457 $("#requestany").prop("checked", false);
1458 $("#holds_to_place_count").prop('disabled', true);
1460 $("#requestany").prop("checked",true);
1461 $("#holds_to_place_count").prop('disabled', false);
1464 var prev_rank_request;
1465 $("select[name=rank-request]").on("focus", function() {
1466 prev_rank_request = $(this).val();
1467 var row = $(this).parents("tr:first");
1468 }).change(function() {
1469 var row = $(this).parents("tr:first");
1470 var value = parseInt($(this).val());
1471 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
1472 if( !isNaN(value) ) { //If moved to 'del'
1473 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)
1474 if (prev_rank_request > value) {
1475 row.insertBefore(after);
1477 row.insertAfter(after);
1481 var next_priority = 1;
1482 $("select[name=rank-request]").each(function () {
1483 if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
1484 $(this).val(next_priority);
1489 $(".clear-date").on("click",function(e){
1491 var fieldID = this.id.replace("clear-date-","");
1492 $("#" + fieldID).val("");
1495 // Confirm cancellation of hold
1497 $(".cancel-hold").on("click",function(e) {
1499 cancel_link = $(this);
1500 $('#cancelModal').modal();
1503 $("#cancelModalConfirmBtn").on("click",function(e) {
1505 if(cancel_link.data('bulk')) {
1506 [% SET data_url = 'biblionumber=' _ biblionumbers.join('&biblionumber=') %]
1507 link = `request.pl?[% data_url | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1509 let borrowernumber = cancel_link.data('borrowernumber');
1510 let biblionumber = cancel_link.data('biblionumber');
1511 let reserve_id = cancel_link.data('id');
1512 link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`;
1514 let reason = $("#modal-cancellation-reason").val();
1516 link += "&cancellation-reason=" + reason
1518 window.location.href = link;
1522 Sticky = $("#toolbar");
1524 stickTo: "#existing_holds",
1525 stickyClass: "floating"
1528 if(!localStorage.selectedHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) {
1529 localStorage.selectedHolds = [];
1532 $('.holds_table .select_hold').each(function() {
1533 if(localStorage.selectedHolds.includes($(this).data('id'))) {
1534 $(this).prop('checked', true);
1538 $('.holds_table .select_hold_all').each(function() {
1539 var table = $(this).parents('.holds_table');
1540 var count = $('.select_hold:not(:checked)', table).length;
1541 $('.select_hold_all', table).prop('checked', !count);
1544 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1546 $('.holds_table .select_hold_all').click(function() {
1547 var table = $(this).parents('.holds_table');
1548 var count = $('.select_hold:checked', table).length;
1549 $('.select_hold', table).prop('checked', !count);
1550 $(this).prop('checked', !count);
1551 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1552 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1555 $('.holds_table .select_hold').click(function() {
1556 var table = $(this).parents('.holds_table');
1557 var count = $('.select_hold:not(:checked)', table).length;
1558 $('.select_hold_all', table).prop('checked', !count);
1559 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1560 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1563 $('.cancel_selected_holds').click(function(e) {
1565 if($('.holds_table .select_hold:checked').length) {
1566 cancel_link = $(this);
1567 delete localStorage.selectedHolds;
1568 $('#cancelModal').modal();
1573 [% FOREACH biblionumber IN biblionumbers %]
1574 [% SET url_biblio_params = url_biblio_params _ "&biblionumber=" _ biblionumber %]
1577 [% SET url_biblio_params = url_biblio_params _ "&multi_hold=1" %]
1580 dtMemberResults = KohaTable("table_borrowers", {
1581 'bServerSide': true,
1582 'sAjaxSource': "/cgi-bin/koha/svc/members/search",
1583 'fnServerData': function(sSource, aoData, fnCallback) {
1588 'name': 'searchmember',
1589 'value': $("#patron").val()
1591 'name': 'template_path',
1592 'value': 'reserve/tables/members_results.tt',
1599 'success': function(json){
1600 // redirect if there is only 1 result.
1601 if ( json.iTotalDisplayRecords == 1 ) {
1602 var borrowernumber = json.aaData[0].borrowernumber;
1603 document.location.href = '/cgi-bin/koha/reserve/request.pl?borrowernumber=' + borrowernumber + "[% url_biblio_params %]"
1610 'fnDrawCallback': function (oSettings) {
1611 var data = this.fnGetData();
1612 $.each($(this).find("tbody tr"), function(index, tr) {
1613 let url = '/cgi-bin/koha/reserve/request.pl?borrowernumber=' + data[index].borrowernumber + "[% url_biblio_params %]"
1614 $(tr).off('click').on('click', function() {
1615 document.location.href = url;
1616 }).addClass('clickable');
1617 $(tr).find("a.patron_preview").attr('href', url);
1621 { 'mDataProp': 'dt_name' },
1622 { 'mDataProp': 'dt_address' },
1623 { 'mDataProp': 'dt_cardnumber' },
1624 { 'mDataProp': 'dt_dateofbirth' },
1625 { 'mDataProp': 'dt_category' },
1626 { 'mDataProp': 'dt_branch' },
1627 { 'mDataProp': 'dt_phone' },
1630 'bAutoWidth': false,
1631 'sPaginationType': 'full_numbers',
1633 }, columns_settings_borrowers_table );
1634 $("#table_borrowers_wrapper").hide();
1638 $("#table_borrowers").show();
1639 $("#table_borrowers_wrapper").show();
1640 dtMemberResults.fnDraw();
1643 $("#holds_patronsearch").on("submit", filter);
1646 $('.printholdslip').click(function(){
1647 var reserve_id = $(this).attr('data-reserve_id');
1648 window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
1654 [% INCLUDE 'intranet-bottom.inc' %]