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 [% INCLUDE 'header.inc' %]
97 [% INCLUDE 'circ-search.inc' %]
99 [% UNLESS ( multi_hold ) %]
100 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
103 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
106 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
109 [% INCLUDE 'biblio-title.inc' link =1 %]
112 <a href="#" aria-current="page">
119 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
122 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
125 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
129 <a href="#" aria-current="page">
134 <a href="#" aria-current="page">
135 Search patrons or clubs
138 <a href="#" aria-current="page">
146 [% END # UNLESS multi_hold %]
148 <div class="main container-fluid">
150 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
151 <div class="col-md-10 col-md-offset-1">
153 <div class="col-sm-10 col-sm-push-2">
159 [% IF ( nobiblio ) %]
160 <div class="dialog alert">
162 <strong>Cannot place hold:</strong> one or more records don't exist.
164 <strong>Cannot place hold:</strong> this record doesn't exist.
169 <div class="dialog alert">
171 <strong>Cannot place hold:</strong> one or more records without items attached.
173 <strong>Cannot place hold:</strong> this record has no items attached.
178 [% IF ( messagetransfert ) %]
179 <div class="dialog message">
180 <h2>Hold found for ([% nextreservtitle | html %]), please transfer</h2>
181 <p>Hold placed by : <strong> [% nextreservsurname | html %] [% nextreservfirstname | html %]</strong> at : <strong> [% branchname | html %] </strong>, Please transfer this item.
183 <form name="cancelReservewithtransfert" action="branchreserves.pl" method="post">
184 <input type="submit" class="button" />
189 [% UNLESS ( multi_hold ) %]
190 <h2>Place a hold on [% INCLUDE 'biblio-title.inc' link = 1 %] [% IF biblio.author %] by [% biblio.author | html %][% END %]</h2>
194 <span>Place holds</span>
197 <span>Search patrons or clubs</span>
199 <span>Search patrons</span>
205 [% UNLESS club OR patron OR patron.borrowernumber OR noitems OR nobiblio %]
206 [% IF ( messageborrower ) %]
207 <div class="dialog alert">
208 <h3>Patron not found</h3>
209 <p>No patron with this name, please, try another</p>
213 [% IF ( messageclub ) %]
214 <div class="dialog alert">
215 <h3>Club not found</h3>
216 <p>No club with this name, please, try another</p>
220 [% UNLESS multi_hold %]
222 <h2>Search patrons or clubs</h2>
224 <h2>Search patrons</h2>
227 <div id="circ_holds_select" class="toptabs">
228 <ul class="nav nav-tabs" role="tablist">
229 <li role="presentation" class="active"><a href="#holds_patronsearch_pane" aria-controls="holds_patronsearch_pane" role="tab" data-toggle="tab">Patrons</a></li>
231 <li role="presentation"><a href="#holds_clubsearch_pane" aria-controls="holds_clubsearch_pane" role="tab" data-toggle="tab">Clubs</a></li>
234 <div class="tab-content">
235 <div id="holds_patronsearch_pane" role="tabpanel" class="tab-pane active">
236 [% PROCESS patron_search_filters_simple %]
238 [% PROCESS patron_search_table table_id => 'table_borrowers', open_on_row_click => 1 %]
241 <div id="holds_clubsearch_pane" role="tabpanel" class="tab-pane">
242 <form id="holds_clubsearch" action="request.pl" method="post">
243 <div class="hint">Enter club ID or partial name:</div>
244 <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" />
245 <input type="submit" value="Search" />
246 [% FOREACH biblionumber IN biblionumbers %]
247 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
250 </form> <!-- /#holds_patronsearch -->
252 [% INCLUDE 'clubs-table.inc' destination = "holds" %]
256 </div> <!-- /.tab-content -->
260 <div class="dialog alert hide clubalert">
262 <fieldset class="rows">
263 <legend>Hold details</legend>
264 <form action="/api/v1/clubs/[% club.id | html %]/holds" method="post" name="form" id="club-request-form">
266 [% IF ( multi_hold ) %]
267 <input type="hidden" name="request" value="any"/>
268 [% FOREACH biblioloo IN biblioloop %]
269 [% UNLESS biblioloo.none_avail %]
270 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
271 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
272 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
276 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
277 <input type="hidden" name="title" value="[% biblio.title | html %]" />
278 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
279 [% END # /IF multi_hold %]
282 <span class="label">Club: </span> [% club.name | html %]
285 <span class="label">Description: </span> [% club.description | html %]
288 <label for="pickup">Pickup at:</label>
289 <select name="pickup" id="pickup_club">
290 [% PROCESS options_for_libraries libraries => Branches.all({ selected => club.branchcode, search_params => { pickup_location => 1 } }) %]
294 <label for="default_patron_home">Pickup at patron's home library when possible:</label>
295 <input type="checkbox" id="default_patron_home" name="default_patron_home"/>
298 <h2 style="padding: 0 1em;">Members</h2>
300 [% FOREACH member IN members %]
301 [% SET patron = member.patron %]
302 <li style="padding: 0.5em 1em;">
303 <div><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a></div>
304 [% IF member.exceeded_maxreserves %]
306 <i class="fa fa-error"></i>
307 <strong>Too many holds: </strong> Patron can only place a maximum of [% maxreserves | html %] total holds.
310 [% IF ( patron.is_expired ) %]
312 <i class="fa fa-warning"></i>
313 <strong>Account has expired</strong>
316 [% IF patron.is_debarred %]
318 <i class="fa fa-warning"></i>
319 <strong>Patron has restrictions</strong>
322 [% IF member.amount_outstanding && Koha.Preference('maxoutstanding') && member.amount_outstanding > Koha.Preference('maxoutstanding') %]
324 <i class="fa fa-warning"></i>
325 <strong>Patron has outstanding fines: [% member.amount_outstanding | $Price %]</strong>
329 [% IF ( member.diffbranch ) %]
331 <i class="fa fa-warning"></i>
332 <strong>Pickup library is different.</strong> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )
337 [% UNLESS ( multi_hold ) %]
338 <fieldset class="action">
339 <input type="submit" value="Place hold" />
342 <table id="requesttitles">
346 [% UNLESS Koha.Preference('item-level_itypes') %]
352 [% FOREACH biblioloo IN biblioloop %]
353 [% IF ( biblioloo.warn ) %]
359 [% UNLESS ( biblioloo.warn ) %]
360 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
366 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
367 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
369 [% IF ( biblioloo.publicationyear ) %]
371 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
375 [% IF ( biblioloo.warn ) %]
376 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
379 [% UNLESS Koha.Preference('item-level_itypes') %]
381 <img src="[% biblioloo.itemtype.image_location| html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
384 <td>[% biblioloo.rank | html %]</td>
386 [% IF ( biblioloo.checked_previously ) %]
387 <span>Patron has previously checked out this title</span><br/>
389 [% IF ( biblioloo.alreadyres ) %]
392 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
397 [% IF ( biblioloo.alreadyres ) %]
399 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
400 <strong>already has a hold</strong> on this item
403 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
404 <li> <strong>No items are available</strong> to be placed on hold</li>
407 [% IF ( biblioloo.alreadyres ) %]
410 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
416 [% END # /FOREACH biblioloo %]
417 </table> <!-- /#requesttitles -->
421 [% ELSIF NOT ( noitems || nobiblio ) # /UNLESS patron %]
423 [% IF ( checked_previously && !multi_hold ) %]
424 <div class="dialog alert">
426 <li>Patron has previously checked out this title</li>
431 [% IF ( no_reserves_allowed || exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted || recall ) %]
432 <div class="dialog alert">
434 [% UNLESS ( multi_hold ) %]
435 <h3>Cannot place hold</h3>
437 [% IF ( no_reserves_allowed ) %]
438 <li><strong>No holds allowed: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> cannot place a hold on any of these items.</li>
439 [% ELSIF ( exceeded_maxreserves ) %]
440 <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> can only place a maximum of [% maxreserves | html %] total holds.</li>
441 [% ELSIF ( exceeded_holds_per_record ) %]
442 <li><strong>Too many holds for this record: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> can only place a maximum of [% max_holds_for_record | html %] hold(s) on this record.</li>
443 [% ELSIF ( alreadypossession ) %]
444 <li> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a> <strong>is already in possession</strong> of one item.</li>
445 [% ELSIF ( alreadyreserved ) %]
446 <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a> <strong>already has a hold</strong> on this item.</li>
447 [% ELSIF ( ageRestricted ) %]
448 <li><strong>Age restricted</strong></li>
449 [% ELSIF ( none_available ) %]
450 <li> <strong>No items are available</strong> to be placed on hold.</li>
451 [% ELSIF ( maxreserves ) %]
452 <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> has too many holds.</li>
453 [% ELSIF ( recall ) %]
454 <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a> has <strong>already placed a recall</strong> on this item.</li>
455 [% END # /IF exceeded_maxreserves %]
457 [% ELSE # UNLESS multi_hold %]
458 <h3>Cannot place hold on some items</h3>
459 [% IF (no_reserves_allowed ) %]
460 <li><strong>No holds allowed: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> cannot place holds on some of these title's items.</li>
461 [% ELSIF ( exceeded_maxreserves ) %]
462 <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> can place [% new_reserves_allowed | html %] of the requested [% new_reserves_count | html %] holds for a maximum of [% maxreserves | html %] total holds.</li>
463 [% ELSIF ( exceeded_holds_per_record ) %]
464 [% FOREACH biblioloo IN biblioloop %]
465 [% IF (biblioloo.tooManyHoldsForThisRecord) %]
466 <li><strong>Too many holds for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]"> [% biblioloo.title | html %]</a>: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | html %]">[% patron.firstname | html %] [% patron.surname | html %] </a> can only place a maximum of [% max_holds_for_record | html %] hold(s) on this record.</li>
469 [% ELSIF ( none_available ) %]
470 <li><strong>No items available: </strong>One or more records have no items that can be held</li>
471 [% END # /IF exceeded_maxreserves %]
472 [% END # /UNLESS multi_hold %]
474 [% END # /IF ( exceeded_maxreserves || ... %]
476 [% IF ( patron.is_expired || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
477 <div class="dialog message">
479 [% IF ( patron.is_expired ) %]
480 <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>: <strong>Account has expired</strong></li>
483 [% IF patron.is_debarred %]
484 <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]#reldebarments">[% patron.firstname | html %] [% patron.surname | html %]</a>: <strong>Patron has restrictions</strong></li>
487 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
488 <li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>: <strong>Patron has outstanding fines: [% amount_outstanding | $Price %]</strong></li>
491 [% IF ( diffbranch ) %]
492 <li> <strong>Pickup library is different. </strong>Patron: <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )</li>
494 </ul> <!-- /.dialog.message -->
496 [% END # /IF patron.is_expired || diffbranch ... %]
498 [% IF ( messageborrower ) %]
499 <div class="dialog alert">
500 <h3>Patron not found:</h3>
501 <p>Name or barcode not found. Please try an other </p>
505 <div class="dialog alert hide holdalert">
508 <fieldset class="rows">
509 <legend>Hold details</legend>
510 <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
512 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
513 [% FOREACH biblionumber IN biblionumbers %]
514 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
516 [% IF ( multi_hold ) %]
517 <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
518 <input type="hidden" name="request" value="any"/>
519 [% FOREACH biblioloo IN biblioloop %]
520 [% UNLESS biblioloo.none_avail %]
521 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
522 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
523 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
527 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
528 <input type="hidden" name="title" value="[% biblio.title | html %]" />
529 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
530 [% END # /IF multi_hold %]
534 <span class="label">Patron:</span>
535 [% IF ( patron.borrowernumber ) %]
536 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a>
542 [% UNLESS ( multi_hold ) %]
544 <span class="label">Estimated priority:</span>
545 <strong>[% fixedRank | html %]</strong>
550 <label for="holdnotes">Notes:</label>
551 <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
554 <label for="pickup">Pickup at:</label>
555 [% UNLESS ( multi_hold ) %]
556 <select name="pickup" id="pickup"
557 data-biblio-id="[% biblio.biblionumber | html %]"
558 data-patron-id="[% patron.borrowernumber | html %]"
559 data-pickup-location-source="biblio">
560 [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
562 <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
563 <option value="" selected="selected"></option>
564 [% FOREACH pickup_location IN multi_pickup_locations %]
565 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
571 [% UNLESS ( multi_hold ) %]
572 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
574 <label for="itemtype">Request specific item type:</label>
575 <select name="itemtype" id="itemtype">
576 <option value="">Any item type</option>
577 [%- FOREACH itemtype IN available_itemtypes %]
578 <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
583 [% END # /UNLESS multi_hold %]
585 [% IF ( reserve_in_future ) %]
587 <label for="from">Hold starts on date:</label>
588 <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" data-date_to="expiration_date" class="flatpickr" data-flatpickr-futuredate="true" />
593 <label for="to">Hold expires on date:</label>
594 <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
597 [% UNLESS ( multi_hold ) %]
599 <label for="requestany">Hold next available item </label>
600 [% IF force_hold_level == 'item' %]
601 <input type="checkbox" id="requestany" name="request" disabled="true" />
602 [% ELSIF force_hold_level == 'record' %]
603 <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
604 <input type="hidden" name="request" value="Any"/>
606 <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
608 <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
611 [% IF remaining_holds_for_record > 1 %]
613 <label for="holds_to_place_count">Holds to place (count)</label>
614 <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" />
617 <input type="hidden" name="holds_to_place_count" value="1" />
619 [% END # /UNLESS multi_hold %]
621 <li id="non_priority_list_item">
622 <label for="non_priority">Non priority hold:</label>
623 <input name="non_priority" id="non_priority" type="checkbox" />
624 <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
628 [% UNLESS ( multi_hold ) %]
629 <fieldset class="action">
630 [% IF ( patron.borrowernumber ) %]
631 [% IF ( override_required ) %]
632 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
633 [% ELSIF ( none_available ) %]
634 <button type="submit" disabled="disabled" class="btn btn-default btn-disabled">Place hold</button>
636 <button type="submit" class="btn btn-default">Place hold</button>
641 [% biblio = biblioloop.0 %]
644 [% UNLESS Koha.Preference('item-level_itypes') %]
646 <span class="label">Item typeX:</span>
647 [% biblio.itemtype.translated_description | html %]
651 [% IF ( biblio.biblioitem.publicationyear ) %]
653 <span class="label">Publication year:</span>
654 [% biblio.biblioitem.publicationyear | html %]
659 <h2 style="padding: 0 1em;">
660 Place a hold on a specific item
661 [% IF force_hold_level == 'item' %]
662 <span class="error"><em>(Required)</em></span>
666 <table id="requestspecific">
670 <th>Allowed pickup locations</th>
671 [% IF Koha.Preference('item-level_itypes') %]
675 <th>Home library</th>
676 <th>Last location</th>
677 [% IF itemdata_ccode %]
682 [% IF itemdata_enumchron %]
689 [% SET selected = 0 %]
690 [% FOREACH itemloo IN biblio.itemloop %]
691 [% UNLESS ( itemloo.hide ) %]
692 <tr class="[% itemloo.backgroundcolor | html %]">
694 [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
696 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
697 Hold must be record level
699 [% ELSIF ( itemloo.available ) %]
700 <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
701 [% ELSIF ( itemloo.override ) %]
702 <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
703 <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
706 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
707 [% IF itemloo.not_holdable %]
708 [% IF itemloo.not_holdable == 'damaged' %]
709 <span>Item damaged</span>
710 [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
711 <span>Age restricted</span>
712 [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
713 <span>Exceeded max holds per record</span>
714 [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
715 <span>Daily hold limit reached for patron</span>
716 [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
717 <span>Too many holds</span>
718 [% ELSIF itemloo.not_holdable == 'notReservable' %]
719 <span>Not holdable</span>
720 [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
721 <span>Patron is from different library</span>
722 [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
723 <span>Cannot place hold from patron's library</span>
724 [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
725 <span>Patron already has hold for this item</span>
726 [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
727 <span>Cannot be transferred to pickup library</span>
728 [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
729 <span>Only pickup locations within the same hold group are allowed</span>
730 [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
731 <span>No holds are allowed on this item</span>
732 [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %]
733 <span>Library is not a pickup location</span>
734 [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
735 <span>No valid pickup location</span>
736 [% ELSIF itemloo.not_holdable == 'notforloan' %]
737 <span>Not for loan</span>
739 <span>[% itemloo.not_holdable | html %]</span>
743 [% END # /IF force_hold_level %]
746 [% IF (itemloo.pickup_locations_count > 0) %]
747 <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations" style="width:100%;"
748 data-item-id="[% itemloo.itemnumber | html %]"
749 data-patron-id="[% patron.borrowernumber | html %]"
750 data-pickup-location-source="item">
751 [% IF (itemloo.default_pickup_location) %]
752 <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option>
757 [% IF Koha.Preference('item-level_itypes') %]
759 [% UNLESS ( noItemTypeImages ) %]
760 [% IF ( itemloo.itemtype.image_location) %]<img src="[% itemloo.itemtype.image_location | html %]" alt="" /> <br /> [% END %]
762 [% itemloo.itemtype.translated_description | html %]
766 [% itemloo.barcode | html %]
769 [% Branches.GetName( itemloo.homebranch ) | html %]
772 [% Branches.GetName( itemloo.holdingbranch ) | html %]
774 [% IF itemdata_ccode %]
776 [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
780 [% itemloo.itemcallnumber | html %]
783 [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %]
785 [% IF itemdata_enumchron %]
787 [% itemloo.enumchron | html %]
790 [% IF ( itemloo.onloan ) %]
791 <td data-order="[% itemloo.date_due | html %]">
792 <span class="checkedout">Due [% itemloo.date_due | $KohaDates as_due_date => 1 %]</span>
795 [% IF ( itemloo.transfertwhen ) %]
796 <span>In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
797 to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %]</span>
801 [% IF ( itemloo.reservedate ) %]
802 [% IF ( itemloo.nocancel ) %]
803 <span>Can't be cancelled when item is in transit</span>
805 [% IF ( itemloo.waitingdate ) %]<span>Waiting</span>[% ELSE %]<span>On hold</span>[% END %]
806 [% IF ( itemloo.canreservefromotherbranches ) %]
807 <span>for</span> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedFor.borrowernumber | uri %]">[% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %]</a>
809 [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %]
810 [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] <span>since</span>
811 [% IF ( itemloo.waitingdate ) %]
812 [% itemloo.waitingdate | $KohaDates %]
814 [% IF ( itemloo.reservedate ) %]
815 [% itemloo.reservedate | html %]
818 <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
819 [% END # /IF itemloo.nocancel %]
822 [% END # /IF itemloo.reservedate %]
824 [% IF itemloo.item_level_holds == "N" %]
825 <br/>Item level hold not allowed from OPAC
826 [% ELSIF itemloo.item_level_holds == "F" %]
827 <br/>Item level hold forced from OPAC
830 [% IF ( itemloo.itemlost ) %]
831 <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
834 [% IF ( itemloo.damaged ) %]
835 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
838 [% IF ( itemloo.withdrawn ) %]
839 <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
842 [% IF ( itemloo.notforloan ) %]
843 <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
844 [% ELSIF ( itemloo.notforloanitype ) %]
845 <span class="nfl">Not for loan (Itemtype not for loan)</span>
849 [% END # / UNLESS itemloo.hide %]
850 [% END # /FOREACH itemloo %]
852 </table> <!-- /#requestspecific -->
856 <p class="hiddencount">
857 <a href="request.pl?biblionumber=[% biblio.biblionumber | uri %]&borrowernumber=[% borrowernumber | uri %]&showallitems=1">Show all items ([% biblio.hiddencount | html %] hidden)</a>
860 [% END # /IF hiddencount %]
862 [% ELSE # /UNLESS multi_hold %]
864 <table id="requesttitles">
867 <th>Pickup location</th>
869 [% UNLESS Koha.Preference('item-level_itypes') %]
875 [% FOREACH biblioloo IN biblioloop %]
876 [% IF ( biblioloo.warn ) %]
882 [% UNLESS ( biblioloo.warn ) %]
883 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
887 [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %]
888 <select name="pickup_[% biblioloo.biblionumber | html %]"
889 class="multi_pickup_select"
890 data-biblio-id="[% biblioloo.biblionumber | html %]"
891 data-patron-id="[% patron.borrowernumber | html %]"
892 data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
893 <option value=""></option>
894 [% FOREACH pickup_location IN biblioloo.pickup_locations %]
895 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
903 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
904 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
906 [% IF ( biblioloo.publicationyear ) %]
908 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
912 [% IF ( biblioloo.warn ) %]
913 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
916 [% UNLESS Koha.Preference('item-level_itypes') %]
918 <img src="[% biblioloo.itemtype.image_location | html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
921 <td>[% biblioloo.rank | html %]</td>
923 [% IF ( biblioloo.checked_previously ) %]
924 <span>Patron has previously checked out this title</span><br/>
926 [% IF ( biblioloo.alreadyres ) %]
929 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
934 [% IF ( biblioloo.alreadyres ) %]
936 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
937 <strong>already has a hold</strong> on this item
940 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
941 <li> <strong>No items are available</strong> to be placed on hold</li>
944 [% IF ( biblioloo.alreadyres ) %]
947 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
953 [% END # /FOREACH biblioloo %]
954 </table> <!-- /#requesttitles -->
956 [% END # /UNLESS multi_hold %]
958 <fieldset class="action">
959 [% IF ( patron AND patron.borrowernumber ) %]
960 [% IF ( multi_hold ) %]
961 [% IF ( override_required ) %]
962 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
963 [% ELSIF ( no_bibs_available ) %]
964 <button type="submit" class="btn btn-default btn-disabled" disabled="disabled">Place holds</button>
965 [% ELSIF ( none_available ) %]
966 <button type="submit" class="btn btn-default">Place holds</button>
968 <button type="submit" class="btn btn-default" id="multi_hold_submit">Place holds</button>
971 [% IF ( override_required ) %]
972 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
973 [% ELSIF ( none_available ) %]
974 <button type="submit" class="btn btn-default btn-disabled" disabled="disabled">Place hold</button>
976 <button type="submit" class="btn btn-default">Place hold</button>
979 [% END # /IF patron %]
980 </fieldset> <!-- /.action -->
981 </form> <!-- /#hold-request-form -->
982 </fieldset> <!-- /.rows -->
985 [% UNLESS ( patron ) %]
986 [% UNLESS borrowers %]
987 [% SET hold_count = Biblio.HoldsCount( biblio.biblionumber ) | html %]
989 <label for ="always_show_holds">Always show holds</label>
990 [% IF always_show_holds == 'DONT' %]
991 <input type="checkbox" name="always_show_holds" id="always_show_holds" value="DO">
992 [% UNLESS reserveloop %]
993 <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>
996 <input type="checkbox" name="always_show_holds" value="DO" id="always_show_holds" checked="checked">
1000 [% IF ( reserveloop ) %]
1001 <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
1002 [% IF ( multi_hold ) %]
1003 [% FOREACH biblionumber IN biblionumbers %]
1004 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
1009 <div class="dialog message">
1010 <p>The job has been enqueued! It will be processed as soon as possible.</p>
1011 <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>
1015 <h2>Existing holds</h2>
1016 <div id="toolbar" class="btn-toolbar">
1017 <input type="submit" name="submit" value="Update hold(s)" /> <button class="cancel_selected_holds" data-bulk="true"></button>
1018 <fieldset id="cancellation-reason-fieldset" class="action">
1019 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1020 [% IF hold_cancellation.count %]
1021 <label for="cancellation-reason">Cancellation reason: </label>
1022 <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
1023 <option value="">No reason given</option>
1024 [% FOREACH reason IN hold_cancellation %]
1025 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1032 [% FOREACH biblioloo IN biblioloop %]
1033 [% IF ( biblioloo.reserveloop ) %]
1034 <div class="hold_title" id="hold_title_[% biblioloo.biblionumber | html %]">
1035 [% IF ( multi_hold ) %]
1037 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
1038 [% biblioloo.title | html %]
1039 </a> <span class="number_box"><span>[% biblioloo.reserveloop.size | html %] [% tn('Hold', 'Holds', biblioloo.reserveloop.size) | $raw %]</span></span>
1043 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
1045 [% SET branchcodes = [] %]
1047 [% FOREACH h IN biblioloo.reserveloop %]
1048 [% branchcodes.push( h.branchcode ) %]
1050 [% branchcodes = branchcodes.unique %]
1051 [% IF ( branchcodes.empty ) %]
1053 There are no holds on this title.
1057 [% FOREACH b IN branchcodes.sort %]
1058 [% SET holds_by_branch = [] %]
1059 [% FOREACH h IN biblioloo.reserveloop %]
1060 [% IF h.branchcode == b %]
1061 [% holds_by_branch.push( h ) %]
1064 <div class="holds_by_library">
1065 <h4>[% Branches.GetName( b ) | html %]</h4>
1067 [% INCLUDE holds_table.inc holds=holds_by_branch %]
1069 [% END # /FOREACh b %]
1070 [% END # /IF ( branchcodes.empty ) %]
1072 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
1074 [% SET itemtypes = [] %]
1076 [% FOREACH h IN biblioloo.reserveloop %]
1077 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1078 [% itemtypes.push( hold_itemtype ) %]
1080 [% itemtypes = itemtypes.unique %]
1081 [% IF ( itemtypes.empty ) %]
1083 There are no holds on this title.
1087 [% FOREACH i IN itemtypes.sort %]
1088 [% SET holds_by_itemtype = [] %]
1089 [% FOREACH h IN biblioloo.reserveloop %]
1090 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1091 [% IF hold_itemtype == i %]
1092 [% holds_by_itemtype.push( h ) %]
1096 <div class="holds_by_itemtype">
1098 <h4>[% ItemTypes.GetDescription( i ) | html %]</h4>
1100 <h4>Any item type</h4>
1102 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1104 [% END # /FOREACH i %]
1105 [% END # /IF ( itemtypes.empty ) %]
1107 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
1108 [% SET branchcodes = [] %]
1110 [% FOREACH h IN biblioloo.reserveloop %]
1111 [% branchcodes.push( h.branchcode ) %]
1113 [% branchcodes = branchcodes.unique %]
1114 [% IF ( branchcodes.empty ) %]
1116 There are no holds on this title.
1120 [% FOREACH b IN branchcodes.sort %]
1121 <div class="holds_by_library">
1122 <h4 class="library_holds">[% Branches.GetName( b ) | html %]</h4>
1123 [% SET holds_by_branch = [] %]
1124 [% FOREACH h IN biblioloo.reserveloop %]
1125 [% IF h.branchcode == b %]
1126 [% holds_by_branch.push( h ) %]
1130 [% SET itemtypes = [] %]
1131 [% FOREACH h IN holds_by_branch %]
1132 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1133 [% itemtypes.push( hold_itemtype ) %]
1135 [% itemtypes = itemtypes.unique %]
1137 [% FOREACH i IN itemtypes.sort %]
1138 <div class="holds_by_itemtype">
1139 <h5 class="itemtype_holds">
1141 [% ItemTypes.GetDescription( i ) | html %]
1143 <span>Any item type</span>
1147 [% SET holds_by_itemtype = [] %]
1148 [% FOREACH h IN holds_by_branch %]
1149 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1150 [% IF hold_itemtype == i %]
1151 [% holds_by_itemtype.push( h ) %]
1154 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1155 </div> <!-- /.holds_by_itemtype -->
1157 </div> <!-- /.holds_by_library -->
1158 [% END # /FOREACH b %]
1159 [% END # /IF ( branchcodes.empty ) %]
1163 [% IF ( biblioloo.reserveloop.size ) %]
1164 [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
1167 There are no holds on this title.
1171 [% END # /IF HoldsSplitQueue %]
1172 </div> <!-- /hold_title -->
1173 [% END # /IF biblioloo.reserveloop %]
1174 [% END # FOREACH biblioloo %]
1175 </form> <!-- /#existing_holds -->
1176 [% END # IF reserveloop %]
1177 [% END # UNLESS patron %]
1181 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
1182 </div> <!-- /.col-md-10.col-md-offset-1 -->
1184 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1185 <div class="col-sm-2 col-sm-pull-10">
1187 [% INCLUDE 'biblio-view-menu.inc' %]
1189 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1191 </div> <!-- /.row -->
1193 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
1194 <div class="modal-dialog" role="document">
1195 <div class="modal-content">
1196 <div class="modal-header">
1197 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1198 <h3>Confirm deletion</h3>
1201 <div class="modal-body">
1202 <p>Are you sure you want to cancel this hold?</p>
1204 <fieldset class="action">
1205 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1206 [% IF hold_cancellation.count %]
1207 <label for="cancellation-reason">Cancellation reason: </label>
1208 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
1209 <option value="">No reason given</option>
1210 [% FOREACH reason IN hold_cancellation %]
1211 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1218 <div class="modal-footer">
1219 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
1220 <a href="#" data-dismiss="modal">Cancel</a>
1226 [% MACRO jsinclude BLOCK %]
1227 [% INCLUDE 'datatables.inc' %]
1228 [% INCLUDE 'calendar.inc' %]
1229 [% INCLUDE 'columns_settings.inc' %]
1230 [% Asset.js("lib/hc-sticky.js") | $raw %]
1231 [% INCLUDE 'select2.inc' %]
1232 [% Asset.js("js/holds.js") | $raw%]
1234 [% SET url_biblio_params = "biblionumber=" _ biblionumbers.join("&biblionumber=") %]
1236 [% SET url_biblio_params = url_biblio_params _ "&multi_hold=1" %]
1241 var biblionumbers = [[% biblionumbers.join(', ') | $raw %]];
1242 var borrowernumber = "[% patron.borrowernumber | $raw %]";
1243 var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1244 var override_items = {[% FOREACH biblio IN biblioloop %][% FOREACH itemloo IN biblio.itemloop %][% IF ( itemloo.override ) %]
1245 [% itemloo.itemnumber | html %]: {
1246 homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1247 holdallowed: "[% itemloo.holdallowed | html %]"
1249 [% END %][% END %][% END %]
1252 damaged: _("Item damaged"),
1253 ageRestricted: _("Age restricted"),
1254 tooManyHoldsForThisRecord: _("Exceeded max holds per record"),
1255 tooManyReservesToday: _("Daily hold limit reached for patron"),
1256 tooManyReserves: _("Too many holds"),
1257 notReservable: _("Not holdable"),
1258 noReservesAllowed: _("No reserves allowed"),
1259 cannotReserveFromOtherBranches: _("Patron is from different library"),
1260 itemAlreadyOnHold: _("Patron already has hold for this item"),
1261 cannotBeTransferred: _("Cannot be transferred to pickup library"),
1262 pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed")
1265 var MSG_CANCEL_SELECTED = _("Cancel selected (%s)");
1266 $.fn.select2.defaults.set("width", "100%" );
1267 $.fn.select2.defaults.set("dropdownAutoWidth", true );
1269 $(document).ready(function() {
1270 $('#cancellation-reason-fieldset').hide();
1271 $('.rank-request').on('change', function() {
1272 if ( $(".rank-request option:selected[value='del']").length ) {
1273 $('#cancellation-reason-fieldset').show();
1275 $('#cancellation-reason-fieldset').hide();
1279 if( $("#circ_holds_select").length > 0 ){
1280 [% SET active = clubs ? 1 : 0 %]
1281 /* Set active tab based on whether a club search was submitted */
1282 var tabs = $("#circ_holds_select li:eq(" + [% active | $raw %] + ") a").tab("show");
1283 $( tabs[0].hash ).find("input.focus").focus();
1285 /* Change active focus when tabs change */
1286 $("#circ_holds_select a[data-toggle='tab']").on("shown.bs.tab", function (e) {
1287 active_tab = e.target.hash;
1288 $( active_tab ).find("input.focus").focus();
1293 function ToggleHoldsToPlace() {
1294 if ( $("#requestany").prop('checked') ) {
1295 $("#holds_to_place_count").prop('disabled', false);
1297 $("#holds_to_place_count").prop('disabled', true);
1300 ToggleHoldsToPlace();
1301 $("#requestany").on('change', function(){
1302 ToggleHoldsToPlace();
1305 [% IF Koha.Preference('UseBranchTransferLimits') %]
1306 $("#pickup").on('change', function(){
1307 var pickup = $("#pickup").val();
1308 var url = "?pickup=" + pickup;
1309 url += "&borrowernumber=" + borrowernumber;
1310 url += "&biblionumber=" + biblionumbers[0];
1311 window.location.replace(url);
1315 var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1317 "sDom": '<"top pager"ilf>t',
1320 //Override fieldset styling for dataTables search box
1321 $("div.top.pager").css("margin-left","1em");
1322 $(".dataTables_filter label").css({
1324 "margin-right":"0em"
1327 $("#club-request-form").on("submit", function() {
1329 $('.clubalert, .holdalert').addClass('hide');
1331 pickup_library_id: $('select[name="pickup"]').val()
1333 if($('input[name="checkitem"]:checked').length)
1334 data.item_id = $('input[name="checkitem"]:checked').val();
1335 if($('input[name="borrowernumber"]').length)
1336 data.patron_id = $('input[name="borrowernumber"]').val();
1337 if($('textarea[name="notes"]').length)
1338 data.notes = $('textarea[name="notes"]').val()||null;
1339 if($('input[name="itemtype"]').length) {
1340 data.item_type = $('input[name="itemtype"]').val()||null;
1342 if($('input[name="default_patron_home"]:checked').length) {
1343 data.default_patron_home = 1;
1346 const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1;
1347 var newloc = 'request.pl?';
1348 biblionumbers.forEach(function (biblionumber) {
1349 newloc += '&biblionumber=' + biblionumber;
1352 biblionumbers.forEach(function(biblionumber) {
1353 data.biblio_id = biblionumber;
1355 url: $t.attr('action'),
1356 method: $t.attr('method').toUpperCase(),
1357 contentType: 'application/json',
1358 data: JSON.stringify(data)
1360 for(let i = 0; i < count; i++) {
1362 .then(function(result) {
1363 document.location = newloc;
1365 .fail(function(err) {
1366 var message = err.responseJSON.error;
1367 var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/);
1368 if(match && ERROR_MAP[match[1]]) {
1369 message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>'
1371 $('.clubalert, .holdalert').removeClass('hide').html(message);
1379 [% UNLESS ( multi_hold ) %]
1380 $("#hold-request-form").on("submit", function(){
1381 return check($(this));
1384 $("#hold-request-form").on("submit", function(){
1385 return checkMultiHold();
1389 $(".pickup_location_dropdown").each( function () {
1390 $(this).pickup_locations_dropdown();
1393 $("#pickup_multi").select2({
1398 $('.multi_pickup_select').select2({
1403 $("#pickup_multi").on("change", function() {
1404 var selection = $(this).val();
1405 if ( selection != '' ) {
1406 $(".multi_pickup_select").each(function() {
1407 var valid_pickup_locations = $(this).data('pickup-locations');
1408 if ( valid_pickup_locations.includes(selection) ) {
1409 $(this).val(selection);
1410 $(this).trigger("change");
1416 $("#pickup").each( function () {
1417 $(this).pickup_locations_dropdown();
1420 $(".pickup_locations").each(function () {
1421 $(this).pickup_locations_dropdown();
1425 function check( table ) {
1429 if ( ! $("#requestany").is(":checked") ) {
1430 // requestany not selected, go through the item-specific cases
1431 if ( $('input[type="radio"]:checked').length > 0 ) {
1432 // got item-specific hold requests in the form!
1433 // verify they have a pickup location selected
1435 if (table.find('input[type="radio"]:checked')
1437 .find(".pickup_locations").val() === null) {
1439 msg = _("- Please select a pickup location for the item" + "\n")
1443 msg = (_("- Please select an item to place a hold") + "\n");
1448 $('#hold-request-form').preventDoubleFormSubmit();
1456 function checkMultiHold() {
1458 var selected_bibs = $(".multi_hold_item_checkbox:checked");
1459 if ( selected_bibs.length > 0 ) {
1460 // there are biblios selected in the form!
1461 // verify they have a pickup location selected
1463 var pickup_not_set = 0;
1464 selected_bibs.each(function() {
1465 if ( $(this).closest('tr').find(".multi_pickup_select").val() === "" ) {
1469 var bibnum = $(this).attr("title");
1472 if ( pickup_not_set > 0 ) {
1473 alert( _("Please make sure all selected titles have a pickup location set" + "\n") );
1478 alert( _("Please select at least one title" + "\n") );
1482 $('#hold-request-form').preventDoubleFormSubmit();
1487 $(document).ready(function() {
1489 $("#always_show_holds").change(function(){
1490 if( $(this).prop('checked') ){
1491 document.cookie = 'always_show_holds=DO';
1493 document.cookie = 'always_show_holds=DONT';
1496 $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1497 var itemnumber = this.value;
1500 switch (override_items[itemnumber].holdallowed) {
1501 case "not_allowed": msg = _("This item normally cannot be put on hold."); break;
1502 case "from_home_library": msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
1505 msg += "\n\n" + _("Place hold on this item?");
1507 return confirm(msg);
1509 $("button.warning").click(function() {
1510 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1512 $("#requestany").click(function() {
1514 $("input[name=checkitem]").each(function() {
1515 $(this).prop("checked", false);
1519 $("input[name=checkitem]").click(function() {
1521 $("input[name=checkitem]").each(function() {
1526 if(onechecked == 1){
1527 $("#requestany").prop("checked", false);
1528 $("#holds_to_place_count").prop('disabled', true);
1530 $("#requestany").prop("checked",true);
1531 $("#holds_to_place_count").prop('disabled', false);
1534 var prev_rank_request;
1535 $("select[name=rank-request]").on("focus", function() {
1536 prev_rank_request = $(this).val();
1537 var row = $(this).parents("tr:first");
1538 }).change(function() {
1539 var row = $(this).parents("tr:first");
1540 var value = parseInt($(this).val());
1541 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
1542 if( !isNaN(value) ) { //If moved to 'del'
1543 var after = row.parent().find("tr:nth-child("+(value+1+found_holds )+")"); //Go to the row 1 after the new value (and skip found holds)
1544 if (prev_rank_request > value) {
1545 row.insertBefore(after);
1547 row.insertAfter(after);
1551 var next_priority = 1;
1552 $("select[name=rank-request]").each(function () {
1553 if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
1554 $(this).val(next_priority);
1559 $(".clear-date").on("click",function(e){
1561 var fieldID = this.id.replace("clear-date-","");
1562 $("#" + fieldID).val("");
1565 // Confirm cancellation of hold
1567 $(".cancel-hold").on("click",function(e) {
1569 cancel_link = $(this);
1570 $('#cancelModal').modal();
1573 $("#cancelModalConfirmBtn").on("click",function(e) {
1575 if(cancel_link.data('bulk')) {
1576 [% SET data_url = 'biblionumber=' _ biblionumbers.join('&biblionumber=') %]
1577 link = `request.pl?[% data_url | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1579 let borrowernumber = cancel_link.data('borrowernumber');
1580 let biblionumber = cancel_link.data('biblionumber');
1581 let reserve_id = cancel_link.data('id');
1582 link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`;
1584 let reason = $("#modal-cancellation-reason").val();
1586 link += "&cancellation-reason=" + reason
1588 window.location.href = link;
1592 [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems || nobiblio ) %]
1593 [% IF ( PatronAutoComplete ) %]
1594 $( "#search_patron_filter" ).autocomplete({
1595 source: "/cgi-bin/koha/circ/ysearch.pl",
1597 select: function( event, ui ) {
1598 document.location.href = '/cgi-bin/koha/reserve/request.pl?[% url_biblio_params | url %]&borrowernumber=' + ui.item.borrowernumber;
1601 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
1602 return $( "<li></li>" )
1603 .data( "ui-autocomplete-item", item )
1606 + ( item.surname ? item.surname.escapeHtml() : "" )
1608 + ( item.firstname ? item.firstname.escapeHtml() : "" )
1609 + ( item.middle_name ? " " + item.middle_name.escapeHtml() : "" )
1610 + " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")"
1613 + ( item.address ? item.address.escapeHtml() : "" )
1615 + ( item.city ? item.city.escapeHtml() : "" )
1617 + ( item.zipcode ? item.zipcode.escapeHtml() : "" )
1619 + ( item.country ? item.country.escapeHtml() : "" )
1627 Sticky = $("#toolbar");
1629 stickTo: "#existing_holds",
1630 stickyClass: "floating"
1633 if(!localStorage.selectedHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) {
1634 localStorage.selectedHolds = [];
1637 $('.holds_table .select_hold').each(function() {
1638 if(localStorage.selectedHolds.includes($(this).data('id'))) {
1639 $(this).prop('checked', true);
1643 $('.holds_table .select_hold_all').each(function() {
1644 var table = $(this).parents('.holds_table');
1645 var count = $('.select_hold:not(:checked)', table).length;
1646 $('.select_hold_all', table).prop('checked', !count);
1649 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1651 $('.holds_table .select_hold_all').click(function() {
1652 var table = $(this).parents('.holds_table');
1653 var count = $('.select_hold:checked', table).length;
1654 $('.select_hold', table).prop('checked', !count);
1655 $(this).prop('checked', !count);
1656 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1657 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1660 $('.holds_table .select_hold').click(function() {
1661 var table = $(this).parents('.holds_table');
1662 var count = $('.select_hold:not(:checked)', table).length;
1663 $('.select_hold_all', table).prop('checked', !count);
1664 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1665 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1668 $('.cancel_selected_holds').click(function(e) {
1670 if($('.holds_table .select_hold:checked').length) {
1671 cancel_link = $(this);
1672 delete localStorage.selectedHolds;
1673 $('#cancelModal').modal();
1681 table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
1684 [% 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' %]
1686 $(document).ready(function() {
1687 $("#holds_patronsearch").on("submit", filter);
1689 $('.printholdslip').click(function(){
1690 var reserve_id = $(this).attr('data-reserve_id');
1691 window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
1697 [% INCLUDE 'intranet-bottom.inc' %]