11 [% USE AuthorisedValues %]
13 [% USE TablesSettings %]
14 [% PROCESS 'i18n.inc' %]
15 [% SET footerjs = 1 %]
16 [% INCLUDE 'doc-head-open.inc' %]
17 [% SET libraries = Branches.all %]
18 [% SET categories = Categories.all.unblessed %]
19 [% SET columns = ['name', 'cardnumber', 'dateofbirth', 'category', 'branch', 'address', 'phone'] %]
20 [% PROCESS "patron-search.inc" %]
21 [% UNLESS ( multi_hold ) %]
22 <title>Place a hold on [% INCLUDE 'biblio-title-head.inc' %] › Holds › Circulation › Koha</title>
24 <title>Confirm holds › Holds › Circulation › Koha</title>
26 [% INCLUDE 'doc-head-close.inc' %]
27 [% Asset.css("css/holds.css") | $raw %]
30 <body id="circ_request" class="catalog">
32 [% INCLUDE 'header.inc' %]
33 [% INCLUDE 'circ-search.inc' %]
35 [% UNLESS ( multi_hold ) %]
36 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
39 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
42 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
45 [% INCLUDE 'biblio-title.inc' link =1 %]
48 <a href="#" aria-current="page">
55 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
58 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
61 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
65 <a href="#" aria-current="page">
70 <a href="#" aria-current="page">
71 Search patrons or clubs
74 <a href="#" aria-current="page">
82 [% END # UNLESS multi_hold %]
84 <div class="main container-fluid">
86 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
87 <div class="col-md-10 col-md-offset-1">
89 <div class="col-sm-10 col-sm-push-2">
95 <div class="dialog alert">
97 <strong>Cannot place hold:</strong> one or more records don't exist.
99 <strong>Cannot place hold:</strong> this record doesn't exist.
104 <div class="dialog alert">
106 <strong>Cannot place hold:</strong> one or more records without items attached.
108 <strong>Cannot place hold:</strong> this record has no items attached.
113 [% IF ( messagetransfert ) %]
114 <div class="dialog message">
115 <h2>Hold found for ([% nextreservtitle | html %]), please transfer</h2>
116 <p>Hold placed by : <strong> [% nextreservsurname | html %] [% nextreservfirstname | html %]</strong> at : <strong> [% branchname | html %] </strong>, Please transfer this item.
118 <form name="cancelReservewithtransfert" action="branchreserves.pl" method="post">
119 <input type="submit" class="button" />
124 [% UNLESS ( multi_hold ) %]
125 <h1>Place a hold on [% INCLUDE 'biblio-title.inc' link = 1 %] [% IF biblio.author %] by [% biblio.author | html %][% END %]</h1>
132 Search patrons or clubs
140 [% UNLESS club OR patron OR patron.borrowernumber OR noitems OR nobiblio %]
141 [% IF ( messageborrower ) %]
142 <div class="dialog alert">
143 <h3>Patron not found</h3>
144 <p>No patron with this name, please, try another</p>
148 [% IF ( messageclub ) %]
149 <div class="dialog alert">
150 <h3>Club not found</h3>
151 <p>No club with this name, please, try another</p>
154 <fieldset class="brief">
155 [% UNLESS multi_hold %]
157 <label>Search patrons or clubs</label>
159 <label>Search patrons</label>
162 <div id="circ_holds_select" class="toptabs">
164 <li><a href="#holds_patronsearch_pane">Patrons</a></li>
166 <li><a href="#holds_clubsearch_pane">Clubs</a></li>
169 <div id="holds_patronsearch_pane">
170 [% PROCESS patron_search_filters_simple %]
172 [% PROCESS patron_search_table table_id => 'table_borrowers', open_on_row_click => 1 %]
175 <div id="holds_clubsearch_pane">
176 <form id="holds_clubsearch" action="request.pl" method="post">
177 <div class="hint">Enter club ID or partial name:</div>
178 <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" />
179 <input type="submit" value="Search" />
180 [% FOREACH biblionumber IN biblionumbers %]
181 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
184 </form> <!-- /#holds_patronsearch -->
186 [% INCLUDE 'clubs-table.inc' destination = "holds" %]
193 <div class="dialog alert hide clubalert">
195 <fieldset class="rows">
196 <legend>Hold details</legend>
197 <form action="/api/v1/clubs/[% club.id | html %]/holds" method="post" name="form" id="club-request-form">
199 [% IF ( multi_hold ) %]
200 <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
201 <input type="hidden" name="request" value="any"/>
202 [% FOREACH biblioloo IN biblioloop %]
203 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
204 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
207 <input type="hidden" name="title" value="[% biblio.title | html %]" />
208 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
209 [% END # /IF multi_hold %]
212 <span class="label">Club: </span> [% club.name | html %]
215 <span class="label">Description: </span> [% club.description | html %]
218 <label for="pickup">Pickup at:</label>
219 <select name="pickup" id="pickup_club">
220 [% PROCESS options_for_libraries libraries => Branches.all({ selected => club.branchcode, search_params => { pickup_location => 1 } }) %]
224 <label for="default_patron_home">Pickup at patron's home library when possible:</label>
225 <input type="checkbox" id="default_patron_home" name="default_patron_home"/>
228 <h2 style="padding: 0 1em;">Members</h2>
230 [% FOREACH member IN members %]
231 [% SET patron = member.patron %]
232 <li style="padding: 0.5em 1em;">
233 <div><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a></div>
234 [% IF member.exceeded_maxreserves %]
236 <i class="fa fa-error"></i>
237 <strong>Too many holds: </strong> Patron can only place a maximum of [% maxreserves | html %] total holds.
240 [% IF ( patron.is_expired ) %]
242 <i class="fa fa-warning"></i>
243 <strong>Account has expired</strong>
246 [% IF patron.is_debarred %]
248 <i class="fa fa-warning"></i>
249 <strong>Patron has restrictions</strong>
252 [% IF member.amount_outstanding && Koha.Preference('maxoutstanding') && member.amount_outstanding > Koha.Preference('maxoutstanding') %]
254 <i class="fa fa-warning"></i>
255 <strong>Patron has outstanding fines: [% member.amount_outstanding | $Price %]</strong>
259 [% IF ( member.diffbranch ) %]
261 <i class="fa fa-warning"></i>
262 <strong>Pickup library is different.</strong> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )
267 [% UNLESS ( multi_hold ) %]
268 <fieldset class="action">
269 <input type="submit" value="Place hold" />
272 <table id="requesttitles">
276 [% UNLESS Koha.Preference('item-level_itypes') %]
282 [% FOREACH biblioloo IN biblioloop %]
283 [% IF ( biblioloo.warn ) %]
289 [% UNLESS ( biblioloo.warn ) %]
290 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
296 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
297 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
299 [% IF ( biblioloo.publicationyear ) %]
301 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
305 [% IF ( biblioloo.warn ) %]
306 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
309 [% UNLESS Koha.Preference('item-level_itypes') %]
311 <img src="[% biblioloo.itemtype.image_location| html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
314 <td>[% biblioloo.rank | html %]</td>
316 [% IF ( biblioloo.checked_previously ) %]
317 <span>Patron has previously checked out this title</span><br/>
319 [% IF ( biblioloo.alreadyres ) %]
322 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
327 [% IF ( biblioloo.alreadyres ) %]
329 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
330 <strong>already has a hold</strong> on this item
333 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
334 <li> <strong>No items are available</strong> to be placed on hold</li>
337 [% IF ( biblioloo.alreadyres ) %]
340 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
346 [% END # /FOREACH biblioloo %]
347 </table> <!-- /#requesttitles -->
351 [% ELSIF NOT ( noitems || nobiblio ) # /UNLESS patron %]
353 [% IF ( checked_previously && !multi_hold ) %]
354 <div class="dialog alert">
356 <li>Patron has previously checked out this title</li>
361 [% IF ( no_reserves_allowed || exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted || recall ) %]
362 <div class="dialog alert">
364 [% UNLESS ( multi_hold ) %]
365 <h3>Cannot place hold</h3>
367 [% IF ( no_reserves_allowed ) %]
368 <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>
369 [% ELSIF ( exceeded_maxreserves ) %]
370 <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>
371 [% ELSIF ( exceeded_holds_per_record ) %]
372 <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>
373 [% ELSIF ( alreadypossession ) %]
374 <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>
375 [% ELSIF ( alreadyreserved ) %]
376 <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>
377 [% ELSIF ( ageRestricted ) %]
378 <li><strong>Age restricted</strong></li>
379 [% ELSIF ( none_available ) %]
380 <li> <strong>No items are available</strong> to be placed on hold.</li>
381 [% ELSIF ( maxreserves ) %]
382 <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>
383 [% ELSIF ( recall ) %]
384 <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a> has <strong>already placed a recall</strong> on this item.</li>
385 [% END # /IF exceeded_maxreserves %]
387 [% ELSE # UNLESS multi_hold %]
388 <h3>Cannot place hold on some items</h3>
389 [% IF (no_reserves_allowed ) %]
390 <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>
391 [% ELSIF ( exceeded_maxreserves ) %]
392 <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> can place [% new_reserves_allowed | html %] of the requested [% new_reserves_count | html %] holds for a maximum of [% maxreserves | html %] total holds.</li>
393 [% ELSIF ( exceeded_holds_per_record ) %]
394 [% FOREACH biblioloo IN biblioloop %]
395 [% IF (biblioloo.tooManyHoldsForThisRecord) %]
396 <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>
399 [% END # /IF exceeded_maxreserves %]
400 [% END # /UNLESS multi_hold %]
402 [% END # /IF ( exceeded_maxreserves || ... %]
404 [% IF ( patron.is_expired || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
405 <div class="dialog message">
407 [% IF ( patron.is_expired ) %]
408 <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>
411 [% IF patron.is_debarred %]
412 <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>
415 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
416 <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>
419 [% IF ( diffbranch ) %]
420 <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>
422 </ul> <!-- /.dialog.message -->
424 [% END # /IF patron.is_expired || diffbranch ... %]
426 [% IF ( messageborrower ) %]
427 <div class="dialog alert">
428 <h3>Patron not found:</h3>
429 <p>Name or barcode not found. Please try an other </p>
433 <div class="dialog alert hide holdalert">
436 <fieldset class="rows">
437 <legend>Hold details</legend>
438 <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
440 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
441 <input type="hidden" name="type" value="str8" />
443 [% FOREACH biblionumber IN biblionumbers %]
444 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
446 [% IF ( multi_hold ) %]
447 <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
448 <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
449 <input type="hidden" name="request" value="any"/>
450 [% FOREACH biblioloo IN biblioloop %]
451 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
452 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
455 <input type="hidden" name="title" value="[% biblio.title | html %]" />
456 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
457 [% END # /IF multi_hold %]
461 <span class="label">Patron:</span>
462 [% IF ( patron.borrowernumber ) %]
463 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a>
469 [% UNLESS ( multi_hold ) %]
471 <span class="label">Estimated priority:</span>
472 <strong>[% fixedRank | html %]</strong>
477 <label for="holdnotes">Notes:</label>
478 <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
481 <label for="pickup">Pickup at:</label>
482 [% UNLESS ( multi_hold ) %]
483 <select name="pickup" id="pickup"
484 data-biblio-id="[% biblio.biblionumber | html %]"
485 data-patron-id="[% patron.borrowernumber | html %]"
486 data-pickup-location-source="biblio">
487 [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
489 <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
490 <option value="" selected="selected"></option>
491 [% FOREACH pickup_location IN multi_pickup_locations %]
492 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
498 [% UNLESS ( multi_hold ) %]
499 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
501 <label for="itemtype">Request specific item type:</label>
502 <select name="itemtype" id="itemtype">
503 <option value="">Any item type</option>
504 [%- FOREACH itemtype IN available_itemtypes %]
505 <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
510 [% END # /UNLESS multi_hold %]
512 [% IF ( reserve_in_future ) %]
514 <label for="from">Hold starts on date:</label>
515 <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" data-date_to="expiration_date" class="flatpickr" data-flatpickr-futuredate="true" />
520 <label for="to">Hold expires on date:</label>
521 <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
524 [% UNLESS ( multi_hold ) %]
526 <label for="requestany">Hold next available item </label>
527 [% IF force_hold_level == 'item' %]
528 <input type="checkbox" id="requestany" name="request" disabled="true" />
529 [% ELSIF force_hold_level == 'record' %]
530 <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
531 <input type="hidden" name="request" value="Any"/>
533 <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
535 <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
538 [% IF remaining_holds_for_record > 1 %]
540 <label for="holds_to_place_count">Holds to place (count)</label>
541 <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" />
544 <input type="hidden" name="holds_to_place_count" value="1" />
546 [% END # /UNLESS multi_hold %]
548 <li id="non_priority_list_item">
549 <label for="non_priority">Non priority hold:</label>
550 <input name="non_priority" id="non_priority" type="checkbox" />
551 <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
555 [% UNLESS ( multi_hold ) %]
556 <fieldset class="action">
557 [% IF ( patron.borrowernumber ) %]
558 [% IF ( override_required ) %]
559 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
560 [% ELSIF ( none_available ) %]
561 <button type="submit" disabled="disabled" class="btn btn-default btn-disabled">Place hold</button>
563 <button type="submit" class="btn btn-default">Place hold</button>
568 [% biblio = biblioloop.0 %]
571 [% UNLESS Koha.Preference('item-level_itypes') %]
573 <span class="label">Item typeX:</span>
574 [% biblio.itemtype.translated_description | html %]
578 [% IF ( biblio.biblioitem.publicationyear ) %]
580 <span class="label">Publication year:</span>
581 [% biblio.biblioitem.publicationyear | $KohaDates %]
586 <h2 style="padding: 0 1em;">
587 Place a hold on a specific item
588 [% IF force_hold_level == 'item' %]
589 <span class="error"><em>(Required)</em></span>
593 <table id="requestspecific">
597 [% IF Koha.Preference('item-level_itypes') %]
601 <th>Home library</th>
602 <th>Last location</th>
603 [% IF itemdata_ccode %]
608 [% IF itemdata_enumchron %]
612 <th>Allowed pickup locations</th>
616 [% SET selected = 0 %]
617 [% FOREACH itemloo IN biblio.itemloop %]
618 [% UNLESS ( itemloo.hide ) %]
619 <tr class="[% itemloo.backgroundcolor | html %]">
621 [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
623 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
624 Hold must be record level
626 [% ELSIF ( itemloo.available ) %]
627 <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
628 [% ELSIF ( itemloo.override ) %]
629 <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
630 <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
633 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
634 [% IF itemloo.not_holdable %]
635 [% IF itemloo.not_holdable == 'damaged' %]
637 [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
639 [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
640 Exceeded max holds per record
641 [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
642 Daily hold limit reached for patron
643 [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
645 [% ELSIF itemloo.not_holdable == 'notReservable' %]
647 [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
648 Patron is from different library
649 [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
650 Cannot place hold from patron's library
651 [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
652 Patron already has hold for this item
653 [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
654 Cannot be transferred to pickup library
655 [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
656 Only pickup locations within the same hold group are allowed
657 [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
658 No reserves are allowed on this item
659 [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %]
660 Library is not a pickup location
661 [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
662 No valid pickup location
664 [% itemloo.not_holdable | html %]
668 [% END # /IF force_hold_level %]
670 [% IF Koha.Preference('item-level_itypes') %]
672 [% UNLESS ( noItemTypeImages ) %]
673 [% IF ( itemloo.itemtype.image_location) %]<img src="[% itemloo.itemtype.image_location | html %]" alt="" /> <br /> [% END %]
675 [% itemloo.itemtype.translated_description | html %]
679 [% itemloo.barcode | html %]
682 [% Branches.GetName( itemloo.homebranch ) | html %]
685 [% Branches.GetName( itemloo.holdingbranch ) | html %]
687 [% IF itemdata_ccode %]
689 [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
693 [% itemloo.itemcallnumber | html %]
696 [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %]
698 [% IF itemdata_enumchron %]
700 [% itemloo.enumchron | html %]
703 [% IF ( itemloo.onloan ) %]
704 <td data-order="[% itemloo.date_due | html %]">
705 <span class="checkedout">Due [% itemloo.date_due | $KohaDates as_due_date => 1 %]</span>
708 [% IF ( itemloo.transfertwhen ) %]
709 In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
710 to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %]
714 [% IF ( itemloo.reservedate ) %]
715 [% IF ( itemloo.nocancel ) %]
716 Can't be cancelled when item is in transit
718 [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %]
719 [% IF ( itemloo.canreservefromotherbranches ) %]
720 for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedFor.borrowernumber | uri %]">[% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %]</a>
722 [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %]
723 [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since
724 [% IF ( itemloo.waitingdate ) %]
725 [% itemloo.waitingdate | $KohaDates %]
727 [% IF ( itemloo.reservedate ) %]
728 [% itemloo.reservedate | html %]
731 <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
732 [% END # /IF itemloo.nocancel %]
735 [% END # /IF itemloo.reservedate %]
737 [% IF itemloo.item_level_holds == "N" %]
738 <br/>Item level hold not allowed from OPAC
739 [% ELSIF itemloo.item_level_holds == "F" %]
740 <br/>Item level hold forced from OPAC
743 [% IF ( itemloo.itemlost ) %]
744 <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
747 [% IF ( itemloo.damaged ) %]
748 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
751 [% IF ( itemloo.withdrawn ) %]
752 <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
755 [% IF ( itemloo.notforloan ) %]
756 <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
760 [% IF (itemloo.pickup_locations_count > 0) %]
761 <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations" style="width:100%;"
762 data-item-id="[% itemloo.itemnumber | html %]"
763 data-patron-id="[% patron.borrowernumber | html %]"
764 data-pickup-location-source="item">
765 [% IF (itemloo.default_pickup_location) %]
766 <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option>
772 [% END # / UNLESS itemloo.hide %]
773 [% END # /FOREACH itemloo %]
775 </table> <!-- /#requestspecific -->
779 <p class="hiddencount">
780 <a href="request.pl?biblionumber=[% biblio.biblionumber | uri %]&borrowernumber=[% borrowernumber | uri %]&showallitems=1">Show all items ([% biblio.hiddencount | html %] hidden)</a>
783 [% END # /IF hiddencount %]
785 [% ELSE # /UNLESS multi_hold %]
787 <table id="requesttitles">
791 [% UNLESS Koha.Preference('item-level_itypes') %]
796 <th>Pickup location</th>
798 [% FOREACH biblioloo IN biblioloop %]
799 [% IF ( biblioloo.warn ) %]
805 [% UNLESS ( biblioloo.warn ) %]
806 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
812 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
813 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
815 [% IF ( biblioloo.publicationyear ) %]
817 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
821 [% IF ( biblioloo.warn ) %]
822 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
825 [% UNLESS Koha.Preference('item-level_itypes') %]
827 <img src="[% biblioloo.itemtype.image_location | html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
830 <td>[% biblioloo.rank | html %]</td>
832 [% IF ( biblioloo.checked_previously ) %]
833 <span>Patron has previously checked out this title</span><br/>
835 [% IF ( biblioloo.alreadyres ) %]
838 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
843 [% IF ( biblioloo.alreadyres ) %]
845 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
846 <strong>already has a hold</strong> on this item
849 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
850 <li> <strong>No items are available</strong> to be placed on hold</li>
853 [% IF ( biblioloo.alreadyres ) %]
856 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
862 [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %]
863 <select name="pickup_[% biblioloo.biblionumber | html %]"
864 class="multi_pickup_select"
865 data-biblio-id="[% biblioloo.biblionumber | html %]"
866 data-patron-id="[% patron.borrowernumber | html %]"
867 data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
868 <option value=""></option>
869 [% FOREACH pickup_location IN biblioloo.pickup_locations %]
870 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
876 [% END # /FOREACH biblioloo %]
877 </table> <!-- /#requesttitles -->
879 [% END # /UNLESS multi_hold %]
881 <fieldset class="action">
882 [% IF ( patron AND patron.borrowernumber ) %]
883 [% IF ( override_required ) %]
884 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
885 [% ELSIF ( none_available ) %]
886 <button class="btn btn-default" type="submit">Place holds</button>
888 [% IF ( multi_hold ) %]
889 <button type="submit" class="btn btn-default" id="multi_hold_submit">Place holds</button>
891 <button type="submit" class="btn btn-default">Place hold</button>
894 [% END # /IF patron %]
895 </fieldset> <!-- /.action -->
896 </form> <!-- /#hold-request-form -->
897 </fieldset> <!-- /.rows -->
900 [% UNLESS ( patron ) %]
901 [% UNLESS borrowers %]
902 [% SET hold_count = Biblio.HoldsCount( biblio.biblionumber ) | html %]
904 <label for ="always_show_holds">Always show holds</label>
905 [% IF always_show_holds == 'DONT' %]
906 <input type="checkbox" name="always_show_holds" id="always_show_holds" value="DO">
907 [% UNLESS reserveloop %]
908 <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>
911 <input type="checkbox" name="always_show_holds" value="DO" id="always_show_holds" checked="checked">
915 [% IF ( reserveloop ) %]
916 <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
917 [% IF ( multi_hold ) %]
918 [% FOREACH biblionumber IN biblionumbers %]
919 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
924 <div class="dialog message">
925 <p>The job has been enqueued! It will be processed as soon as possible.</p>
926 <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>
930 <h2>Existing holds</h2>
931 <div id="toolbar" class="btn-toolbar">
932 <input type="submit" name="submit" value="Update hold(s)" /> <button class="cancel_selected_holds" data-bulk="true"></button>
933 <fieldset id="cancellation-reason-fieldset" class="action">
934 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
935 [% IF hold_cancellation %]
936 <label for="cancellation-reason">Cancellation reason: </label>
937 <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
938 <option value="">No reason given</option>
939 [% FOREACH reason IN hold_cancellation %]
940 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
947 [% FOREACH biblioloo IN biblioloop %]
948 [% IF ( biblioloo.reserveloop ) %]
949 <div class="hold_title" id="hold_title_[% biblioloo.biblionumber | html %]">
950 [% IF ( multi_hold ) %]
952 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
953 [% biblioloo.title | html %]
954 </a> <span class="number_box"><span>[% biblioloo.reserveloop.size | html %] [% tn('Hold', 'Holds', biblioloo.reserveloop.size) | $raw %]</span></span>
958 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
960 [% SET branchcodes = [] %]
962 [% FOREACH h IN biblioloo.reserveloop %]
963 [% branchcodes.push( h.branchcode ) %]
965 [% branchcodes = branchcodes.unique %]
966 [% IF ( branchcodes.empty ) %]
968 There are no holds on this title.
972 [% FOREACH b IN branchcodes.sort %]
973 [% SET holds_by_branch = [] %]
974 [% FOREACH h IN biblioloo.reserveloop %]
975 [% IF h.branchcode == b %]
976 [% holds_by_branch.push( h ) %]
979 <div class="holds_by_library">
980 <h4>[% Branches.GetName( b ) | html %]</h4>
982 [% INCLUDE holds_table.inc holds=holds_by_branch %]
984 [% END # /FOREACh b %]
985 [% END # /IF ( branchcodes.empty ) %]
987 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
989 [% SET itemtypes = [] %]
991 [% FOREACH h IN biblioloo.reserveloop %]
992 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
993 [% itemtypes.push( hold_itemtype ) %]
995 [% itemtypes = itemtypes.unique %]
996 [% IF ( itemtypes.empty ) %]
998 There are no holds on this title.
1002 [% FOREACH i IN itemtypes.sort %]
1003 [% SET holds_by_itemtype = [] %]
1004 [% FOREACH h IN biblioloo.reserveloop %]
1005 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1006 [% IF hold_itemtype == i %]
1007 [% holds_by_itemtype.push( h ) %]
1011 <div class="holds_by_itemtype">
1013 <h4>[% ItemTypes.GetDescription( i ) | html %]</h4>
1015 <h4>Any item type</h4>
1017 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1019 [% END # /FOREACH i %]
1020 [% END # /IF ( itemtypes.empty ) %]
1022 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
1023 [% SET branchcodes = [] %]
1025 [% FOREACH h IN biblioloo.reserveloop %]
1026 [% branchcodes.push( h.branchcode ) %]
1028 [% branchcodes = branchcodes.unique %]
1029 [% IF ( branchcodes.empty ) %]
1031 There are no holds on this title.
1035 [% FOREACH b IN branchcodes.sort %]
1036 <div class="holds_by_library">
1037 <h4 class="library_holds">[% Branches.GetName( b ) | html %]</h4>
1038 [% SET holds_by_branch = [] %]
1039 [% FOREACH h IN biblioloo.reserveloop %]
1040 [% IF h.branchcode == b %]
1041 [% holds_by_branch.push( h ) %]
1045 [% SET itemtypes = [] %]
1046 [% FOREACH h IN holds_by_branch %]
1047 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1048 [% itemtypes.push( hold_itemtype ) %]
1050 [% itemtypes = itemtypes.unique %]
1052 [% FOREACH i IN itemtypes.sort %]
1053 <div class="holds_by_itemtype">
1054 <h5 class="itemtype_holds">
1056 [% ItemTypes.GetDescription( i ) | html %]
1062 [% SET holds_by_itemtype = [] %]
1063 [% FOREACH h IN holds_by_branch %]
1064 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1065 [% IF hold_itemtype == i %]
1066 [% holds_by_itemtype.push( h ) %]
1069 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1070 </div> <!-- /.holds_by_itemtype -->
1072 </div> <!-- /.holds_by_library -->
1073 [% END # /FOREACH b %]
1074 [% END # /IF ( branchcodes.empty ) %]
1078 [% IF ( biblioloo.reserveloop.size ) %]
1079 [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
1082 There are no holds on this title.
1086 [% END # /IF HoldsSplitQueue %]
1087 </div> <!-- /hold_title -->
1088 [% END # /IF biblioloo.reserveloop %]
1089 [% END # FOREACH biblioloo %]
1090 </form> <!-- /#existing_holds -->
1091 [% END # IF reserveloop %]
1092 [% END # UNLESS patron %]
1096 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
1097 </div> <!-- /.col-md-10.col-md-offset-1 -->
1099 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1100 <div class="col-sm-2 col-sm-pull-10">
1102 [% INCLUDE 'biblio-view-menu.inc' %]
1104 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1106 </div> <!-- /.row -->
1108 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
1109 <div class="modal-dialog" role="document">
1110 <div class="modal-content">
1111 <div class="modal-header">
1112 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1113 <h3>Confirm deletion</h3>
1116 <div class="modal-body">
1117 <p>Are you sure you want to cancel this hold?</p>
1119 <fieldset class="action">
1120 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1121 [% IF hold_cancellation %]
1122 <label for="cancellation-reason">Cancellation reason: </label>
1123 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
1124 <option value="">No reason given</option>
1125 [% FOREACH reason IN hold_cancellation %]
1126 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1133 <div class="modal-footer">
1134 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
1135 <a href="#" data-dismiss="modal">Cancel</a>
1141 [% MACRO jsinclude BLOCK %]
1142 [% INCLUDE 'datatables.inc' %]
1143 [% INCLUDE 'calendar.inc' %]
1144 [% INCLUDE 'columns_settings.inc' %]
1145 [% Asset.js("lib/hc-sticky.js") | $raw %]
1146 [% INCLUDE 'select2.inc' %]
1147 [% Asset.js("js/holds.js") | $raw%]
1150 var biblionumbers = [[% biblionumbers.join(', ') | $raw %]];
1151 var borrowernumber = "[% patron.borrowernumber | $raw %]";
1152 var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1153 var override_items = {[% FOREACH biblio IN biblioloop %][% FOREACH itemloo IN biblio.itemloop %][% IF ( itemloo.override ) %]
1154 [% itemloo.itemnumber | html %]: {
1155 homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1156 holdallowed: "[% itemloo.holdallowed | html %]"
1158 [% END %][% END %][% END %]
1161 damaged: _("Item damaged"),
1162 ageRestricted: _("Age restricted"),
1163 tooManyHoldsForThisRecord: _("Exceeded max holds per record"),
1164 tooManyReservesToday: _("Daily hold limit reached for patron"),
1165 tooManyReserves: _("Too many holds"),
1166 notReservable: _("Not holdable"),
1167 noReservesAllowed: _("No reserves allowed"),
1168 cannotReserveFromOtherBranches: _("Patron is from different library"),
1169 itemAlreadyOnHold: _("Patron already has hold for this item"),
1170 cannotBeTransferred: _("Cannot be transferred to pickup library"),
1171 pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed")
1174 var MSG_CANCEL_SELECTED = _("Cancel selected (%s)");
1175 $.fn.select2.defaults.set("width", "100%" );
1176 $.fn.select2.defaults.set("dropdownAutoWidth", true );
1178 $(document).ready(function() {
1179 $('#cancellation-reason-fieldset').hide();
1180 $('.rank-request').on('change', function() {
1181 if ( $(".rank-request option:selected[value='del']").length ) {
1182 $('#cancellation-reason-fieldset').show();
1184 $('#cancellation-reason-fieldset').hide();
1188 [% SET active = clubs ? 1 : 0 %]
1189 $('#circ_holds_select').tabs({
1190 active: [% active | $raw %],
1191 activate: function(){
1192 $(this).find("input.focus").focus();
1195 $(this).find("input.focus").focus();
1198 function ToggleHoldsToPlace() {
1199 if ( $("#requestany").prop('checked') ) {
1200 $("#holds_to_place_count").prop('disabled', false);
1202 $("#holds_to_place_count").prop('disabled', true);
1205 ToggleHoldsToPlace();
1206 $("#requestany").on('change', function(){
1207 ToggleHoldsToPlace();
1210 [% IF Koha.Preference('UseBranchTransferLimits') %]
1211 $("#pickup").on('change', function(){
1212 var pickup = $("#pickup").val();
1213 var url = "?pickup=" + pickup;
1214 url += "&borrowernumber=" + borrowernumber;
1215 url += "&biblionumber=" + biblionumbers[0];
1216 window.location.replace(url);
1220 var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1222 "sDom": '<"top pager"ilf>t',
1225 //Override fieldset styling for dataTables search box
1226 $("div.top.pager").css("margin-left","1em");
1227 $(".dataTables_filter label").css({
1229 "margin-right":"0em"
1232 $("#club-request-form").on("submit", function() {
1234 $('.clubalert, .holdalert').addClass('hide');
1236 pickup_library_id: $('select[name="pickup"]').val()
1238 if($('input[name="checkitem"]:checked').length)
1239 data.item_id = $('input[name="checkitem"]:checked').val();
1240 if($('input[name="borrowernumber"]').length)
1241 data.patron_id = $('input[name="borrowernumber"]').val();
1242 if($('textarea[name="notes"]').length)
1243 data.notes = $('textarea[name="notes"]').val()||null;
1244 if($('input[name="itemtype"]').length) {
1245 data.item_type = $('input[name="itemtype"]').val()||null;
1247 if($('input[name="default_patron_home"]:checked').length) {
1248 data.default_patron_home = 1;
1251 const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1;
1252 var newloc = 'request.pl?';
1253 biblionumbers.forEach(function (biblionumber) {
1254 newloc += '&biblionumber=' + biblionumber;
1257 biblionumbers.forEach(function(biblionumber) {
1258 data.biblio_id = biblionumber;
1260 url: $t.attr('action'),
1261 method: $t.attr('method').toUpperCase(),
1262 contentType: 'application/json',
1263 data: JSON.stringify(data)
1265 for(let i = 0; i < count; i++) {
1267 .then(function(result) {
1268 document.location = newloc;
1270 .fail(function(err) {
1271 var message = err.responseJSON.error;
1272 var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/);
1273 if(match && ERROR_MAP[match[1]]) {
1274 message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>'
1276 $('.clubalert, .holdalert').removeClass('hide').html(message);
1284 [% UNLESS ( multi_hold ) %]
1285 $("#hold-request-form").on("submit", function(){
1286 return check($(this));
1289 $("#hold-request-form").on("submit", function(){
1290 return checkMultiHold();
1294 $(".pickup_location_dropdown").each( function () {
1295 $(this).pickup_locations_dropdown();
1298 $("#pickup_multi").select2({
1303 $('.multi_pickup_select').select2({
1308 $("#pickup_multi").on("change", function() {
1309 var selection = $(this).val();
1310 if ( selection != '' ) {
1311 $(".multi_pickup_select").each(function() {
1312 var valid_pickup_locations = $(this).data('pickup-locations');
1313 if ( valid_pickup_locations.includes(selection) ) {
1314 $(this).val(selection);
1315 $(this).trigger("change");
1321 $("#pickup").each( function () {
1322 $(this).pickup_locations_dropdown();
1325 $(".pickup_locations").each(function () {
1326 $(this).pickup_locations_dropdown();
1330 function check( table ) {
1334 if ( $("#requestany").attr("checked") !== "checked" ) {
1335 // requestany not selected, go through the item-specific cases
1336 if ( $('input[type="radio"]:checked').length > 0 ) {
1337 // got item-specific hold requests in the form!
1338 // verify they have a pickup location selected
1340 if (table.find('input[type="radio"]:checked')
1342 .find(".pickup_locations").val() === null) {
1344 msg = _("- Please select a pickup location for the item" + "\n")
1348 msg = (_("- Please select an item to place a hold") + "\n");
1353 $('#hold-request-form').preventDoubleFormSubmit();
1361 function checkMultiHold() {
1363 var selected_bibs = $(".multi_hold_item_checkbox:checked");
1364 if ( selected_bibs.length > 0 ) {
1365 // there are biblios selected in the form!
1366 // verify they have a pickup location selected
1368 var pickup_not_set = 0;
1369 selected_bibs.each(function() {
1370 if ( $(this).closest('tr').find(".multi_pickup_select").val() === "" ) {
1374 var bibnum = $(this).attr("title");
1377 if ( pickup_not_set > 0 ) {
1378 alert( _("Please make sure all selected titles have a pickup location set" + "\n") );
1383 alert( _("Please select at least one title" + "\n") );
1387 var badSpans = $(".not_holdable");
1389 $(badSpans).each(function() {
1390 var bibnum = $(this).attr("title");
1391 badBibs += bibnum + "/";
1394 $("#bad_bibs").val(badBibs);
1396 $('#hold-request-form').preventDoubleFormSubmit();
1401 $(document).ready(function() {
1403 $("#always_show_holds").change(function(){
1404 if( $(this).prop('checked') ){
1405 document.cookie = 'always_show_holds=DO';
1407 document.cookie = 'always_show_holds=DONT';
1410 $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1411 var itemnumber = this.value;
1414 switch (override_items[itemnumber].holdallowed) {
1415 case "not_allowed": msg = _("This item normally cannot be put on hold."); break;
1416 case "from_home_library": msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
1419 msg += "\n\n" + _("Place hold on this item?");
1421 return confirm(msg);
1423 $("button.warning").click(function() {
1424 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1426 $("#requestany").click(function() {
1428 $("input[name=checkitem]").each(function() {
1429 $(this).prop("checked", false);
1433 $("input[name=checkitem]").click(function() {
1435 $("input[name=checkitem]").each(function() {
1440 if(onechecked == 1){
1441 $("#requestany").prop("checked", false);
1442 $("#holds_to_place_count").prop('disabled', true);
1444 $("#requestany").prop("checked",true);
1445 $("#holds_to_place_count").prop('disabled', false);
1448 var prev_rank_request;
1449 $("select[name=rank-request]").on("focus", function() {
1450 prev_rank_request = $(this).val();
1451 var row = $(this).parents("tr:first");
1452 }).change(function() {
1453 var row = $(this).parents("tr:first");
1454 var value = parseInt($(this).val());
1455 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
1456 if( !isNaN(value) ) { //If moved to 'del'
1457 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)
1458 if (prev_rank_request > value) {
1459 row.insertBefore(after);
1461 row.insertAfter(after);
1465 var next_priority = 1;
1466 $("select[name=rank-request]").each(function () {
1467 if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
1468 $(this).val(next_priority);
1473 $(".clear-date").on("click",function(e){
1475 var fieldID = this.id.replace("clear-date-","");
1476 $("#" + fieldID).val("");
1479 // Confirm cancellation of hold
1481 $(".cancel-hold").on("click",function(e) {
1483 cancel_link = $(this);
1484 $('#cancelModal').modal();
1487 $("#cancelModalConfirmBtn").on("click",function(e) {
1489 if(cancel_link.data('bulk')) {
1490 [% SET data_url = 'biblionumber=' _ biblionumbers.join('&biblionumber=') %]
1491 link = `request.pl?[% data_url | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1493 let borrowernumber = cancel_link.data('borrowernumber');
1494 let biblionumber = cancel_link.data('biblionumber');
1495 let reserve_id = cancel_link.data('id');
1496 link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`;
1498 let reason = $("#modal-cancellation-reason").val();
1500 link += "&cancellation-reason=" + reason
1502 window.location.href = link;
1506 Sticky = $("#toolbar");
1508 stickTo: "#existing_holds",
1509 stickyClass: "floating"
1512 if(!localStorage.selectedHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) {
1513 localStorage.selectedHolds = [];
1516 $('.holds_table .select_hold').each(function() {
1517 if(localStorage.selectedHolds.includes($(this).data('id'))) {
1518 $(this).prop('checked', true);
1522 $('.holds_table .select_hold_all').each(function() {
1523 var table = $(this).parents('.holds_table');
1524 var count = $('.select_hold:not(:checked)', table).length;
1525 $('.select_hold_all', table).prop('checked', !count);
1528 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1530 $('.holds_table .select_hold_all').click(function() {
1531 var table = $(this).parents('.holds_table');
1532 var count = $('.select_hold:checked', table).length;
1533 $('.select_hold', table).prop('checked', !count);
1534 $(this).prop('checked', !count);
1535 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1536 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1539 $('.holds_table .select_hold').click(function() {
1540 var table = $(this).parents('.holds_table');
1541 var count = $('.select_hold:not(:checked)', table).length;
1542 $('.select_hold_all', table).prop('checked', !count);
1543 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1544 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1547 $('.cancel_selected_holds').click(function(e) {
1549 if($('.holds_table .select_hold:checked').length) {
1550 cancel_link = $(this);
1551 delete localStorage.selectedHolds;
1552 $('#cancelModal').modal();
1560 table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
1563 [% SET url_biblio_params = "biblionumber=" _ biblionumbers.join("&biblionumber=") %]
1565 [% SET url_biblio_params = url_biblio_params _ "&multi_hold=1" %]
1568 [% PROCESS patron_search_js
1569 table_id => 'table_borrowers',
1570 categories => categories,
1571 libraries => libraries,
1572 extended_attribute_types => attribute_type_codes,
1574 open_on_row_click => 1,
1575 on_click_url => '/cgi-bin/koha/reserve/request.pl?' _ url_biblio_params,
1576 redirect_if_one_result => 1,
1577 redirect_url => '/cgi-bin/koha/reserve/request.pl?' _ url_biblio_params
1580 $(document).ready(function() {
1581 $("#holds_patronsearch").on("submit", filter);
1583 $('.printholdslip').click(function(){
1584 var reserve_id = $(this).attr('data-reserve_id');
1585 window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
1591 [% INCLUDE 'intranet-bottom.inc' %]