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 [% WRAPPER 'header.inc' %]
97 [% INCLUDE 'circ-search.inc' %]
100 [% WRAPPER 'sub-header.inc' %]
101 [% UNLESS ( multi_hold ) %]
102 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
105 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
108 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
111 [% INCLUDE 'biblio-title.inc' link =1 %]
114 <a href="#" aria-current="page">
121 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
124 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
127 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
131 <a href="#" aria-current="page">
136 <a href="#" aria-current="page">
137 Search patrons or clubs
140 <a href="#" aria-current="page">
148 [% END # UNLESS multi_hold %]
151 <div class="main container-fluid">
153 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
154 <div class="col-md-10 col-md-offset-1">
156 <div class="col-sm-10 col-sm-push-2">
162 [% IF ( nobiblio ) %]
163 <div class="dialog alert">
165 <strong>Cannot place hold:</strong> one or more records don't exist.
167 <strong>Cannot place hold:</strong> this record doesn't exist.
172 <div class="dialog alert">
174 <strong>Cannot place hold:</strong> one or more records without items attached.
176 <strong>Cannot place hold:</strong> this record has no items attached.
181 [% IF ( messagetransfert ) %]
182 <div class="dialog message">
183 <h2>Hold found for ([% nextreservtitle | html %]), please transfer</h2>
184 <p>Hold placed by : <strong> [% nextreservsurname | html %] [% nextreservfirstname | html %]</strong> at : <strong> [% branchname | html %] </strong>, Please transfer this item.
186 <form name="cancelReservewithtransfert" action="branchreserves.pl" method="post">
187 <input type="submit" class="button" />
192 [% UNLESS ( multi_hold ) %]
193 <h2>Place a hold on [% INCLUDE 'biblio-title.inc' link = 1 %] [% IF biblio.author %] by [% biblio.author | html %][% END %]</h2>
197 <span>Place holds</span>
200 <span>Search patrons or clubs</span>
202 <span>Search patrons</span>
208 [% UNLESS club OR patron OR patron.borrowernumber OR noitems OR nobiblio %]
209 [% IF ( messageborrower ) %]
210 <div class="dialog alert">
211 <h3>Patron not found</h3>
212 <p>No patron with this name, please, try another</p>
216 [% IF ( messageclub ) %]
217 <div class="dialog alert">
218 <h3>Club not found</h3>
219 <p>No club with this name, please, try another</p>
223 [% UNLESS multi_hold %]
225 <h2>Search patrons or clubs</h2>
227 <h2>Search patrons</h2>
230 <div id="circ_holds_select" class="toptabs">
231 <ul class="nav nav-tabs" role="tablist">
232 <li role="presentation" class="active"><a href="#holds_patronsearch_pane" aria-controls="holds_patronsearch_pane" role="tab" data-toggle="tab">Patrons</a></li>
234 <li role="presentation"><a href="#holds_clubsearch_pane" aria-controls="holds_clubsearch_pane" role="tab" data-toggle="tab">Clubs</a></li>
237 <div class="tab-content">
238 <div id="holds_patronsearch_pane" role="tabpanel" class="tab-pane active">
239 [% PROCESS patron_search_filters_simple %]
241 [% PROCESS patron_search_table table_id => 'table_borrowers', open_on_row_click => 1 %]
244 <div id="holds_clubsearch_pane" role="tabpanel" class="tab-pane">
245 <form id="holds_clubsearch" action="request.pl" method="post">
246 <div class="hint">Enter club ID or partial name:</div>
247 <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" />
248 <input type="submit" value="Search" />
249 [% FOREACH biblionumber IN biblionumbers %]
250 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
253 </form> <!-- /#holds_patronsearch -->
255 [% INCLUDE 'clubs-table.inc' destination = "holds" %]
259 </div> <!-- /.tab-content -->
263 <div class="dialog alert hide clubalert">
265 <fieldset class="rows">
266 <legend>Hold details</legend>
267 <form action="/api/v1/clubs/[% club.id | html %]/holds" method="post" name="form" id="club-request-form">
269 [% IF ( multi_hold ) %]
270 <input type="hidden" name="request" value="any"/>
271 [% FOREACH biblioloo IN biblioloop %]
272 [% UNLESS biblioloo.none_avail %]
273 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
274 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
275 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
279 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
280 <input type="hidden" name="title" value="[% biblio.title | html %]" />
281 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
282 [% END # /IF multi_hold %]
285 <span class="label">Club: </span> [% club.name | html %]
288 <span class="label">Description: </span> [% club.description | html %]
291 <label for="pickup">Pickup at:</label>
292 <select name="pickup" id="pickup_club">
293 [% PROCESS options_for_libraries libraries => Branches.all({ selected => club.branchcode, search_params => { pickup_location => 1 } }) %]
297 <label for="default_patron_home">Pickup at patron's home library when possible:</label>
298 <input type="checkbox" id="default_patron_home" name="default_patron_home"/>
301 <h2 style="padding: 0 1em;">Members</h2>
303 [% FOREACH member IN members %]
304 [% SET patron = member.patron %]
305 <li style="padding: 0.5em 1em;">
306 <div>[% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %]</div>
307 [% IF member.exceeded_maxreserves %]
309 <i class="fa fa-error"></i>
310 <strong>Too many holds: </strong> Patron can only place a maximum of [% maxreserves | html %] total holds.
313 [% IF ( patron.is_expired ) %]
315 <i class="fa fa-warning"></i>
316 <strong>Account has expired</strong>
319 [% IF patron.is_debarred %]
321 <i class="fa fa-warning"></i>
322 <strong>Patron has restrictions</strong>
325 [% IF member.amount_outstanding && Koha.Preference('maxoutstanding') && member.amount_outstanding > Koha.Preference('maxoutstanding') %]
327 <i class="fa fa-warning"></i>
328 <strong>Patron has outstanding fines: [% member.amount_outstanding | $Price %]</strong>
332 [% IF ( member.diffbranch ) %]
334 <i class="fa fa-warning"></i>
335 <strong>Pickup library is different.</strong> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )
340 [% UNLESS ( multi_hold ) %]
341 <fieldset class="action">
342 <input type="submit" value="Place hold" />
345 <table id="requesttitles">
349 [% UNLESS Koha.Preference('item-level_itypes') %]
355 [% FOREACH biblioloo IN biblioloop %]
356 [% IF ( biblioloo.warn ) %]
362 [% UNLESS ( biblioloo.warn ) %]
363 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
369 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
370 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
372 [% IF ( biblioloo.publicationyear ) %]
374 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
378 [% IF ( biblioloo.warn ) %]
379 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
382 [% UNLESS Koha.Preference('item-level_itypes') %]
384 <img src="[% biblioloo.itemtype.image_location| html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
387 <td>[% biblioloo.rank | html %]</td>
389 [% IF ( biblioloo.checked_previously ) %]
390 <span>Patron has previously checked out this title</span><br/>
392 [% IF ( biblioloo.alreadyres ) %]
395 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
400 [% IF ( biblioloo.alreadyres ) %]
402 [% 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
405 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
406 <li> <strong>No items are available</strong> to be placed on hold</li>
409 [% IF ( biblioloo.alreadyres ) %]
412 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
418 [% END # /FOREACH biblioloo %]
419 </table> <!-- /#requesttitles -->
423 [% ELSIF NOT ( noitems || nobiblio ) # /UNLESS patron %]
425 [% IF ( checked_previously && !multi_hold ) %]
426 <div class="dialog alert">
428 <li>Patron has previously checked out this title</li>
433 [% IF ( no_reserves_allowed || exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted || recall ) %]
434 <div class="dialog alert">
436 [% UNLESS ( multi_hold ) %]
437 <h3>Cannot place hold</h3>
439 [% IF ( no_reserves_allowed ) %]
440 <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>
441 [% ELSIF ( exceeded_maxreserves ) %]
442 <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>
443 [% ELSIF ( exceeded_holds_per_record ) %]
444 <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>
445 [% ELSIF ( alreadypossession ) %]
446 <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>
447 [% ELSIF ( alreadyreserved ) %]
448 <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>
449 [% ELSIF ( ageRestricted ) %]
450 <li><strong>Age restricted</strong></li>
451 [% ELSIF ( none_available ) %]
452 <li> <strong>No items are available</strong> to be placed on hold.</li>
453 [% ELSIF ( maxreserves ) %]
454 <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>
455 [% ELSIF ( recall ) %]
456 <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>
457 [% END # /IF exceeded_maxreserves %]
459 [% ELSE # UNLESS multi_hold %]
460 <h3>Cannot place hold on some items</h3>
461 [% IF (no_reserves_allowed ) %]
462 <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>
463 [% ELSIF ( exceeded_maxreserves ) %]
464 <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>
465 [% ELSIF ( exceeded_holds_per_record ) %]
466 [% FOREACH biblioloo IN biblioloop %]
467 [% IF (biblioloo.tooManyHoldsForThisRecord) %]
468 <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>
471 [% ELSIF ( none_available ) %]
472 <li><strong>No items available: </strong>One or more records have no items that can be held</li>
473 [% END # /IF exceeded_maxreserves %]
474 [% END # /UNLESS multi_hold %]
476 [% END # /IF ( exceeded_maxreserves || ... %]
478 [% IF ( patron.is_expired || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
479 <div class="dialog message">
481 [% IF ( patron.is_expired ) %]
482 <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>
485 [% IF patron.is_debarred %]
486 <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>
489 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
490 <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>
493 [% IF ( diffbranch ) %]
494 <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>
496 </ul> <!-- /.dialog.message -->
498 [% END # /IF patron.is_expired || diffbranch ... %]
500 [% IF ( messageborrower ) %]
501 <div class="dialog alert">
502 <h3>Patron not found:</h3>
503 <p>Name or barcode not found. Please try an other </p>
507 <div class="dialog alert hide holdalert">
510 <fieldset class="rows">
511 <legend>Hold details</legend>
512 <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
514 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
515 [% FOREACH biblionumber IN biblionumbers %]
516 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
518 [% IF ( multi_hold ) %]
519 <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
520 <input type="hidden" name="request" value="any"/>
521 [% FOREACH biblioloo IN biblioloop %]
522 [% UNLESS biblioloo.none_avail %]
523 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
524 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
525 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
529 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
530 <input type="hidden" name="title" value="[% biblio.title | html %]" />
531 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
532 [% END # /IF multi_hold %]
536 <span class="label">Patron:</span>
537 [% IF ( patron.borrowernumber ) %]
538 [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %]
544 [% UNLESS ( multi_hold ) %]
546 <span class="label">Estimated priority:</span>
547 <strong>[% fixedRank | html %]</strong>
552 <label for="holdnotes">Notes:</label>
553 <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
556 <label for="pickup">Pickup at:</label>
557 [% UNLESS ( multi_hold ) %]
558 <select name="pickup" id="pickup"
559 data-biblio-id="[% biblio.biblionumber | html %]"
560 data-patron-id="[% patron.borrowernumber | html %]"
561 data-pickup-location-source="biblio">
562 [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
564 <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
565 <option value="" selected="selected"></option>
566 [% FOREACH pickup_location IN multi_pickup_locations %]
567 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
573 [% UNLESS ( multi_hold ) %]
574 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
576 <label for="itemtype">Request specific item type:</label>
577 <select name="itemtype" id="itemtype">
578 <option value="">Any item type</option>
579 [%- FOREACH itemtype IN available_itemtypes %]
580 <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
585 [% END # /UNLESS multi_hold %]
587 [% IF ( Koha.Preference('AllowHoldDateInFuture') ) %]
589 <label for="from">Hold starts on date:</label>
590 <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" data-date_to="expiration_date" class="flatpickr" data-flatpickr-futuredate="true" />
595 <label for="to">Hold expires on date:</label>
596 <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
599 [% UNLESS ( multi_hold ) %]
601 <label for="requestany">Hold next available item </label>
602 [% IF force_hold_level == 'item' %]
603 <input type="checkbox" id="requestany" name="request" disabled="true" />
604 [% ELSIF force_hold_level == 'record' %]
605 <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
606 <input type="hidden" name="request" value="Any"/>
608 <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
610 <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
613 [% IF remaining_holds_for_record > 1 %]
615 <label for="holds_to_place_count">Holds to place (count)</label>
616 <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" />
619 <input type="hidden" name="holds_to_place_count" value="1" />
621 [% END # /UNLESS multi_hold %]
623 <li id="non_priority_list_item">
624 <label for="non_priority">Non priority hold:</label>
625 <input name="non_priority" id="non_priority" type="checkbox" />
626 <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
630 [% UNLESS ( multi_hold ) %]
631 <fieldset class="action">
632 [% IF ( patron.borrowernumber ) %]
633 [% IF ( override_required ) %]
634 <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
635 [% ELSIF ( none_available ) %]
636 <button type="submit" disabled="disabled" class="btn btn-primary btn-disabled">Place hold</button>
638 <button type="submit" class="btn btn-primary">Place hold</button>
643 [% biblio = biblioloop.0 %]
646 [% UNLESS Koha.Preference('item-level_itypes') %]
648 <span class="label">Item type:</span>
649 [% biblio.itemtype.translated_description | html %]
653 [% IF ( biblio.biblioitem.publicationyear ) %]
655 <span class="label">Publication year:</span>
656 [% biblio.biblioitem.publicationyear | html %]
661 <h2 style="padding: 0 1em;">
662 Place a hold on a specific item
663 [% IF force_hold_level == 'item' %]
664 <span class="error"><em>(Required)</em></span>
668 <table id="requestspecific">
672 <th>Allowed pickup locations</th>
673 [% IF Koha.Preference('item-level_itypes') %]
677 <th>Home library</th>
678 <th>Last location</th>
679 [% IF itemdata_ccode %]
684 [% IF itemdata_enumchron %]
691 [% SET selected = 0 %]
692 [% FOREACH itemloo IN biblio.itemloop %]
693 [% UNLESS ( itemloo.hide ) %]
694 <tr class="[% itemloo.backgroundcolor | html %]">
696 [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
698 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
699 Hold must be record level
701 [% ELSIF ( itemloo.available ) %]
702 <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
703 [% ELSIF ( itemloo.override ) %]
704 <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
705 <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
708 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
709 [% IF itemloo.not_holdable %]
710 [% IF itemloo.not_holdable == 'damaged' %]
711 <span>Item damaged</span>
712 [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
713 <span>Age restricted</span>
714 [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
715 <span>Exceeded max holds per record</span>
716 [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
717 <span>Daily hold limit reached for patron</span>
718 [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
719 <span>Too many holds</span>
720 [% ELSIF itemloo.not_holdable == 'notReservable' %]
721 <span>Not holdable</span>
722 [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
723 <span>Patron is from different library</span>
724 [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
725 <span>Cannot place hold from patron's library</span>
726 [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
727 <span>Patron already has hold for this item</span>
728 [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
729 <span>Cannot be transferred to pickup library</span>
730 [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
731 <span>Only pickup locations within the same hold group are allowed</span>
732 [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
733 <span>No holds are allowed on this item</span>
734 [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %]
735 <span>Library is not a pickup location</span>
736 [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
737 <span>No valid pickup location</span>
738 [% ELSIF itemloo.not_holdable == 'notforloan' %]
739 <span>Not for loan</span>
741 <span>[% itemloo.not_holdable | html %]</span>
745 [% END # /IF force_hold_level %]
748 [% IF (itemloo.pickup_locations_count > 0) %]
749 <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations" style="width:100%;"
750 data-item-id="[% itemloo.itemnumber | html %]"
751 data-patron-id="[% patron.borrowernumber | html %]"
752 data-pickup-location-source="item">
753 [% IF (itemloo.default_pickup_location) %]
754 <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option>
759 [% IF Koha.Preference('item-level_itypes') %]
761 [% UNLESS ( noItemTypeImages ) %]
762 [% IF ( itemloo.itemtype.image_location) %]<img src="[% itemloo.itemtype.image_location | html %]" alt="" /> <br /> [% END %]
764 [% itemloo.itemtype.translated_description | html %]
768 [% itemloo.barcode | html %]
771 [% Branches.GetName( itemloo.homebranch ) | html %]
774 [% Branches.GetName( itemloo.holdingbranch ) | html %]
776 [% IF itemdata_ccode %]
778 [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
782 [% itemloo.itemcallnumber | html %]
785 [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %]
787 [% IF itemdata_enumchron %]
789 [% itemloo.enumchron | html %]
792 [% IF ( itemloo.onloan ) %]
793 <td data-order="[% itemloo.date_due | html %]">
794 <span class="checkedout">Due [% itemloo.date_due | $KohaDates as_due_date => 1 %]</span>
797 [% IF ( itemloo.transfertwhen ) %]
798 <span>In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
799 to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | $KohaDates %]</span>
803 [% IF ( itemloo.reservedate ) %]
804 [% IF ( itemloo.nocancel ) %]
805 <span>Can't be cancelled when item is in transit</span>
807 [% IF ( itemloo.waitingdate ) %]
808 [% IF ( itemloo.canreservefromotherbranches ) %]
809 <span>Waiting for [% INCLUDE 'patron-title.inc' patron=itemloo.ReservedFor %] at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.waitingdate | $KohaDates %]</span>
811 <span>Waiting at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.waitingdate | $KohaDates %]</span>
814 [% IF ( itemloo.canreservefromotherbranches ) %]
815 [% IF itemloo.reservedate %]
816 <span>On hold for [% INCLUDE 'patron-title.inc' patron=itemloo.ReservedFor %] expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since</span>
818 <span>On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %]</span>
820 [% ELSIF itemloo.reservedate %]
821 <span>On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.reservedate | $KohaDates %]</span>
823 <span>On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %]</span>
826 <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
827 [% END # /IF itemloo.nocancel %]
830 [% END # /IF itemloo.reservedate %]
832 [% IF itemloo.item_level_holds == "N" %]
833 <br/>Item level hold not allowed from OPAC
834 [% ELSIF itemloo.item_level_holds == "F" %]
835 <br/>Item level hold forced from OPAC
838 [% IF ( itemloo.itemlost ) %]
839 <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
842 [% IF ( itemloo.damaged ) %]
843 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
846 [% IF ( itemloo.withdrawn ) %]
847 <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
850 [% IF ( itemloo.notforloan ) %]
851 <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
852 [% ELSIF ( itemloo.notforloanitype ) %]
853 <span class="nfl">Not for loan (Itemtype not for loan)</span>
857 [% END # / UNLESS itemloo.hide %]
858 [% END # /FOREACH itemloo %]
860 </table> <!-- /#requestspecific -->
864 <p class="hiddencount">
865 <a href="request.pl?biblionumber=[% biblio.biblionumber | uri %]&borrowernumber=[% borrowernumber | uri %]&showallitems=1">Show all items ([% hiddencount | html %] hidden)</a>
868 [% END # /IF hiddencount %]
870 [% ELSE # /UNLESS multi_hold %]
872 <table id="requesttitles">
875 <th>Pickup location</th>
877 [% UNLESS Koha.Preference('item-level_itypes') %]
883 [% FOREACH biblioloo IN biblioloop %]
884 [% IF ( biblioloo.warn ) %]
890 [% UNLESS ( biblioloo.warn ) %]
891 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
895 [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %]
896 <select name="pickup_[% biblioloo.biblionumber | html %]"
897 class="multi_pickup_select"
898 data-biblio-id="[% biblioloo.biblionumber | html %]"
899 data-patron-id="[% patron.borrowernumber | html %]"
900 data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
901 <option value=""></option>
902 [% FOREACH pickup_location IN biblioloo.pickup_locations %]
903 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
911 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
912 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
914 [% IF ( biblioloo.publicationyear ) %]
916 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
920 [% IF ( biblioloo.warn ) %]
921 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
924 [% UNLESS Koha.Preference('item-level_itypes') %]
926 <img src="[% biblioloo.itemtype.image_location | html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
929 <td>[% biblioloo.rank | html %]</td>
931 [% IF ( biblioloo.checked_previously ) %]
932 <span>Patron has previously checked out this title</span><br/>
934 [% IF ( biblioloo.alreadyres ) %]
937 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
942 [% IF ( biblioloo.alreadyres ) %]
944 [% 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
947 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
948 <li> <strong>No items are available</strong> to be placed on hold</li>
951 [% IF ( biblioloo.alreadyres ) %]
954 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
960 [% END # /FOREACH biblioloo %]
961 </table> <!-- /#requesttitles -->
963 [% END # /UNLESS multi_hold %]
965 <fieldset class="action">
966 [% IF ( patron AND patron.borrowernumber ) %]
967 [% IF ( multi_hold ) %]
968 [% IF ( override_required ) %]
969 <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
970 [% ELSIF ( no_bibs_available ) %]
971 <button type="submit" class="btn btn-primary btn-disabled" disabled="disabled">Place holds</button>
972 [% ELSIF ( none_available ) %]
973 <button type="submit" class="btn btn-primary">Place holds</button>
975 <button type="submit" class="btn btn-primary" id="multi_hold_submit">Place holds</button>
978 [% IF ( override_required ) %]
979 <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
980 [% ELSIF ( none_available ) %]
981 <button type="submit" class="btn btn-primary btn-disabled" disabled="disabled">Place hold</button>
983 <button type="submit" class="btn btn-primary">Place hold</button>
986 [% END # /IF patron %]
987 </fieldset> <!-- /.action -->
988 </form> <!-- /#hold-request-form -->
989 </fieldset> <!-- /.rows -->
992 [% UNLESS ( patron ) %]
993 [% UNLESS borrowers %]
994 [% SET hold_count = Biblio.HoldsCount( biblio.biblionumber ) | html %]
996 <label for ="always_show_holds">Always show holds</label>
997 [% IF always_show_holds == 'DONT' %]
998 <input type="checkbox" name="always_show_holds" id="always_show_holds" value="DO">
999 [% UNLESS reserveloop %]
1000 <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>
1003 <input type="checkbox" name="always_show_holds" value="DO" id="always_show_holds" checked="checked">
1007 [% IF ( reserveloop ) %]
1008 <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
1009 [% IF ( multi_hold ) %]
1010 [% FOREACH biblionumber IN biblionumbers %]
1011 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
1016 <div class="dialog message">
1017 <p>The job has been enqueued! It will be processed as soon as possible.</p>
1018 <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>
1022 <h2>Existing holds</h2>
1023 <div class="page-section">
1024 <div id="toolbar" class="btn-toolbar">
1025 <input type="submit" name="submit" value="Update hold(s)" /> <button class="cancel_selected_holds" data-bulk="true"></button>
1026 <fieldset id="cancellation-reason-fieldset" class="action">
1027 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1028 [% IF hold_cancellation.count %]
1029 <label for="cancellation-reason">Cancellation reason: </label>
1030 <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
1031 <option value="">No reason given</option>
1032 [% FOREACH reason IN hold_cancellation %]
1033 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1040 [% FOREACH biblioloo IN biblioloop %]
1041 [% IF ( biblioloo.reserveloop ) %]
1042 <div class="hold_title" id="hold_title_[% biblioloo.biblionumber | html %]">
1043 [% IF ( multi_hold ) %]
1045 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
1046 [% biblioloo.title | html %]
1047 </a> <span class="number_box"><span>[% biblioloo.reserveloop.size | html %] [% tn('Hold', 'Holds', biblioloo.reserveloop.size) | $raw %]</span></span>
1051 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
1053 [% SET branchcodes = [] %]
1055 [% FOREACH h IN biblioloo.reserveloop %]
1056 [% branchcodes.push( h.branchcode ) %]
1058 [% branchcodes = branchcodes.unique %]
1059 [% IF ( branchcodes.empty ) %]
1061 There are no holds on this title.
1065 [% FOREACH b IN branchcodes.sort %]
1066 [% SET holds_by_branch = [] %]
1067 [% FOREACH h IN biblioloo.reserveloop %]
1068 [% IF h.branchcode == b %]
1069 [% holds_by_branch.push( h ) %]
1072 <div class="holds_by_library">
1073 <h4>[% Branches.GetName( b ) | html %]</h4>
1075 [% INCLUDE holds_table.inc holds=holds_by_branch %]
1077 [% END # /FOREACh b %]
1078 [% END # /IF ( branchcodes.empty ) %]
1080 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
1082 [% SET itemtypes = [] %]
1084 [% FOREACH h IN biblioloo.reserveloop %]
1085 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1086 [% itemtypes.push( hold_itemtype ) %]
1088 [% itemtypes = itemtypes.unique %]
1089 [% IF ( itemtypes.empty ) %]
1091 There are no holds on this title.
1095 [% FOREACH i IN itemtypes.sort %]
1096 [% SET holds_by_itemtype = [] %]
1097 [% FOREACH h IN biblioloo.reserveloop %]
1098 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1099 [% IF hold_itemtype == i %]
1100 [% holds_by_itemtype.push( h ) %]
1104 <div class="holds_by_itemtype">
1106 <h4>[% ItemTypes.GetDescription( i ) | html %]</h4>
1108 <h4>Any item type</h4>
1110 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1112 [% END # /FOREACH i %]
1113 [% END # /IF ( itemtypes.empty ) %]
1115 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
1116 [% SET branchcodes = [] %]
1118 [% FOREACH h IN biblioloo.reserveloop %]
1119 [% branchcodes.push( h.branchcode ) %]
1121 [% branchcodes = branchcodes.unique %]
1122 [% IF ( branchcodes.empty ) %]
1124 There are no holds on this title.
1128 [% FOREACH b IN branchcodes.sort %]
1129 <div class="holds_by_library">
1130 <h4 class="library_holds">[% Branches.GetName( b ) | html %]</h4>
1131 [% SET holds_by_branch = [] %]
1132 [% FOREACH h IN biblioloo.reserveloop %]
1133 [% IF h.branchcode == b %]
1134 [% holds_by_branch.push( h ) %]
1138 [% SET itemtypes = [] %]
1139 [% FOREACH h IN holds_by_branch %]
1140 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1141 [% itemtypes.push( hold_itemtype ) %]
1143 [% itemtypes = itemtypes.unique %]
1145 [% FOREACH i IN itemtypes.sort %]
1146 <div class="holds_by_itemtype">
1147 <h5 class="itemtype_holds">
1149 [% ItemTypes.GetDescription( i ) | html %]
1151 <span>Any item type</span>
1155 [% SET holds_by_itemtype = [] %]
1156 [% FOREACH h IN holds_by_branch %]
1157 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1158 [% IF hold_itemtype == i %]
1159 [% holds_by_itemtype.push( h ) %]
1162 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1163 </div> <!-- /.holds_by_itemtype -->
1165 </div> <!-- /.holds_by_library -->
1166 [% END # /FOREACH b %]
1167 [% END # /IF ( branchcodes.empty ) %]
1171 [% IF ( biblioloo.reserveloop.size ) %]
1172 [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
1175 There are no holds on this title.
1179 [% END # /IF HoldsSplitQueue %]
1180 </div> <!-- /hold_title -->
1181 [% END # /IF biblioloo.reserveloop %]
1182 [% END # FOREACH biblioloo %]
1184 </form> <!-- /#existing_holds -->
1185 [% END # IF reserveloop %]
1186 [% END # UNLESS patron %]
1190 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
1191 </div> <!-- /.col-md-10.col-md-offset-1 -->
1193 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1194 <div class="col-sm-2 col-sm-pull-10">
1196 [% INCLUDE 'biblio-view-menu.inc' %]
1198 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1200 </div> <!-- /.row -->
1202 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
1203 <div class="modal-dialog" role="document">
1204 <div class="modal-content">
1205 <div class="modal-header">
1206 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1207 <h3>Confirm deletion</h3>
1210 <div class="modal-body">
1211 <p>Are you sure you want to cancel this hold?</p>
1213 <fieldset class="action">
1214 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1215 [% IF hold_cancellation.count %]
1216 <label for="cancellation-reason">Cancellation reason: </label>
1217 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
1218 <option value="">No reason given</option>
1219 [% FOREACH reason IN hold_cancellation %]
1220 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1227 <div class="modal-footer">
1228 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
1229 <a href="#" data-dismiss="modal">Cancel</a>
1235 [% MACRO jsinclude BLOCK %]
1236 [% INCLUDE 'datatables.inc' %]
1237 [% INCLUDE 'calendar.inc' %]
1238 [% INCLUDE 'columns_settings.inc' %]
1239 [% Asset.js("lib/hc-sticky.js") | $raw %]
1240 [% INCLUDE 'select2.inc' %]
1241 [% Asset.js("js/holds.js") | $raw%]
1243 [% SET url_biblio_params = "biblionumber=" _ biblionumbers.join("&biblionumber=") %]
1245 [% SET url_biblio_params = url_biblio_params _ "&multi_hold=1" %]
1250 var biblionumbers = [[% biblionumbers.join(', ') | $raw %]];
1251 var borrowernumber = "[% patron.borrowernumber | $raw %]";
1252 var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1253 var override_items = {[% FOREACH biblio IN biblioloop %][% FOREACH itemloo IN biblio.itemloop %][% IF ( itemloo.override ) %]
1254 [% itemloo.itemnumber | html %]: {
1255 homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1256 holdallowed: "[% itemloo.holdallowed | html %]"
1258 [% END %][% END %][% END %]
1261 damaged: _("Item damaged"),
1262 ageRestricted: _("Age restricted"),
1263 tooManyHoldsForThisRecord: _("Exceeded max holds per record"),
1264 tooManyReservesToday: _("Daily hold limit reached for patron"),
1265 tooManyReserves: _("Too many holds"),
1266 notReservable: _("Not holdable"),
1267 noReservesAllowed: _("No reserves allowed"),
1268 cannotReserveFromOtherBranches: _("Patron is from different library"),
1269 itemAlreadyOnHold: _("Patron already has hold for this item"),
1270 cannotBeTransferred: _("Cannot be transferred to pickup library"),
1271 pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed")
1274 var MSG_CANCEL_SELECTED = _("Cancel selected (%s)");
1275 $.fn.select2.defaults.set("width", "100%" );
1276 $.fn.select2.defaults.set("dropdownAutoWidth", true );
1278 $(document).ready(function() {
1279 $('#cancellation-reason-fieldset').hide();
1280 $('.rank-request').on('change', function() {
1281 if ( $(".rank-request option:selected[value='del']").length ) {
1282 $('#cancellation-reason-fieldset').show();
1284 $('#cancellation-reason-fieldset').hide();
1288 if( $("#circ_holds_select").length > 0 ){
1289 [% SET active = clubs ? 1 : 0 %]
1290 /* Set active tab based on whether a club search was submitted */
1291 var tabs = $("#circ_holds_select li:eq(" + [% active | $raw %] + ") a").tab("show");
1292 $( tabs[0].hash ).find("input.focus").focus();
1294 /* Change active focus when tabs change */
1295 $("#circ_holds_select a[data-toggle='tab']").on("shown.bs.tab", function (e) {
1296 active_tab = e.target.hash;
1297 $( active_tab ).find("input.focus").focus();
1302 function ToggleHoldsToPlace() {
1303 if ( $("#requestany").prop('checked') ) {
1304 $("#holds_to_place_count").prop('disabled', false);
1306 $("#holds_to_place_count").prop('disabled', true);
1309 ToggleHoldsToPlace();
1310 $("#requestany").on('change', function(){
1311 ToggleHoldsToPlace();
1314 [% IF Koha.Preference('UseBranchTransferLimits') %]
1315 $("#pickup").on('change', function(){
1316 var pickup = $("#pickup").val();
1317 var url = "?pickup=" + pickup;
1318 url += "&borrowernumber=" + borrowernumber;
1319 url += "&biblionumber=" + biblionumbers[0];
1320 window.location.replace(url);
1324 var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1326 "sDom": '<"top pager"ilf>t',
1329 //Override fieldset styling for dataTables search box
1330 $("div.top.pager").css("margin-left","1em");
1331 $(".dataTables_filter label").css({
1333 "margin-right":"0em"
1336 $("#club-request-form").on("submit", function() {
1338 $('.clubalert, .holdalert').addClass('hide');
1340 pickup_library_id: $('select[name="pickup"]').val()
1342 if($('input[name="checkitem"]:checked').length)
1343 data.item_id = $('input[name="checkitem"]:checked').val();
1344 if($('input[name="borrowernumber"]').length)
1345 data.patron_id = $('input[name="borrowernumber"]').val();
1346 if($('textarea[name="notes"]').length)
1347 data.notes = $('textarea[name="notes"]').val()||null;
1348 if($('input[name="itemtype"]').length) {
1349 data.item_type = $('input[name="itemtype"]').val()||null;
1351 if($('input[name="default_patron_home"]:checked').length) {
1352 data.default_patron_home = 1;
1355 const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1;
1356 var newloc = 'request.pl?';
1357 biblionumbers.forEach(function (biblionumber) {
1358 newloc += '&biblionumber=' + biblionumber;
1361 biblionumbers.forEach(function(biblionumber) {
1362 data.biblio_id = biblionumber;
1364 url: $t.attr('action'),
1365 method: $t.attr('method').toUpperCase(),
1366 contentType: 'application/json',
1367 data: JSON.stringify(data)
1369 for(let i = 0; i < count; i++) {
1371 .then(function(result) {
1372 document.location = newloc;
1374 .fail(function(err) {
1375 var message = err.responseJSON.error;
1376 var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/);
1377 if(match && ERROR_MAP[match[1]]) {
1378 message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>'
1380 $('.clubalert, .holdalert').removeClass('hide').html(message);
1388 [% UNLESS ( multi_hold ) %]
1389 $("#hold-request-form").on("submit", function(){
1390 return check($(this));
1393 $("#hold-request-form").on("submit", function(){
1394 return checkMultiHold();
1398 $(".pickup_location_dropdown").each( function () {
1399 $(this).pickup_locations_dropdown();
1402 $("#pickup_multi").select2({
1407 $('.multi_pickup_select').select2({
1412 $("#pickup_multi").on("change", function() {
1413 var selection = $(this).val();
1414 if ( selection != '' ) {
1415 $(".multi_pickup_select").each(function() {
1416 var valid_pickup_locations = $(this).data('pickup-locations');
1417 if ( valid_pickup_locations.includes(selection) ) {
1418 $(this).val(selection);
1419 $(this).trigger("change");
1425 $("#pickup").each( function () {
1426 $(this).pickup_locations_dropdown();
1429 $(".pickup_locations").each(function () {
1430 $(this).pickup_locations_dropdown();
1434 function check( table ) {
1438 if ( ! $("#requestany").is(":checked") ) {
1439 // requestany not selected, go through the item-specific cases
1440 if ( $('input[type="radio"]:checked').length > 0 ) {
1441 // got item-specific hold requests in the form!
1442 // verify they have a pickup location selected
1444 if (table.find('input[type="radio"]:checked')
1446 .find(".pickup_locations").val() === null) {
1448 msg = _("- Please select a pickup location for the item" + "\n")
1452 msg = (_("- Please select an item to place a hold") + "\n");
1455 if( $("#pickup").length < 1 || $("#pickup").val() == "" ){
1456 msg = _("- Please select a pickup location for this hold" + "\n");
1462 $('#hold-request-form').preventDoubleFormSubmit();
1470 function checkMultiHold() {
1472 var selected_bibs = $(".multi_hold_item_checkbox:checked");
1473 if ( selected_bibs.length > 0 ) {
1474 // there are biblios selected in the form!
1475 // verify they have a pickup location selected
1477 var pickup_not_set = 0;
1478 selected_bibs.each(function() {
1479 if ( $(this).closest('tr').find(".multi_pickup_select").val() === "" ) {
1483 var bibnum = $(this).attr("title");
1486 if ( pickup_not_set > 0 ) {
1487 alert( _("Please make sure all selected titles have a pickup location set" + "\n") );
1492 alert( _("Please select at least one title" + "\n") );
1496 $('#hold-request-form').preventDoubleFormSubmit();
1501 $(document).ready(function() {
1503 $("#always_show_holds").change(function(){
1504 if( $(this).prop('checked') ){
1505 document.cookie = 'always_show_holds=DO';
1507 document.cookie = 'always_show_holds=DONT';
1510 $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1511 var itemnumber = this.value;
1514 switch (override_items[itemnumber].holdallowed) {
1515 case "not_allowed": msg = _("This item normally cannot be put on hold."); break;
1516 case "from_home_library": msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
1519 msg += "\n\n" + _("Place hold on this item?");
1521 return confirm(msg);
1523 $("button.warning").click(function() {
1524 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1526 $("#requestany").click(function() {
1528 $("input[name=checkitem]").each(function() {
1529 $(this).prop("checked", false);
1533 $("input[name=checkitem]").click(function() {
1535 $("input[name=checkitem]").each(function() {
1540 if(onechecked == 1){
1541 $("#requestany").prop("checked", false);
1542 $("#holds_to_place_count").prop('disabled', true);
1544 $("#requestany").prop("checked",true);
1545 $("#holds_to_place_count").prop('disabled', false);
1548 var prev_rank_request;
1549 $("select[name=rank-request]").on("focus", function() {
1550 prev_rank_request = $(this).val();
1551 var row = $(this).parents("tr:first");
1552 }).change(function() {
1553 var row = $(this).parents("tr:first");
1554 var value = parseInt($(this).val());
1555 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
1556 if( !isNaN(value) ) { //If moved to 'del'
1557 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)
1558 if (prev_rank_request > value) {
1559 row.insertBefore(after);
1561 row.insertAfter(after);
1565 var next_priority = 1;
1566 $("select[name=rank-request]").each(function () {
1567 if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
1568 $(this).val(next_priority);
1573 $(".clear-date").on("click",function(e){
1575 var fieldID = this.id.replace("clear-date-","");
1576 $("#" + fieldID).val("");
1579 // Confirm cancellation of hold
1581 $(".cancel-hold").on("click",function(e) {
1583 cancel_link = $(this);
1584 $('#cancelModal').modal();
1587 $("#cancelModalConfirmBtn").on("click",function(e) {
1589 if(cancel_link.data('bulk')) {
1590 [% SET data_url = 'biblionumber=' _ biblionumbers.join('&biblionumber=') %]
1591 link = `request.pl?[% data_url | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1593 let borrowernumber = cancel_link.data('borrowernumber');
1594 let biblionumber = cancel_link.data('biblionumber');
1595 let reserve_id = cancel_link.data('id');
1596 link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`;
1598 let reason = $("#modal-cancellation-reason").val();
1600 link += "&cancellation-reason=" + reason
1602 window.location.href = link;
1606 [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems || nobiblio ) %]
1607 [% IF ( PatronAutoComplete ) %]
1608 patron_autocomplete($("#search_patron_filter"), { 'link-to': 'reserve', 'url-params': '[% url_biblio_params | url %]' });
1612 Sticky = $("#toolbar");
1614 stickTo: "#existing_holds",
1615 stickyClass: "floating"
1618 if(!localStorage.selectedHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) {
1619 localStorage.selectedHolds = [];
1622 $('.holds_table .select_hold').each(function() {
1623 if(localStorage.selectedHolds.includes($(this).data('id'))) {
1624 $(this).prop('checked', true);
1628 $('.holds_table .select_hold_all').each(function() {
1629 var table = $(this).parents('.holds_table');
1630 var count = $('.select_hold:not(:checked)', table).length;
1631 $('.select_hold_all', table).prop('checked', !count);
1634 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1636 $('.holds_table .select_hold_all').click(function() {
1637 var table = $(this).parents('.holds_table');
1638 var count = $('.select_hold:checked', table).length;
1639 $('.select_hold', table).prop('checked', !count);
1640 $(this).prop('checked', !count);
1641 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1642 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1645 $('.holds_table .select_hold').click(function() {
1646 var table = $(this).parents('.holds_table');
1647 var count = $('.select_hold:not(:checked)', table).length;
1648 $('.select_hold_all', table).prop('checked', !count);
1649 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1650 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1653 $('.cancel_selected_holds').click(function(e) {
1655 if($('.holds_table .select_hold:checked').length) {
1656 cancel_link = $(this);
1657 delete localStorage.selectedHolds;
1658 $('#cancelModal').modal();
1666 table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
1669 [% 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' %]
1671 $(document).ready(function() {
1672 $("#holds_patronsearch").on("submit", filter);
1674 $('.printholdslip').click(function(){
1675 var reserve_id = $(this).attr('data-reserve_id');
1676 window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
1682 [% INCLUDE 'intranet-bottom.inc' %]