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 [% IF ( messagetransfert ) %]
172 <div class="dialog message">
173 <h2>Hold found for ([% nextreservtitle | html %]), please transfer</h2>
174 <p>Hold placed by : <strong> [% nextreservsurname | html %] [% nextreservfirstname | html %]</strong> at : <strong> [% branchname | html %] </strong>, Please transfer this item.
176 <form name="cancelReservewithtransfert" action="branchreserves.pl" method="post">
177 <input type="submit" class="button" />
182 [% UNLESS ( multi_hold ) %]
183 <h2>Place a hold on [% INCLUDE 'biblio-title.inc' link = 1 %] [% IF biblio.author %] by [% biblio.author | html %][% END %]</h2>
187 <span>Place holds</span>
190 <span>Search patrons or clubs</span>
192 <span>Search patrons</span>
198 [% UNLESS club OR patron OR patron.borrowernumber OR noitems OR nobiblio %]
199 [% IF ( messageborrower ) %]
200 <div class="dialog alert">
201 <h3>Patron not found</h3>
202 <p>No patron with this name, please, try another</p>
206 [% IF ( messageclub ) %]
207 <div class="dialog alert">
208 <h3>Club not found</h3>
209 <p>No club with this name, please, try another</p>
213 [% UNLESS multi_hold %]
215 <h2>Search patrons or clubs</h2>
217 <h2>Search patrons</h2>
221 [% WRAPPER tabs id= "circ_holds_select" %]
222 [% WRAPPER tabs_nav %]
223 [% WRAPPER tab_item tabname= "holds_patronsearch_pane" bt_active= 1 %] <span>Patrons</span> [% END %]
225 [% WRAPPER tab_item tabname= "holds_clubsearch_pane" %] <span>Clubs</span> [% END %]
227 [% END # /WRAPPER tabs_nav %]
229 [% WRAPPER tab_panels %]
230 [% WRAPPER tab_panel tabname="holds_patronsearch_pane" bt_active= 1 %]
231 [% PROCESS patron_search_filters_simple %]
233 [% PROCESS patron_search_table table_id => 'table_borrowers', open_on_row_click => 1 %]
234 [% END # /tab_panel# %]
236 [% WRAPPER tab_panel tabname="holds_clubsearch_pane" %]
237 <form id="holds_clubsearch" action="request.pl" method="post">
238 <div class="hint">Enter club ID or partial name:</div>
239 <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" />
240 <input type="submit" class="btn btn-primary" value="Search" />
241 [% FOREACH biblionumber IN biblionumbers %]
242 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
245 </form> <!-- /#holds_patronsearch -->
247 [% INCLUDE 'clubs-table.inc' destination = "holds" %]
249 [% END # /tab_panel# %]
250 [% END # /IF clubcount %]
251 [% END # /WRAPPER tab_panels %]
252 [% END # /WRAPPER tabs %]
255 <div class="dialog alert hide clubalert">
257 <fieldset class="rows">
258 <legend>Hold details</legend>
259 <form action="/api/v1/clubs/[% club.id | html %]/holds" method="post" name="form" id="club-request-form">
261 [% IF ( multi_hold ) %]
262 <input type="hidden" name="request" value="any"/>
263 [% FOREACH biblioloo IN biblioloop %]
264 [% UNLESS biblioloo.none_avail %]
265 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
266 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
267 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
271 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
272 <input type="hidden" name="title" value="[% biblio.title | html %]" />
273 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
274 [% END # /IF multi_hold %]
277 <span class="label">Club: </span> [% club.name | html %]
280 <span class="label">Description: </span> [% club.description | html %]
283 <label for="pickup">Pickup at:</label>
284 <select name="pickup" id="pickup_club">
285 [% PROCESS options_for_libraries libraries => Branches.all({ selected => club.branchcode, search_params => { pickup_location => 1 } }) %]
289 <label for="default_patron_home">Pickup at patron's home library when possible:</label>
290 <input type="checkbox" id="default_patron_home" name="default_patron_home"/>
293 <h2 style="padding: 0 1em;">Members</h2>
295 [% FOREACH member IN members %]
296 [% SET patron = member.patron %]
297 <li style="padding: 0.5em 1em;">
298 <div>[% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %]</div>
299 [% IF member.exceeded_maxreserves %]
301 <i class="fa fa-error"></i>
302 <strong>Too many holds: </strong> Patron can only place a maximum of [% maxreserves | html %] total holds.
305 [% IF ( patron.is_expired ) %]
307 <i class="fa-solid fa-triangle-exclamation"></i>
308 <strong>Account has expired</strong>
311 [% IF patron.is_debarred %]
313 <i class="fa-solid fa-triangle-exclamation"></i>
314 <strong>Patron has restrictions</strong>
317 [% IF member.amount_outstanding && Koha.Preference('maxoutstanding') && member.amount_outstanding > Koha.Preference('maxoutstanding') %]
319 <i class="fa-solid fa-triangle-exclamation"></i>
320 <strong>Patron has outstanding fines: [% member.amount_outstanding | $Price %]</strong>
324 [% IF ( member.diffbranch ) %]
326 <i class="fa-solid fa-triangle-exclamation"></i>
327 <strong>Pickup library is different.</strong> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )
332 [% UNLESS ( multi_hold ) %]
333 <fieldset class="action">
334 <input type="submit" class="btn btn-primary" value="Place hold" />
337 <table id="requesttitles">
341 [% UNLESS Koha.Preference('item-level_itypes') %]
347 [% FOREACH biblioloo IN biblioloop %]
348 [% IF ( biblioloo.warn ) %]
354 [% UNLESS ( biblioloo.warn ) %]
355 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
361 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
362 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
364 [% IF ( biblioloo.publicationyear ) %]
366 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
370 [% IF ( biblioloo.warn ) %]
371 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
374 [% UNLESS Koha.Preference('item-level_itypes') %]
376 <img src="[% biblioloo.itemtype.image_location| html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
379 <td>[% biblioloo.rank | html %]</td>
381 [% IF ( biblioloo.checked_previously ) %]
382 <span>Patron has previously checked out this title</span><br/>
384 [% IF ( biblioloo.alreadyres ) %]
387 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
392 [% IF ( biblioloo.alreadyres ) %]
394 [% 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
397 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
398 <li> <strong>No items are available</strong> to be placed on hold</li>
401 [% IF ( biblioloo.alreadyres ) %]
404 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
410 [% END # /FOREACH biblioloo %]
411 </table> <!-- /#requesttitles -->
415 [% ELSIF NOT ( noitems || nobiblio ) # /UNLESS patron %]
417 [% IF ( checked_previously && !multi_hold ) %]
418 <div class="dialog alert">
420 <li>Patron has previously checked out this title</li>
425 [% IF ( no_reserves_allowed || exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted || recall ) %]
426 <div class="dialog alert">
428 [% UNLESS ( multi_hold ) %]
429 <h3>Cannot place hold</h3>
431 [% IF ( no_reserves_allowed ) %]
432 <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>
433 [% ELSIF ( exceeded_maxreserves ) %]
434 <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>
435 [% ELSIF ( exceeded_holds_per_record ) %]
436 <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>
437 [% ELSIF ( alreadypossession ) %]
438 <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>
439 [% ELSIF ( alreadyreserved ) %]
440 <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>
441 [% ELSIF ( ageRestricted ) %]
442 <li><strong>Age restricted</strong></li>
443 [% ELSIF ( none_available ) %]
444 <li> <strong>No items are available</strong> to be placed on hold.</li>
445 [% ELSIF ( maxreserves ) %]
446 <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>
447 [% ELSIF ( recall ) %]
448 <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>
449 [% END # /IF exceeded_maxreserves %]
451 [% ELSE # UNLESS multi_hold %]
452 <h3>Cannot place hold on some items</h3>
453 [% IF (no_reserves_allowed ) %]
454 <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>
455 [% ELSIF ( exceeded_maxreserves ) %]
456 <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>
457 [% ELSIF ( exceeded_holds_per_record ) %]
458 [% FOREACH biblioloo IN biblioloop %]
459 [% IF (biblioloo.tooManyHoldsForThisRecord) %]
460 <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>
463 [% ELSIF ( none_available ) %]
464 <li><strong>No items available: </strong>One or more records have no items that can be held</li>
465 [% END # /IF exceeded_maxreserves %]
466 [% END # /UNLESS multi_hold %]
468 [% END # /IF ( exceeded_maxreserves || ... %]
470 [% IF ( patron.is_expired || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
471 <div class="dialog message">
473 [% IF ( patron.is_expired ) %]
474 <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>
477 [% IF patron.is_debarred %]
478 <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>
481 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
482 <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>
485 [% IF ( diffbranch ) %]
486 <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>
488 </ul> <!-- /.dialog.message -->
490 [% END # /IF patron.is_expired || diffbranch ... %]
492 [% IF ( messageborrower ) %]
493 <div class="dialog alert">
494 <h3>Patron not found:</h3>
495 <p>Name or barcode not found. Please try an other </p>
499 <div class="dialog alert hide holdalert">
502 <fieldset class="rows">
503 <legend>Hold details</legend>
504 <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
506 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
507 [% FOREACH biblionumber IN biblionumbers %]
508 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
510 [% IF ( multi_hold ) %]
511 <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
512 <input type="hidden" name="request" value="any"/>
513 [% FOREACH biblioloo IN biblioloop %]
514 [% UNLESS biblioloo.none_avail %]
515 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
516 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
517 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
521 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
522 <input type="hidden" name="title" value="[% biblio.title | html %]" />
523 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
524 [% END # /IF multi_hold %]
528 <span class="label">Patron:</span>
529 [% IF ( patron.borrowernumber ) %]
530 [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 hide_patron_infos_if_needed => 1 %]
536 [% UNLESS ( multi_hold ) %]
538 <span class="label">Estimated priority:</span>
539 <strong>[% fixedRank | html %]</strong>
544 <label for="holdnotes">Notes:</label>
545 <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
548 <label for="pickup">Pickup at:</label>
549 [% UNLESS ( multi_hold ) %]
550 <select name="pickup" id="pickup"
551 data-biblio-id="[% biblio.biblionumber | html %]"
552 data-patron-id="[% patron.borrowernumber | html %]"
553 data-pickup-location-source="biblio">
554 [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
556 <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
557 <option value="" selected="selected"></option>
558 [% FOREACH pickup_location IN multi_pickup_locations %]
559 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
565 [% UNLESS ( multi_hold ) %]
566 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
568 <label for="itemtype">Request specific item type:</label>
569 <select name="itemtype" id="itemtype">
570 <option value="">Any item type</option>
571 [%- FOREACH itemtype IN available_itemtypes %]
572 <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
577 [% END # /UNLESS multi_hold %]
579 [% IF ( Koha.Preference('AllowHoldDateInFuture') ) %]
581 <label for="from">Hold starts on date:</label>
582 <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" data-date_to="expiration_date" class="flatpickr" data-flatpickr-futuredate="true" />
587 <label for="to">Hold expires on date:</label>
588 <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
591 [% UNLESS ( multi_hold ) %]
593 <label for="requestany">Hold next available item </label>
594 [% IF force_hold_level == 'item' || force_hold_level == 'item_group' %]
595 <input type="checkbox" id="requestany" name="request" disabled="true" />
596 [% ELSIF force_hold_level == 'record' %]
597 <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
598 <input type="hidden" name="request" value="Any"/>
600 <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
602 <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
605 [% IF remaining_holds_for_record > 1 %]
607 <label for="holds_to_place_count">Holds to place (count)</label>
608 <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" />
611 <input type="hidden" name="holds_to_place_count" value="1" />
613 [% END # /UNLESS multi_hold %]
615 <li id="non_priority_list_item">
616 <label for="non_priority">Non priority hold:</label>
617 <input name="non_priority" id="non_priority" type="checkbox" />
618 <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
622 [% UNLESS ( multi_hold ) %]
623 <fieldset class="action">
624 [% IF ( patron.borrowernumber ) %]
625 [% IF ( override_required ) %]
626 <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
627 [% ELSIF ( none_available ) %]
628 <button type="submit" disabled="disabled" class="btn btn-primary btn-disabled">Place hold</button>
630 <button type="submit" class="btn btn-primary">Place hold</button>
635 [% biblio = biblioloop.0 %]
638 [% UNLESS Koha.Preference('item-level_itypes') %]
640 <span class="label">Item type:</span>
641 [% biblio.itemtype.translated_description | html %]
645 [% IF ( biblio.biblioitem.publicationyear ) %]
647 <span class="label">Publication year:</span>
648 [% biblio.biblioitem.publicationyear | html %]
653 <!-- ItemGroup level holds -->
654 [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %]
655 <h2 style="padding: 0 1em;">
656 Hold next available item from an item group
657 [% IF force_hold_level == 'item_group' %]
658 <span class="error"><i>(Required)</i></span>
662 [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
664 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
665 Hold must be record level
667 [% ELSIF force_hold_level == 'item' # Patron has placed an item level hold previously for this record %]
669 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
670 Hold must be item level
681 [% FOREACH g IN biblio.object.item_groups.search({}, { order_by => ['display_order'] }) %]
685 <input id="item_group_id_[% g.id | html %]" type="radio" name="item_group_id" value="[% g.id | html %]" />
688 <label for="item_group_id_[% g.id | html %]">[% g.description | html %]</label>
697 <!-- /ItemGroup level holds -->
699 <h2 style="padding: 0 1em;">
700 Place a hold on a specific item
701 [% IF force_hold_level == 'item' %]
702 <span class="error"><em>(Required)</em></span>
706 <table id="requestspecific">
710 <th>Allowed pickup locations</th>
711 [% IF Koha.Preference('item-level_itypes') %]
715 [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %]
718 <th>Home library</th>
719 <th>Last location</th>
720 [% IF itemdata_ccode %]
725 [% IF itemdata_enumchron %]
732 [% SET selected = 0 %]
733 [% FOREACH itemloo IN biblio.itemloop %]
734 [% UNLESS ( itemloo.hide ) %]
735 <tr class="[% itemloo.backgroundcolor | html %]">
737 [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
739 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
740 Hold must be record level
742 [% ELSIF force_hold_level == 'item_group' %]
744 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
745 Hold must be item group level
747 [% ELSIF ( itemloo.available ) %]
748 <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
749 [% ELSIF ( itemloo.override ) %]
750 <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
751 <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
754 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
755 [% IF itemloo.not_holdable %]
756 [% IF itemloo.not_holdable == 'damaged' %]
757 <span>Item damaged</span>
758 [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
759 <span>Age restricted</span>
760 [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
761 <span>Exceeded max holds per record</span>
762 [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
763 <span>Daily hold limit reached for patron</span>
764 [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
765 <span>Too many holds</span>
766 [% ELSIF itemloo.not_holdable == 'notReservable' %]
767 <span>Not holdable</span>
768 [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
769 <span>Patron is from different library</span>
770 [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
771 <span>Cannot place hold from patron's library</span>
772 [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
773 <span>Patron already has hold for this item</span>
774 [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
775 <span>Cannot be transferred to pickup library</span>
776 [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
777 <span>Only pickup locations within the same hold group are allowed</span>
778 [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
779 <span>No holds are allowed on this item</span>
780 [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %]
781 <span>Library is not a pickup location</span>
782 [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
783 <span>No valid pickup location</span>
784 [% ELSIF itemloo.not_holdable == 'notforloan' %]
785 <span>Not for loan</span>
787 <span>[% itemloo.not_holdable | html %]</span>
791 [% END # /IF force_hold_level %]
794 [% IF (itemloo.pickup_locations_count > 0) || itemloo.override %]
795 <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations" style="width:100%;"
796 data-item-id="[% itemloo.itemnumber | html %]"
797 data-patron-id="[% patron.borrowernumber | html %]"
798 data-pickup-location-source="item">
799 [% IF (itemloo.default_pickup_location) %]
800 <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option>
805 [% IF Koha.Preference('item-level_itypes') %]
807 [% UNLESS ( noItemTypeImages ) %]
808 [% IF ( itemloo.itemtype.image_location) %]<img src="[% itemloo.itemtype.image_location | html %]" alt="" /> <br /> [% END %]
810 <span class="itypetext">[% itemloo.itemtype.translated_description | html %]</span>
814 [% itemloo.barcode | html %]
816 [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %]
818 [% itemloo.object.item_group.description | html %]
822 [% Branches.GetName( itemloo.homebranch ) | html %]
825 [% Branches.GetName( itemloo.holdingbranch ) | html %]
827 [% IF itemdata_ccode %]
829 [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
833 [% itemloo.itemcallnumber | html %]
836 [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %]
838 [% IF itemdata_enumchron %]
840 [% itemloo.enumchron | html %]
843 [% IF ( itemloo.onloan ) %]
844 <td data-order="[% itemloo.date_due | html %]">
845 <span class="checkedout">Due [% itemloo.date_due | $KohaDates as_due_date => 1 %]</span>
848 [% IF ( itemloo.transfertwhen ) %]
849 <span>In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
850 to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | $KohaDates %]</span>
854 [% IF ( itemloo.reservedate ) %]
855 [% IF ( itemloo.nocancel ) %]
856 <span>Can't be cancelled when item is in transit</span>
858 [% IF ( itemloo.waitingdate ) %]
859 [% IF ( itemloo.canreservefromotherbranches ) %]
860 <span>Waiting for [% INCLUDE 'patron-title.inc' patron=itemloo.ReservedFor %] at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.waitingdate | $KohaDates %]</span>
862 <span>Waiting at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.waitingdate | $KohaDates %]</span>
865 [% IF ( itemloo.canreservefromotherbranches ) %]
866 [% IF itemloo.reservedate %]
867 <span>On hold for [% INCLUDE 'patron-title.inc' patron=itemloo.ReservedFor %] expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since</span>
869 <span>On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %]</span>
871 [% ELSIF itemloo.reservedate %]
872 <span>On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.reservedate | $KohaDates %]</span>
874 <span>On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %]</span>
877 <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
878 [% END # /IF itemloo.nocancel %]
881 [% END # /IF itemloo.reservedate %]
883 [% IF itemloo.item_level_holds == "N" %]
884 <br/>Item level hold not allowed from OPAC
885 [% ELSIF itemloo.item_level_holds == "F" %]
886 <br/>Item level hold forced from OPAC
889 [% IF ( itemloo.itemlost ) %]
890 <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
893 [% IF ( itemloo.damaged ) %]
894 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
897 [% IF ( itemloo.withdrawn ) %]
898 <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
901 [% IF ( itemloo.notforloan ) %]
902 <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
903 [% ELSIF ( itemloo.notforloanitype ) %]
904 <span class="nfl">Not for loan (Itemtype not for loan)</span>
908 [% END # / UNLESS itemloo.hide %]
909 [% END # /FOREACH itemloo %]
911 </table> <!-- /#requestspecific -->
915 <p class="hiddencount">
916 <a href="request.pl?biblionumber=[% biblio.biblionumber | uri %]&borrowernumber=[% borrowernumber | uri %]&showallitems=1">Show all items ([% hiddencount | html %] hidden)</a>
919 [% END # /IF hiddencount %]
921 [% ELSE # /UNLESS multi_hold %]
923 <table id="requesttitles">
926 <th>Pickup location</th>
928 [% UNLESS Koha.Preference('item-level_itypes') %]
934 [% FOREACH biblioloo IN biblioloop %]
935 [% IF ( biblioloo.warn ) %]
941 [% UNLESS ( biblioloo.warn ) %]
942 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
946 [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %]
947 <select name="pickup_[% biblioloo.biblionumber | html %]"
948 class="multi_pickup_select"
949 data-biblio-id="[% biblioloo.biblionumber | html %]"
950 data-patron-id="[% patron.borrowernumber | html %]"
951 data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
952 <option value=""></option>
953 [% FOREACH pickup_location IN biblioloo.pickup_locations %]
954 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
962 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
963 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
965 [% IF ( biblioloo.publicationyear ) %]
967 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
971 [% IF ( biblioloo.warn ) %]
972 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
975 [% UNLESS Koha.Preference('item-level_itypes') %]
977 <img src="[% biblioloo.itemtype.image_location | html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
980 <td>[% biblioloo.rank | html %]</td>
982 [% IF ( biblioloo.checked_previously ) %]
983 <span>Patron has previously checked out this title</span><br/>
985 [% IF ( biblioloo.alreadyres ) %]
988 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
993 [% IF ( biblioloo.alreadyres ) %]
995 [% 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
998 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
999 <li> <strong>No items are available</strong> to be placed on hold</li>
1002 [% IF ( biblioloo.alreadyres ) %]
1005 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1011 [% END # /FOREACH biblioloo %]
1012 </table> <!-- /#requesttitles -->
1014 [% END # /UNLESS multi_hold %]
1016 <fieldset class="action">
1017 [% IF ( patron AND patron.borrowernumber ) %]
1018 [% IF ( multi_hold ) %]
1019 [% IF ( override_required ) %]
1020 <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
1021 [% ELSIF ( no_bibs_available ) %]
1022 <button type="submit" class="btn btn-primary btn-disabled" disabled="disabled">Place holds</button>
1023 [% ELSIF ( none_available ) %]
1024 <button type="submit" class="btn btn-primary">Place holds</button>
1026 <button type="submit" class="btn btn-primary" id="multi_hold_submit">Place holds</button>
1029 [% IF ( override_required ) %]
1030 <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
1031 [% ELSIF ( none_available ) %]
1032 <button type="submit" class="btn btn-primary btn-disabled" disabled="disabled">Place hold</button>
1034 <button type="submit" class="btn btn-primary">Place hold</button>
1037 [% END # /IF patron %]
1038 </fieldset> <!-- /.action -->
1039 </form> <!-- /#hold-request-form -->
1040 </fieldset> <!-- /.rows -->
1043 [% UNLESS ( patron ) %]
1044 [% UNLESS borrowers %]
1045 [% SET hold_count = Biblio.HoldsCount( biblio.biblionumber ) | html %]
1047 <label for ="always_show_holds">Always show holds</label>
1048 [% IF always_show_holds == 'DONT' %]
1049 <input type="checkbox" name="always_show_holds" id="always_show_holds" value="DO">
1050 [% UNLESS reserveloop %]
1051 <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>
1054 <input type="checkbox" name="always_show_holds" value="DO" id="always_show_holds" checked="checked">
1058 [% IF ( reserveloop ) %]
1059 <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
1060 [% IF ( multi_hold ) %]
1061 [% FOREACH biblionumber IN biblionumbers %]
1062 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
1067 <div class="dialog message">
1068 <p>The job has been enqueued! It will be processed as soon as possible.</p>
1069 <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>
1073 <h2>Existing holds</h2>
1074 <div id="toolbar" class="btn-toolbar">
1075 <div class="btn-group">
1076 <input type="submit" class="btn btn-primary" name="submit" value="Update hold(s)" />
1078 <div class="btn-group">
1079 <button class="btn cancel_selected_holds" data-bulk="true"></button>
1081 <fieldset id="cancellation-reason-fieldset" class="action" style="display:none">
1082 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1083 [% IF hold_cancellation.count %]
1084 <label for="cancellation-reason">Cancellation reason: </label>
1085 <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
1086 <option value="">No reason given</option>
1087 [% FOREACH reason IN hold_cancellation %]
1088 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1094 <div class="page-section">
1096 [% FOREACH biblioloo IN biblioloop %]
1097 [% IF ( biblioloo.reserveloop ) %]
1098 <div class="hold_title" id="hold_title_[% biblioloo.biblionumber | html %]">
1099 [% IF ( multi_hold ) %]
1101 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
1102 [% biblioloo.title | html %]
1103 </a> <span class="number_box"><span>[% biblioloo.reserveloop.size | html %] [% tn('Hold', 'Holds', biblioloo.reserveloop.size) | $raw %]</span></span>
1107 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
1109 [% SET branchcodes = [] %]
1111 [% FOREACH h IN biblioloo.reserveloop %]
1112 [% branchcodes.push( h.branchcode ) %]
1114 [% branchcodes = branchcodes.unique %]
1115 [% IF ( branchcodes.empty ) %]
1117 There are no holds on this title.
1121 [% FOREACH b IN branchcodes.sort %]
1122 [% SET holds_by_branch = [] %]
1123 [% FOREACH h IN biblioloo.reserveloop %]
1124 [% IF h.branchcode == b %]
1125 [% holds_by_branch.push( h ) %]
1128 <div class="holds_by_library">
1129 <h4>[% Branches.GetName( b ) | html %]</h4>
1131 [% INCLUDE holds_table.inc holds=holds_by_branch %]
1133 [% END # /FOREACh b %]
1134 [% END # /IF ( branchcodes.empty ) %]
1136 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
1138 [% SET itemtypes = [] %]
1140 [% FOREACH h IN biblioloo.reserveloop %]
1141 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1142 [% itemtypes.push( hold_itemtype ) %]
1144 [% itemtypes = itemtypes.unique %]
1145 [% IF ( itemtypes.empty ) %]
1147 There are no holds on this title.
1151 [% FOREACH i IN itemtypes.sort %]
1152 [% SET holds_by_itemtype = [] %]
1153 [% FOREACH h IN biblioloo.reserveloop %]
1154 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1155 [% IF hold_itemtype == i %]
1156 [% holds_by_itemtype.push( h ) %]
1160 <div class="holds_by_itemtype">
1162 <h4>[% ItemTypes.GetDescription( i ) | html %]</h4>
1164 <h4>Any item type</h4>
1166 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1168 [% END # /FOREACH i %]
1169 [% END # /IF ( itemtypes.empty ) %]
1171 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
1172 [% SET branchcodes = [] %]
1174 [% FOREACH h IN biblioloo.reserveloop %]
1175 [% branchcodes.push( h.branchcode ) %]
1177 [% branchcodes = branchcodes.unique %]
1178 [% IF ( branchcodes.empty ) %]
1180 There are no holds on this title.
1184 [% FOREACH b IN branchcodes.sort %]
1185 <div class="holds_by_library">
1186 <h4 class="library_holds">[% Branches.GetName( b ) | html %]</h4>
1187 [% SET holds_by_branch = [] %]
1188 [% FOREACH h IN biblioloo.reserveloop %]
1189 [% IF h.branchcode == b %]
1190 [% holds_by_branch.push( h ) %]
1194 [% SET itemtypes = [] %]
1195 [% FOREACH h IN holds_by_branch %]
1196 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1197 [% itemtypes.push( hold_itemtype ) %]
1199 [% itemtypes = itemtypes.unique %]
1201 [% FOREACH i IN itemtypes.sort %]
1202 <div class="holds_by_itemtype">
1203 <h5 class="itemtype_holds">
1205 [% ItemTypes.GetDescription( i ) | html %]
1207 <span>Any item type</span>
1211 [% SET holds_by_itemtype = [] %]
1212 [% FOREACH h IN holds_by_branch %]
1213 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1214 [% IF hold_itemtype == i %]
1215 [% holds_by_itemtype.push( h ) %]
1218 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1219 </div> <!-- /.holds_by_itemtype -->
1221 </div> <!-- /.holds_by_library -->
1222 [% END # /FOREACH b %]
1223 [% END # /IF ( branchcodes.empty ) %]
1227 [% IF ( biblioloo.reserveloop.size ) %]
1228 [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
1231 There are no holds on this title.
1235 [% END # /IF HoldsSplitQueue %]
1236 </div> <!-- /hold_title -->
1237 [% END # /IF biblioloo.reserveloop %]
1238 [% END # FOREACH biblioloo %]
1240 </form> <!-- /#existing_holds -->
1241 [% END # IF reserveloop %]
1242 [% END # UNLESS patron %]
1246 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
1247 </div> <!-- /.col-md-10.col-md-offset-1 -->
1249 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1250 <div class="col-sm-2 col-sm-pull-10">
1252 [% INCLUDE 'biblio-view-menu.inc' %]
1254 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1256 </div> <!-- /.row -->
1258 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
1259 <div class="modal-dialog" role="document">
1260 <div class="modal-content">
1261 <div class="modal-header">
1262 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1263 <h3>Confirm deletion</h3>
1266 <div class="modal-body">
1267 <p>Are you sure you want to cancel this hold?</p>
1269 <fieldset class="action">
1270 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1271 [% IF hold_cancellation.count %]
1272 <label for="cancellation-reason">Cancellation reason: </label>
1273 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
1274 <option value="">No reason given</option>
1275 [% FOREACH reason IN hold_cancellation %]
1276 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1283 <div class="modal-footer">
1284 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
1285 <a href="#" data-dismiss="modal">Cancel</a>
1291 [% MACRO jsinclude BLOCK %]
1292 [% INCLUDE 'datatables.inc' %]
1293 [% INCLUDE 'calendar.inc' %]
1294 [% INCLUDE 'columns_settings.inc' %]
1295 [% Asset.js("lib/hc-sticky.js") | $raw %]
1296 [% INCLUDE 'select2.inc' %]
1297 [% Asset.js("js/holds.js") | $raw%]
1299 [% SET url_biblio_params = "biblionumber=" _ biblionumbers.join("&biblionumber=") %]
1301 [% SET url_biblio_params = url_biblio_params _ "&multi_hold=1" %]
1305 $(document).ready(function () {
1306 hold_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'holds', 'patron_holds_table', 'json' ) | $raw %];
1307 KohaTable("patron_holds_table", {
1309 "bKohaColumnsUseNames": true,
1310 }, hold_table_settings);
1313 var biblionumbers = [[% biblionumbers.join(', ') | $raw %]];
1314 var borrowernumber = "[% patron.borrowernumber | $raw %]";
1315 var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1316 var override_items = {[% FOREACH biblio IN biblioloop %][% FOREACH itemloo IN biblio.itemloop %][% IF ( itemloo.override ) %]
1317 [% itemloo.itemnumber | html %]: {
1318 homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1319 holdallowed: "[% itemloo.holdallowed | html %]"
1321 [% END %][% END %][% END %]
1324 damaged: _("Item damaged"),
1325 ageRestricted: _("Age restricted"),
1326 tooManyHoldsForThisRecord: _("Exceeded max holds per record"),
1327 tooManyReservesToday: _("Daily hold limit reached for patron"),
1328 tooManyReserves: _("Too many holds"),
1329 notReservable: _("Not holdable"),
1330 noReservesAllowed: _("No reserves allowed"),
1331 cannotReserveFromOtherBranches: _("Patron is from different library"),
1332 itemAlreadyOnHold: _("Patron already has hold for this item"),
1333 cannotBeTransferred: _("Cannot be transferred to pickup library"),
1334 pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed")
1337 var MSG_CANCEL_SELECTED = _("Cancel selected (%s)");
1338 $.fn.select2.defaults.set("width", "100%" );
1339 $.fn.select2.defaults.set("dropdownAutoWidth", true );
1341 $(document).ready(function() {
1342 $('#cancellation-reason-fieldset').hide();
1343 $('.rank-request').on('change', function() {
1344 if ( $(".rank-request option:selected[value='del']").length ) {
1345 $('#cancellation-reason-fieldset').show();
1347 $('#cancellation-reason-fieldset').hide();
1351 if( $("#circ_holds_select").length > 0 ){
1352 [% SET active = clubs ? 1 : 0 %]
1353 /* Set active tab based on whether a club search was submitted */
1354 var tabs = $("#circ_holds_select li:eq(" + [% active | $raw %] + ") a").tab("show");
1355 $( tabs[0].hash ).find("input.focus").focus();
1357 /* Change active focus when tabs change */
1358 $("#circ_holds_select a[data-toggle='tab']").on("shown.bs.tab", function (e) {
1359 active_tab = e.target.hash;
1360 $( active_tab ).find("input.focus").focus();
1365 function ToggleHoldsToPlace() {
1366 if ( $("#requestany").prop('checked') ) {
1367 $("#holds_to_place_count").prop('disabled', false);
1369 $("#holds_to_place_count").prop('disabled', true);
1372 ToggleHoldsToPlace();
1373 $("#requestany").on('change', function(){
1374 ToggleHoldsToPlace();
1377 [% IF Koha.Preference('UseBranchTransferLimits') %]
1378 $("#pickup").on('change', function(){
1379 var pickup = $("#pickup").val();
1380 var url = "?pickup=" + pickup;
1381 url += "&borrowernumber=" + borrowernumber;
1382 url += "&biblionumber=" + biblionumbers[0];
1383 window.location.replace(url);
1387 var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1389 "dom": '<"top pager"ilf>t',
1392 //Override fieldset styling for dataTables search box
1393 $("div.top.pager").css("margin-left","1em");
1394 $(".dataTables_filter label").css({
1396 "margin-right":"0em"
1399 $("#club-request-form").on("submit", function() {
1401 $('.clubalert, .holdalert').addClass('hide');
1403 pickup_library_id: $('select[name="pickup"]').val()
1405 if($('input[name="checkitem"]:checked').length)
1406 data.item_id = $('input[name="checkitem"]:checked').val();
1407 if($('input[name="item_group_id"]:checked').length)
1408 data.item_group_id = $('input[name="item_group_id"]:checked').val();
1409 if($('input[name="borrowernumber"]').length)
1410 data.patron_id = $('input[name="borrowernumber"]').val();
1411 if($('textarea[name="notes"]').length)
1412 data.notes = $('textarea[name="notes"]').val()||null;
1413 if($('input[name="itemtype"]').length) {
1414 data.item_type = $('input[name="itemtype"]').val()||null;
1416 if($('input[name="default_patron_home"]:checked').length) {
1417 data.default_patron_home = 1;
1420 const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1;
1421 var newloc = 'request.pl?';
1422 biblionumbers.forEach(function (biblionumber) {
1423 newloc += '&biblionumber=' + biblionumber;
1426 biblionumbers.forEach(function(biblionumber) {
1427 data.biblio_id = biblionumber;
1429 url: $t.attr('action'),
1430 method: $t.attr('method').toUpperCase(),
1431 contentType: 'application/json',
1432 data: JSON.stringify(data)
1434 for(let i = 0; i < count; i++) {
1436 .then(function(result) {
1437 document.location = newloc;
1439 .fail(function(err) {
1440 var message = err.responseJSON.error;
1441 var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/);
1442 if(match && ERROR_MAP[match[1]]) {
1443 message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>'
1445 $('.clubalert, .holdalert').removeClass('hide').html(message);
1453 [% UNLESS ( multi_hold ) %]
1454 $("#hold-request-form").on("submit", function(e){
1455 return check(e, $(this));
1458 $("#hold-request-form").on("submit", function(){
1459 return checkMultiHold();
1463 $(".pickup_location_dropdown").each( function () {
1464 $(this).pickup_locations_dropdown();
1467 $("#pickup_multi").select2({
1472 $('.multi_pickup_select').select2({
1477 $("#pickup_multi").on("change", function() {
1478 var selection = $(this).val();
1479 if ( selection != '' ) {
1480 $(".multi_pickup_select").each(function() {
1481 var valid_pickup_locations = $(this).data('pickup-locations');
1482 if ( valid_pickup_locations.includes(selection) ) {
1483 $(this).val(selection);
1484 $(this).trigger("change");
1490 $("#pickup").each( function () {
1491 $(this).pickup_locations_dropdown();
1494 $(".pickup_locations").each(function () {
1495 $(this).pickup_locations_dropdown();
1499 function check( e, table ) {
1503 if ( ! $("#requestany").is(":checked") ) {
1504 // requestany not selected, go through the item-specific cases
1505 if ( $('input[type="radio"]:checked').length > 0 ) {
1506 // got item-specific hold requests in the form!
1507 // verify they have a pickup location selected
1509 if (table.find('input[type="radio"]:checked')
1511 .find(".pickup_locations").val() === null) {
1513 msg = _("- Please select a pickup location for the item" + "\n")
1517 msg = (_("- Please select an item to place a hold") + "\n");
1520 if( $("#pickup").length < 1 || $("#pickup").val() == "" || $('#pickup').val() === null ){
1521 msg = _("- Please select a pickup location for this hold" + "\n");
1527 $('#hold-request-form').preventDoubleFormSubmit();
1536 function checkMultiHold() {
1538 var selected_bibs = $(".multi_hold_item_checkbox:checked");
1539 if ( selected_bibs.length > 0 ) {
1540 // there are biblios selected in the form!
1541 // verify they have a pickup location selected
1543 var pickup_not_set = 0;
1544 selected_bibs.each(function() {
1545 if ( $(this).closest('tr').find(".multi_pickup_select").val() === "" ) {
1549 var bibnum = $(this).attr("title");
1552 if ( pickup_not_set > 0 ) {
1553 alert( _("Please make sure all selected titles have a pickup location set" + "\n") );
1558 alert( _("Please select at least one title" + "\n") );
1562 $('#hold-request-form').preventDoubleFormSubmit();
1567 $(document).ready(function() {
1569 $("#always_show_holds").change(function(){
1570 if( $(this).prop('checked') ){
1571 document.cookie = 'always_show_holds=DO';
1573 document.cookie = 'always_show_holds=DONT';
1576 $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1577 var itemnumber = this.value;
1580 switch (override_items[itemnumber].holdallowed) {
1581 case "not_allowed": msg = _("This item normally cannot be put on hold."); break;
1582 case "from_home_library": msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
1585 msg += "\n\n" + _("Place hold on this item?");
1587 return confirm(msg);
1589 $("button.warning").click(function() {
1590 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1592 $("#requestany").click(function() {
1594 $("input[name=checkitem]").each(function() {
1595 $(this).prop("checked", false);
1599 $("input[name=checkitem]").click(function() {
1601 $("input[name=checkitem]").each(function() {
1606 if(onechecked == 1){
1607 $("#requestany").prop("checked", false);
1608 $("#holds_to_place_count").prop('disabled', true);
1610 $("#requestany").prop("checked",true);
1611 $("#holds_to_place_count").prop('disabled', false);
1614 var prev_rank_request;
1615 $("select[name=rank-request]").on("focus", function() {
1616 prev_rank_request = $(this).val();
1617 var row = $(this).parents("tr:first");
1618 }).change(function() {
1619 var row = $(this).parents("tr:first");
1620 var value = parseInt($(this).val());
1621 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
1622 if( !isNaN(value) ) { //If moved to 'del'
1623 var after = row.parent().find(`tr:nth-child(${value+found_holds})`); //Go to the row 1 after the new value (and skip found holds)
1624 if (prev_rank_request > value) {
1625 row.insertBefore(after);
1627 row.insertAfter(after);
1631 var next_priority = 1;
1632 $("select[name=rank-request]").each(function () {
1633 if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
1634 $(this).val(next_priority);
1639 $(".clear-date").on("click",function(e){
1641 var fieldID = this.id.replace("clear-date-","");
1642 $("#" + fieldID).val("");
1645 // Confirm cancellation of hold
1647 $(".cancel-hold").on("click",function(e) {
1649 cancel_link = $(this);
1650 $('#cancelModal').modal();
1653 $("#cancelModalConfirmBtn").on("click",function(e) {
1655 if(cancel_link.data('bulk')) {
1656 [% SET data_url = 'biblionumber=' _ biblionumbers.join('&biblionumber=') %]
1657 link = `request.pl?[% data_url | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1659 let borrowernumber = cancel_link.data('borrowernumber');
1660 let biblionumber = cancel_link.data('biblionumber');
1661 let reserve_id = cancel_link.data('id');
1662 link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`;
1664 let reason = $("#modal-cancellation-reason").val();
1666 link += "&cancellation-reason=" + reason
1668 window.location.href = link;
1672 [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems || nobiblio ) %]
1673 [% IF ( PatronAutoComplete ) %]
1674 patron_autocomplete($("#search_patron_filter"), { 'link-to': 'reserve', 'url-params': '[% url_biblio_params | url %]' });
1678 Sticky = $("#toolbar");
1680 stickTo: "#existing_holds",
1681 stickyClass: "floating"
1684 [% IF Koha.Preference('EnableItemGroupHolds') %]
1685 $(':radio[name="item_group_id"]').change(function(){
1686 $(':radio[name="checkitem"]').prop('checked', false);
1689 $(':radio[name="checkitem"]').change(function(){
1690 $(':radio[name="item_group_id"]').prop('checked', false);
1694 if(!localStorage.selectedHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) {
1695 localStorage.selectedHolds = [];
1698 $('.holds_table .select_hold').each(function() {
1699 if(localStorage.selectedHolds.includes($(this).data('id'))) {
1700 $(this).prop('checked', true);
1704 $('.holds_table .select_hold_all').each(function() {
1705 var table = $(this).parents('.holds_table');
1706 var count = $('.select_hold:not(:checked)', table).length;
1707 $('.select_hold_all', table).prop('checked', !count);
1710 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1712 $('.holds_table .select_hold_all').click(function() {
1713 var table = $(this).parents('.holds_table');
1714 var count = $('.select_hold:checked', table).length;
1715 $('.select_hold', table).prop('checked', !count);
1716 $(this).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 $('.holds_table .select_hold').click(function() {
1722 var table = $(this).parents('.holds_table');
1723 var count = $('.select_hold:not(:checked)', table).length;
1724 $('.select_hold_all', table).prop('checked', !count);
1725 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1726 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1729 $('.cancel_selected_holds').click(function(e) {
1731 if($('.holds_table .select_hold:checked').length) {
1732 cancel_link = $(this);
1733 delete localStorage.selectedHolds;
1734 $('#cancelModal').modal();
1742 table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
1745 [% 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' %]
1747 $(document).ready(function() {
1748 $("#holds_patronsearch").on("submit", filter);
1750 $('.printholdslip').click(function(){
1751 var reserve_id = $(this).attr('data-reserve_id');
1752 window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
1758 [% INCLUDE 'intranet-bottom.inc' %]