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 <title>[% FILTER collapse %]
22 [% UNLESS ( multi_hold ) %]
23 [% title_in_title = INCLUDE 'biblio-title-head.inc' %]
24 [% tx("Place a hold on {title}", { title = title_in_title }) | html %] ›
26 [% t("Confirm holds") | html %] ›
28 [% t("Holds") | html %] ›
29 [% t("Circulation") | html %] ›
30 [% t("Koha") | html %]
32 [% INCLUDE 'doc-head-close.inc' %]
40 a.hold-arrow:visited {
50 .hold-arrow:active i {
51 border-color: #75b700;
60 a.cancel-hold:visited{
65 .icon-move-hold-up::before {
70 border-top: 2px solid #538200;
74 .icon-move-hold-top::before {
78 .icon-move-hold-bottom {
79 border-bottom: 2px solid #538200;
83 .icon-move-hold-bottom::before {
87 .icon-move-hold-down::before {
91 .icon-unset-lowest::before {
95 .icon-set-lowest::before {
102 <body id="circ_request" class="catalog">
104 [% WRAPPER 'header.inc' %]
105 [% INCLUDE 'circ-search.inc' %]
108 [% WRAPPER 'sub-header.inc' %]
109 [% WRAPPER breadcrumbs %]
110 [% WRAPPER breadcrumb_item %]
111 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
113 [% UNLESS ( multi_hold ) %]
114 [% WRAPPER breadcrumb_item %]
115 [% INCLUDE 'biblio-title.inc' link =1 %]
117 [% WRAPPER breadcrumb_item bc_active= 1 %]
118 <span>Place a hold</span>
122 [% WRAPPER breadcrumb_item bc_active= 1 %]
123 <span>Place holds</span>
127 [% WRAPPER breadcrumb_item bc_active= 1 %]
128 <span>Search patrons or clubs</span>
131 [% WRAPPER breadcrumb_item bc_active= 1 %]
132 <span>Search patrons</span>
136 [% END # UNLESS multi_hold %]
137 [% END #/ WRAPPER breadcrumbs %]
138 [% END #/ WRAPPER sub-header.inc %]
140 <div class="main container-fluid">
142 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
143 <div class="col-md-10 col-md-offset-1">
145 <div class="col-sm-10 col-sm-push-2">
149 [% INCLUDE 'messages.inc' %]
152 [% IF ( nobiblio ) %]
153 <div class="dialog alert">
155 <strong>Cannot place hold:</strong> one or more records don't exist.
157 <strong>Cannot place hold:</strong> this record doesn't exist.
162 <div class="dialog alert">
164 <strong>Cannot place hold:</strong> one or more records without items attached.
166 <strong>Cannot place hold:</strong> this record has no items attached.
171 [% UNLESS ( multi_hold ) %]
172 <h2>Place a hold on [% INCLUDE 'biblio-title.inc' link = 1 %] [% IF biblio.author %] by [% biblio.author | html %][% END %]</h2>
176 <span>Place holds</span>
179 <span>Search patrons or clubs</span>
181 <span>Search patrons</span>
187 [% UNLESS club OR patron OR patron.borrowernumber OR noitems OR nobiblio %]
188 [% IF ( messageborrower ) %]
189 <div class="dialog alert">
190 <h3>Patron not found</h3>
191 <p>No patron with this name, please, try another</p>
195 [% IF ( messageclub ) %]
196 <div class="dialog alert">
197 <h3>Club not found</h3>
198 <p>No club with this name, please, try another</p>
202 [% UNLESS multi_hold %]
204 <h2>Search patrons or clubs</h2>
206 <h2>Search patrons</h2>
210 [% WRAPPER tabs id= "circ_holds_select" %]
211 [% WRAPPER tabs_nav %]
212 [% WRAPPER tab_item tabname= "holds_patronsearch_pane" bt_active= 1 %] <span>Patrons</span> [% END %]
214 [% WRAPPER tab_item tabname= "holds_clubsearch_pane" %] <span>Clubs</span> [% END %]
216 [% END # /WRAPPER tabs_nav %]
218 [% WRAPPER tab_panels %]
219 [% WRAPPER tab_panel tabname="holds_patronsearch_pane" bt_active= 1 %]
220 [% PROCESS patron_search_filters_simple %]
222 [% PROCESS patron_search_table table_id => 'table_borrowers', open_on_row_click => 1 %]
223 [% END # /tab_panel# %]
225 [% WRAPPER tab_panel tabname="holds_clubsearch_pane" %]
226 <form id="holds_clubsearch" action="request.pl" method="post">
227 [% INCLUDE 'csrf-token.inc' %]
228 <div class="hint">Enter club ID or partial name:</div>
229 <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" />
230 <input type="submit" class="btn btn-primary" value="Search" />
231 [% FOREACH biblionumber IN biblionumbers %]
232 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
235 </form> <!-- /#holds_patronsearch -->
237 [% INCLUDE 'clubs-table.inc' destination = "holds" %]
239 [% END # /tab_panel# %]
240 [% END # /IF clubcount %]
241 [% END # /WRAPPER tab_panels %]
242 [% END # /WRAPPER tabs %]
245 <div class="dialog alert hide clubalert">
247 <fieldset class="rows">
248 <legend>Hold details</legend>
249 <form action="/api/v1/clubs/[% club.id | html %]/holds" method="post" name="form" id="club-request-form">
250 [% INCLUDE 'csrf-token.inc' %]
252 [% IF ( multi_hold ) %]
253 <input type="hidden" name="request" value="any"/>
254 [% FOREACH biblioloo IN biblioloop %]
255 [% UNLESS biblioloo.none_avail %]
256 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
257 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
258 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
262 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
263 <input type="hidden" name="title" value="[% biblio.title | html %]" />
264 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
265 [% END # /IF multi_hold %]
268 <span class="label">Club: </span> [% club.name | html %]
271 <span class="label">Description: </span> [% club.description | html %]
274 <label for="pickup">Pickup at:</label>
275 <select name="pickup" id="pickup_club">
276 [% PROCESS options_for_libraries libraries => Branches.all({ selected => club.branchcode, search_params => { pickup_location => 1 } }) %]
280 <label for="default_patron_home">Pickup at patron's home library when possible:</label>
281 <input type="checkbox" id="default_patron_home" name="default_patron_home"/>
284 <h2 style="padding: 0 1em;">Members</h2>
286 [% FOREACH member IN members %]
287 [% SET patron = member.patron %]
288 <li style="padding: 0.5em 1em;">
289 <div>[% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %]</div>
290 [% IF member.exceeded_maxreserves %]
292 <i class="fa fa-error"></i>
293 <strong>Too many holds: </strong> Patron can only place a maximum of [% maxreserves | html %] total holds.
296 [% IF ( patron.is_expired ) %]
298 <i class="fa-solid fa-triangle-exclamation"></i>
299 <strong>Account has expired</strong>
302 [% IF patron.is_debarred %]
304 <i class="fa-solid fa-triangle-exclamation"></i>
305 <strong>Patron has restrictions</strong>
308 [% IF member.amount_outstanding && Koha.Preference('maxoutstanding') && member.amount_outstanding > Koha.Preference('maxoutstanding') %]
310 <i class="fa-solid fa-triangle-exclamation"></i>
311 <strong>Patron has outstanding fines: [% member.amount_outstanding | $Price %]</strong>
315 [% IF ( member.diffbranch ) %]
317 <i class="fa-solid fa-triangle-exclamation"></i>
318 <strong>Pickup library is different.</strong> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )
323 [% UNLESS ( multi_hold ) %]
324 <fieldset class="action">
325 <input type="submit" class="btn btn-primary" value="Place hold" />
328 <table id="requesttitles">
332 [% UNLESS Koha.Preference('item-level_itypes') %]
338 [% FOREACH biblioloo IN biblioloop %]
339 [% IF ( biblioloo.warn ) %]
345 [% UNLESS ( biblioloo.warn ) %]
346 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
352 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
353 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
355 [% IF ( biblioloo.publicationyear ) %]
357 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
361 [% IF ( biblioloo.warn ) %]
362 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
365 [% UNLESS Koha.Preference('item-level_itypes') %]
367 <img src="[% biblioloo.itemtype.image_location| html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
370 <td>[% biblioloo.rank | html %]</td>
372 [% IF ( biblioloo.checked_previously ) %]
373 <span>Patron has previously checked out this title</span><br/>
375 [% IF ( biblioloo.alreadyres ) %]
378 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
383 [% IF ( biblioloo.alreadyres ) %]
385 [% 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
388 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
389 <li> <strong>No items are available</strong> to be placed on hold</li>
392 [% IF ( biblioloo.alreadyres ) %]
395 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
401 [% END # /FOREACH biblioloo %]
402 </table> <!-- /#requesttitles -->
406 [% ELSIF NOT ( noitems || nobiblio ) # /UNLESS patron %]
408 [% IF ( checked_previously && !multi_hold ) %]
409 <div class="dialog alert">
411 <li>Patron has previously checked out this title</li>
416 [% IF ( no_reserves_allowed || exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted || recall ) %]
417 <div class="dialog alert">
419 [% UNLESS ( multi_hold ) %]
420 <h3>Cannot place hold</h3>
422 [% IF ( no_reserves_allowed ) %]
423 <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>
424 [% ELSIF ( exceeded_maxreserves ) %]
425 <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>
426 [% ELSIF ( exceeded_holds_per_record ) %]
427 <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>
428 [% ELSIF ( alreadypossession ) %]
429 <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>
430 [% ELSIF ( alreadyreserved ) %]
431 <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>
432 [% ELSIF ( ageRestricted ) %]
433 <li><strong>Age restricted</strong></li>
434 [% ELSIF ( none_available ) %]
435 <li> <strong>No items are available</strong> to be placed on hold.</li>
436 [% ELSIF ( maxreserves ) %]
437 <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>
438 [% ELSIF ( recall ) %]
439 <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>
440 [% END # /IF exceeded_maxreserves %]
442 [% ELSE # UNLESS multi_hold %]
443 <h3>Cannot place hold on some items</h3>
444 [% IF (no_reserves_allowed ) %]
445 <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>
446 [% ELSIF ( exceeded_maxreserves ) %]
447 <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>
448 [% ELSIF ( exceeded_holds_per_record ) %]
449 [% FOREACH biblioloo IN biblioloop %]
450 [% IF (biblioloo.tooManyHoldsForThisRecord) %]
451 <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>
454 [% ELSIF ( none_available ) %]
455 <li><strong>No items available: </strong>One or more records have no items that can be held</li>
456 [% END # /IF exceeded_maxreserves %]
457 [% END # /UNLESS multi_hold %]
459 [% END # /IF ( exceeded_maxreserves || ... %]
461 [% IF ( patron.is_expired || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
462 <div class="dialog message">
464 [% IF ( patron.is_expired ) %]
465 <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>
468 [% IF patron.is_debarred %]
469 <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>
472 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
473 <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>
476 [% IF ( diffbranch ) %]
477 <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>
479 </ul> <!-- /.dialog.message -->
481 [% END # /IF patron.is_expired || diffbranch ... %]
483 [% IF ( messageborrower ) %]
484 <div class="dialog alert">
485 <h3>Patron not found:</h3>
486 <p>Name or barcode not found. Please try an other </p>
490 <div class="dialog alert hide holdalert">
493 <fieldset class="rows">
494 <legend>Hold details</legend>
495 <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
496 [% INCLUDE 'csrf-token.inc' %]
498 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
499 [% FOREACH biblionumber IN biblionumbers %]
500 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
502 [% IF ( multi_hold ) %]
503 <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
504 <input type="hidden" name="request" value="any"/>
505 [% FOREACH biblioloo IN biblioloop %]
506 [% UNLESS biblioloo.none_avail %]
507 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
508 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
509 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
513 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
514 <input type="hidden" name="title" value="[% biblio.title | html %]" />
515 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
516 [% END # /IF multi_hold %]
520 <span class="label">Patron:</span>
521 [% IF ( patron.borrowernumber ) %]
522 [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 hide_patron_infos_if_needed => 1 %]
528 [% UNLESS ( multi_hold ) %]
530 <span class="label">Estimated priority:</span>
531 <strong>[% fixedRank | html %]</strong>
536 <label for="holdnotes">Notes:</label>
537 <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
540 <label for="pickup">Pickup at:</label>
541 [% UNLESS ( multi_hold ) %]
542 <select name="pickup" id="pickup"
543 data-biblio-id="[% biblio.biblionumber | html %]"
544 data-patron-id="[% patron.borrowernumber | html %]"
545 data-pickup-location-source="biblio">
546 [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
548 <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
549 <option value="" selected="selected"></option>
550 [% FOREACH pickup_location IN multi_pickup_locations %]
551 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
557 [% UNLESS ( multi_hold ) %]
558 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
560 <label for="itemtype">Request specific item type:</label>
561 <select name="itemtype" id="itemtype">
562 <option value="">Any item type</option>
563 [%- FOREACH itemtype IN available_itemtypes %]
564 <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
569 [% END # /UNLESS multi_hold %]
571 [% IF ( Koha.Preference('AllowHoldDateInFuture') ) %]
573 <label for="from">Hold starts on date:</label>
574 <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" data-date_to="expiration_date" class="flatpickr" data-flatpickr-futuredate="true" />
579 <label for="to">Hold expires on date:</label>
580 <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
583 [% UNLESS ( multi_hold ) %]
585 <label for="requestany">Hold next available item </label>
586 [% IF force_hold_level == 'item' || force_hold_level == 'item_group' %]
587 <input type="checkbox" id="requestany" name="request" disabled="true" />
588 [% ELSIF force_hold_level == 'record' %]
589 <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
590 <input type="hidden" name="request" value="Any"/>
592 <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
594 <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
597 [% IF remaining_holds_for_record > 1 %]
599 <label for="holds_to_place_count">Holds to place (count)</label>
600 <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" />
603 <input type="hidden" name="holds_to_place_count" value="1" />
605 [% END # /UNLESS multi_hold %]
607 <li id="non_priority_list_item">
608 <label for="non_priority">Non priority hold:</label>
609 <input name="non_priority" id="non_priority" type="checkbox" />
610 <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
614 [% UNLESS ( multi_hold ) %]
615 <fieldset class="action">
616 [% IF ( patron.borrowernumber ) %]
617 [% IF ( override_required ) %]
618 <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
619 [% ELSIF ( none_available ) %]
620 <button type="submit" disabled="disabled" class="btn btn-primary btn-disabled">Place hold</button>
622 <button type="submit" class="btn btn-primary">Place hold</button>
627 [% biblio = biblioloop.0 %]
630 [% UNLESS Koha.Preference('item-level_itypes') %]
632 <span class="label">Item type:</span>
633 [% biblio.itemtype.translated_description | html %]
637 [% IF ( biblio.biblioitem.publicationyear ) %]
639 <span class="label">Publication year:</span>
640 [% biblio.biblioitem.publicationyear | html %]
645 <!-- ItemGroup level holds -->
646 [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %]
647 <h2 style="padding: 0 1em;">
648 Hold next available item from an item group
649 [% IF force_hold_level == 'item_group' %]
650 <span class="error"><i>(Required)</i></span>
654 [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
656 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
657 Hold must be record level
659 [% ELSIF force_hold_level == 'item' # Patron has placed an item level hold previously for this record %]
661 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
662 Hold must be item level
673 [% FOREACH g IN biblio.object.item_groups.search({}, { order_by => ['display_order'] }) %]
677 <input id="item_group_id_[% g.id | html %]" type="radio" name="item_group_id" value="[% g.id | html %]" />
680 <label for="item_group_id_[% g.id | html %]">[% g.description | html %]</label>
689 <!-- /ItemGroup level holds -->
691 <h2 style="padding: 0 1em;">
692 Place a hold on a specific item
693 [% IF force_hold_level == 'item' %]
694 <span class="error"><em>(Required)</em></span>
698 <table id="requestspecific">
702 <th>Allowed pickup locations</th>
703 [% IF Koha.Preference('item-level_itypes') %]
707 [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %]
710 <th>Home library</th>
711 <th>Last location</th>
712 [% IF itemdata_ccode %]
717 [% IF itemdata_enumchron %]
724 [% SET selected = 0 %]
725 [% FOREACH itemloo IN biblio.itemloop %]
726 [% UNLESS ( itemloo.hide ) %]
727 <tr class="[% itemloo.backgroundcolor | html %]">
729 [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
731 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
732 Hold must be record level
734 [% ELSIF force_hold_level == 'item_group' %]
736 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
737 Hold must be item group level
739 [% ELSIF ( itemloo.available ) %]
740 <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
741 [% ELSIF ( itemloo.override ) %]
742 <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
743 <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
746 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
747 [% IF itemloo.not_holdable %]
748 [% IF itemloo.not_holdable == 'damaged' %]
749 <span>Item damaged</span>
750 [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
751 <span>Age restricted</span>
752 [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
753 <span>Exceeded max holds per record</span>
754 [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
755 <span>Daily hold limit reached for patron</span>
756 [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
757 <span>Too many holds</span>
758 [% ELSIF itemloo.not_holdable == 'notReservable' %]
759 <span>Not holdable</span>
760 [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
761 <span>Patron is from different library</span>
762 [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
763 <span>Cannot place hold from patron's library</span>
764 [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
765 <span>Patron already has hold for this item</span>
766 [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
767 <span>Cannot be transferred to pickup library</span>
768 [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
769 <span>Only pickup locations within the same hold group are allowed</span>
770 [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
771 <span>No holds are allowed on this item</span>
772 [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %]
773 <span>Library is not a pickup location</span>
774 [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
775 <span>No valid pickup location</span>
776 [% ELSIF itemloo.not_holdable == 'notforloan' %]
777 <span>Not for loan</span>
779 <span>[% itemloo.not_holdable | html %]</span>
783 [% END # /IF force_hold_level %]
786 [% IF (itemloo.pickup_locations_count > 0) || itemloo.override %]
787 <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations" style="width:100%;"
788 data-item-id="[% itemloo.itemnumber | html %]"
789 data-patron-id="[% patron.borrowernumber | html %]"
790 data-pickup-location-source="item">
791 [% IF (itemloo.default_pickup_location) %]
792 <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option>
797 [% IF Koha.Preference('item-level_itypes') %]
799 [% UNLESS ( noItemTypeImages ) %]
800 [% IF ( itemloo.itemtype.image_location) %]<img src="[% itemloo.itemtype.image_location | html %]" alt="" /> <br /> [% END %]
802 <span class="itypetext">[% itemloo.itemtype.translated_description | html %]</span>
806 [% itemloo.barcode | html %]
808 [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %]
810 [% itemloo.object.item_group.description | html %]
814 [% Branches.GetName( itemloo.homebranch ) | html %]
817 [% Branches.GetName( itemloo.holdingbranch ) | html %]
819 [% IF itemdata_ccode %]
821 [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
825 [% itemloo.itemcallnumber | html %]
828 [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %]
830 [% IF itemdata_enumchron %]
832 [% itemloo.enumchron | html %]
835 [% IF ( itemloo.onloan ) %]
836 <td data-order="[% itemloo.date_due | html %]">
837 <span class="checkedout">Due [% itemloo.date_due | $KohaDates as_due_date => 1 %]</span>
840 [% IF ( itemloo.transfertwhen ) %]
841 <span>In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
842 to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | $KohaDates %]</span>
846 [% IF ( itemloo.reservedate ) %]
847 [% IF ( itemloo.nocancel ) %]
848 <span>Can't be cancelled when item is in transit</span>
850 [% IF ( itemloo.waitingdate ) %]
851 [% IF ( itemloo.canreservefromotherbranches ) %]
852 <span>Waiting for [% INCLUDE 'patron-title.inc' patron=itemloo.ReservedFor %] at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.waitingdate | $KohaDates %]</span>
854 <span>Waiting at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.waitingdate | $KohaDates %]</span>
857 [% IF ( itemloo.canreservefromotherbranches ) %]
858 [% IF itemloo.reservedate %]
859 <span>On hold for [% INCLUDE 'patron-title.inc' patron=itemloo.ReservedFor %] expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since</span>
861 <span>On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %]</span>
863 [% ELSIF itemloo.reservedate %]
864 <span>On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.reservedate | $KohaDates %]</span>
866 <span>On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %]</span>
869 <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
870 [% END # /IF itemloo.nocancel %]
873 [% END # /IF itemloo.reservedate %]
875 [% IF itemloo.item_level_holds == "N" %]
876 <br/>Item level hold not allowed from OPAC
877 [% ELSIF itemloo.item_level_holds == "F" %]
878 <br/>Item level hold forced from OPAC
881 [% IF ( itemloo.itemlost ) %]
882 <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
885 [% IF ( itemloo.damaged ) %]
886 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
889 [% IF ( itemloo.withdrawn ) %]
890 <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
893 [% IF ( itemloo.notforloan ) %]
894 <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
895 [% ELSIF ( itemloo.notforloanitype ) %]
896 <span class="nfl">Not for loan (Itemtype not for loan)</span>
900 [% END # / UNLESS itemloo.hide %]
901 [% END # /FOREACH itemloo %]
903 </table> <!-- /#requestspecific -->
907 <p class="hiddencount">
908 <a href="request.pl?biblionumber=[% biblio.biblionumber | uri %]&borrowernumber=[% borrowernumber | uri %]&showallitems=1">Show all items ([% hiddencount | html %] hidden)</a>
911 [% END # /IF hiddencount %]
913 [% ELSE # /UNLESS multi_hold %]
915 <table id="requesttitles">
918 <th>Pickup location</th>
920 [% UNLESS Koha.Preference('item-level_itypes') %]
926 [% FOREACH biblioloo IN biblioloop %]
927 [% IF ( biblioloo.warn ) %]
933 [% UNLESS ( biblioloo.warn ) %]
934 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
938 [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %]
939 <select name="pickup_[% biblioloo.biblionumber | html %]"
940 class="multi_pickup_select"
941 data-biblio-id="[% biblioloo.biblionumber | html %]"
942 data-patron-id="[% patron.borrowernumber | html %]"
943 data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
944 <option value=""></option>
945 [% FOREACH pickup_location IN biblioloo.pickup_locations %]
946 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
954 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
955 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
957 [% IF ( biblioloo.publicationyear ) %]
959 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
963 [% IF ( biblioloo.warn ) %]
964 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
967 [% UNLESS Koha.Preference('item-level_itypes') %]
969 <img src="[% biblioloo.itemtype.image_location | html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
972 <td>[% biblioloo.rank | html %]</td>
974 [% IF ( biblioloo.checked_previously ) %]
975 <span>Patron has previously checked out this title</span><br/>
977 [% IF ( biblioloo.alreadyres ) %]
980 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
985 [% IF ( biblioloo.alreadyres ) %]
987 [% 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
990 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
991 <li> <strong>No items are available</strong> to be placed on hold</li>
994 [% IF ( biblioloo.alreadyres ) %]
997 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1003 [% END # /FOREACH biblioloo %]
1004 </table> <!-- /#requesttitles -->
1006 [% END # /UNLESS multi_hold %]
1008 <fieldset class="action">
1009 [% IF ( patron AND patron.borrowernumber ) %]
1010 [% IF ( multi_hold ) %]
1011 [% IF ( override_required ) %]
1012 <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
1013 [% ELSIF ( no_bibs_available ) %]
1014 <button type="submit" class="btn btn-primary btn-disabled" disabled="disabled">Place holds</button>
1015 [% ELSIF ( none_available ) %]
1016 <button type="submit" class="btn btn-primary">Place holds</button>
1018 <button type="submit" class="btn btn-primary" id="multi_hold_submit">Place holds</button>
1021 [% IF ( override_required ) %]
1022 <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
1023 [% ELSIF ( none_available ) %]
1024 <button type="submit" class="btn btn-primary btn-disabled" disabled="disabled">Place hold</button>
1026 <button type="submit" class="btn btn-primary">Place hold</button>
1029 [% END # /IF patron %]
1030 </fieldset> <!-- /.action -->
1031 </form> <!-- /#hold-request-form -->
1032 </fieldset> <!-- /.rows -->
1035 [% UNLESS ( patron ) %]
1036 [% UNLESS borrowers %]
1037 [% SET hold_count = Biblio.HoldsCount( biblio.biblionumber ) | html %]
1039 <label for ="always_show_holds">Always show holds</label>
1040 [% IF always_show_holds == 'DONT' %]
1041 <input type="checkbox" name="always_show_holds" id="always_show_holds" value="DO">
1042 [% UNLESS reserveloop %]
1043 <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>
1046 <input type="checkbox" name="always_show_holds" value="DO" id="always_show_holds" checked="checked">
1050 [% IF ( reserveloop ) %]
1051 <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
1052 [% INCLUDE 'csrf-token.inc' %]
1053 [% IF ( multi_hold ) %]
1054 [% FOREACH biblionumber IN biblionumbers %]
1055 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
1060 <div class="dialog message">
1061 <p>The job has been enqueued! It will be processed as soon as possible.</p>
1062 <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>
1066 <h2>Existing holds</h2>
1067 <div id="toolbar" class="btn-toolbar">
1068 <div class="btn-group">
1069 <input type="submit" class="btn btn-primary" name="submit" value="Update hold(s)" />
1071 <div class="btn-group">
1072 <button class="btn cancel_selected_holds" data-bulk="true"></button>
1074 <fieldset id="cancellation-reason-fieldset" class="action" style="display:none">
1075 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1076 [% IF hold_cancellation.count %]
1077 <label for="cancellation-reason">Cancellation reason: </label>
1078 <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
1079 <option value="">No reason given</option>
1080 [% FOREACH reason IN hold_cancellation %]
1081 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1087 <div class="page-section">
1089 [% FOREACH biblioloo IN biblioloop %]
1090 [% IF ( biblioloo.reserveloop ) %]
1091 <div class="hold_title" id="hold_title_[% biblioloo.biblionumber | html %]">
1092 [% IF ( multi_hold ) %]
1094 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
1095 [% biblioloo.title | html %]
1096 </a> <span class="number_box"><span>[% biblioloo.reserveloop.size | html %] [% tn('Hold', 'Holds', biblioloo.reserveloop.size) | $raw %]</span></span>
1100 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
1102 [% SET branchcodes = [] %]
1104 [% FOREACH h IN biblioloo.reserveloop %]
1105 [% branchcodes.push( h.branchcode ) %]
1107 [% branchcodes = branchcodes.unique %]
1108 [% IF ( branchcodes.empty ) %]
1110 There are no holds on this title.
1114 [% FOREACH b IN branchcodes.sort %]
1115 [% SET holds_by_branch = [] %]
1116 [% FOREACH h IN biblioloo.reserveloop %]
1117 [% IF h.branchcode == b %]
1118 [% holds_by_branch.push( h ) %]
1121 <div class="holds_by_library">
1122 <h4>[% Branches.GetName( b ) | html %]</h4>
1124 [% INCLUDE holds_table.inc holds=holds_by_branch %]
1126 [% END # /FOREACh b %]
1127 [% END # /IF ( branchcodes.empty ) %]
1129 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
1131 [% SET itemtypes = [] %]
1133 [% FOREACH h IN biblioloo.reserveloop %]
1134 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1135 [% itemtypes.push( hold_itemtype ) %]
1137 [% itemtypes = itemtypes.unique %]
1138 [% IF ( itemtypes.empty ) %]
1140 There are no holds on this title.
1144 [% FOREACH i IN itemtypes.sort %]
1145 [% SET holds_by_itemtype = [] %]
1146 [% FOREACH h IN biblioloo.reserveloop %]
1147 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1148 [% IF hold_itemtype == i %]
1149 [% holds_by_itemtype.push( h ) %]
1153 <div class="holds_by_itemtype">
1155 <h4>[% ItemTypes.GetDescription( i ) | html %]</h4>
1157 <h4>Any item type</h4>
1159 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1161 [% END # /FOREACH i %]
1162 [% END # /IF ( itemtypes.empty ) %]
1164 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
1165 [% SET branchcodes = [] %]
1167 [% FOREACH h IN biblioloo.reserveloop %]
1168 [% branchcodes.push( h.branchcode ) %]
1170 [% branchcodes = branchcodes.unique %]
1171 [% IF ( branchcodes.empty ) %]
1173 There are no holds on this title.
1177 [% FOREACH b IN branchcodes.sort %]
1178 <div class="holds_by_library">
1179 <h4 class="library_holds">[% Branches.GetName( b ) | html %]</h4>
1180 [% SET holds_by_branch = [] %]
1181 [% FOREACH h IN biblioloo.reserveloop %]
1182 [% IF h.branchcode == b %]
1183 [% holds_by_branch.push( h ) %]
1187 [% SET itemtypes = [] %]
1188 [% FOREACH h IN holds_by_branch %]
1189 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1190 [% itemtypes.push( hold_itemtype ) %]
1192 [% itemtypes = itemtypes.unique %]
1194 [% FOREACH i IN itemtypes.sort %]
1195 <div class="holds_by_itemtype">
1196 <h5 class="itemtype_holds">
1198 [% ItemTypes.GetDescription( i ) | html %]
1200 <span>Any item type</span>
1204 [% SET holds_by_itemtype = [] %]
1205 [% FOREACH h IN holds_by_branch %]
1206 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1207 [% IF hold_itemtype == i %]
1208 [% holds_by_itemtype.push( h ) %]
1211 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1212 </div> <!-- /.holds_by_itemtype -->
1214 </div> <!-- /.holds_by_library -->
1215 [% END # /FOREACH b %]
1216 [% END # /IF ( branchcodes.empty ) %]
1220 [% IF ( biblioloo.reserveloop.size ) %]
1221 [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
1224 There are no holds on this title.
1228 [% END # /IF HoldsSplitQueue %]
1229 </div> <!-- /hold_title -->
1230 [% END # /IF biblioloo.reserveloop %]
1231 [% END # FOREACH biblioloo %]
1233 </form> <!-- /#existing_holds -->
1234 [% END # IF reserveloop %]
1235 [% END # UNLESS patron %]
1239 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
1240 </div> <!-- /.col-md-10.col-md-offset-1 -->
1242 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1243 <div class="col-sm-2 col-sm-pull-10">
1245 [% INCLUDE 'biblio-view-menu.inc' %]
1247 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1249 </div> <!-- /.row -->
1251 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
1252 <div class="modal-dialog" role="document">
1253 <div class="modal-content">
1254 <div class="modal-header">
1255 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1256 <h3>Confirm deletion</h3>
1259 <div class="modal-body">
1260 <p>Are you sure you want to cancel this hold?</p>
1262 <fieldset class="action">
1263 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1264 [% IF hold_cancellation.count %]
1265 <label for="cancellation-reason">Cancellation reason: </label>
1266 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
1267 <option value="">No reason given</option>
1268 [% FOREACH reason IN hold_cancellation %]
1269 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1276 <div class="modal-footer">
1277 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
1278 <a href="#" data-dismiss="modal">Cancel</a>
1284 [% MACRO jsinclude BLOCK %]
1285 [% INCLUDE 'datatables.inc' %]
1286 [% INCLUDE 'calendar.inc' %]
1287 [% INCLUDE 'columns_settings.inc' %]
1288 [% Asset.js("lib/hc-sticky.js") | $raw %]
1289 [% INCLUDE 'select2.inc' %]
1290 [% Asset.js("js/holds.js") | $raw%]
1292 [% SET url_biblio_params = "biblionumber=" _ biblionumbers.join("&biblionumber=") %]
1294 [% SET url_biblio_params = url_biblio_params _ "&multi_hold=1" %]
1298 $(document).ready(function () {
1299 hold_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'holds', 'patron_holds_table', 'json' ) | $raw %];
1300 KohaTable("patron_holds_table", {
1302 "bKohaColumnsUseNames": true,
1303 }, hold_table_settings);
1306 var biblionumbers = [[% biblionumbers.join(', ') | $raw %]];
1307 var borrowernumber = "[% patron.borrowernumber | $raw %]";
1308 var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1309 var override_items = {[% FOREACH biblio IN biblioloop %][% FOREACH itemloo IN biblio.itemloop %][% IF ( itemloo.override ) %]
1310 [% itemloo.itemnumber | html %]: {
1311 homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1312 holdallowed: "[% itemloo.holdallowed | html %]"
1314 [% END %][% END %][% END %]
1317 damaged: _("Item damaged"),
1318 ageRestricted: _("Age restricted"),
1319 tooManyHoldsForThisRecord: _("Exceeded max holds per record"),
1320 tooManyReservesToday: _("Daily hold limit reached for patron"),
1321 tooManyReserves: _("Too many holds"),
1322 notReservable: _("Not holdable"),
1323 noReservesAllowed: _("No reserves allowed"),
1324 cannotReserveFromOtherBranches: _("Patron is from different library"),
1325 itemAlreadyOnHold: _("Patron already has hold for this item"),
1326 cannotBeTransferred: _("Cannot be transferred to pickup library"),
1327 pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed")
1330 var MSG_CANCEL_SELECTED = _("Cancel selected (%s)");
1331 $.fn.select2.defaults.set("width", "100%" );
1332 $.fn.select2.defaults.set("dropdownAutoWidth", true );
1334 $(document).ready(function() {
1335 $('#cancellation-reason-fieldset').hide();
1336 $('.rank-request').on('change', function() {
1337 if ( $(".rank-request option:selected[value='del']").length ) {
1338 $('#cancellation-reason-fieldset').show();
1340 $('#cancellation-reason-fieldset').hide();
1344 if( $("#circ_holds_select").length > 0 ){
1345 [% SET active = clubs ? 1 : 0 %]
1346 /* Set active tab based on whether a club search was submitted */
1347 var tabs = $("#circ_holds_select li:eq(" + [% active | $raw %] + ") a").tab("show");
1348 $( tabs[0].hash ).find("input.focus").focus();
1350 /* Change active focus when tabs change */
1351 $("#circ_holds_select a[data-toggle='tab']").on("shown.bs.tab", function (e) {
1352 active_tab = e.target.hash;
1353 $( active_tab ).find("input.focus").focus();
1358 function ToggleHoldsToPlace() {
1359 if ( $("#requestany").prop('checked') ) {
1360 $("#holds_to_place_count").prop('disabled', false);
1362 $("#holds_to_place_count").prop('disabled', true);
1365 ToggleHoldsToPlace();
1366 $("#requestany").on('change', function(){
1367 ToggleHoldsToPlace();
1370 [% IF Koha.Preference('UseBranchTransferLimits') %]
1371 $("#pickup").on('change', function(){
1372 var pickup = $("#pickup").val();
1373 var url = "?pickup=" + pickup;
1374 url += "&borrowernumber=" + borrowernumber;
1375 url += "&biblionumber=" + biblionumbers[0];
1376 window.location.replace(url);
1380 var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1382 "dom": '<"top pager"ilf>t',
1385 //Override fieldset styling for dataTables search box
1386 $("div.top.pager").css("margin-left","1em");
1387 $(".dataTables_filter label").css({
1389 "margin-right":"0em"
1392 $("#club-request-form").on("submit", function() {
1394 $('.clubalert, .holdalert').addClass('hide');
1396 pickup_library_id: $('select[name="pickup"]').val()
1398 if($('input[name="checkitem"]:checked').length)
1399 data.item_id = $('input[name="checkitem"]:checked').val();
1400 if($('input[name="item_group_id"]:checked').length)
1401 data.item_group_id = $('input[name="item_group_id"]:checked').val();
1402 if($('input[name="borrowernumber"]').length)
1403 data.patron_id = $('input[name="borrowernumber"]').val();
1404 if($('textarea[name="notes"]').length)
1405 data.notes = $('textarea[name="notes"]').val()||null;
1406 if($('input[name="itemtype"]').length) {
1407 data.item_type = $('input[name="itemtype"]').val()||null;
1409 if($('input[name="default_patron_home"]:checked').length) {
1410 data.default_patron_home = 1;
1413 const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1;
1414 var newloc = 'request.pl?';
1415 biblionumbers.forEach(function (biblionumber) {
1416 newloc += '&biblionumber=' + biblionumber;
1419 biblionumbers.forEach(function(biblionumber) {
1420 data.biblio_id = biblionumber;
1422 url: $t.attr('action'),
1423 method: $t.attr('method').toUpperCase(),
1424 contentType: 'application/json',
1425 data: JSON.stringify(data)
1427 for(let i = 0; i < count; i++) {
1429 .then(function(result) {
1430 document.location = newloc;
1432 .fail(function(err) {
1433 var message = err.responseJSON.error;
1434 var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/);
1435 if(match && ERROR_MAP[match[1]]) {
1436 message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>'
1438 $('.clubalert, .holdalert').removeClass('hide').html(message);
1446 [% UNLESS ( multi_hold ) %]
1447 $("#hold-request-form").on("submit", function(e){
1448 return check(e, $(this));
1451 $("#hold-request-form").on("submit", function(){
1452 return checkMultiHold();
1456 $(".pickup_location_dropdown").each( function () {
1457 $(this).pickup_locations_dropdown();
1460 $("#pickup_multi").select2({
1465 $('.multi_pickup_select').select2({
1470 $("#pickup_multi").on("change", function() {
1471 var selection = $(this).val();
1472 if ( selection != '' ) {
1473 $(".multi_pickup_select").each(function() {
1474 var valid_pickup_locations = $(this).data('pickup-locations');
1475 if ( valid_pickup_locations.includes(selection) ) {
1476 $(this).val(selection);
1477 $(this).trigger("change");
1483 $("#pickup").each( function () {
1484 $(this).pickup_locations_dropdown();
1487 $(".pickup_locations").each(function () {
1488 $(this).pickup_locations_dropdown();
1492 function check( e, table ) {
1496 if ( ! $("#requestany").is(":checked") ) {
1497 // requestany not selected, go through the item-specific cases
1498 if ( $('input[type="radio"]:checked').length > 0 ) {
1499 // got item-specific hold requests in the form!
1500 // verify they have a pickup location selected
1502 if (table.find('input[type="radio"]:checked')
1504 .find(".pickup_locations").val() === null) {
1506 msg = _("- Please select a pickup location for the item" + "\n")
1510 msg = (_("- Please select an item to place a hold") + "\n");
1513 if( $("#pickup").length < 1 || $("#pickup").val() == "" || $('#pickup').val() === null ){
1514 msg = _("- Please select a pickup location for this hold" + "\n");
1520 $('#hold-request-form').preventDoubleFormSubmit();
1529 function checkMultiHold() {
1531 var selected_bibs = $(".multi_hold_item_checkbox:checked");
1532 if ( selected_bibs.length > 0 ) {
1533 // there are biblios selected in the form!
1534 // verify they have a pickup location selected
1536 var pickup_not_set = 0;
1537 selected_bibs.each(function() {
1538 if ( $(this).closest('tr').find(".multi_pickup_select").val() === "" ) {
1542 var bibnum = $(this).attr("title");
1545 if ( pickup_not_set > 0 ) {
1546 alert( _("Please make sure all selected titles have a pickup location set" + "\n") );
1551 alert( _("Please select at least one title" + "\n") );
1555 $('#hold-request-form').preventDoubleFormSubmit();
1560 $(document).ready(function() {
1562 $("#always_show_holds").change(function(){
1563 if( $(this).prop('checked') ){
1564 document.cookie = 'always_show_holds=DO';
1566 document.cookie = 'always_show_holds=DONT';
1569 $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1570 var itemnumber = this.value;
1573 switch (override_items[itemnumber].holdallowed) {
1574 case "not_allowed": msg = _("This item normally cannot be put on hold."); break;
1575 case "from_home_library": msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
1578 msg += "\n\n" + _("Place hold on this item?");
1580 return confirm(msg);
1582 $("button.warning").click(function() {
1583 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1585 $("#requestany").click(function() {
1587 $("input[name=checkitem]").each(function() {
1588 $(this).prop("checked", false);
1592 $("input[name=checkitem]").click(function() {
1594 $("input[name=checkitem]").each(function() {
1599 if(onechecked == 1){
1600 $("#requestany").prop("checked", false);
1601 $("#holds_to_place_count").prop('disabled', true);
1603 $("#requestany").prop("checked",true);
1604 $("#holds_to_place_count").prop('disabled', false);
1607 var prev_rank_request;
1608 $("select[name=rank-request]").on("focus", function() {
1609 prev_rank_request = $(this).val();
1610 var row = $(this).parents("tr:first");
1611 }).change(function() {
1612 var row = $(this).parents("tr:first");
1613 var value = parseInt($(this).val());
1614 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
1615 if( !isNaN(value) ) { //If moved to 'del'
1616 var after = row.parent().find(`tr:nth-child(${value+found_holds})`); //Go to the row 1 after the new value (and skip found holds)
1617 if (prev_rank_request > value) {
1618 row.insertBefore(after);
1620 row.insertAfter(after);
1624 var next_priority = 1;
1625 $("select[name=rank-request]").each(function () {
1626 if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
1627 $(this).val(next_priority);
1632 $(".clear-date").on("click",function(e){
1634 var fieldID = this.id.replace("clear-date-","");
1635 $("#" + fieldID).val("");
1638 // Confirm cancellation of hold
1640 $(".cancel-hold").on("click",function(e) {
1642 cancel_link = $(this);
1643 $('#cancelModal').modal();
1646 $("#cancelModalConfirmBtn").on("click",function(e) {
1648 if(cancel_link.data('bulk')) {
1649 [% SET data_url = 'biblionumber=' _ biblionumbers.join('&biblionumber=') %]
1650 link = `request.pl?[% data_url | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1652 let borrowernumber = cancel_link.data('borrowernumber');
1653 let biblionumber = cancel_link.data('biblionumber');
1654 let reserve_id = cancel_link.data('id');
1655 link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`;
1657 let reason = $("#modal-cancellation-reason").val();
1659 link += "&cancellation-reason=" + reason
1661 window.location.href = link;
1665 [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems || nobiblio ) %]
1666 [% IF ( PatronAutoComplete ) %]
1667 patron_autocomplete($("#search_patron_filter"), { 'link-to': 'reserve', 'url-params': '[% url_biblio_params | url %]' });
1671 Sticky = $("#toolbar");
1673 stickTo: "#existing_holds",
1674 stickyClass: "floating"
1677 [% IF Koha.Preference('EnableItemGroupHolds') %]
1678 $(':radio[name="item_group_id"]').change(function(){
1679 $(':radio[name="checkitem"]').prop('checked', false);
1682 $(':radio[name="checkitem"]').change(function(){
1683 $(':radio[name="item_group_id"]').prop('checked', false);
1687 if(!localStorage.selectedHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) {
1688 localStorage.selectedHolds = [];
1691 $('.holds_table .select_hold').each(function() {
1692 if(localStorage.selectedHolds.includes($(this).data('id'))) {
1693 $(this).prop('checked', true);
1697 $('.holds_table .select_hold_all').each(function() {
1698 var table = $(this).parents('.holds_table');
1699 var count = $('.select_hold:not(:checked)', table).length;
1700 $('.select_hold_all', table).prop('checked', !count);
1703 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1705 $('.holds_table .select_hold_all').click(function() {
1706 var table = $(this).parents('.holds_table');
1707 var count = $('.select_hold:checked', table).length;
1708 $('.select_hold', table).prop('checked', !count);
1709 $(this).prop('checked', !count);
1710 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1711 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1714 $('.holds_table .select_hold').click(function() {
1715 var table = $(this).parents('.holds_table');
1716 var count = $('.select_hold:not(:checked)', table).length;
1717 $('.select_hold_all', table).prop('checked', !count);
1718 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1719 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1722 $('.cancel_selected_holds').click(function(e) {
1724 if($('.holds_table .select_hold:checked').length) {
1725 cancel_link = $(this);
1726 delete localStorage.selectedHolds;
1727 $('#cancelModal').modal();
1735 table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
1738 [% PROCESS patron_search_js table_id => 'table_borrowers', categories => categories, libraries => libraries, 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' %]
1740 $(document).ready(function() {
1741 $("#holds_patronsearch").on("submit", filter);
1743 $('.printholdslip').click(function(){
1744 var reserve_id = $(this).attr('data-reserve_id');
1745 window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
1751 [% INCLUDE 'intranet-bottom.inc' %]