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">
151 [% IF ( nobiblio ) %]
152 <div class="dialog alert">
154 <strong>Cannot place hold:</strong> one or more records don't exist.
156 <strong>Cannot place hold:</strong> this record doesn't exist.
161 <div class="dialog alert">
163 <strong>Cannot place hold:</strong> one or more records without items attached.
165 <strong>Cannot place hold:</strong> this record has no items attached.
170 [% IF ( messagetransfert ) %]
171 <div class="dialog message">
172 <h2>Hold found for ([% nextreservtitle | html %]), please transfer</h2>
173 <p>Hold placed by : <strong> [% nextreservsurname | html %] [% nextreservfirstname | html %]</strong> at : <strong> [% branchname | html %] </strong>, Please transfer this item.
175 <form name="cancelReservewithtransfert" action="branchreserves.pl" method="post">
176 <input type="submit" class="button" />
181 [% UNLESS ( multi_hold ) %]
182 <h2>Place a hold on [% INCLUDE 'biblio-title.inc' link = 1 %] [% IF biblio.author %] by [% biblio.author | html %][% END %]</h2>
186 <span>Place holds</span>
189 <span>Search patrons or clubs</span>
191 <span>Search patrons</span>
197 [% UNLESS club OR patron OR patron.borrowernumber OR noitems OR nobiblio %]
198 [% IF ( messageborrower ) %]
199 <div class="dialog alert">
200 <h3>Patron not found</h3>
201 <p>No patron with this name, please, try another</p>
205 [% IF ( messageclub ) %]
206 <div class="dialog alert">
207 <h3>Club not found</h3>
208 <p>No club with this name, please, try another</p>
212 [% UNLESS multi_hold %]
214 <h2>Search patrons or clubs</h2>
216 <h2>Search patrons</h2>
220 [% WRAPPER tabs id= "circ_holds_select" %]
221 [% WRAPPER tabs_nav %]
222 [% WRAPPER tab_item tabname= "holds_patronsearch_pane" bt_active= 1 %] <span>Patrons</span> [% END %]
224 [% WRAPPER tab_item tabname= "holds_clubsearch_pane" %] <span>Clubs</span> [% END %]
226 [% END # /WRAPPER tabs_nav %]
228 [% WRAPPER tab_panels %]
229 [% WRAPPER tab_panel tabname="holds_patronsearch_pane" bt_active= 1 %]
230 [% PROCESS patron_search_filters_simple %]
232 [% PROCESS patron_search_table table_id => 'table_borrowers', open_on_row_click => 1 %]
233 [% END # /tab_panel# %]
235 [% WRAPPER tab_panel tabname="holds_clubsearch_pane" %]
236 <form id="holds_clubsearch" action="request.pl" method="post">
237 <div class="hint">Enter club ID or partial name:</div>
238 <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" />
239 <input type="submit" class="btn btn-primary" value="Search" />
240 [% FOREACH biblionumber IN biblionumbers %]
241 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
244 </form> <!-- /#holds_patronsearch -->
246 [% INCLUDE 'clubs-table.inc' destination = "holds" %]
248 [% END # /tab_panel# %]
249 [% END # /IF clubcount %]
250 [% END # /WRAPPER tab_panels %]
251 [% END # /WRAPPER tabs %]
254 <div class="dialog alert hide clubalert">
256 <fieldset class="rows">
257 <legend>Hold details</legend>
258 <form action="/api/v1/clubs/[% club.id | html %]/holds" method="post" name="form" id="club-request-form">
260 [% IF ( multi_hold ) %]
261 <input type="hidden" name="request" value="any"/>
262 [% FOREACH biblioloo IN biblioloop %]
263 [% UNLESS biblioloo.none_avail %]
264 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
265 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
266 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
270 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
271 <input type="hidden" name="title" value="[% biblio.title | html %]" />
272 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
273 [% END # /IF multi_hold %]
276 <span class="label">Club: </span> [% club.name | html %]
279 <span class="label">Description: </span> [% club.description | html %]
282 <label for="pickup">Pickup at:</label>
283 <select name="pickup" id="pickup_club">
284 [% PROCESS options_for_libraries libraries => Branches.all({ selected => club.branchcode, search_params => { pickup_location => 1 } }) %]
288 <label for="default_patron_home">Pickup at patron's home library when possible:</label>
289 <input type="checkbox" id="default_patron_home" name="default_patron_home"/>
292 <h2 style="padding: 0 1em;">Members</h2>
294 [% FOREACH member IN members %]
295 [% SET patron = member.patron %]
296 <li style="padding: 0.5em 1em;">
297 <div>[% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %]</div>
298 [% IF member.exceeded_maxreserves %]
300 <i class="fa fa-error"></i>
301 <strong>Too many holds: </strong> Patron can only place a maximum of [% maxreserves | html %] total holds.
304 [% IF ( patron.is_expired ) %]
306 <i class="fa-solid fa-triangle-exclamation"></i>
307 <strong>Account has expired</strong>
310 [% IF patron.is_debarred %]
312 <i class="fa-solid fa-triangle-exclamation"></i>
313 <strong>Patron has restrictions</strong>
316 [% IF member.amount_outstanding && Koha.Preference('maxoutstanding') && member.amount_outstanding > Koha.Preference('maxoutstanding') %]
318 <i class="fa-solid fa-triangle-exclamation"></i>
319 <strong>Patron has outstanding fines: [% member.amount_outstanding | $Price %]</strong>
323 [% IF ( member.diffbranch ) %]
325 <i class="fa-solid fa-triangle-exclamation"></i>
326 <strong>Pickup library is different.</strong> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )
331 [% UNLESS ( multi_hold ) %]
332 <fieldset class="action">
333 <input type="submit" class="btn btn-primary" value="Place hold" />
336 <table id="requesttitles">
340 [% UNLESS Koha.Preference('item-level_itypes') %]
346 [% FOREACH biblioloo IN biblioloop %]
347 [% IF ( biblioloo.warn ) %]
353 [% UNLESS ( biblioloo.warn ) %]
354 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
360 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
361 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
363 [% IF ( biblioloo.publicationyear ) %]
365 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
369 [% IF ( biblioloo.warn ) %]
370 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
373 [% UNLESS Koha.Preference('item-level_itypes') %]
375 <img src="[% biblioloo.itemtype.image_location| html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
378 <td>[% biblioloo.rank | html %]</td>
380 [% IF ( biblioloo.checked_previously ) %]
381 <span>Patron has previously checked out this title</span><br/>
383 [% IF ( biblioloo.alreadyres ) %]
386 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
391 [% IF ( biblioloo.alreadyres ) %]
393 [% 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
396 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
397 <li> <strong>No items are available</strong> to be placed on hold</li>
400 [% IF ( biblioloo.alreadyres ) %]
403 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
409 [% END # /FOREACH biblioloo %]
410 </table> <!-- /#requesttitles -->
414 [% ELSIF NOT ( noitems || nobiblio ) # /UNLESS patron %]
416 [% IF ( checked_previously && !multi_hold ) %]
417 <div class="dialog alert">
419 <li>Patron has previously checked out this title</li>
424 [% IF ( no_reserves_allowed || exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted || recall ) %]
425 <div class="dialog alert">
427 [% UNLESS ( multi_hold ) %]
428 <h3>Cannot place hold</h3>
430 [% IF ( no_reserves_allowed ) %]
431 <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>
432 [% ELSIF ( exceeded_maxreserves ) %]
433 <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>
434 [% ELSIF ( exceeded_holds_per_record ) %]
435 <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>
436 [% ELSIF ( alreadypossession ) %]
437 <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>
438 [% ELSIF ( alreadyreserved ) %]
439 <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>
440 [% ELSIF ( ageRestricted ) %]
441 <li><strong>Age restricted</strong></li>
442 [% ELSIF ( none_available ) %]
443 <li> <strong>No items are available</strong> to be placed on hold.</li>
444 [% ELSIF ( maxreserves ) %]
445 <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>
446 [% ELSIF ( recall ) %]
447 <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>
448 [% END # /IF exceeded_maxreserves %]
450 [% ELSE # UNLESS multi_hold %]
451 <h3>Cannot place hold on some items</h3>
452 [% IF (no_reserves_allowed ) %]
453 <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>
454 [% ELSIF ( exceeded_maxreserves ) %]
455 <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>
456 [% ELSIF ( exceeded_holds_per_record ) %]
457 [% FOREACH biblioloo IN biblioloop %]
458 [% IF (biblioloo.tooManyHoldsForThisRecord) %]
459 <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>
462 [% ELSIF ( none_available ) %]
463 <li><strong>No items available: </strong>One or more records have no items that can be held</li>
464 [% END # /IF exceeded_maxreserves %]
465 [% END # /UNLESS multi_hold %]
467 [% END # /IF ( exceeded_maxreserves || ... %]
469 [% IF ( patron.is_expired || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
470 <div class="dialog message">
472 [% IF ( patron.is_expired ) %]
473 <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>
476 [% IF patron.is_debarred %]
477 <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>
480 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
481 <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>
484 [% IF ( diffbranch ) %]
485 <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>
487 </ul> <!-- /.dialog.message -->
489 [% END # /IF patron.is_expired || diffbranch ... %]
491 [% IF ( messageborrower ) %]
492 <div class="dialog alert">
493 <h3>Patron not found:</h3>
494 <p>Name or barcode not found. Please try an other </p>
498 <div class="dialog alert hide holdalert">
501 <fieldset class="rows">
502 <legend>Hold details</legend>
503 <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
505 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
506 [% FOREACH biblionumber IN biblionumbers %]
507 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
509 [% IF ( multi_hold ) %]
510 <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
511 <input type="hidden" name="request" value="any"/>
512 [% FOREACH biblioloo IN biblioloop %]
513 [% UNLESS biblioloo.none_avail %]
514 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
515 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
516 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
520 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
521 <input type="hidden" name="title" value="[% biblio.title | html %]" />
522 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
523 [% END # /IF multi_hold %]
527 <span class="label">Patron:</span>
528 [% IF ( patron.borrowernumber ) %]
529 [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %]
535 [% UNLESS ( multi_hold ) %]
537 <span class="label">Estimated priority:</span>
538 <strong>[% fixedRank | html %]</strong>
543 <label for="holdnotes">Notes:</label>
544 <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
547 <label for="pickup">Pickup at:</label>
548 [% UNLESS ( multi_hold ) %]
549 <select name="pickup" id="pickup"
550 data-biblio-id="[% biblio.biblionumber | html %]"
551 data-patron-id="[% patron.borrowernumber | html %]"
552 data-pickup-location-source="biblio">
553 [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
555 <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
556 <option value="" selected="selected"></option>
557 [% FOREACH pickup_location IN multi_pickup_locations %]
558 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
564 [% UNLESS ( multi_hold ) %]
565 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
567 <label for="itemtype">Request specific item type:</label>
568 <select name="itemtype" id="itemtype">
569 <option value="">Any item type</option>
570 [%- FOREACH itemtype IN available_itemtypes %]
571 <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
576 [% END # /UNLESS multi_hold %]
578 [% IF ( Koha.Preference('AllowHoldDateInFuture') ) %]
580 <label for="from">Hold starts on date:</label>
581 <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" data-date_to="expiration_date" class="flatpickr" data-flatpickr-futuredate="true" />
586 <label for="to">Hold expires on date:</label>
587 <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
590 [% UNLESS ( multi_hold ) %]
592 <label for="requestany">Hold next available item </label>
593 [% IF force_hold_level == 'item' || force_hold_level == 'item_group' %]
594 <input type="checkbox" id="requestany" name="request" disabled="true" />
595 [% ELSIF force_hold_level == 'record' %]
596 <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
597 <input type="hidden" name="request" value="Any"/>
599 <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
601 <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
604 [% IF remaining_holds_for_record > 1 %]
606 <label for="holds_to_place_count">Holds to place (count)</label>
607 <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" />
610 <input type="hidden" name="holds_to_place_count" value="1" />
612 [% END # /UNLESS multi_hold %]
614 <li id="non_priority_list_item">
615 <label for="non_priority">Non priority hold:</label>
616 <input name="non_priority" id="non_priority" type="checkbox" />
617 <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
621 [% UNLESS ( multi_hold ) %]
622 <fieldset class="action">
623 [% IF ( patron.borrowernumber ) %]
624 [% IF ( override_required ) %]
625 <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
626 [% ELSIF ( none_available ) %]
627 <button type="submit" disabled="disabled" class="btn btn-primary btn-disabled">Place hold</button>
629 <button type="submit" class="btn btn-primary">Place hold</button>
634 [% biblio = biblioloop.0 %]
637 [% UNLESS Koha.Preference('item-level_itypes') %]
639 <span class="label">Item type:</span>
640 [% biblio.itemtype.translated_description | html %]
644 [% IF ( biblio.biblioitem.publicationyear ) %]
646 <span class="label">Publication year:</span>
647 [% biblio.biblioitem.publicationyear | html %]
652 <!-- ItemGroup level holds -->
653 [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %]
654 <h2 style="padding: 0 1em;">
655 Hold next available item from an item group
656 [% IF force_hold_level == 'item_group' %]
657 <span class="error"><i>(Required)</i></span>
661 [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
663 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
664 Hold must be record level
666 [% ELSIF force_hold_level == 'item' # Patron has placed an item level hold previously for this record %]
668 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
669 Hold must be item level
680 [% FOREACH g IN biblio.object.item_groups.search({}, { order_by => ['display_order'] }) %]
684 <input id="item_group_id_[% g.id | html %]" type="radio" name="item_group_id" value="[% g.id | html %]" />
687 <label for="item_group_id_[% g.id | html %]">[% g.description | html %]</label>
696 <!-- /ItemGroup level holds -->
698 <h2 style="padding: 0 1em;">
699 Place a hold on a specific item
700 [% IF force_hold_level == 'item' %]
701 <span class="error"><em>(Required)</em></span>
705 <table id="requestspecific">
709 <th>Allowed pickup locations</th>
710 [% IF Koha.Preference('item-level_itypes') %]
714 [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %]
717 <th>Home library</th>
718 <th>Last location</th>
719 [% IF itemdata_ccode %]
724 [% IF itemdata_enumchron %]
731 [% SET selected = 0 %]
732 [% FOREACH itemloo IN biblio.itemloop %]
733 [% UNLESS ( itemloo.hide ) %]
734 <tr class="[% itemloo.backgroundcolor | html %]">
736 [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
738 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
739 Hold must be record level
741 [% ELSIF force_hold_level == 'item_group' %]
743 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
744 Hold must be item group level
746 [% ELSIF ( itemloo.available ) %]
747 <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
748 [% ELSIF ( itemloo.override ) %]
749 <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
750 <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
753 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
754 [% IF itemloo.not_holdable %]
755 [% IF itemloo.not_holdable == 'damaged' %]
756 <span>Item damaged</span>
757 [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
758 <span>Age restricted</span>
759 [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
760 <span>Exceeded max holds per record</span>
761 [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
762 <span>Daily hold limit reached for patron</span>
763 [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
764 <span>Too many holds</span>
765 [% ELSIF itemloo.not_holdable == 'notReservable' %]
766 <span>Not holdable</span>
767 [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
768 <span>Patron is from different library</span>
769 [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
770 <span>Cannot place hold from patron's library</span>
771 [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
772 <span>Patron already has hold for this item</span>
773 [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
774 <span>Cannot be transferred to pickup library</span>
775 [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
776 <span>Only pickup locations within the same hold group are allowed</span>
777 [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
778 <span>No holds are allowed on this item</span>
779 [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %]
780 <span>Library is not a pickup location</span>
781 [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
782 <span>No valid pickup location</span>
783 [% ELSIF itemloo.not_holdable == 'notforloan' %]
784 <span>Not for loan</span>
786 <span>[% itemloo.not_holdable | html %]</span>
790 [% END # /IF force_hold_level %]
793 [% IF (itemloo.pickup_locations_count > 0) || itemloo.override %]
794 <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations" style="width:100%;"
795 data-item-id="[% itemloo.itemnumber | html %]"
796 data-patron-id="[% patron.borrowernumber | html %]"
797 data-pickup-location-source="item">
798 [% IF (itemloo.default_pickup_location) %]
799 <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option>
804 [% IF Koha.Preference('item-level_itypes') %]
806 [% UNLESS ( noItemTypeImages ) %]
807 [% IF ( itemloo.itemtype.image_location) %]<img src="[% itemloo.itemtype.image_location | html %]" alt="" /> <br /> [% END %]
809 <span class="itypetext">[% itemloo.itemtype.translated_description | html %]</span>
813 [% itemloo.barcode | html %]
815 [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %]
817 [% itemloo.object.item_group.description | html %]
821 [% Branches.GetName( itemloo.homebranch ) | html %]
824 [% Branches.GetName( itemloo.holdingbranch ) | html %]
826 [% IF itemdata_ccode %]
828 [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
832 [% itemloo.itemcallnumber | html %]
835 [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %]
837 [% IF itemdata_enumchron %]
839 [% itemloo.enumchron | html %]
842 [% IF ( itemloo.onloan ) %]
843 <td data-order="[% itemloo.date_due | html %]">
844 <span class="checkedout">Due [% itemloo.date_due | $KohaDates as_due_date => 1 %]</span>
847 [% IF ( itemloo.transfertwhen ) %]
848 <span>In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
849 to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | $KohaDates %]</span>
853 [% IF ( itemloo.reservedate ) %]
854 [% IF ( itemloo.nocancel ) %]
855 <span>Can't be cancelled when item is in transit</span>
857 [% IF ( itemloo.waitingdate ) %]
858 [% IF ( itemloo.canreservefromotherbranches ) %]
859 <span>Waiting for [% INCLUDE 'patron-title.inc' patron=itemloo.ReservedFor %] at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.waitingdate | $KohaDates %]</span>
861 <span>Waiting at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.waitingdate | $KohaDates %]</span>
864 [% IF ( itemloo.canreservefromotherbranches ) %]
865 [% IF itemloo.reservedate %]
866 <span>On hold for [% INCLUDE 'patron-title.inc' patron=itemloo.ReservedFor %] expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since</span>
868 <span>On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %]</span>
870 [% ELSIF itemloo.reservedate %]
871 <span>On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.reservedate | $KohaDates %]</span>
873 <span>On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %]</span>
876 <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
877 [% END # /IF itemloo.nocancel %]
880 [% END # /IF itemloo.reservedate %]
882 [% IF itemloo.item_level_holds == "N" %]
883 <br/>Item level hold not allowed from OPAC
884 [% ELSIF itemloo.item_level_holds == "F" %]
885 <br/>Item level hold forced from OPAC
888 [% IF ( itemloo.itemlost ) %]
889 <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
892 [% IF ( itemloo.damaged ) %]
893 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
896 [% IF ( itemloo.withdrawn ) %]
897 <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
900 [% IF ( itemloo.notforloan ) %]
901 <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
902 [% ELSIF ( itemloo.notforloanitype ) %]
903 <span class="nfl">Not for loan (Itemtype not for loan)</span>
907 [% END # / UNLESS itemloo.hide %]
908 [% END # /FOREACH itemloo %]
910 </table> <!-- /#requestspecific -->
914 <p class="hiddencount">
915 <a href="request.pl?biblionumber=[% biblio.biblionumber | uri %]&borrowernumber=[% borrowernumber | uri %]&showallitems=1">Show all items ([% hiddencount | html %] hidden)</a>
918 [% END # /IF hiddencount %]
920 [% ELSE # /UNLESS multi_hold %]
922 <table id="requesttitles">
925 <th>Pickup location</th>
927 [% UNLESS Koha.Preference('item-level_itypes') %]
933 [% FOREACH biblioloo IN biblioloop %]
934 [% IF ( biblioloo.warn ) %]
940 [% UNLESS ( biblioloo.warn ) %]
941 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
945 [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %]
946 <select name="pickup_[% biblioloo.biblionumber | html %]"
947 class="multi_pickup_select"
948 data-biblio-id="[% biblioloo.biblionumber | html %]"
949 data-patron-id="[% patron.borrowernumber | html %]"
950 data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
951 <option value=""></option>
952 [% FOREACH pickup_location IN biblioloo.pickup_locations %]
953 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
961 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
962 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
964 [% IF ( biblioloo.publicationyear ) %]
966 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
970 [% IF ( biblioloo.warn ) %]
971 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
974 [% UNLESS Koha.Preference('item-level_itypes') %]
976 <img src="[% biblioloo.itemtype.image_location | html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
979 <td>[% biblioloo.rank | html %]</td>
981 [% IF ( biblioloo.checked_previously ) %]
982 <span>Patron has previously checked out this title</span><br/>
984 [% IF ( biblioloo.alreadyres ) %]
987 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
992 [% IF ( biblioloo.alreadyres ) %]
994 [% 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
997 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
998 <li> <strong>No items are available</strong> to be placed on hold</li>
1001 [% IF ( biblioloo.alreadyres ) %]
1004 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1010 [% END # /FOREACH biblioloo %]
1011 </table> <!-- /#requesttitles -->
1013 [% END # /UNLESS multi_hold %]
1015 <fieldset class="action">
1016 [% IF ( patron AND patron.borrowernumber ) %]
1017 [% IF ( multi_hold ) %]
1018 [% IF ( override_required ) %]
1019 <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
1020 [% ELSIF ( no_bibs_available ) %]
1021 <button type="submit" class="btn btn-primary btn-disabled" disabled="disabled">Place holds</button>
1022 [% ELSIF ( none_available ) %]
1023 <button type="submit" class="btn btn-primary">Place holds</button>
1025 <button type="submit" class="btn btn-primary" id="multi_hold_submit">Place holds</button>
1028 [% IF ( override_required ) %]
1029 <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
1030 [% ELSIF ( none_available ) %]
1031 <button type="submit" class="btn btn-primary btn-disabled" disabled="disabled">Place hold</button>
1033 <button type="submit" class="btn btn-primary">Place hold</button>
1036 [% END # /IF patron %]
1037 </fieldset> <!-- /.action -->
1038 </form> <!-- /#hold-request-form -->
1039 </fieldset> <!-- /.rows -->
1042 [% UNLESS ( patron ) %]
1043 [% UNLESS borrowers %]
1044 [% SET hold_count = Biblio.HoldsCount( biblio.biblionumber ) | html %]
1046 <label for ="always_show_holds">Always show holds</label>
1047 [% IF always_show_holds == 'DONT' %]
1048 <input type="checkbox" name="always_show_holds" id="always_show_holds" value="DO">
1049 [% UNLESS reserveloop %]
1050 <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>
1053 <input type="checkbox" name="always_show_holds" value="DO" id="always_show_holds" checked="checked">
1057 [% IF ( reserveloop ) %]
1058 <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
1059 [% IF ( multi_hold ) %]
1060 [% FOREACH biblionumber IN biblionumbers %]
1061 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
1066 <div class="dialog message">
1067 <p>The job has been enqueued! It will be processed as soon as possible.</p>
1068 <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>
1072 <h2>Existing holds</h2>
1073 <div id="toolbar" class="btn-toolbar">
1074 <div class="btn-group">
1075 <input type="submit" class="btn btn-primary" name="submit" value="Update hold(s)" />
1077 <div class="btn-group">
1078 <button class="btn cancel_selected_holds" data-bulk="true"></button>
1080 <fieldset id="cancellation-reason-fieldset" class="action" style="display:none">
1081 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1082 [% IF hold_cancellation.count %]
1083 <label for="cancellation-reason">Cancellation reason: </label>
1084 <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
1085 <option value="">No reason given</option>
1086 [% FOREACH reason IN hold_cancellation %]
1087 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1093 <div class="page-section">
1095 [% FOREACH biblioloo IN biblioloop %]
1096 [% IF ( biblioloo.reserveloop ) %]
1097 <div class="hold_title" id="hold_title_[% biblioloo.biblionumber | html %]">
1098 [% IF ( multi_hold ) %]
1100 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
1101 [% biblioloo.title | html %]
1102 </a> <span class="number_box"><span>[% biblioloo.reserveloop.size | html %] [% tn('Hold', 'Holds', biblioloo.reserveloop.size) | $raw %]</span></span>
1106 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
1108 [% SET branchcodes = [] %]
1110 [% FOREACH h IN biblioloo.reserveloop %]
1111 [% branchcodes.push( h.branchcode ) %]
1113 [% branchcodes = branchcodes.unique %]
1114 [% IF ( branchcodes.empty ) %]
1116 There are no holds on this title.
1120 [% FOREACH b IN branchcodes.sort %]
1121 [% SET holds_by_branch = [] %]
1122 [% FOREACH h IN biblioloo.reserveloop %]
1123 [% IF h.branchcode == b %]
1124 [% holds_by_branch.push( h ) %]
1127 <div class="holds_by_library">
1128 <h4>[% Branches.GetName( b ) | html %]</h4>
1130 [% INCLUDE holds_table.inc holds=holds_by_branch %]
1132 [% END # /FOREACh b %]
1133 [% END # /IF ( branchcodes.empty ) %]
1135 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
1137 [% SET itemtypes = [] %]
1139 [% FOREACH h IN biblioloo.reserveloop %]
1140 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1141 [% itemtypes.push( hold_itemtype ) %]
1143 [% itemtypes = itemtypes.unique %]
1144 [% IF ( itemtypes.empty ) %]
1146 There are no holds on this title.
1150 [% FOREACH i IN itemtypes.sort %]
1151 [% SET holds_by_itemtype = [] %]
1152 [% FOREACH h IN biblioloo.reserveloop %]
1153 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1154 [% IF hold_itemtype == i %]
1155 [% holds_by_itemtype.push( h ) %]
1159 <div class="holds_by_itemtype">
1161 <h4>[% ItemTypes.GetDescription( i ) | html %]</h4>
1163 <h4>Any item type</h4>
1165 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1167 [% END # /FOREACH i %]
1168 [% END # /IF ( itemtypes.empty ) %]
1170 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
1171 [% SET branchcodes = [] %]
1173 [% FOREACH h IN biblioloo.reserveloop %]
1174 [% branchcodes.push( h.branchcode ) %]
1176 [% branchcodes = branchcodes.unique %]
1177 [% IF ( branchcodes.empty ) %]
1179 There are no holds on this title.
1183 [% FOREACH b IN branchcodes.sort %]
1184 <div class="holds_by_library">
1185 <h4 class="library_holds">[% Branches.GetName( b ) | html %]</h4>
1186 [% SET holds_by_branch = [] %]
1187 [% FOREACH h IN biblioloo.reserveloop %]
1188 [% IF h.branchcode == b %]
1189 [% holds_by_branch.push( h ) %]
1193 [% SET itemtypes = [] %]
1194 [% FOREACH h IN holds_by_branch %]
1195 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1196 [% itemtypes.push( hold_itemtype ) %]
1198 [% itemtypes = itemtypes.unique %]
1200 [% FOREACH i IN itemtypes.sort %]
1201 <div class="holds_by_itemtype">
1202 <h5 class="itemtype_holds">
1204 [% ItemTypes.GetDescription( i ) | html %]
1206 <span>Any item type</span>
1210 [% SET holds_by_itemtype = [] %]
1211 [% FOREACH h IN holds_by_branch %]
1212 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1213 [% IF hold_itemtype == i %]
1214 [% holds_by_itemtype.push( h ) %]
1217 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1218 </div> <!-- /.holds_by_itemtype -->
1220 </div> <!-- /.holds_by_library -->
1221 [% END # /FOREACH b %]
1222 [% END # /IF ( branchcodes.empty ) %]
1226 [% IF ( biblioloo.reserveloop.size ) %]
1227 [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
1230 There are no holds on this title.
1234 [% END # /IF HoldsSplitQueue %]
1235 </div> <!-- /hold_title -->
1236 [% END # /IF biblioloo.reserveloop %]
1237 [% END # FOREACH biblioloo %]
1239 </form> <!-- /#existing_holds -->
1240 [% END # IF reserveloop %]
1241 [% END # UNLESS patron %]
1245 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
1246 </div> <!-- /.col-md-10.col-md-offset-1 -->
1248 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1249 <div class="col-sm-2 col-sm-pull-10">
1251 [% INCLUDE 'biblio-view-menu.inc' %]
1253 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1255 </div> <!-- /.row -->
1257 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
1258 <div class="modal-dialog" role="document">
1259 <div class="modal-content">
1260 <div class="modal-header">
1261 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1262 <h3>Confirm deletion</h3>
1265 <div class="modal-body">
1266 <p>Are you sure you want to cancel this hold?</p>
1268 <fieldset class="action">
1269 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1270 [% IF hold_cancellation.count %]
1271 <label for="cancellation-reason">Cancellation reason: </label>
1272 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
1273 <option value="">No reason given</option>
1274 [% FOREACH reason IN hold_cancellation %]
1275 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1282 <div class="modal-footer">
1283 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
1284 <a href="#" data-dismiss="modal">Cancel</a>
1290 [% MACRO jsinclude BLOCK %]
1291 [% INCLUDE 'datatables.inc' %]
1292 [% INCLUDE 'calendar.inc' %]
1293 [% INCLUDE 'columns_settings.inc' %]
1294 [% Asset.js("lib/hc-sticky.js") | $raw %]
1295 [% INCLUDE 'select2.inc' %]
1296 [% Asset.js("js/holds.js") | $raw%]
1298 [% SET url_biblio_params = "biblionumber=" _ biblionumbers.join("&biblionumber=") %]
1300 [% SET url_biblio_params = url_biblio_params _ "&multi_hold=1" %]
1305 var biblionumbers = [[% biblionumbers.join(', ') | $raw %]];
1306 var borrowernumber = "[% patron.borrowernumber | $raw %]";
1307 var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1308 var override_items = {[% FOREACH biblio IN biblioloop %][% FOREACH itemloo IN biblio.itemloop %][% IF ( itemloo.override ) %]
1309 [% itemloo.itemnumber | html %]: {
1310 homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1311 holdallowed: "[% itemloo.holdallowed | html %]"
1313 [% END %][% END %][% END %]
1316 damaged: _("Item damaged"),
1317 ageRestricted: _("Age restricted"),
1318 tooManyHoldsForThisRecord: _("Exceeded max holds per record"),
1319 tooManyReservesToday: _("Daily hold limit reached for patron"),
1320 tooManyReserves: _("Too many holds"),
1321 notReservable: _("Not holdable"),
1322 noReservesAllowed: _("No reserves allowed"),
1323 cannotReserveFromOtherBranches: _("Patron is from different library"),
1324 itemAlreadyOnHold: _("Patron already has hold for this item"),
1325 cannotBeTransferred: _("Cannot be transferred to pickup library"),
1326 pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed")
1329 var MSG_CANCEL_SELECTED = _("Cancel selected (%s)");
1330 $.fn.select2.defaults.set("width", "100%" );
1331 $.fn.select2.defaults.set("dropdownAutoWidth", true );
1333 $(document).ready(function() {
1334 $('#cancellation-reason-fieldset').hide();
1335 $('.rank-request').on('change', function() {
1336 if ( $(".rank-request option:selected[value='del']").length ) {
1337 $('#cancellation-reason-fieldset').show();
1339 $('#cancellation-reason-fieldset').hide();
1343 if( $("#circ_holds_select").length > 0 ){
1344 [% SET active = clubs ? 1 : 0 %]
1345 /* Set active tab based on whether a club search was submitted */
1346 var tabs = $("#circ_holds_select li:eq(" + [% active | $raw %] + ") a").tab("show");
1347 $( tabs[0].hash ).find("input.focus").focus();
1349 /* Change active focus when tabs change */
1350 $("#circ_holds_select a[data-toggle='tab']").on("shown.bs.tab", function (e) {
1351 active_tab = e.target.hash;
1352 $( active_tab ).find("input.focus").focus();
1357 function ToggleHoldsToPlace() {
1358 if ( $("#requestany").prop('checked') ) {
1359 $("#holds_to_place_count").prop('disabled', false);
1361 $("#holds_to_place_count").prop('disabled', true);
1364 ToggleHoldsToPlace();
1365 $("#requestany").on('change', function(){
1366 ToggleHoldsToPlace();
1369 [% IF Koha.Preference('UseBranchTransferLimits') %]
1370 $("#pickup").on('change', function(){
1371 var pickup = $("#pickup").val();
1372 var url = "?pickup=" + pickup;
1373 url += "&borrowernumber=" + borrowernumber;
1374 url += "&biblionumber=" + biblionumbers[0];
1375 window.location.replace(url);
1379 var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1381 "sDom": '<"top pager"ilf>t',
1384 //Override fieldset styling for dataTables search box
1385 $("div.top.pager").css("margin-left","1em");
1386 $(".dataTables_filter label").css({
1388 "margin-right":"0em"
1391 $("#club-request-form").on("submit", function() {
1393 $('.clubalert, .holdalert').addClass('hide');
1395 pickup_library_id: $('select[name="pickup"]').val()
1397 if($('input[name="checkitem"]:checked').length)
1398 data.item_id = $('input[name="checkitem"]:checked').val();
1399 if($('input[name="item_group_id"]:checked').length)
1400 data.item_group_id = $('input[name="item_group_id"]:checked').val();
1401 if($('input[name="borrowernumber"]').length)
1402 data.patron_id = $('input[name="borrowernumber"]').val();
1403 if($('textarea[name="notes"]').length)
1404 data.notes = $('textarea[name="notes"]').val()||null;
1405 if($('input[name="itemtype"]').length) {
1406 data.item_type = $('input[name="itemtype"]').val()||null;
1408 if($('input[name="default_patron_home"]:checked').length) {
1409 data.default_patron_home = 1;
1412 const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1;
1413 var newloc = 'request.pl?';
1414 biblionumbers.forEach(function (biblionumber) {
1415 newloc += '&biblionumber=' + biblionumber;
1418 biblionumbers.forEach(function(biblionumber) {
1419 data.biblio_id = biblionumber;
1421 url: $t.attr('action'),
1422 method: $t.attr('method').toUpperCase(),
1423 contentType: 'application/json',
1424 data: JSON.stringify(data)
1426 for(let i = 0; i < count; i++) {
1428 .then(function(result) {
1429 document.location = newloc;
1431 .fail(function(err) {
1432 var message = err.responseJSON.error;
1433 var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/);
1434 if(match && ERROR_MAP[match[1]]) {
1435 message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>'
1437 $('.clubalert, .holdalert').removeClass('hide').html(message);
1445 [% UNLESS ( multi_hold ) %]
1446 $("#hold-request-form").on("submit", function(e){
1447 return check(e, $(this));
1450 $("#hold-request-form").on("submit", function(){
1451 return checkMultiHold();
1455 $(".pickup_location_dropdown").each( function () {
1456 $(this).pickup_locations_dropdown();
1459 $("#pickup_multi").select2({
1464 $('.multi_pickup_select').select2({
1469 $("#pickup_multi").on("change", function() {
1470 var selection = $(this).val();
1471 if ( selection != '' ) {
1472 $(".multi_pickup_select").each(function() {
1473 var valid_pickup_locations = $(this).data('pickup-locations');
1474 if ( valid_pickup_locations.includes(selection) ) {
1475 $(this).val(selection);
1476 $(this).trigger("change");
1482 $("#pickup").each( function () {
1483 $(this).pickup_locations_dropdown();
1486 $(".pickup_locations").each(function () {
1487 $(this).pickup_locations_dropdown();
1491 function check( e, table ) {
1495 if ( ! $("#requestany").is(":checked") ) {
1496 // requestany not selected, go through the item-specific cases
1497 if ( $('input[type="radio"]:checked').length > 0 ) {
1498 // got item-specific hold requests in the form!
1499 // verify they have a pickup location selected
1501 if (table.find('input[type="radio"]:checked')
1503 .find(".pickup_locations").val() === null) {
1505 msg = _("- Please select a pickup location for the item" + "\n")
1509 msg = (_("- Please select an item to place a hold") + "\n");
1512 if( $("#pickup").length < 1 || $("#pickup").val() == "" || $('#pickup').val() === null ){
1513 msg = _("- Please select a pickup location for this hold" + "\n");
1519 $('#hold-request-form').preventDoubleFormSubmit();
1528 function checkMultiHold() {
1530 var selected_bibs = $(".multi_hold_item_checkbox:checked");
1531 if ( selected_bibs.length > 0 ) {
1532 // there are biblios selected in the form!
1533 // verify they have a pickup location selected
1535 var pickup_not_set = 0;
1536 selected_bibs.each(function() {
1537 if ( $(this).closest('tr').find(".multi_pickup_select").val() === "" ) {
1541 var bibnum = $(this).attr("title");
1544 if ( pickup_not_set > 0 ) {
1545 alert( _("Please make sure all selected titles have a pickup location set" + "\n") );
1550 alert( _("Please select at least one title" + "\n") );
1554 $('#hold-request-form').preventDoubleFormSubmit();
1559 $(document).ready(function() {
1561 $("#always_show_holds").change(function(){
1562 if( $(this).prop('checked') ){
1563 document.cookie = 'always_show_holds=DO';
1565 document.cookie = 'always_show_holds=DONT';
1568 $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1569 var itemnumber = this.value;
1572 switch (override_items[itemnumber].holdallowed) {
1573 case "not_allowed": msg = _("This item normally cannot be put on hold."); break;
1574 case "from_home_library": msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
1577 msg += "\n\n" + _("Place hold on this item?");
1579 return confirm(msg);
1581 $("button.warning").click(function() {
1582 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1584 $("#requestany").click(function() {
1586 $("input[name=checkitem]").each(function() {
1587 $(this).prop("checked", false);
1591 $("input[name=checkitem]").click(function() {
1593 $("input[name=checkitem]").each(function() {
1598 if(onechecked == 1){
1599 $("#requestany").prop("checked", false);
1600 $("#holds_to_place_count").prop('disabled', true);
1602 $("#requestany").prop("checked",true);
1603 $("#holds_to_place_count").prop('disabled', false);
1606 var prev_rank_request;
1607 $("select[name=rank-request]").on("focus", function() {
1608 prev_rank_request = $(this).val();
1609 var row = $(this).parents("tr:first");
1610 }).change(function() {
1611 var row = $(this).parents("tr:first");
1612 var value = parseInt($(this).val());
1613 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
1614 if( !isNaN(value) ) { //If moved to 'del'
1615 var after = row.parent().find(`tr:nth-child(${value+found_holds})`); //Go to the row 1 after the new value (and skip found holds)
1616 if (prev_rank_request > value) {
1617 row.insertBefore(after);
1619 row.insertAfter(after);
1623 var next_priority = 1;
1624 $("select[name=rank-request]").each(function () {
1625 if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
1626 $(this).val(next_priority);
1631 $(".clear-date").on("click",function(e){
1633 var fieldID = this.id.replace("clear-date-","");
1634 $("#" + fieldID).val("");
1637 // Confirm cancellation of hold
1639 $(".cancel-hold").on("click",function(e) {
1641 cancel_link = $(this);
1642 $('#cancelModal').modal();
1645 $("#cancelModalConfirmBtn").on("click",function(e) {
1647 if(cancel_link.data('bulk')) {
1648 [% SET data_url = 'biblionumber=' _ biblionumbers.join('&biblionumber=') %]
1649 link = `request.pl?[% data_url | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1651 let borrowernumber = cancel_link.data('borrowernumber');
1652 let biblionumber = cancel_link.data('biblionumber');
1653 let reserve_id = cancel_link.data('id');
1654 link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`;
1656 let reason = $("#modal-cancellation-reason").val();
1658 link += "&cancellation-reason=" + reason
1660 window.location.href = link;
1664 [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems || nobiblio ) %]
1665 [% IF ( PatronAutoComplete ) %]
1666 patron_autocomplete($("#search_patron_filter"), { 'link-to': 'reserve', 'url-params': '[% url_biblio_params | url %]' });
1670 Sticky = $("#toolbar");
1672 stickTo: "#existing_holds",
1673 stickyClass: "floating"
1676 [% IF Koha.Preference('EnableItemGroupHolds') %]
1677 $(':radio[name="item_group_id"]').change(function(){
1678 $(':radio[name="checkitem"]').prop('checked', false);
1681 $(':radio[name="checkitem"]').change(function(){
1682 $(':radio[name="item_group_id"]').prop('checked', false);
1686 if(!localStorage.selectedHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) {
1687 localStorage.selectedHolds = [];
1690 $('.holds_table .select_hold').each(function() {
1691 if(localStorage.selectedHolds.includes($(this).data('id'))) {
1692 $(this).prop('checked', true);
1696 $('.holds_table .select_hold_all').each(function() {
1697 var table = $(this).parents('.holds_table');
1698 var count = $('.select_hold:not(:checked)', table).length;
1699 $('.select_hold_all', table).prop('checked', !count);
1702 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1704 $('.holds_table .select_hold_all').click(function() {
1705 var table = $(this).parents('.holds_table');
1706 var count = $('.select_hold:checked', table).length;
1707 $('.select_hold', table).prop('checked', !count);
1708 $(this).prop('checked', !count);
1709 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1710 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1713 $('.holds_table .select_hold').click(function() {
1714 var table = $(this).parents('.holds_table');
1715 var count = $('.select_hold:not(:checked)', table).length;
1716 $('.select_hold_all', table).prop('checked', !count);
1717 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1718 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1721 $('.cancel_selected_holds').click(function(e) {
1723 if($('.holds_table .select_hold:checked').length) {
1724 cancel_link = $(this);
1725 delete localStorage.selectedHolds;
1726 $('#cancelModal').modal();
1734 table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
1737 [% 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' %]
1739 $(document).ready(function() {
1740 $("#holds_patronsearch").on("submit", filter);
1742 $('.printholdslip').click(function(){
1743 var reserve_id = $(this).attr('data-reserve_id');
1744 window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
1750 [% INCLUDE 'intranet-bottom.inc' %]