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' %]
34 a.hold-arrow:visited {
44 .hold-arrow:active i {
45 border-color: #75b700;
54 a.cancel-hold:visited{
59 .icon-move-hold-up::before {
64 border-top: 3px solid #538200;
67 .icon-move-hold-top::before {
71 .icon-move-hold-bottom {
72 border-bottom: 3px solid #538200;
75 .icon-move-hold-bottom::before {
79 .icon-move-hold-down::before {
83 .icon-unset-lowest::before {
87 .icon-set-lowest::before {
94 <body id="circ_request" class="catalog">
96 [% INCLUDE 'header.inc' %]
97 [% INCLUDE 'circ-search.inc' %]
99 [% UNLESS ( multi_hold ) %]
100 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
103 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
106 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
109 [% INCLUDE 'biblio-title.inc' link =1 %]
112 <a href="#" aria-current="page">
119 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
122 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
125 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
129 <a href="#" aria-current="page">
134 <a href="#" aria-current="page">
135 Search patrons or clubs
138 <a href="#" aria-current="page">
146 [% END # UNLESS multi_hold %]
148 <div class="main container-fluid">
150 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
151 <div class="col-md-10 col-md-offset-1">
153 <div class="col-sm-10 col-sm-push-2">
159 [% IF ( nobiblio ) %]
160 <div class="dialog alert">
162 <strong>Cannot place hold:</strong> one or more records don't exist.
164 <strong>Cannot place hold:</strong> this record doesn't exist.
169 <div class="dialog alert">
171 <strong>Cannot place hold:</strong> one or more records without items attached.
173 <strong>Cannot place hold:</strong> this record has no items attached.
178 [% IF ( messagetransfert ) %]
179 <div class="dialog message">
180 <h2>Hold found for ([% nextreservtitle | html %]), please transfer</h2>
181 <p>Hold placed by : <strong> [% nextreservsurname | html %] [% nextreservfirstname | html %]</strong> at : <strong> [% branchname | html %] </strong>, Please transfer this item.
183 <form name="cancelReservewithtransfert" action="branchreserves.pl" method="post">
184 <input type="submit" class="button" />
189 [% UNLESS ( multi_hold ) %]
190 <h2>Place a hold on [% INCLUDE 'biblio-title.inc' link = 1 %] [% IF biblio.author %] by [% biblio.author | html %][% END %]</h2>
194 <span>Place holds</span>
197 <span>Search patrons or clubs</span>
199 <span>Search patrons</span>
205 [% UNLESS club OR patron OR patron.borrowernumber OR noitems OR nobiblio %]
206 [% IF ( messageborrower ) %]
207 <div class="dialog alert">
208 <h3>Patron not found</h3>
209 <p>No patron with this name, please, try another</p>
213 [% IF ( messageclub ) %]
214 <div class="dialog alert">
215 <h3>Club not found</h3>
216 <p>No club with this name, please, try another</p>
220 [% UNLESS multi_hold %]
222 <h2>Search patrons or clubs</h2>
224 <h2>Search patrons</h2>
227 <div id="circ_holds_select" class="toptabs">
228 <ul class="nav nav-tabs" role="tablist">
229 <li role="presentation" class="active"><a href="#holds_patronsearch_pane" aria-controls="holds_patronsearch_pane" role="tab" data-toggle="tab">Patrons</a></li>
231 <li role="presentation"><a href="#holds_clubsearch_pane" aria-controls="holds_clubsearch_pane" role="tab" data-toggle="tab">Clubs</a></li>
234 <div class="tab-content">
235 <div id="holds_patronsearch_pane" role="tabpanel" class="tab-pane active">
236 [% PROCESS patron_search_filters_simple %]
238 [% PROCESS patron_search_table table_id => 'table_borrowers', open_on_row_click => 1 %]
241 <div id="holds_clubsearch_pane" role="tabpanel" class="tab-pane">
242 <form id="holds_clubsearch" action="request.pl" method="post">
243 <div class="hint">Enter club ID or partial name:</div>
244 <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" />
245 <input type="submit" value="Search" />
246 [% FOREACH biblionumber IN biblionumbers %]
247 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
250 </form> <!-- /#holds_patronsearch -->
252 [% INCLUDE 'clubs-table.inc' destination = "holds" %]
256 </div> <!-- /.tab-content -->
260 <div class="dialog alert hide clubalert">
262 <fieldset class="rows">
263 <legend>Hold details</legend>
264 <form action="/api/v1/clubs/[% club.id | html %]/holds" method="post" name="form" id="club-request-form">
266 [% IF ( multi_hold ) %]
267 <input type="hidden" name="request" value="any"/>
268 [% FOREACH biblioloo IN biblioloop %]
269 [% UNLESS biblioloo.none_avail %]
270 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
271 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
272 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
276 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
277 <input type="hidden" name="title" value="[% biblio.title | html %]" />
278 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
279 [% END # /IF multi_hold %]
282 <span class="label">Club: </span> [% club.name | html %]
285 <span class="label">Description: </span> [% club.description | html %]
288 <label for="pickup">Pickup at:</label>
289 <select name="pickup" id="pickup_club">
290 [% PROCESS options_for_libraries libraries => Branches.all({ selected => club.branchcode, search_params => { pickup_location => 1 } }) %]
294 <label for="default_patron_home">Pickup at patron's home library when possible:</label>
295 <input type="checkbox" id="default_patron_home" name="default_patron_home"/>
298 <h2 style="padding: 0 1em;">Members</h2>
300 [% FOREACH member IN members %]
301 [% SET patron = member.patron %]
302 <li style="padding: 0.5em 1em;">
303 <div>[% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %]</div>
304 [% IF member.exceeded_maxreserves %]
306 <i class="fa fa-error"></i>
307 <strong>Too many holds: </strong> Patron can only place a maximum of [% maxreserves | html %] total holds.
310 [% IF ( patron.is_expired ) %]
312 <i class="fa fa-warning"></i>
313 <strong>Account has expired</strong>
316 [% IF patron.is_debarred %]
318 <i class="fa fa-warning"></i>
319 <strong>Patron has restrictions</strong>
322 [% IF member.amount_outstanding && Koha.Preference('maxoutstanding') && member.amount_outstanding > Koha.Preference('maxoutstanding') %]
324 <i class="fa fa-warning"></i>
325 <strong>Patron has outstanding fines: [% member.amount_outstanding | $Price %]</strong>
329 [% IF ( member.diffbranch ) %]
331 <i class="fa fa-warning"></i>
332 <strong>Pickup library is different.</strong> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )
337 [% UNLESS ( multi_hold ) %]
338 <fieldset class="action">
339 <input type="submit" value="Place hold" />
342 <table id="requesttitles">
346 [% UNLESS Koha.Preference('item-level_itypes') %]
352 [% FOREACH biblioloo IN biblioloop %]
353 [% IF ( biblioloo.warn ) %]
359 [% UNLESS ( biblioloo.warn ) %]
360 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
366 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
367 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
369 [% IF ( biblioloo.publicationyear ) %]
371 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
375 [% IF ( biblioloo.warn ) %]
376 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
379 [% UNLESS Koha.Preference('item-level_itypes') %]
381 <img src="[% biblioloo.itemtype.image_location| html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
384 <td>[% biblioloo.rank | html %]</td>
386 [% IF ( biblioloo.checked_previously ) %]
387 <span>Patron has previously checked out this title</span><br/>
389 [% IF ( biblioloo.alreadyres ) %]
392 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
397 [% IF ( biblioloo.alreadyres ) %]
399 [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] <strong>already has a hold</strong> on this item
402 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
403 <li> <strong>No items are available</strong> to be placed on hold</li>
406 [% IF ( biblioloo.alreadyres ) %]
409 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
415 [% END # /FOREACH biblioloo %]
416 </table> <!-- /#requesttitles -->
420 [% ELSIF NOT ( noitems || nobiblio ) # /UNLESS patron %]
422 [% IF ( checked_previously && !multi_hold ) %]
423 <div class="dialog alert">
425 <li>Patron has previously checked out this title</li>
430 [% IF ( no_reserves_allowed || exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted || recall ) %]
431 <div class="dialog alert">
433 [% UNLESS ( multi_hold ) %]
434 <h3>Cannot place hold</h3>
436 [% IF ( no_reserves_allowed ) %]
437 <li><strong>No holds allowed:</strong> [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] cannot place a hold on any of these items.</li>
438 [% ELSIF ( exceeded_maxreserves ) %]
439 <li><strong>Too many holds:</strong> [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] can only place a maximum of [% maxreserves | html %] total holds.</li>
440 [% ELSIF ( exceeded_holds_per_record ) %]
441 <li><strong>Too many holds for this record:</strong> [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] can only place a maximum of [% max_holds_for_record | html %] hold(s) on this record.</li>
442 [% ELSIF ( alreadypossession ) %]
443 <li>[% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 hide_patron_infos_if_needed => 1 %] <strong>is already in possession</strong> of one item.</li>
444 [% ELSIF ( alreadyreserved ) %]
445 <li>[% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] <strong>already has a hold</strong> on this item.</li>
446 [% ELSIF ( ageRestricted ) %]
447 <li><strong>Age restricted</strong></li>
448 [% ELSIF ( none_available ) %]
449 <li> <strong>No items are available</strong> to be placed on hold.</li>
450 [% ELSIF ( maxreserves ) %]
451 <li><strong>Too many holds:</strong> [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] has too many holds.</li>
452 [% ELSIF ( recall ) %]
453 <li>[% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] has <strong>already placed a recall</strong> on this item.</li>
454 [% END # /IF exceeded_maxreserves %]
456 [% ELSE # UNLESS multi_hold %]
457 <h3>Cannot place hold on some items</h3>
458 [% IF (no_reserves_allowed ) %]
459 <li><strong>No holds allowed:</strong> [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] cannot place holds on some of these title's items.</li>
460 [% ELSIF ( exceeded_maxreserves ) %]
461 <li><strong>Too many holds:</strong> [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] can place [% new_reserves_allowed | html %] of the requested [% new_reserves_count | html %] holds for a maximum of [% maxreserves | html %] total holds.</li>
462 [% ELSIF ( exceeded_holds_per_record ) %]
463 [% FOREACH biblioloo IN biblioloop %]
464 [% IF (biblioloo.tooManyHoldsForThisRecord) %]
465 <li><strong>Too many holds for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]"> [% biblioloo.title | html %]</a>:</strong> [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] can only place a maximum of [% max_holds_for_record | html %] hold(s) on this record.</li>
468 [% ELSIF ( none_available ) %]
469 <li><strong>No items available: </strong>One or more records have no items that can be held</li>
470 [% END # /IF exceeded_maxreserves %]
471 [% END # /UNLESS multi_hold %]
473 [% END # /IF ( exceeded_maxreserves || ... %]
475 [% IF ( patron.is_expired || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
476 <div class="dialog message">
478 [% IF ( patron.is_expired ) %]
479 <li>[% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %]: <strong>Account has expired</strong></li>
482 [% IF patron.is_debarred %]
483 <li>[% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %]: <strong>Patron has restrictions</strong></li>
486 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
487 <li>[% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 link_to => 'members_pay' %]: <strong>Patron has outstanding fines: [% amount_outstanding | $Price %]</strong></li>
490 [% IF ( diffbranch ) %]
491 <li><strong>Pickup library is different. </strong>Patron: [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )</li>
493 </ul> <!-- /.dialog.message -->
495 [% END # /IF patron.is_expired || diffbranch ... %]
497 [% IF ( messageborrower ) %]
498 <div class="dialog alert">
499 <h3>Patron not found:</h3>
500 <p>Name or barcode not found. Please try an other </p>
504 <div class="dialog alert hide holdalert">
507 <fieldset class="rows">
508 <legend>Hold details</legend>
509 <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
511 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
512 [% FOREACH biblionumber IN biblionumbers %]
513 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
515 [% IF ( multi_hold ) %]
516 <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
517 <input type="hidden" name="request" value="any"/>
518 [% FOREACH biblioloo IN biblioloop %]
519 [% UNLESS biblioloo.none_avail %]
520 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
521 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
522 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
526 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
527 <input type="hidden" name="title" value="[% biblio.title | html %]" />
528 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
529 [% END # /IF multi_hold %]
533 <span class="label">Patron:</span>
534 [% IF ( patron.borrowernumber ) %]
535 [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %]
541 [% UNLESS ( multi_hold ) %]
543 <span class="label">Estimated priority:</span>
544 <strong>[% fixedRank | html %]</strong>
549 <label for="holdnotes">Notes:</label>
550 <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
553 <label for="pickup">Pickup at:</label>
554 [% UNLESS ( multi_hold ) %]
555 <select name="pickup" id="pickup"
556 data-biblio-id="[% biblio.biblionumber | html %]"
557 data-patron-id="[% patron.borrowernumber | html %]"
558 data-pickup-location-source="biblio">
559 [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
561 <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
562 <option value="" selected="selected"></option>
563 [% FOREACH pickup_location IN multi_pickup_locations %]
564 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
570 [% UNLESS ( multi_hold ) %]
571 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
573 <label for="itemtype">Request specific item type:</label>
574 <select name="itemtype" id="itemtype">
575 <option value="">Any item type</option>
576 [%- FOREACH itemtype IN available_itemtypes %]
577 <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
582 [% END # /UNLESS multi_hold %]
584 [% IF ( reserve_in_future ) %]
586 <label for="from">Hold starts on date:</label>
587 <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" data-date_to="expiration_date" class="flatpickr" data-flatpickr-futuredate="true" />
592 <label for="to">Hold expires on date:</label>
593 <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
596 [% UNLESS ( multi_hold ) %]
598 <label for="requestany">Hold next available item </label>
599 [% IF force_hold_level == 'item' %]
600 <input type="checkbox" id="requestany" name="request" disabled="true" />
601 [% ELSIF force_hold_level == 'record' %]
602 <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
603 <input type="hidden" name="request" value="Any"/>
605 <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
607 <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
610 [% IF remaining_holds_for_record > 1 %]
612 <label for="holds_to_place_count">Holds to place (count)</label>
613 <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" />
616 <input type="hidden" name="holds_to_place_count" value="1" />
618 [% END # /UNLESS multi_hold %]
620 <li id="non_priority_list_item">
621 <label for="non_priority">Non priority hold:</label>
622 <input name="non_priority" id="non_priority" type="checkbox" />
623 <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
627 [% UNLESS ( multi_hold ) %]
628 <fieldset class="action">
629 [% IF ( patron.borrowernumber ) %]
630 [% IF ( override_required ) %]
631 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
632 [% ELSIF ( none_available ) %]
633 <button type="submit" disabled="disabled" class="btn btn-default btn-disabled">Place hold</button>
635 <button type="submit" class="btn btn-default">Place hold</button>
640 [% biblio = biblioloop.0 %]
643 [% UNLESS Koha.Preference('item-level_itypes') %]
645 <span class="label">Item typeX:</span>
646 [% biblio.itemtype.translated_description | html %]
650 [% IF ( biblio.biblioitem.publicationyear ) %]
652 <span class="label">Publication year:</span>
653 [% biblio.biblioitem.publicationyear | html %]
658 <h2 style="padding: 0 1em;">
659 Place a hold on a specific item
660 [% IF force_hold_level == 'item' %]
661 <span class="error"><em>(Required)</em></span>
665 <table id="requestspecific">
669 <th>Allowed pickup locations</th>
670 [% IF Koha.Preference('item-level_itypes') %]
674 <th>Home library</th>
675 <th>Last location</th>
676 [% IF itemdata_ccode %]
681 [% IF itemdata_enumchron %]
688 [% SET selected = 0 %]
689 [% FOREACH itemloo IN biblio.itemloop %]
690 [% UNLESS ( itemloo.hide ) %]
691 <tr class="[% itemloo.backgroundcolor | html %]">
693 [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
695 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
696 Hold must be record level
698 [% ELSIF ( itemloo.available ) %]
699 <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
700 [% ELSIF ( itemloo.override ) %]
701 <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
702 <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
705 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
706 [% IF itemloo.not_holdable %]
707 [% IF itemloo.not_holdable == 'damaged' %]
708 <span>Item damaged</span>
709 [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
710 <span>Age restricted</span>
711 [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
712 <span>Exceeded max holds per record</span>
713 [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
714 <span>Daily hold limit reached for patron</span>
715 [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
716 <span>Too many holds</span>
717 [% ELSIF itemloo.not_holdable == 'notReservable' %]
718 <span>Not holdable</span>
719 [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
720 <span>Patron is from different library</span>
721 [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
722 <span>Cannot place hold from patron's library</span>
723 [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
724 <span>Patron already has hold for this item</span>
725 [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
726 <span>Cannot be transferred to pickup library</span>
727 [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
728 <span>Only pickup locations within the same hold group are allowed</span>
729 [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
730 <span>No holds are allowed on this item</span>
731 [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %]
732 <span>Library is not a pickup location</span>
733 [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
734 <span>No valid pickup location</span>
735 [% ELSIF itemloo.not_holdable == 'notforloan' %]
736 <span>Not for loan</span>
738 <span>[% itemloo.not_holdable | html %]</span>
742 [% END # /IF force_hold_level %]
745 [% IF (itemloo.pickup_locations_count > 0) %]
746 <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations" style="width:100%;"
747 data-item-id="[% itemloo.itemnumber | html %]"
748 data-patron-id="[% patron.borrowernumber | html %]"
749 data-pickup-location-source="item">
750 [% IF (itemloo.default_pickup_location) %]
751 <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option>
756 [% IF Koha.Preference('item-level_itypes') %]
758 [% UNLESS ( noItemTypeImages ) %]
759 [% IF ( itemloo.itemtype.image_location) %]<img src="[% itemloo.itemtype.image_location | html %]" alt="" /> <br /> [% END %]
761 [% itemloo.itemtype.translated_description | html %]
765 [% itemloo.barcode | html %]
768 [% Branches.GetName( itemloo.homebranch ) | html %]
771 [% Branches.GetName( itemloo.holdingbranch ) | html %]
773 [% IF itemdata_ccode %]
775 [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
779 [% itemloo.itemcallnumber | html %]
782 [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %]
784 [% IF itemdata_enumchron %]
786 [% itemloo.enumchron | html %]
789 [% IF ( itemloo.onloan ) %]
790 <td data-order="[% itemloo.date_due | html %]">
791 <span class="checkedout">Due [% itemloo.date_due | $KohaDates as_due_date => 1 %]</span>
794 [% IF ( itemloo.transfertwhen ) %]
795 <span>In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
796 to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %]</span>
800 [% IF ( itemloo.reservedate ) %]
801 [% IF ( itemloo.nocancel ) %]
802 <span>Can't be cancelled when item is in transit</span>
804 [% IF ( itemloo.waitingdate ) %]<span>Waiting</span>[% ELSE %]<span>On hold</span>[% END %]
805 [% IF ( itemloo.canreservefromotherbranches ) %]
806 <span>for</span> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedFor.borrowernumber | uri %]">[% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %]</a>
808 [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %]
809 [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] <span>since</span>
810 [% IF ( itemloo.waitingdate ) %]
811 [% itemloo.waitingdate | $KohaDates %]
813 [% IF ( itemloo.reservedate ) %]
814 [% itemloo.reservedate | html %]
817 <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
818 [% END # /IF itemloo.nocancel %]
821 [% END # /IF itemloo.reservedate %]
823 [% IF itemloo.item_level_holds == "N" %]
824 <br/>Item level hold not allowed from OPAC
825 [% ELSIF itemloo.item_level_holds == "F" %]
826 <br/>Item level hold forced from OPAC
829 [% IF ( itemloo.itemlost ) %]
830 <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
833 [% IF ( itemloo.damaged ) %]
834 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
837 [% IF ( itemloo.withdrawn ) %]
838 <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
841 [% IF ( itemloo.notforloan ) %]
842 <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
843 [% ELSIF ( itemloo.notforloanitype ) %]
844 <span class="nfl">Not for loan (Itemtype not for loan)</span>
848 [% END # / UNLESS itemloo.hide %]
849 [% END # /FOREACH itemloo %]
851 </table> <!-- /#requestspecific -->
855 <p class="hiddencount">
856 <a href="request.pl?biblionumber=[% biblio.biblionumber | uri %]&borrowernumber=[% borrowernumber | uri %]&showallitems=1">Show all items ([% biblio.hiddencount | html %] hidden)</a>
859 [% END # /IF hiddencount %]
861 [% ELSE # /UNLESS multi_hold %]
863 <table id="requesttitles">
866 <th>Pickup location</th>
868 [% UNLESS Koha.Preference('item-level_itypes') %]
874 [% FOREACH biblioloo IN biblioloop %]
875 [% IF ( biblioloo.warn ) %]
881 [% UNLESS ( biblioloo.warn ) %]
882 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
886 [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %]
887 <select name="pickup_[% biblioloo.biblionumber | html %]"
888 class="multi_pickup_select"
889 data-biblio-id="[% biblioloo.biblionumber | html %]"
890 data-patron-id="[% patron.borrowernumber | html %]"
891 data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
892 <option value=""></option>
893 [% FOREACH pickup_location IN biblioloo.pickup_locations %]
894 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
902 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
903 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
905 [% IF ( biblioloo.publicationyear ) %]
907 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
911 [% IF ( biblioloo.warn ) %]
912 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
915 [% UNLESS Koha.Preference('item-level_itypes') %]
917 <img src="[% biblioloo.itemtype.image_location | html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
920 <td>[% biblioloo.rank | html %]</td>
922 [% IF ( biblioloo.checked_previously ) %]
923 <span>Patron has previously checked out this title</span><br/>
925 [% IF ( biblioloo.alreadyres ) %]
928 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
933 [% IF ( biblioloo.alreadyres ) %]
935 [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] <strong>already has a hold</strong> on this item
938 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
939 <li> <strong>No items are available</strong> to be placed on hold</li>
942 [% IF ( biblioloo.alreadyres ) %]
945 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
951 [% END # /FOREACH biblioloo %]
952 </table> <!-- /#requesttitles -->
954 [% END # /UNLESS multi_hold %]
956 <fieldset class="action">
957 [% IF ( patron AND patron.borrowernumber ) %]
958 [% IF ( multi_hold ) %]
959 [% IF ( override_required ) %]
960 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
961 [% ELSIF ( no_bibs_available ) %]
962 <button type="submit" class="btn btn-default btn-disabled" disabled="disabled">Place holds</button>
963 [% ELSIF ( none_available ) %]
964 <button type="submit" class="btn btn-default">Place holds</button>
966 <button type="submit" class="btn btn-default" id="multi_hold_submit">Place holds</button>
969 [% IF ( override_required ) %]
970 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
971 [% ELSIF ( none_available ) %]
972 <button type="submit" class="btn btn-default btn-disabled" disabled="disabled">Place hold</button>
974 <button type="submit" class="btn btn-default">Place hold</button>
977 [% END # /IF patron %]
978 </fieldset> <!-- /.action -->
979 </form> <!-- /#hold-request-form -->
980 </fieldset> <!-- /.rows -->
983 [% UNLESS ( patron ) %]
984 [% UNLESS borrowers %]
985 [% SET hold_count = Biblio.HoldsCount( biblio.biblionumber ) | html %]
987 <label for ="always_show_holds">Always show holds</label>
988 [% IF always_show_holds == 'DONT' %]
989 <input type="checkbox" name="always_show_holds" id="always_show_holds" value="DO">
990 [% UNLESS reserveloop %]
991 <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>
994 <input type="checkbox" name="always_show_holds" value="DO" id="always_show_holds" checked="checked">
998 [% IF ( reserveloop ) %]
999 <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
1000 [% IF ( multi_hold ) %]
1001 [% FOREACH biblionumber IN biblionumbers %]
1002 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
1007 <div class="dialog message">
1008 <p>The job has been enqueued! It will be processed as soon as possible.</p>
1009 <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>
1013 <h2>Existing holds</h2>
1014 <div id="toolbar" class="btn-toolbar">
1015 <input type="submit" name="submit" value="Update hold(s)" /> <button class="cancel_selected_holds" data-bulk="true"></button>
1016 <fieldset id="cancellation-reason-fieldset" class="action">
1017 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1018 [% IF hold_cancellation.count %]
1019 <label for="cancellation-reason">Cancellation reason: </label>
1020 <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
1021 <option value="">No reason given</option>
1022 [% FOREACH reason IN hold_cancellation %]
1023 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1030 [% FOREACH biblioloo IN biblioloop %]
1031 [% IF ( biblioloo.reserveloop ) %]
1032 <div class="hold_title" id="hold_title_[% biblioloo.biblionumber | html %]">
1033 [% IF ( multi_hold ) %]
1035 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
1036 [% biblioloo.title | html %]
1037 </a> <span class="number_box"><span>[% biblioloo.reserveloop.size | html %] [% tn('Hold', 'Holds', biblioloo.reserveloop.size) | $raw %]</span></span>
1041 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
1043 [% SET branchcodes = [] %]
1045 [% FOREACH h IN biblioloo.reserveloop %]
1046 [% branchcodes.push( h.branchcode ) %]
1048 [% branchcodes = branchcodes.unique %]
1049 [% IF ( branchcodes.empty ) %]
1051 There are no holds on this title.
1055 [% FOREACH b IN branchcodes.sort %]
1056 [% SET holds_by_branch = [] %]
1057 [% FOREACH h IN biblioloo.reserveloop %]
1058 [% IF h.branchcode == b %]
1059 [% holds_by_branch.push( h ) %]
1062 <div class="holds_by_library">
1063 <h4>[% Branches.GetName( b ) | html %]</h4>
1065 [% INCLUDE holds_table.inc holds=holds_by_branch %]
1067 [% END # /FOREACh b %]
1068 [% END # /IF ( branchcodes.empty ) %]
1070 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
1072 [% SET itemtypes = [] %]
1074 [% FOREACH h IN biblioloo.reserveloop %]
1075 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1076 [% itemtypes.push( hold_itemtype ) %]
1078 [% itemtypes = itemtypes.unique %]
1079 [% IF ( itemtypes.empty ) %]
1081 There are no holds on this title.
1085 [% FOREACH i IN itemtypes.sort %]
1086 [% SET holds_by_itemtype = [] %]
1087 [% FOREACH h IN biblioloo.reserveloop %]
1088 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1089 [% IF hold_itemtype == i %]
1090 [% holds_by_itemtype.push( h ) %]
1094 <div class="holds_by_itemtype">
1096 <h4>[% ItemTypes.GetDescription( i ) | html %]</h4>
1098 <h4>Any item type</h4>
1100 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1102 [% END # /FOREACH i %]
1103 [% END # /IF ( itemtypes.empty ) %]
1105 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
1106 [% SET branchcodes = [] %]
1108 [% FOREACH h IN biblioloo.reserveloop %]
1109 [% branchcodes.push( h.branchcode ) %]
1111 [% branchcodes = branchcodes.unique %]
1112 [% IF ( branchcodes.empty ) %]
1114 There are no holds on this title.
1118 [% FOREACH b IN branchcodes.sort %]
1119 <div class="holds_by_library">
1120 <h4 class="library_holds">[% Branches.GetName( b ) | html %]</h4>
1121 [% SET holds_by_branch = [] %]
1122 [% FOREACH h IN biblioloo.reserveloop %]
1123 [% IF h.branchcode == b %]
1124 [% holds_by_branch.push( h ) %]
1128 [% SET itemtypes = [] %]
1129 [% FOREACH h IN holds_by_branch %]
1130 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1131 [% itemtypes.push( hold_itemtype ) %]
1133 [% itemtypes = itemtypes.unique %]
1135 [% FOREACH i IN itemtypes.sort %]
1136 <div class="holds_by_itemtype">
1137 <h5 class="itemtype_holds">
1139 [% ItemTypes.GetDescription( i ) | html %]
1141 <span>Any item type</span>
1145 [% SET holds_by_itemtype = [] %]
1146 [% FOREACH h IN holds_by_branch %]
1147 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1148 [% IF hold_itemtype == i %]
1149 [% holds_by_itemtype.push( h ) %]
1152 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1153 </div> <!-- /.holds_by_itemtype -->
1155 </div> <!-- /.holds_by_library -->
1156 [% END # /FOREACH b %]
1157 [% END # /IF ( branchcodes.empty ) %]
1161 [% IF ( biblioloo.reserveloop.size ) %]
1162 [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
1165 There are no holds on this title.
1169 [% END # /IF HoldsSplitQueue %]
1170 </div> <!-- /hold_title -->
1171 [% END # /IF biblioloo.reserveloop %]
1172 [% END # FOREACH biblioloo %]
1173 </form> <!-- /#existing_holds -->
1174 [% END # IF reserveloop %]
1175 [% END # UNLESS patron %]
1179 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
1180 </div> <!-- /.col-md-10.col-md-offset-1 -->
1182 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1183 <div class="col-sm-2 col-sm-pull-10">
1185 [% INCLUDE 'biblio-view-menu.inc' %]
1187 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1189 </div> <!-- /.row -->
1191 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
1192 <div class="modal-dialog" role="document">
1193 <div class="modal-content">
1194 <div class="modal-header">
1195 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1196 <h3>Confirm deletion</h3>
1199 <div class="modal-body">
1200 <p>Are you sure you want to cancel this hold?</p>
1202 <fieldset class="action">
1203 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1204 [% IF hold_cancellation.count %]
1205 <label for="cancellation-reason">Cancellation reason: </label>
1206 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
1207 <option value="">No reason given</option>
1208 [% FOREACH reason IN hold_cancellation %]
1209 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1216 <div class="modal-footer">
1217 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
1218 <a href="#" data-dismiss="modal">Cancel</a>
1224 [% MACRO jsinclude BLOCK %]
1225 [% INCLUDE 'datatables.inc' %]
1226 [% INCLUDE 'calendar.inc' %]
1227 [% INCLUDE 'columns_settings.inc' %]
1228 [% Asset.js("lib/hc-sticky.js") | $raw %]
1229 [% INCLUDE 'select2.inc' %]
1230 [% Asset.js("js/holds.js") | $raw%]
1232 [% SET url_biblio_params = "biblionumber=" _ biblionumbers.join("&biblionumber=") %]
1234 [% SET url_biblio_params = url_biblio_params _ "&multi_hold=1" %]
1239 var biblionumbers = [[% biblionumbers.join(', ') | $raw %]];
1240 var borrowernumber = "[% patron.borrowernumber | $raw %]";
1241 var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1242 var override_items = {[% FOREACH biblio IN biblioloop %][% FOREACH itemloo IN biblio.itemloop %][% IF ( itemloo.override ) %]
1243 [% itemloo.itemnumber | html %]: {
1244 homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1245 holdallowed: "[% itemloo.holdallowed | html %]"
1247 [% END %][% END %][% END %]
1250 damaged: _("Item damaged"),
1251 ageRestricted: _("Age restricted"),
1252 tooManyHoldsForThisRecord: _("Exceeded max holds per record"),
1253 tooManyReservesToday: _("Daily hold limit reached for patron"),
1254 tooManyReserves: _("Too many holds"),
1255 notReservable: _("Not holdable"),
1256 noReservesAllowed: _("No reserves allowed"),
1257 cannotReserveFromOtherBranches: _("Patron is from different library"),
1258 itemAlreadyOnHold: _("Patron already has hold for this item"),
1259 cannotBeTransferred: _("Cannot be transferred to pickup library"),
1260 pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed")
1263 var MSG_CANCEL_SELECTED = _("Cancel selected (%s)");
1264 $.fn.select2.defaults.set("width", "100%" );
1265 $.fn.select2.defaults.set("dropdownAutoWidth", true );
1267 $(document).ready(function() {
1268 $('#cancellation-reason-fieldset').hide();
1269 $('.rank-request').on('change', function() {
1270 if ( $(".rank-request option:selected[value='del']").length ) {
1271 $('#cancellation-reason-fieldset').show();
1273 $('#cancellation-reason-fieldset').hide();
1277 if( $("#circ_holds_select").length > 0 ){
1278 [% SET active = clubs ? 1 : 0 %]
1279 /* Set active tab based on whether a club search was submitted */
1280 var tabs = $("#circ_holds_select li:eq(" + [% active | $raw %] + ") a").tab("show");
1281 $( tabs[0].hash ).find("input.focus").focus();
1283 /* Change active focus when tabs change */
1284 $("#circ_holds_select a[data-toggle='tab']").on("shown.bs.tab", function (e) {
1285 active_tab = e.target.hash;
1286 $( active_tab ).find("input.focus").focus();
1291 function ToggleHoldsToPlace() {
1292 if ( $("#requestany").prop('checked') ) {
1293 $("#holds_to_place_count").prop('disabled', false);
1295 $("#holds_to_place_count").prop('disabled', true);
1298 ToggleHoldsToPlace();
1299 $("#requestany").on('change', function(){
1300 ToggleHoldsToPlace();
1303 [% IF Koha.Preference('UseBranchTransferLimits') %]
1304 $("#pickup").on('change', function(){
1305 var pickup = $("#pickup").val();
1306 var url = "?pickup=" + pickup;
1307 url += "&borrowernumber=" + borrowernumber;
1308 url += "&biblionumber=" + biblionumbers[0];
1309 window.location.replace(url);
1313 var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1315 "sDom": '<"top pager"ilf>t',
1318 //Override fieldset styling for dataTables search box
1319 $("div.top.pager").css("margin-left","1em");
1320 $(".dataTables_filter label").css({
1322 "margin-right":"0em"
1325 $("#club-request-form").on("submit", function() {
1327 $('.clubalert, .holdalert').addClass('hide');
1329 pickup_library_id: $('select[name="pickup"]').val()
1331 if($('input[name="checkitem"]:checked').length)
1332 data.item_id = $('input[name="checkitem"]:checked').val();
1333 if($('input[name="borrowernumber"]').length)
1334 data.patron_id = $('input[name="borrowernumber"]').val();
1335 if($('textarea[name="notes"]').length)
1336 data.notes = $('textarea[name="notes"]').val()||null;
1337 if($('input[name="itemtype"]').length) {
1338 data.item_type = $('input[name="itemtype"]').val()||null;
1340 if($('input[name="default_patron_home"]:checked').length) {
1341 data.default_patron_home = 1;
1344 const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1;
1345 var newloc = 'request.pl?';
1346 biblionumbers.forEach(function (biblionumber) {
1347 newloc += '&biblionumber=' + biblionumber;
1350 biblionumbers.forEach(function(biblionumber) {
1351 data.biblio_id = biblionumber;
1353 url: $t.attr('action'),
1354 method: $t.attr('method').toUpperCase(),
1355 contentType: 'application/json',
1356 data: JSON.stringify(data)
1358 for(let i = 0; i < count; i++) {
1360 .then(function(result) {
1361 document.location = newloc;
1363 .fail(function(err) {
1364 var message = err.responseJSON.error;
1365 var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/);
1366 if(match && ERROR_MAP[match[1]]) {
1367 message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>'
1369 $('.clubalert, .holdalert').removeClass('hide').html(message);
1377 [% UNLESS ( multi_hold ) %]
1378 $("#hold-request-form").on("submit", function(){
1379 return check($(this));
1382 $("#hold-request-form").on("submit", function(){
1383 return checkMultiHold();
1387 $(".pickup_location_dropdown").each( function () {
1388 $(this).pickup_locations_dropdown();
1391 $("#pickup_multi").select2({
1396 $('.multi_pickup_select').select2({
1401 $("#pickup_multi").on("change", function() {
1402 var selection = $(this).val();
1403 if ( selection != '' ) {
1404 $(".multi_pickup_select").each(function() {
1405 var valid_pickup_locations = $(this).data('pickup-locations');
1406 if ( valid_pickup_locations.includes(selection) ) {
1407 $(this).val(selection);
1408 $(this).trigger("change");
1414 $("#pickup").each( function () {
1415 $(this).pickup_locations_dropdown();
1418 $(".pickup_locations").each(function () {
1419 $(this).pickup_locations_dropdown();
1423 function check( table ) {
1427 if ( ! $("#requestany").is(":checked") ) {
1428 // requestany not selected, go through the item-specific cases
1429 if ( $('input[type="radio"]:checked').length > 0 ) {
1430 // got item-specific hold requests in the form!
1431 // verify they have a pickup location selected
1433 if (table.find('input[type="radio"]:checked')
1435 .find(".pickup_locations").val() === null) {
1437 msg = _("- Please select a pickup location for the item" + "\n")
1441 msg = (_("- Please select an item to place a hold") + "\n");
1446 $('#hold-request-form').preventDoubleFormSubmit();
1454 function checkMultiHold() {
1456 var selected_bibs = $(".multi_hold_item_checkbox:checked");
1457 if ( selected_bibs.length > 0 ) {
1458 // there are biblios selected in the form!
1459 // verify they have a pickup location selected
1461 var pickup_not_set = 0;
1462 selected_bibs.each(function() {
1463 if ( $(this).closest('tr').find(".multi_pickup_select").val() === "" ) {
1467 var bibnum = $(this).attr("title");
1470 if ( pickup_not_set > 0 ) {
1471 alert( _("Please make sure all selected titles have a pickup location set" + "\n") );
1476 alert( _("Please select at least one title" + "\n") );
1480 $('#hold-request-form').preventDoubleFormSubmit();
1485 $(document).ready(function() {
1487 $("#always_show_holds").change(function(){
1488 if( $(this).prop('checked') ){
1489 document.cookie = 'always_show_holds=DO';
1491 document.cookie = 'always_show_holds=DONT';
1494 $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1495 var itemnumber = this.value;
1498 switch (override_items[itemnumber].holdallowed) {
1499 case "not_allowed": msg = _("This item normally cannot be put on hold."); break;
1500 case "from_home_library": msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
1503 msg += "\n\n" + _("Place hold on this item?");
1505 return confirm(msg);
1507 $("button.warning").click(function() {
1508 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1510 $("#requestany").click(function() {
1512 $("input[name=checkitem]").each(function() {
1513 $(this).prop("checked", false);
1517 $("input[name=checkitem]").click(function() {
1519 $("input[name=checkitem]").each(function() {
1524 if(onechecked == 1){
1525 $("#requestany").prop("checked", false);
1526 $("#holds_to_place_count").prop('disabled', true);
1528 $("#requestany").prop("checked",true);
1529 $("#holds_to_place_count").prop('disabled', false);
1532 var prev_rank_request;
1533 $("select[name=rank-request]").on("focus", function() {
1534 prev_rank_request = $(this).val();
1535 var row = $(this).parents("tr:first");
1536 }).change(function() {
1537 var row = $(this).parents("tr:first");
1538 var value = parseInt($(this).val());
1539 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
1540 if( !isNaN(value) ) { //If moved to 'del'
1541 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)
1542 if (prev_rank_request > value) {
1543 row.insertBefore(after);
1545 row.insertAfter(after);
1549 var next_priority = 1;
1550 $("select[name=rank-request]").each(function () {
1551 if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
1552 $(this).val(next_priority);
1557 $(".clear-date").on("click",function(e){
1559 var fieldID = this.id.replace("clear-date-","");
1560 $("#" + fieldID).val("");
1563 // Confirm cancellation of hold
1565 $(".cancel-hold").on("click",function(e) {
1567 cancel_link = $(this);
1568 $('#cancelModal').modal();
1571 $("#cancelModalConfirmBtn").on("click",function(e) {
1573 if(cancel_link.data('bulk')) {
1574 [% SET data_url = 'biblionumber=' _ biblionumbers.join('&biblionumber=') %]
1575 link = `request.pl?[% data_url | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1577 let borrowernumber = cancel_link.data('borrowernumber');
1578 let biblionumber = cancel_link.data('biblionumber');
1579 let reserve_id = cancel_link.data('id');
1580 link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`;
1582 let reason = $("#modal-cancellation-reason").val();
1584 link += "&cancellation-reason=" + reason
1586 window.location.href = link;
1590 [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems || nobiblio ) %]
1591 [% IF ( PatronAutoComplete ) %]
1592 $( "#search_patron_filter" ).autocomplete({
1593 source: "/cgi-bin/koha/circ/ysearch.pl",
1595 select: function( event, ui ) {
1596 document.location.href = '/cgi-bin/koha/reserve/request.pl?[% url_biblio_params | url %]&borrowernumber=' + ui.item.borrowernumber;
1599 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
1600 return $( "<li></li>" )
1601 .data( "ui-autocomplete-item", item )
1604 + ( item.surname ? item.surname.escapeHtml() : "" )
1606 + ( item.firstname ? item.firstname.escapeHtml() : "" )
1607 + ( item.middle_name ? " " + item.middle_name.escapeHtml() : "" )
1608 + " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")"
1611 + ( item.address ? item.address.escapeHtml() : "" )
1613 + ( item.city ? item.city.escapeHtml() : "" )
1615 + ( item.zipcode ? item.zipcode.escapeHtml() : "" )
1617 + ( item.country ? item.country.escapeHtml() : "" )
1625 Sticky = $("#toolbar");
1627 stickTo: "#existing_holds",
1628 stickyClass: "floating"
1631 if(!localStorage.selectedHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) {
1632 localStorage.selectedHolds = [];
1635 $('.holds_table .select_hold').each(function() {
1636 if(localStorage.selectedHolds.includes($(this).data('id'))) {
1637 $(this).prop('checked', true);
1641 $('.holds_table .select_hold_all').each(function() {
1642 var table = $(this).parents('.holds_table');
1643 var count = $('.select_hold:not(:checked)', table).length;
1644 $('.select_hold_all', table).prop('checked', !count);
1647 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1649 $('.holds_table .select_hold_all').click(function() {
1650 var table = $(this).parents('.holds_table');
1651 var count = $('.select_hold:checked', table).length;
1652 $('.select_hold', table).prop('checked', !count);
1653 $(this).prop('checked', !count);
1654 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1655 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1658 $('.holds_table .select_hold').click(function() {
1659 var table = $(this).parents('.holds_table');
1660 var count = $('.select_hold:not(:checked)', table).length;
1661 $('.select_hold_all', table).prop('checked', !count);
1662 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1663 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1666 $('.cancel_selected_holds').click(function(e) {
1668 if($('.holds_table .select_hold:checked').length) {
1669 cancel_link = $(this);
1670 delete localStorage.selectedHolds;
1671 $('#cancelModal').modal();
1679 table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
1682 [% PROCESS patron_search_js table_id => 'table_borrowers', categories => categories, libraries => libraries, extended_attribute_types => attribute_type_codes, columns => columns, open_on_row_click => 1, on_click_url => '/cgi-bin/koha/reserve/request.pl?' _ url_biblio_params, redirect_if_one_result => 1, redirect_url => '/cgi-bin/koha/reserve/request.pl?' _ url_biblio_params, redirect_if_attribute_equal => 'cardnumber' %]
1684 $(document).ready(function() {
1685 $("#holds_patronsearch").on("submit", filter);
1687 $('.printholdslip').click(function(){
1688 var reserve_id = $(this).attr('data-reserve_id');
1689 window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
1695 [% INCLUDE 'intranet-bottom.inc' %]