11 [% USE AuthorisedValues %]
13 [% USE TablesSettings %]
14 [% PROCESS 'i18n.inc' %]
15 [% SET footerjs = 1 %]
16 [% INCLUDE 'doc-head-open.inc' %]
17 [% SET libraries = Branches.all %]
18 [% SET categories = Categories.all.unblessed %]
19 [% SET columns = ['name', 'cardnumber', 'dateofbirth', 'category', 'branch', 'address', 'phone'] %]
20 [% PROCESS "patron-search.inc" %]
21 [% UNLESS ( multi_hold ) %]
22 <title>Place a hold on [% INCLUDE 'biblio-title-head.inc' %] › Holds › Circulation › Koha</title>
24 <title>Confirm holds › Holds › Circulation › Koha</title>
26 [% INCLUDE 'doc-head-close.inc' %]
34 a.hold-arrow:visited {
44 .hold-arrow:active i {
45 border-color: #75b700;
54 a.cancel-hold:visited{
59 .icon-move-hold-up::before {
64 border-top: 3px solid #538200;
67 .icon-move-hold-top::before {
71 .icon-move-hold-bottom {
72 border-bottom: 3px solid #538200;
75 .icon-move-hold-bottom::before {
79 .icon-move-hold-down::before {
83 .icon-unset-lowest::before {
87 .icon-set-lowest::before {
94 <body id="circ_request" class="catalog">
96 [% WRAPPER 'header.inc' %]
97 [% INCLUDE 'circ-search.inc' %]
100 [% WRAPPER 'sub-header.inc' %]
101 [% UNLESS ( multi_hold ) %]
102 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
105 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
108 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
111 [% INCLUDE 'biblio-title.inc' link =1 %]
114 <a href="#" aria-current="page">
121 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
124 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
127 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
131 <a href="#" aria-current="page">
136 <a href="#" aria-current="page">
137 Search patrons or clubs
140 <a href="#" aria-current="page">
148 [% END # UNLESS multi_hold %]
151 <div class="main container-fluid">
153 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
154 <div class="col-md-10 col-md-offset-1">
156 <div class="col-sm-10 col-sm-push-2">
162 [% IF ( nobiblio ) %]
163 <div class="dialog alert">
165 <strong>Cannot place hold:</strong> one or more records don't exist.
167 <strong>Cannot place hold:</strong> this record doesn't exist.
172 <div class="dialog alert">
174 <strong>Cannot place hold:</strong> one or more records without items attached.
176 <strong>Cannot place hold:</strong> this record has no items attached.
181 [% IF ( messagetransfert ) %]
182 <div class="dialog message">
183 <h2>Hold found for ([% nextreservtitle | html %]), please transfer</h2>
184 <p>Hold placed by : <strong> [% nextreservsurname | html %] [% nextreservfirstname | html %]</strong> at : <strong> [% branchname | html %] </strong>, Please transfer this item.
186 <form name="cancelReservewithtransfert" action="branchreserves.pl" method="post">
187 <input type="submit" class="button" />
192 [% UNLESS ( multi_hold ) %]
193 <h2>Place a hold on [% INCLUDE 'biblio-title.inc' link = 1 %] [% IF biblio.author %] by [% biblio.author | html %][% END %]</h2>
197 <span>Place holds</span>
200 <span>Search patrons or clubs</span>
202 <span>Search patrons</span>
208 [% UNLESS club OR patron OR patron.borrowernumber OR noitems OR nobiblio %]
209 [% IF ( messageborrower ) %]
210 <div class="dialog alert">
211 <h3>Patron not found</h3>
212 <p>No patron with this name, please, try another</p>
216 [% IF ( messageclub ) %]
217 <div class="dialog alert">
218 <h3>Club not found</h3>
219 <p>No club with this name, please, try another</p>
223 [% UNLESS multi_hold %]
225 <h2>Search patrons or clubs</h2>
227 <h2>Search patrons</h2>
231 [% WRAPPER tabs id= "circ_holds_select" %]
232 [% WRAPPER tabs_nav %]
233 [% WRAPPER tab_item tabname= "holds_patronsearch_pane" bt_active= 1 %] <span>Patrons</span> [% END %]
235 [% WRAPPER tab_item tabname= "holds_clubsearch_pane" %] <span>Clubs</span> [% END %]
237 [% END # /WRAPPER tabs_nav %]
239 [% WRAPPER tab_panels %]
240 [% WRAPPER tab_panel tabname="holds_patronsearch_pane" bt_active= 1 %]
241 [% PROCESS patron_search_filters_simple %]
243 [% PROCESS patron_search_table table_id => 'table_borrowers', open_on_row_click => 1 %]
244 [% END # /tab_panel# %]
246 [% WRAPPER tab_panel tabname="holds_clubsearch_pane" %]
247 <form id="holds_clubsearch" action="request.pl" method="post">
248 <div class="hint">Enter club ID or partial name:</div>
249 <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" />
250 <input type="submit" class="btn btn-primary" value="Search" />
251 [% FOREACH biblionumber IN biblionumbers %]
252 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
255 </form> <!-- /#holds_patronsearch -->
257 [% INCLUDE 'clubs-table.inc' destination = "holds" %]
259 [% END # /tab_panel# %]
260 [% END # /IF clubcount %]
261 [% END # /WRAPPER tab_panels %]
262 [% END # /WRAPPER tabs %]
265 <div class="dialog alert hide clubalert">
267 <fieldset class="rows">
268 <legend>Hold details</legend>
269 <form action="/api/v1/clubs/[% club.id | html %]/holds" method="post" name="form" id="club-request-form">
271 [% IF ( multi_hold ) %]
272 <input type="hidden" name="request" value="any"/>
273 [% FOREACH biblioloo IN biblioloop %]
274 [% UNLESS biblioloo.none_avail %]
275 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
276 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
277 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
281 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
282 <input type="hidden" name="title" value="[% biblio.title | html %]" />
283 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
284 [% END # /IF multi_hold %]
287 <span class="label">Club: </span> [% club.name | html %]
290 <span class="label">Description: </span> [% club.description | html %]
293 <label for="pickup">Pickup at:</label>
294 <select name="pickup" id="pickup_club">
295 [% PROCESS options_for_libraries libraries => Branches.all({ selected => club.branchcode, search_params => { pickup_location => 1 } }) %]
299 <label for="default_patron_home">Pickup at patron's home library when possible:</label>
300 <input type="checkbox" id="default_patron_home" name="default_patron_home"/>
303 <h2 style="padding: 0 1em;">Members</h2>
305 [% FOREACH member IN members %]
306 [% SET patron = member.patron %]
307 <li style="padding: 0.5em 1em;">
308 <div>[% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %]</div>
309 [% IF member.exceeded_maxreserves %]
311 <i class="fa fa-error"></i>
312 <strong>Too many holds: </strong> Patron can only place a maximum of [% maxreserves | html %] total holds.
315 [% IF ( patron.is_expired ) %]
317 <i class="fa fa-warning"></i>
318 <strong>Account has expired</strong>
321 [% IF patron.is_debarred %]
323 <i class="fa fa-warning"></i>
324 <strong>Patron has restrictions</strong>
327 [% IF member.amount_outstanding && Koha.Preference('maxoutstanding') && member.amount_outstanding > Koha.Preference('maxoutstanding') %]
329 <i class="fa fa-warning"></i>
330 <strong>Patron has outstanding fines: [% member.amount_outstanding | $Price %]</strong>
334 [% IF ( member.diffbranch ) %]
336 <i class="fa fa-warning"></i>
337 <strong>Pickup library is different.</strong> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )
342 [% UNLESS ( multi_hold ) %]
343 <fieldset class="action">
344 <input type="submit" class="btn btn-primary" value="Place hold" />
347 <table id="requesttitles">
351 [% UNLESS Koha.Preference('item-level_itypes') %]
357 [% FOREACH biblioloo IN biblioloop %]
358 [% IF ( biblioloo.warn ) %]
364 [% UNLESS ( biblioloo.warn ) %]
365 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
371 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
372 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
374 [% IF ( biblioloo.publicationyear ) %]
376 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
380 [% IF ( biblioloo.warn ) %]
381 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
384 [% UNLESS Koha.Preference('item-level_itypes') %]
386 <img src="[% biblioloo.itemtype.image_location| html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
389 <td>[% biblioloo.rank | html %]</td>
391 [% IF ( biblioloo.checked_previously ) %]
392 <span>Patron has previously checked out this title</span><br/>
394 [% IF ( biblioloo.alreadyres ) %]
397 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
402 [% IF ( biblioloo.alreadyres ) %]
404 [% 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
407 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
408 <li> <strong>No items are available</strong> to be placed on hold</li>
411 [% IF ( biblioloo.alreadyres ) %]
414 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
420 [% END # /FOREACH biblioloo %]
421 </table> <!-- /#requesttitles -->
425 [% ELSIF NOT ( noitems || nobiblio ) # /UNLESS patron %]
427 [% IF ( checked_previously && !multi_hold ) %]
428 <div class="dialog alert">
430 <li>Patron has previously checked out this title</li>
435 [% IF ( no_reserves_allowed || exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted || recall ) %]
436 <div class="dialog alert">
438 [% UNLESS ( multi_hold ) %]
439 <h3>Cannot place hold</h3>
441 [% IF ( no_reserves_allowed ) %]
442 <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>
443 [% ELSIF ( exceeded_maxreserves ) %]
444 <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>
445 [% ELSIF ( exceeded_holds_per_record ) %]
446 <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>
447 [% ELSIF ( alreadypossession ) %]
448 <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>
449 [% ELSIF ( alreadyreserved ) %]
450 <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>
451 [% ELSIF ( ageRestricted ) %]
452 <li><strong>Age restricted</strong></li>
453 [% ELSIF ( none_available ) %]
454 <li> <strong>No items are available</strong> to be placed on hold.</li>
455 [% ELSIF ( 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 no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] has too many holds.</li>
457 [% ELSIF ( recall ) %]
458 <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>
459 [% END # /IF exceeded_maxreserves %]
461 [% ELSE # UNLESS multi_hold %]
462 <h3>Cannot place hold on some items</h3>
463 [% IF (no_reserves_allowed ) %]
464 <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>
465 [% ELSIF ( exceeded_maxreserves ) %]
466 <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>
467 [% ELSIF ( exceeded_holds_per_record ) %]
468 [% FOREACH biblioloo IN biblioloop %]
469 [% IF (biblioloo.tooManyHoldsForThisRecord) %]
470 <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>
473 [% ELSIF ( none_available ) %]
474 <li><strong>No items available: </strong>One or more records have no items that can be held</li>
475 [% END # /IF exceeded_maxreserves %]
476 [% END # /UNLESS multi_hold %]
478 [% END # /IF ( exceeded_maxreserves || ... %]
480 [% IF ( patron.is_expired || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
481 <div class="dialog message">
483 [% IF ( patron.is_expired ) %]
484 <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>
487 [% IF patron.is_debarred %]
488 <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>
491 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
492 <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>
495 [% IF ( diffbranch ) %]
496 <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>
498 </ul> <!-- /.dialog.message -->
500 [% END # /IF patron.is_expired || diffbranch ... %]
502 [% IF ( messageborrower ) %]
503 <div class="dialog alert">
504 <h3>Patron not found:</h3>
505 <p>Name or barcode not found. Please try an other </p>
509 <div class="dialog alert hide holdalert">
512 <fieldset class="rows">
513 <legend>Hold details</legend>
514 <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
516 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
517 [% FOREACH biblionumber IN biblionumbers %]
518 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
520 [% IF ( multi_hold ) %]
521 <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
522 <input type="hidden" name="request" value="any"/>
523 [% FOREACH biblioloo IN biblioloop %]
524 [% UNLESS biblioloo.none_avail %]
525 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
526 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
527 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
531 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
532 <input type="hidden" name="title" value="[% biblio.title | html %]" />
533 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
534 [% END # /IF multi_hold %]
538 <span class="label">Patron:</span>
539 [% IF ( patron.borrowernumber ) %]
540 [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %]
546 [% UNLESS ( multi_hold ) %]
548 <span class="label">Estimated priority:</span>
549 <strong>[% fixedRank | html %]</strong>
554 <label for="holdnotes">Notes:</label>
555 <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
558 <label for="pickup">Pickup at:</label>
559 [% UNLESS ( multi_hold ) %]
560 <select name="pickup" id="pickup"
561 data-biblio-id="[% biblio.biblionumber | html %]"
562 data-patron-id="[% patron.borrowernumber | html %]"
563 data-pickup-location-source="biblio">
564 [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
566 <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
567 <option value="" selected="selected"></option>
568 [% FOREACH pickup_location IN multi_pickup_locations %]
569 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
575 [% UNLESS ( multi_hold ) %]
576 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
578 <label for="itemtype">Request specific item type:</label>
579 <select name="itemtype" id="itemtype">
580 <option value="">Any item type</option>
581 [%- FOREACH itemtype IN available_itemtypes %]
582 <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
587 [% END # /UNLESS multi_hold %]
589 [% IF ( Koha.Preference('AllowHoldDateInFuture') ) %]
591 <label for="from">Hold starts on date:</label>
592 <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" data-date_to="expiration_date" class="flatpickr" data-flatpickr-futuredate="true" />
597 <label for="to">Hold expires on date:</label>
598 <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
601 [% UNLESS ( multi_hold ) %]
603 <label for="requestany">Hold next available item </label>
604 [% IF force_hold_level == 'item' || force_hold_level == 'item_group' %]
605 <input type="checkbox" id="requestany" name="request" disabled="true" />
606 [% ELSIF force_hold_level == 'record' %]
607 <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
608 <input type="hidden" name="request" value="Any"/>
610 <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
612 <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
615 [% IF remaining_holds_for_record > 1 %]
617 <label for="holds_to_place_count">Holds to place (count)</label>
618 <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" />
621 <input type="hidden" name="holds_to_place_count" value="1" />
623 [% END # /UNLESS multi_hold %]
625 <li id="non_priority_list_item">
626 <label for="non_priority">Non priority hold:</label>
627 <input name="non_priority" id="non_priority" type="checkbox" />
628 <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
632 [% UNLESS ( multi_hold ) %]
633 <fieldset class="action">
634 [% IF ( patron.borrowernumber ) %]
635 [% IF ( override_required ) %]
636 <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
637 [% ELSIF ( none_available ) %]
638 <button type="submit" disabled="disabled" class="btn btn-primary btn-disabled">Place hold</button>
640 <button type="submit" class="btn btn-primary">Place hold</button>
645 [% biblio = biblioloop.0 %]
648 [% UNLESS Koha.Preference('item-level_itypes') %]
650 <span class="label">Item type:</span>
651 [% biblio.itemtype.translated_description | html %]
655 [% IF ( biblio.biblioitem.publicationyear ) %]
657 <span class="label">Publication year:</span>
658 [% biblio.biblioitem.publicationyear | html %]
663 <!-- ItemGroup level holds -->
664 [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %]
665 <h2 style="padding: 0 1em;">
666 Hold next available item from an item group
667 [% IF force_hold_level == 'item_group' %]
668 <span class="error"><i>(Required)</i></span>
672 [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
674 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
675 Hold must be record level
677 [% ELSIF force_hold_level == 'item' # Patron has placed an item level hold previously for this record %]
679 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
680 Hold must be item level
691 [% FOREACH g IN biblio.object.item_groups.search({}, { order_by => ['display_order'] }) %]
695 <input id="item_group_id_[% g.id | html %]" type="radio" name="item_group_id" value="[% g.id | html %]" />
698 <label for="item_group_id_[% g.id | html %]">[% g.description | html %]</label>
707 <!-- /ItemGroup level holds -->
709 <h2 style="padding: 0 1em;">
710 Place a hold on a specific item
711 [% IF force_hold_level == 'item' %]
712 <span class="error"><em>(Required)</em></span>
716 <table id="requestspecific">
720 <th>Allowed pickup locations</th>
721 [% IF Koha.Preference('item-level_itypes') %]
725 [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %]
728 <th>Home library</th>
729 <th>Last location</th>
730 [% IF itemdata_ccode %]
735 [% IF itemdata_enumchron %]
742 [% SET selected = 0 %]
743 [% FOREACH itemloo IN biblio.itemloop %]
744 [% UNLESS ( itemloo.hide ) %]
745 <tr class="[% itemloo.backgroundcolor | html %]">
747 [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
749 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
750 Hold must be record level
752 [% ELSIF force_hold_level == 'item_group' %]
754 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
755 Hold must be item group level
757 [% ELSIF ( itemloo.available ) %]
758 <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
759 [% ELSIF ( itemloo.override ) %]
760 <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
761 <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
764 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
765 [% IF itemloo.not_holdable %]
766 [% IF itemloo.not_holdable == 'damaged' %]
767 <span>Item damaged</span>
768 [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
769 <span>Age restricted</span>
770 [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
771 <span>Exceeded max holds per record</span>
772 [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
773 <span>Daily hold limit reached for patron</span>
774 [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
775 <span>Too many holds</span>
776 [% ELSIF itemloo.not_holdable == 'notReservable' %]
777 <span>Not holdable</span>
778 [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
779 <span>Patron is from different library</span>
780 [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
781 <span>Cannot place hold from patron's library</span>
782 [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
783 <span>Patron already has hold for this item</span>
784 [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
785 <span>Cannot be transferred to pickup library</span>
786 [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
787 <span>Only pickup locations within the same hold group are allowed</span>
788 [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
789 <span>No holds are allowed on this item</span>
790 [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %]
791 <span>Library is not a pickup location</span>
792 [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
793 <span>No valid pickup location</span>
794 [% ELSIF itemloo.not_holdable == 'notforloan' %]
795 <span>Not for loan</span>
797 <span>[% itemloo.not_holdable | html %]</span>
801 [% END # /IF force_hold_level %]
804 [% IF (itemloo.pickup_locations_count > 0) %]
805 <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations" style="width:100%;"
806 data-item-id="[% itemloo.itemnumber | html %]"
807 data-patron-id="[% patron.borrowernumber | html %]"
808 data-pickup-location-source="item">
809 [% IF (itemloo.default_pickup_location) %]
810 <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option>
815 [% IF Koha.Preference('item-level_itypes') %]
817 [% UNLESS ( noItemTypeImages ) %]
818 [% IF ( itemloo.itemtype.image_location) %]<img src="[% itemloo.itemtype.image_location | html %]" alt="" /> <br /> [% END %]
820 <span class="itypetext">[% itemloo.itemtype.translated_description | html %]</span>
824 [% itemloo.barcode | html %]
826 [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %]
828 [% itemloo.object.item_group.description | html %]
832 [% Branches.GetName( itemloo.homebranch ) | html %]
835 [% Branches.GetName( itemloo.holdingbranch ) | html %]
837 [% IF itemdata_ccode %]
839 [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
843 [% itemloo.itemcallnumber | html %]
846 [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %]
848 [% IF itemdata_enumchron %]
850 [% itemloo.enumchron | html %]
853 [% IF ( itemloo.onloan ) %]
854 <td data-order="[% itemloo.date_due | html %]">
855 <span class="checkedout">Due [% itemloo.date_due | $KohaDates as_due_date => 1 %]</span>
858 [% IF ( itemloo.transfertwhen ) %]
859 <span>In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
860 to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | $KohaDates %]</span>
864 [% IF ( itemloo.reservedate ) %]
865 [% IF ( itemloo.nocancel ) %]
866 <span>Can't be cancelled when item is in transit</span>
868 [% IF ( itemloo.waitingdate ) %]
869 [% IF ( itemloo.canreservefromotherbranches ) %]
870 <span>Waiting for [% INCLUDE 'patron-title.inc' patron=itemloo.ReservedFor %] at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.waitingdate | $KohaDates %]</span>
872 <span>Waiting at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.waitingdate | $KohaDates %]</span>
875 [% IF ( itemloo.canreservefromotherbranches ) %]
876 [% IF itemloo.reservedate %]
877 <span>On hold for [% INCLUDE 'patron-title.inc' patron=itemloo.ReservedFor %] expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since</span>
879 <span>On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %]</span>
881 [% ELSIF itemloo.reservedate %]
882 <span>On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since [% itemloo.reservedate | $KohaDates %]</span>
884 <span>On hold expected at [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %]</span>
887 <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
888 [% END # /IF itemloo.nocancel %]
891 [% END # /IF itemloo.reservedate %]
893 [% IF itemloo.item_level_holds == "N" %]
894 <br/>Item level hold not allowed from OPAC
895 [% ELSIF itemloo.item_level_holds == "F" %]
896 <br/>Item level hold forced from OPAC
899 [% IF ( itemloo.itemlost ) %]
900 <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
903 [% IF ( itemloo.damaged ) %]
904 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
907 [% IF ( itemloo.withdrawn ) %]
908 <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
911 [% IF ( itemloo.notforloan ) %]
912 <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
913 [% ELSIF ( itemloo.notforloanitype ) %]
914 <span class="nfl">Not for loan (Itemtype not for loan)</span>
918 [% END # / UNLESS itemloo.hide %]
919 [% END # /FOREACH itemloo %]
921 </table> <!-- /#requestspecific -->
925 <p class="hiddencount">
926 <a href="request.pl?biblionumber=[% biblio.biblionumber | uri %]&borrowernumber=[% borrowernumber | uri %]&showallitems=1">Show all items ([% hiddencount | html %] hidden)</a>
929 [% END # /IF hiddencount %]
931 [% ELSE # /UNLESS multi_hold %]
933 <table id="requesttitles">
936 <th>Pickup location</th>
938 [% UNLESS Koha.Preference('item-level_itypes') %]
944 [% FOREACH biblioloo IN biblioloop %]
945 [% IF ( biblioloo.warn ) %]
951 [% UNLESS ( biblioloo.warn ) %]
952 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
956 [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %]
957 <select name="pickup_[% biblioloo.biblionumber | html %]"
958 class="multi_pickup_select"
959 data-biblio-id="[% biblioloo.biblionumber | html %]"
960 data-patron-id="[% patron.borrowernumber | html %]"
961 data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
962 <option value=""></option>
963 [% FOREACH pickup_location IN biblioloo.pickup_locations %]
964 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
972 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
973 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
975 [% IF ( biblioloo.publicationyear ) %]
977 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
981 [% IF ( biblioloo.warn ) %]
982 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
985 [% UNLESS Koha.Preference('item-level_itypes') %]
987 <img src="[% biblioloo.itemtype.image_location | html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
990 <td>[% biblioloo.rank | html %]</td>
992 [% IF ( biblioloo.checked_previously ) %]
993 <span>Patron has previously checked out this title</span><br/>
995 [% IF ( biblioloo.alreadyres ) %]
998 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1003 [% IF ( biblioloo.alreadyres ) %]
1005 [% 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
1008 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1009 <li> <strong>No items are available</strong> to be placed on hold</li>
1012 [% IF ( biblioloo.alreadyres ) %]
1015 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1021 [% END # /FOREACH biblioloo %]
1022 </table> <!-- /#requesttitles -->
1024 [% END # /UNLESS multi_hold %]
1026 <fieldset class="action">
1027 [% IF ( patron AND patron.borrowernumber ) %]
1028 [% IF ( multi_hold ) %]
1029 [% IF ( override_required ) %]
1030 <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
1031 [% ELSIF ( no_bibs_available ) %]
1032 <button type="submit" class="btn btn-primary btn-disabled" disabled="disabled">Place holds</button>
1033 [% ELSIF ( none_available ) %]
1034 <button type="submit" class="btn btn-primary">Place holds</button>
1036 <button type="submit" class="btn btn-primary" id="multi_hold_submit">Place holds</button>
1039 [% IF ( override_required ) %]
1040 <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
1041 [% ELSIF ( none_available ) %]
1042 <button type="submit" class="btn btn-primary btn-disabled" disabled="disabled">Place hold</button>
1044 <button type="submit" class="btn btn-primary">Place hold</button>
1047 [% END # /IF patron %]
1048 </fieldset> <!-- /.action -->
1049 </form> <!-- /#hold-request-form -->
1050 </fieldset> <!-- /.rows -->
1053 [% UNLESS ( patron ) %]
1054 [% UNLESS borrowers %]
1055 [% SET hold_count = Biblio.HoldsCount( biblio.biblionumber ) | html %]
1057 <label for ="always_show_holds">Always show holds</label>
1058 [% IF always_show_holds == 'DONT' %]
1059 <input type="checkbox" name="always_show_holds" id="always_show_holds" value="DO">
1060 [% UNLESS reserveloop %]
1061 <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>
1064 <input type="checkbox" name="always_show_holds" value="DO" id="always_show_holds" checked="checked">
1068 [% IF ( reserveloop ) %]
1069 <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
1070 [% IF ( multi_hold ) %]
1071 [% FOREACH biblionumber IN biblionumbers %]
1072 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
1077 <div class="dialog message">
1078 <p>The job has been enqueued! It will be processed as soon as possible.</p>
1079 <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>
1083 <h2>Existing holds</h2>
1084 <div id="toolbar" class="btn-toolbar">
1085 <div class="btn-group">
1086 <input type="submit" class="btn btn-primary" name="submit" value="Update hold(s)" />
1088 <div class="btn-group">
1089 <button class="btn cancel_selected_holds" data-bulk="true"></button>
1091 <fieldset id="cancellation-reason-fieldset" class="action" style="display:none">
1092 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1093 [% IF hold_cancellation.count %]
1094 <label for="cancellation-reason">Cancellation reason: </label>
1095 <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
1096 <option value="">No reason given</option>
1097 [% FOREACH reason IN hold_cancellation %]
1098 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1104 <div class="page-section">
1106 [% FOREACH biblioloo IN biblioloop %]
1107 [% IF ( biblioloo.reserveloop ) %]
1108 <div class="hold_title" id="hold_title_[% biblioloo.biblionumber | html %]">
1109 [% IF ( multi_hold ) %]
1111 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
1112 [% biblioloo.title | html %]
1113 </a> <span class="number_box"><span>[% biblioloo.reserveloop.size | html %] [% tn('Hold', 'Holds', biblioloo.reserveloop.size) | $raw %]</span></span>
1117 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
1119 [% SET branchcodes = [] %]
1121 [% FOREACH h IN biblioloo.reserveloop %]
1122 [% branchcodes.push( h.branchcode ) %]
1124 [% branchcodes = branchcodes.unique %]
1125 [% IF ( branchcodes.empty ) %]
1127 There are no holds on this title.
1131 [% FOREACH b IN branchcodes.sort %]
1132 [% SET holds_by_branch = [] %]
1133 [% FOREACH h IN biblioloo.reserveloop %]
1134 [% IF h.branchcode == b %]
1135 [% holds_by_branch.push( h ) %]
1138 <div class="holds_by_library">
1139 <h4>[% Branches.GetName( b ) | html %]</h4>
1141 [% INCLUDE holds_table.inc holds=holds_by_branch %]
1143 [% END # /FOREACh b %]
1144 [% END # /IF ( branchcodes.empty ) %]
1146 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
1148 [% SET itemtypes = [] %]
1150 [% FOREACH h IN biblioloo.reserveloop %]
1151 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1152 [% itemtypes.push( hold_itemtype ) %]
1154 [% itemtypes = itemtypes.unique %]
1155 [% IF ( itemtypes.empty ) %]
1157 There are no holds on this title.
1161 [% FOREACH i IN itemtypes.sort %]
1162 [% SET holds_by_itemtype = [] %]
1163 [% FOREACH h IN biblioloo.reserveloop %]
1164 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1165 [% IF hold_itemtype == i %]
1166 [% holds_by_itemtype.push( h ) %]
1170 <div class="holds_by_itemtype">
1172 <h4>[% ItemTypes.GetDescription( i ) | html %]</h4>
1174 <h4>Any item type</h4>
1176 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1178 [% END # /FOREACH i %]
1179 [% END # /IF ( itemtypes.empty ) %]
1181 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
1182 [% SET branchcodes = [] %]
1184 [% FOREACH h IN biblioloo.reserveloop %]
1185 [% branchcodes.push( h.branchcode ) %]
1187 [% branchcodes = branchcodes.unique %]
1188 [% IF ( branchcodes.empty ) %]
1190 There are no holds on this title.
1194 [% FOREACH b IN branchcodes.sort %]
1195 <div class="holds_by_library">
1196 <h4 class="library_holds">[% Branches.GetName( b ) | html %]</h4>
1197 [% SET holds_by_branch = [] %]
1198 [% FOREACH h IN biblioloo.reserveloop %]
1199 [% IF h.branchcode == b %]
1200 [% holds_by_branch.push( h ) %]
1204 [% SET itemtypes = [] %]
1205 [% FOREACH h IN holds_by_branch %]
1206 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1207 [% itemtypes.push( hold_itemtype ) %]
1209 [% itemtypes = itemtypes.unique %]
1211 [% FOREACH i IN itemtypes.sort %]
1212 <div class="holds_by_itemtype">
1213 <h5 class="itemtype_holds">
1215 [% ItemTypes.GetDescription( i ) | html %]
1217 <span>Any item type</span>
1221 [% SET holds_by_itemtype = [] %]
1222 [% FOREACH h IN holds_by_branch %]
1223 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1224 [% IF hold_itemtype == i %]
1225 [% holds_by_itemtype.push( h ) %]
1228 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1229 </div> <!-- /.holds_by_itemtype -->
1231 </div> <!-- /.holds_by_library -->
1232 [% END # /FOREACH b %]
1233 [% END # /IF ( branchcodes.empty ) %]
1237 [% IF ( biblioloo.reserveloop.size ) %]
1238 [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
1241 There are no holds on this title.
1245 [% END # /IF HoldsSplitQueue %]
1246 </div> <!-- /hold_title -->
1247 [% END # /IF biblioloo.reserveloop %]
1248 [% END # FOREACH biblioloo %]
1250 </form> <!-- /#existing_holds -->
1251 [% END # IF reserveloop %]
1252 [% END # UNLESS patron %]
1256 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
1257 </div> <!-- /.col-md-10.col-md-offset-1 -->
1259 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1260 <div class="col-sm-2 col-sm-pull-10">
1262 [% INCLUDE 'biblio-view-menu.inc' %]
1264 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1266 </div> <!-- /.row -->
1268 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
1269 <div class="modal-dialog" role="document">
1270 <div class="modal-content">
1271 <div class="modal-header">
1272 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1273 <h3>Confirm deletion</h3>
1276 <div class="modal-body">
1277 <p>Are you sure you want to cancel this hold?</p>
1279 <fieldset class="action">
1280 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1281 [% IF hold_cancellation.count %]
1282 <label for="cancellation-reason">Cancellation reason: </label>
1283 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
1284 <option value="">No reason given</option>
1285 [% FOREACH reason IN hold_cancellation %]
1286 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1293 <div class="modal-footer">
1294 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
1295 <a href="#" data-dismiss="modal">Cancel</a>
1301 [% MACRO jsinclude BLOCK %]
1302 [% INCLUDE 'datatables.inc' %]
1303 [% INCLUDE 'calendar.inc' %]
1304 [% INCLUDE 'columns_settings.inc' %]
1305 [% Asset.js("lib/hc-sticky.js") | $raw %]
1306 [% INCLUDE 'select2.inc' %]
1307 [% Asset.js("js/holds.js") | $raw%]
1309 [% SET url_biblio_params = "biblionumber=" _ biblionumbers.join("&biblionumber=") %]
1311 [% SET url_biblio_params = url_biblio_params _ "&multi_hold=1" %]
1316 var biblionumbers = [[% biblionumbers.join(', ') | $raw %]];
1317 var borrowernumber = "[% patron.borrowernumber | $raw %]";
1318 var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1319 var override_items = {[% FOREACH biblio IN biblioloop %][% FOREACH itemloo IN biblio.itemloop %][% IF ( itemloo.override ) %]
1320 [% itemloo.itemnumber | html %]: {
1321 homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1322 holdallowed: "[% itemloo.holdallowed | html %]"
1324 [% END %][% END %][% END %]
1327 damaged: _("Item damaged"),
1328 ageRestricted: _("Age restricted"),
1329 tooManyHoldsForThisRecord: _("Exceeded max holds per record"),
1330 tooManyReservesToday: _("Daily hold limit reached for patron"),
1331 tooManyReserves: _("Too many holds"),
1332 notReservable: _("Not holdable"),
1333 noReservesAllowed: _("No reserves allowed"),
1334 cannotReserveFromOtherBranches: _("Patron is from different library"),
1335 itemAlreadyOnHold: _("Patron already has hold for this item"),
1336 cannotBeTransferred: _("Cannot be transferred to pickup library"),
1337 pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed")
1340 var MSG_CANCEL_SELECTED = _("Cancel selected (%s)");
1341 $.fn.select2.defaults.set("width", "100%" );
1342 $.fn.select2.defaults.set("dropdownAutoWidth", true );
1344 $(document).ready(function() {
1345 $('#cancellation-reason-fieldset').hide();
1346 $('.rank-request').on('change', function() {
1347 if ( $(".rank-request option:selected[value='del']").length ) {
1348 $('#cancellation-reason-fieldset').show();
1350 $('#cancellation-reason-fieldset').hide();
1354 if( $("#circ_holds_select").length > 0 ){
1355 [% SET active = clubs ? 1 : 0 %]
1356 /* Set active tab based on whether a club search was submitted */
1357 var tabs = $("#circ_holds_select li:eq(" + [% active | $raw %] + ") a").tab("show");
1358 $( tabs[0].hash ).find("input.focus").focus();
1360 /* Change active focus when tabs change */
1361 $("#circ_holds_select a[data-toggle='tab']").on("shown.bs.tab", function (e) {
1362 active_tab = e.target.hash;
1363 $( active_tab ).find("input.focus").focus();
1368 function ToggleHoldsToPlace() {
1369 if ( $("#requestany").prop('checked') ) {
1370 $("#holds_to_place_count").prop('disabled', false);
1372 $("#holds_to_place_count").prop('disabled', true);
1375 ToggleHoldsToPlace();
1376 $("#requestany").on('change', function(){
1377 ToggleHoldsToPlace();
1380 [% IF Koha.Preference('UseBranchTransferLimits') %]
1381 $("#pickup").on('change', function(){
1382 var pickup = $("#pickup").val();
1383 var url = "?pickup=" + pickup;
1384 url += "&borrowernumber=" + borrowernumber;
1385 url += "&biblionumber=" + biblionumbers[0];
1386 window.location.replace(url);
1390 var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1392 "sDom": '<"top pager"ilf>t',
1395 //Override fieldset styling for dataTables search box
1396 $("div.top.pager").css("margin-left","1em");
1397 $(".dataTables_filter label").css({
1399 "margin-right":"0em"
1402 $("#club-request-form").on("submit", function() {
1404 $('.clubalert, .holdalert').addClass('hide');
1406 pickup_library_id: $('select[name="pickup"]').val()
1408 if($('input[name="checkitem"]:checked').length)
1409 data.item_id = $('input[name="checkitem"]:checked').val();
1410 if($('input[name="item_group_id"]:checked').length)
1411 data.item_group_id = $('input[name="item_group_id"]:checked').val();
1412 if($('input[name="borrowernumber"]').length)
1413 data.patron_id = $('input[name="borrowernumber"]').val();
1414 if($('textarea[name="notes"]').length)
1415 data.notes = $('textarea[name="notes"]').val()||null;
1416 if($('input[name="itemtype"]').length) {
1417 data.item_type = $('input[name="itemtype"]').val()||null;
1419 if($('input[name="default_patron_home"]:checked').length) {
1420 data.default_patron_home = 1;
1423 const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1;
1424 var newloc = 'request.pl?';
1425 biblionumbers.forEach(function (biblionumber) {
1426 newloc += '&biblionumber=' + biblionumber;
1429 biblionumbers.forEach(function(biblionumber) {
1430 data.biblio_id = biblionumber;
1432 url: $t.attr('action'),
1433 method: $t.attr('method').toUpperCase(),
1434 contentType: 'application/json',
1435 data: JSON.stringify(data)
1437 for(let i = 0; i < count; i++) {
1439 .then(function(result) {
1440 document.location = newloc;
1442 .fail(function(err) {
1443 var message = err.responseJSON.error;
1444 var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/);
1445 if(match && ERROR_MAP[match[1]]) {
1446 message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>'
1448 $('.clubalert, .holdalert').removeClass('hide').html(message);
1456 [% UNLESS ( multi_hold ) %]
1457 $("#hold-request-form").on("submit", function(e){
1458 return check(e, $(this));
1461 $("#hold-request-form").on("submit", function(){
1462 return checkMultiHold();
1466 $(".pickup_location_dropdown").each( function () {
1467 $(this).pickup_locations_dropdown();
1470 $("#pickup_multi").select2({
1475 $('.multi_pickup_select').select2({
1480 $("#pickup_multi").on("change", function() {
1481 var selection = $(this).val();
1482 if ( selection != '' ) {
1483 $(".multi_pickup_select").each(function() {
1484 var valid_pickup_locations = $(this).data('pickup-locations');
1485 if ( valid_pickup_locations.includes(selection) ) {
1486 $(this).val(selection);
1487 $(this).trigger("change");
1493 $("#pickup").each( function () {
1494 $(this).pickup_locations_dropdown();
1497 $(".pickup_locations").each(function () {
1498 $(this).pickup_locations_dropdown();
1502 function check( e, table ) {
1506 if ( ! $("#requestany").is(":checked") ) {
1507 // requestany not selected, go through the item-specific cases
1508 if ( $('input[type="radio"]:checked').length > 0 ) {
1509 // got item-specific hold requests in the form!
1510 // verify they have a pickup location selected
1512 if (table.find('input[type="radio"]:checked')
1514 .find(".pickup_locations").val() === null) {
1516 msg = _("- Please select a pickup location for the item" + "\n")
1520 msg = (_("- Please select an item to place a hold") + "\n");
1523 if( $("#pickup").length < 1 || $("#pickup").val() == "" ){
1524 msg = _("- Please select a pickup location for this hold" + "\n");
1530 $('#hold-request-form').preventDoubleFormSubmit();
1539 function checkMultiHold() {
1541 var selected_bibs = $(".multi_hold_item_checkbox:checked");
1542 if ( selected_bibs.length > 0 ) {
1543 // there are biblios selected in the form!
1544 // verify they have a pickup location selected
1546 var pickup_not_set = 0;
1547 selected_bibs.each(function() {
1548 if ( $(this).closest('tr').find(".multi_pickup_select").val() === "" ) {
1552 var bibnum = $(this).attr("title");
1555 if ( pickup_not_set > 0 ) {
1556 alert( _("Please make sure all selected titles have a pickup location set" + "\n") );
1561 alert( _("Please select at least one title" + "\n") );
1565 $('#hold-request-form').preventDoubleFormSubmit();
1570 $(document).ready(function() {
1572 $("#always_show_holds").change(function(){
1573 if( $(this).prop('checked') ){
1574 document.cookie = 'always_show_holds=DO';
1576 document.cookie = 'always_show_holds=DONT';
1579 $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1580 var itemnumber = this.value;
1583 switch (override_items[itemnumber].holdallowed) {
1584 case "not_allowed": msg = _("This item normally cannot be put on hold."); break;
1585 case "from_home_library": msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
1588 msg += "\n\n" + _("Place hold on this item?");
1590 return confirm(msg);
1592 $("button.warning").click(function() {
1593 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1595 $("#requestany").click(function() {
1597 $("input[name=checkitem]").each(function() {
1598 $(this).prop("checked", false);
1602 $("input[name=checkitem]").click(function() {
1604 $("input[name=checkitem]").each(function() {
1609 if(onechecked == 1){
1610 $("#requestany").prop("checked", false);
1611 $("#holds_to_place_count").prop('disabled', true);
1613 $("#requestany").prop("checked",true);
1614 $("#holds_to_place_count").prop('disabled', false);
1617 var prev_rank_request;
1618 $("select[name=rank-request]").on("focus", function() {
1619 prev_rank_request = $(this).val();
1620 var row = $(this).parents("tr:first");
1621 }).change(function() {
1622 var row = $(this).parents("tr:first");
1623 var value = parseInt($(this).val());
1624 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
1625 if( !isNaN(value) ) { //If moved to 'del'
1626 var after = row.parent().find(`tr:nth-child(${value+found_holds})`); //Go to the row 1 after the new value (and skip found holds)
1627 if (prev_rank_request > value) {
1628 row.insertBefore(after);
1630 row.insertAfter(after);
1634 var next_priority = 1;
1635 $("select[name=rank-request]").each(function () {
1636 if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
1637 $(this).val(next_priority);
1642 $(".clear-date").on("click",function(e){
1644 var fieldID = this.id.replace("clear-date-","");
1645 $("#" + fieldID).val("");
1648 // Confirm cancellation of hold
1650 $(".cancel-hold").on("click",function(e) {
1652 cancel_link = $(this);
1653 $('#cancelModal').modal();
1656 $("#cancelModalConfirmBtn").on("click",function(e) {
1658 if(cancel_link.data('bulk')) {
1659 [% SET data_url = 'biblionumber=' _ biblionumbers.join('&biblionumber=') %]
1660 link = `request.pl?[% data_url | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1662 let borrowernumber = cancel_link.data('borrowernumber');
1663 let biblionumber = cancel_link.data('biblionumber');
1664 let reserve_id = cancel_link.data('id');
1665 link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`;
1667 let reason = $("#modal-cancellation-reason").val();
1669 link += "&cancellation-reason=" + reason
1671 window.location.href = link;
1675 [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems || nobiblio ) %]
1676 [% IF ( PatronAutoComplete ) %]
1677 patron_autocomplete($("#search_patron_filter"), { 'link-to': 'reserve', 'url-params': '[% url_biblio_params | url %]' });
1681 Sticky = $("#toolbar");
1683 stickTo: "#existing_holds",
1684 stickyClass: "floating"
1687 [% IF Koha.Preference('EnableItemGroupHolds') %]
1688 $(':radio[name="item_group_id"]').change(function(){
1689 $(':radio[name="checkitem"]').prop('checked', false);
1692 $(':radio[name="checkitem"]').change(function(){
1693 $(':radio[name="item_group_id"]').prop('checked', false);
1697 if(!localStorage.selectedHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) {
1698 localStorage.selectedHolds = [];
1701 $('.holds_table .select_hold').each(function() {
1702 if(localStorage.selectedHolds.includes($(this).data('id'))) {
1703 $(this).prop('checked', true);
1707 $('.holds_table .select_hold_all').each(function() {
1708 var table = $(this).parents('.holds_table');
1709 var count = $('.select_hold:not(:checked)', table).length;
1710 $('.select_hold_all', table).prop('checked', !count);
1713 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1715 $('.holds_table .select_hold_all').click(function() {
1716 var table = $(this).parents('.holds_table');
1717 var count = $('.select_hold:checked', table).length;
1718 $('.select_hold', table).prop('checked', !count);
1719 $(this).prop('checked', !count);
1720 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1721 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1724 $('.holds_table .select_hold').click(function() {
1725 var table = $(this).parents('.holds_table');
1726 var count = $('.select_hold:not(:checked)', table).length;
1727 $('.select_hold_all', table).prop('checked', !count);
1728 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1729 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1732 $('.cancel_selected_holds').click(function(e) {
1734 if($('.holds_table .select_hold:checked').length) {
1735 cancel_link = $(this);
1736 delete localStorage.selectedHolds;
1737 $('#cancelModal').modal();
1745 table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
1748 [% 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' %]
1750 $(document).ready(function() {
1751 $("#holds_patronsearch").on("submit", filter);
1753 $('.printholdslip').click(function(){
1754 var reserve_id = $(this).attr('data-reserve_id');
1755 window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
1761 [% INCLUDE 'intranet-bottom.inc' %]