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' %]
27 [% Asset.css("css/holds.css") | $raw %]
30 <body id="circ_request" class="catalog">
32 [% INCLUDE 'header.inc' %]
33 [% INCLUDE 'circ-search.inc' %]
35 [% UNLESS ( multi_hold ) %]
36 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
39 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
42 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
45 [% INCLUDE 'biblio-title.inc' link =1 %]
48 <a href="#" aria-current="page">
55 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
58 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
61 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
65 <a href="#" aria-current="page">
70 <a href="#" aria-current="page">
71 Search patrons or clubs
74 <a href="#" aria-current="page">
82 [% END # UNLESS multi_hold %]
84 <div class="main container-fluid">
86 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
87 <div class="col-md-10 col-md-offset-1">
89 <div class="col-sm-10 col-sm-push-2">
96 <div class="dialog alert">
98 <strong>Cannot place hold:</strong> one or more records don't exist.
100 <strong>Cannot place hold:</strong> this record doesn't exist.
105 <div class="dialog alert">
107 <strong>Cannot place hold:</strong> one or more records without items attached.
109 <strong>Cannot place hold:</strong> this record has no items attached.
114 [% IF ( messagetransfert ) %]
115 <div class="dialog message">
116 <h2>Hold found for ([% nextreservtitle | html %]), please transfer</h2>
117 <p>Hold placed by : <strong> [% nextreservsurname | html %] [% nextreservfirstname | html %]</strong> at : <strong> [% branchname | html %] </strong>, Please transfer this item.
119 <form name="cancelReservewithtransfert" action="branchreserves.pl" method="post">
120 <input type="submit" class="button" />
125 [% UNLESS ( multi_hold ) %]
126 <h2>Place a hold on [% INCLUDE 'biblio-title.inc' link = 1 %] [% IF biblio.author %] by [% biblio.author | html %][% END %]</h2>
133 Search patrons or clubs
141 [% UNLESS club OR patron OR patron.borrowernumber OR noitems OR nobiblio %]
142 [% IF ( messageborrower ) %]
143 <div class="dialog alert">
144 <h3>Patron not found</h3>
145 <p>No patron with this name, please, try another</p>
149 [% IF ( messageclub ) %]
150 <div class="dialog alert">
151 <h3>Club not found</h3>
152 <p>No club with this name, please, try another</p>
156 [% UNLESS multi_hold %]
158 <h2>Search patrons or clubs</h2>
160 <h2>Search patrons</h2>
163 <div id="circ_holds_select" class="toptabs">
164 <ul class="nav nav-tabs" role="tablist">
165 <li role="presentation" class="active"><a href="#holds_patronsearch_pane" aria-controls="holds_patronsearch_pane" role="tab" data-toggle="tab">Patrons</a></li>
167 <li role="presentation"><a href="#holds_clubsearch_pane" aria-controls="holds_clubsearch_pane" role="tab" data-toggle="tab">Clubs</a></li>
170 <div class="tab-content">
171 <div id="holds_patronsearch_pane" role="tabpanel" class="tab-pane active">
172 [% PROCESS patron_search_filters_simple %]
174 [% PROCESS patron_search_table table_id => 'table_borrowers', open_on_row_click => 1 %]
177 <div id="holds_clubsearch_pane" role="tabpanel" class="tab-pane">
178 <form id="holds_clubsearch" action="request.pl" method="post">
179 <div class="hint">Enter club ID or partial name:</div>
180 <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" />
181 <input type="submit" value="Search" />
182 [% FOREACH biblionumber IN biblionumbers %]
183 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
186 </form> <!-- /#holds_patronsearch -->
188 [% INCLUDE 'clubs-table.inc' destination = "holds" %]
192 </div> <!-- /.tab-content -->
196 <div class="dialog alert hide clubalert">
198 <fieldset class="rows">
199 <legend>Hold details</legend>
200 <form action="/api/v1/clubs/[% club.id | html %]/holds" method="post" name="form" id="club-request-form">
202 [% IF ( multi_hold ) %]
203 <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
204 <input type="hidden" name="request" value="any"/>
205 [% FOREACH biblioloo IN biblioloop %]
206 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
207 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
210 <input type="hidden" name="title" value="[% biblio.title | html %]" />
211 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
212 [% END # /IF multi_hold %]
215 <span class="label">Club: </span> [% club.name | html %]
218 <span class="label">Description: </span> [% club.description | html %]
221 <label for="pickup">Pickup at:</label>
222 <select name="pickup" id="pickup_club">
223 [% PROCESS options_for_libraries libraries => Branches.all({ selected => club.branchcode, search_params => { pickup_location => 1 } }) %]
227 <label for="default_patron_home">Pickup at patron's home library when possible:</label>
228 <input type="checkbox" id="default_patron_home" name="default_patron_home"/>
231 <h2 style="padding: 0 1em;">Members</h2>
233 [% FOREACH member IN members %]
234 [% SET patron = member.patron %]
235 <li style="padding: 0.5em 1em;">
236 <div><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a></div>
237 [% IF member.exceeded_maxreserves %]
239 <i class="fa fa-error"></i>
240 <strong>Too many holds: </strong> Patron can only place a maximum of [% maxreserves | html %] total holds.
243 [% IF ( patron.is_expired ) %]
245 <i class="fa fa-warning"></i>
246 <strong>Account has expired</strong>
249 [% IF patron.is_debarred %]
251 <i class="fa fa-warning"></i>
252 <strong>Patron has restrictions</strong>
255 [% IF member.amount_outstanding && Koha.Preference('maxoutstanding') && member.amount_outstanding > Koha.Preference('maxoutstanding') %]
257 <i class="fa fa-warning"></i>
258 <strong>Patron has outstanding fines: [% member.amount_outstanding | $Price %]</strong>
262 [% IF ( member.diffbranch ) %]
264 <i class="fa fa-warning"></i>
265 <strong>Pickup library is different.</strong> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )
270 [% UNLESS ( multi_hold ) %]
271 <fieldset class="action">
272 <input type="submit" value="Place hold" />
275 <table id="requesttitles">
279 [% UNLESS Koha.Preference('item-level_itypes') %]
285 [% FOREACH biblioloo IN biblioloop %]
286 [% IF ( biblioloo.warn ) %]
292 [% UNLESS ( biblioloo.warn ) %]
293 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
299 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
300 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
302 [% IF ( biblioloo.publicationyear ) %]
304 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
308 [% IF ( biblioloo.warn ) %]
309 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
312 [% UNLESS Koha.Preference('item-level_itypes') %]
314 <img src="[% biblioloo.itemtype.image_location| html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
317 <td>[% biblioloo.rank | html %]</td>
319 [% IF ( biblioloo.checked_previously ) %]
320 <span>Patron has previously checked out this title</span><br/>
322 [% IF ( biblioloo.alreadyres ) %]
325 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
330 [% IF ( biblioloo.alreadyres ) %]
332 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
333 <strong>already has a hold</strong> on this item
336 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
337 <li> <strong>No items are available</strong> to be placed on hold</li>
340 [% IF ( biblioloo.alreadyres ) %]
343 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
349 [% END # /FOREACH biblioloo %]
350 </table> <!-- /#requesttitles -->
354 [% ELSIF NOT ( noitems || nobiblio ) # /UNLESS patron %]
356 [% IF ( checked_previously && !multi_hold ) %]
357 <div class="dialog alert">
359 <li>Patron has previously checked out this title</li>
364 [% IF ( no_reserves_allowed || exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted || recall ) %]
365 <div class="dialog alert">
367 [% UNLESS ( multi_hold ) %]
368 <h3>Cannot place hold</h3>
370 [% IF ( no_reserves_allowed ) %]
371 <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>
372 [% ELSIF ( exceeded_maxreserves ) %]
373 <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>
374 [% ELSIF ( exceeded_holds_per_record ) %]
375 <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>
376 [% ELSIF ( alreadypossession ) %]
377 <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>
378 [% ELSIF ( alreadyreserved ) %]
379 <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>
380 [% ELSIF ( ageRestricted ) %]
381 <li><strong>Age restricted</strong></li>
382 [% ELSIF ( none_available ) %]
383 <li> <strong>No items are available</strong> to be placed on hold.</li>
384 [% ELSIF ( maxreserves ) %]
385 <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>
386 [% ELSIF ( recall ) %]
387 <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>
388 [% END # /IF exceeded_maxreserves %]
390 [% ELSE # UNLESS multi_hold %]
391 <h3>Cannot place hold on some items</h3>
392 [% IF (no_reserves_allowed ) %]
393 <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>
394 [% ELSIF ( exceeded_maxreserves ) %]
395 <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>
396 [% ELSIF ( exceeded_holds_per_record ) %]
397 [% FOREACH biblioloo IN biblioloop %]
398 [% IF (biblioloo.tooManyHoldsForThisRecord) %]
399 <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>
402 [% END # /IF exceeded_maxreserves %]
403 [% END # /UNLESS multi_hold %]
405 [% END # /IF ( exceeded_maxreserves || ... %]
407 [% IF ( patron.is_expired || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
408 <div class="dialog message">
410 [% IF ( patron.is_expired ) %]
411 <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>
414 [% IF patron.is_debarred %]
415 <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>
418 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
419 <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>
422 [% IF ( diffbranch ) %]
423 <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>
425 </ul> <!-- /.dialog.message -->
427 [% END # /IF patron.is_expired || diffbranch ... %]
429 [% IF ( messageborrower ) %]
430 <div class="dialog alert">
431 <h3>Patron not found:</h3>
432 <p>Name or barcode not found. Please try an other </p>
436 <div class="dialog alert hide holdalert">
439 <fieldset class="rows">
440 <legend>Hold details</legend>
441 <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
443 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
444 <input type="hidden" name="type" value="str8" />
446 [% FOREACH biblionumber IN biblionumbers %]
447 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
449 [% IF ( multi_hold ) %]
450 <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
451 <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
452 <input type="hidden" name="request" value="any"/>
453 [% FOREACH biblioloo IN biblioloop %]
454 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
455 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
458 <input type="hidden" name="title" value="[% biblio.title | html %]" />
459 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
460 [% END # /IF multi_hold %]
464 <span class="label">Patron:</span>
465 [% IF ( patron.borrowernumber ) %]
466 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a>
472 [% UNLESS ( multi_hold ) %]
474 <span class="label">Estimated priority:</span>
475 <strong>[% fixedRank | html %]</strong>
480 <label for="holdnotes">Notes:</label>
481 <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
484 <label for="pickup">Pickup at:</label>
485 [% UNLESS ( multi_hold ) %]
486 <select name="pickup" id="pickup"
487 data-biblio-id="[% biblio.biblionumber | html %]"
488 data-patron-id="[% patron.borrowernumber | html %]"
489 data-pickup-location-source="biblio">
490 [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
492 <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
493 <option value="" selected="selected"></option>
494 [% FOREACH pickup_location IN multi_pickup_locations %]
495 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
501 [% UNLESS ( multi_hold ) %]
502 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
504 <label for="itemtype">Request specific item type:</label>
505 <select name="itemtype" id="itemtype">
506 <option value="">Any item type</option>
507 [%- FOREACH itemtype IN available_itemtypes %]
508 <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
513 [% END # /UNLESS multi_hold %]
515 [% IF ( reserve_in_future ) %]
517 <label for="from">Hold starts on date:</label>
518 <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" data-date_to="expiration_date" class="flatpickr" data-flatpickr-futuredate="true" />
523 <label for="to">Hold expires on date:</label>
524 <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
527 [% UNLESS ( multi_hold ) %]
529 <label for="requestany">Hold next available item </label>
530 [% IF force_hold_level == 'item' %]
531 <input type="checkbox" id="requestany" name="request" disabled="true" />
532 [% ELSIF force_hold_level == 'record' %]
533 <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
534 <input type="hidden" name="request" value="Any"/>
536 <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
538 <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
541 [% IF remaining_holds_for_record > 1 %]
543 <label for="holds_to_place_count">Holds to place (count)</label>
544 <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" />
547 <input type="hidden" name="holds_to_place_count" value="1" />
549 [% END # /UNLESS multi_hold %]
551 <li id="non_priority_list_item">
552 <label for="non_priority">Non priority hold:</label>
553 <input name="non_priority" id="non_priority" type="checkbox" />
554 <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
558 [% UNLESS ( multi_hold ) %]
559 <fieldset class="action">
560 [% IF ( patron.borrowernumber ) %]
561 [% IF ( override_required ) %]
562 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
563 [% ELSIF ( none_available ) %]
564 <button type="submit" disabled="disabled" class="btn btn-default btn-disabled">Place hold</button>
566 <button type="submit" class="btn btn-default">Place hold</button>
571 [% biblio = biblioloop.0 %]
574 [% UNLESS Koha.Preference('item-level_itypes') %]
576 <span class="label">Item typeX:</span>
577 [% biblio.itemtype.translated_description | html %]
581 [% IF ( biblio.biblioitem.publicationyear ) %]
583 <span class="label">Publication year:</span>
584 [% biblio.biblioitem.publicationyear | html %]
589 <h2 style="padding: 0 1em;">
590 Place a hold on a specific item
591 [% IF force_hold_level == 'item' %]
592 <span class="error"><em>(Required)</em></span>
596 <table id="requestspecific">
600 <th>Allowed pickup locations</th>
601 [% IF Koha.Preference('item-level_itypes') %]
605 <th>Home library</th>
606 <th>Last location</th>
607 [% IF itemdata_ccode %]
612 [% IF itemdata_enumchron %]
619 [% SET selected = 0 %]
620 [% FOREACH itemloo IN biblio.itemloop %]
621 [% UNLESS ( itemloo.hide ) %]
622 <tr class="[% itemloo.backgroundcolor | html %]">
624 [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
626 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
627 Hold must be record level
629 [% ELSIF ( itemloo.available ) %]
630 <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
631 [% ELSIF ( itemloo.override ) %]
632 <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
633 <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
636 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
637 [% IF itemloo.not_holdable %]
638 [% IF itemloo.not_holdable == 'damaged' %]
639 <span>Item damaged</span>
640 [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
641 <span>Age restricted</span>
642 [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
643 <span>Exceeded max holds per record</span>
644 [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
645 <span>Daily hold limit reached for patron</span>
646 [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
647 <span>Too many holds</span>
648 [% ELSIF itemloo.not_holdable == 'notReservable' %]
649 <span>Not holdable</span>
650 [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
651 <span>Patron is from different library</span>
652 [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
653 <span>Cannot place hold from patron's library</span>
654 [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
655 <span>Patron already has hold for this item</span>
656 [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
657 <span>Cannot be transferred to pickup library</span>
658 [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
659 <span>Only pickup locations within the same hold group are allowed</span>
660 [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
661 <span>No reserves are allowed on this item</span>
662 [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %]
663 <span>Library is not a pickup location</span>
664 [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
665 <span>No valid pickup location</span>
667 <span>[% itemloo.not_holdable | html %]</span>
671 [% END # /IF force_hold_level %]
674 [% IF (itemloo.pickup_locations_count > 0) %]
675 <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations" style="width:100%;"
676 data-item-id="[% itemloo.itemnumber | html %]"
677 data-patron-id="[% patron.borrowernumber | html %]"
678 data-pickup-location-source="item">
679 [% IF (itemloo.default_pickup_location) %]
680 <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option>
685 [% IF Koha.Preference('item-level_itypes') %]
687 [% UNLESS ( noItemTypeImages ) %]
688 [% IF ( itemloo.itemtype.image_location) %]<img src="[% itemloo.itemtype.image_location | html %]" alt="" /> <br /> [% END %]
690 [% itemloo.itemtype.translated_description | html %]
694 [% itemloo.barcode | html %]
697 [% Branches.GetName( itemloo.homebranch ) | html %]
700 [% Branches.GetName( itemloo.holdingbranch ) | html %]
702 [% IF itemdata_ccode %]
704 [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
708 [% itemloo.itemcallnumber | html %]
711 [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %]
713 [% IF itemdata_enumchron %]
715 [% itemloo.enumchron | html %]
718 [% IF ( itemloo.onloan ) %]
719 <td data-order="[% itemloo.date_due | html %]">
720 <span class="checkedout">Due [% itemloo.date_due | $KohaDates as_due_date => 1 %]</span>
723 [% IF ( itemloo.transfertwhen ) %]
724 In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
725 to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %]
729 [% IF ( itemloo.reservedate ) %]
730 [% IF ( itemloo.nocancel ) %]
731 Can't be cancelled when item is in transit
733 [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %]
734 [% IF ( itemloo.canreservefromotherbranches ) %]
735 for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedFor.borrowernumber | uri %]">[% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %]</a>
737 [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %]
738 [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since
739 [% IF ( itemloo.waitingdate ) %]
740 [% itemloo.waitingdate | $KohaDates %]
742 [% IF ( itemloo.reservedate ) %]
743 [% itemloo.reservedate | html %]
746 <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
747 [% END # /IF itemloo.nocancel %]
750 [% END # /IF itemloo.reservedate %]
752 [% IF itemloo.item_level_holds == "N" %]
753 <br/>Item level hold not allowed from OPAC
754 [% ELSIF itemloo.item_level_holds == "F" %]
755 <br/>Item level hold forced from OPAC
758 [% IF ( itemloo.itemlost ) %]
759 <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
762 [% IF ( itemloo.damaged ) %]
763 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
766 [% IF ( itemloo.withdrawn ) %]
767 <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
770 [% IF ( itemloo.notforloan ) %]
771 <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
775 [% END # / UNLESS itemloo.hide %]
776 [% END # /FOREACH itemloo %]
778 </table> <!-- /#requestspecific -->
782 <p class="hiddencount">
783 <a href="request.pl?biblionumber=[% biblio.biblionumber | uri %]&borrowernumber=[% borrowernumber | uri %]&showallitems=1">Show all items ([% biblio.hiddencount | html %] hidden)</a>
786 [% END # /IF hiddencount %]
788 [% ELSE # /UNLESS multi_hold %]
790 <table id="requesttitles">
793 <th>Pickup location</th>
795 [% UNLESS Koha.Preference('item-level_itypes') %]
801 [% FOREACH biblioloo IN biblioloop %]
802 [% IF ( biblioloo.warn ) %]
808 [% UNLESS ( biblioloo.warn ) %]
809 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
813 [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %]
814 <select name="pickup_[% biblioloo.biblionumber | html %]"
815 class="multi_pickup_select"
816 data-biblio-id="[% biblioloo.biblionumber | html %]"
817 data-patron-id="[% patron.borrowernumber | html %]"
818 data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
819 <option value=""></option>
820 [% FOREACH pickup_location IN biblioloo.pickup_locations %]
821 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
829 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
830 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
832 [% IF ( biblioloo.publicationyear ) %]
834 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
838 [% IF ( biblioloo.warn ) %]
839 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
842 [% UNLESS Koha.Preference('item-level_itypes') %]
844 <img src="[% biblioloo.itemtype.image_location | html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
847 <td>[% biblioloo.rank | html %]</td>
849 [% IF ( biblioloo.checked_previously ) %]
850 <span>Patron has previously checked out this title</span><br/>
852 [% IF ( biblioloo.alreadyres ) %]
855 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
860 [% IF ( biblioloo.alreadyres ) %]
862 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
863 <strong>already has a hold</strong> on this item
866 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
867 <li> <strong>No items are available</strong> to be placed on hold</li>
870 [% IF ( biblioloo.alreadyres ) %]
873 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
879 [% END # /FOREACH biblioloo %]
880 </table> <!-- /#requesttitles -->
882 [% END # /UNLESS multi_hold %]
884 <fieldset class="action">
885 [% IF ( patron AND patron.borrowernumber ) %]
886 [% IF ( override_required ) %]
887 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
888 [% ELSIF ( none_available ) %]
889 <button class="btn btn-default" type="submit">Place holds</button>
891 [% IF ( multi_hold ) %]
892 <button type="submit" class="btn btn-default" id="multi_hold_submit">Place holds</button>
894 <button type="submit" class="btn btn-default">Place hold</button>
897 [% END # /IF patron %]
898 </fieldset> <!-- /.action -->
899 </form> <!-- /#hold-request-form -->
900 </fieldset> <!-- /.rows -->
903 [% UNLESS ( patron ) %]
904 [% UNLESS borrowers %]
905 [% SET hold_count = Biblio.HoldsCount( biblio.biblionumber ) | html %]
907 <label for ="always_show_holds">Always show holds</label>
908 [% IF always_show_holds == 'DONT' %]
909 <input type="checkbox" name="always_show_holds" id="always_show_holds" value="DO">
910 [% UNLESS reserveloop %]
911 <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>
914 <input type="checkbox" name="always_show_holds" value="DO" id="always_show_holds" checked="checked">
918 [% IF ( reserveloop ) %]
919 <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
920 [% IF ( multi_hold ) %]
921 [% FOREACH biblionumber IN biblionumbers %]
922 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
927 <div class="dialog message">
928 <p>The job has been enqueued! It will be processed as soon as possible.</p>
929 <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>
933 <h2>Existing holds</h2>
934 <div id="toolbar" class="btn-toolbar">
935 <input type="submit" name="submit" value="Update hold(s)" /> <button class="cancel_selected_holds" data-bulk="true"></button>
936 <fieldset id="cancellation-reason-fieldset" class="action">
937 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
938 [% IF hold_cancellation %]
939 <label for="cancellation-reason">Cancellation reason: </label>
940 <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
941 <option value="">No reason given</option>
942 [% FOREACH reason IN hold_cancellation %]
943 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
950 [% FOREACH biblioloo IN biblioloop %]
951 [% IF ( biblioloo.reserveloop ) %]
952 <div class="hold_title" id="hold_title_[% biblioloo.biblionumber | html %]">
953 [% IF ( multi_hold ) %]
955 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
956 [% biblioloo.title | html %]
957 </a> <span class="number_box"><span>[% biblioloo.reserveloop.size | html %] [% tn('Hold', 'Holds', biblioloo.reserveloop.size) | $raw %]</span></span>
961 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
963 [% SET branchcodes = [] %]
965 [% FOREACH h IN biblioloo.reserveloop %]
966 [% branchcodes.push( h.branchcode ) %]
968 [% branchcodes = branchcodes.unique %]
969 [% IF ( branchcodes.empty ) %]
971 There are no holds on this title.
975 [% FOREACH b IN branchcodes.sort %]
976 [% SET holds_by_branch = [] %]
977 [% FOREACH h IN biblioloo.reserveloop %]
978 [% IF h.branchcode == b %]
979 [% holds_by_branch.push( h ) %]
982 <div class="holds_by_library">
983 <h4>[% Branches.GetName( b ) | html %]</h4>
985 [% INCLUDE holds_table.inc holds=holds_by_branch %]
987 [% END # /FOREACh b %]
988 [% END # /IF ( branchcodes.empty ) %]
990 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
992 [% SET itemtypes = [] %]
994 [% FOREACH h IN biblioloo.reserveloop %]
995 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
996 [% itemtypes.push( hold_itemtype ) %]
998 [% itemtypes = itemtypes.unique %]
999 [% IF ( itemtypes.empty ) %]
1001 There are no holds on this title.
1005 [% FOREACH i IN itemtypes.sort %]
1006 [% SET holds_by_itemtype = [] %]
1007 [% FOREACH h IN biblioloo.reserveloop %]
1008 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1009 [% IF hold_itemtype == i %]
1010 [% holds_by_itemtype.push( h ) %]
1014 <div class="holds_by_itemtype">
1016 <h4>[% ItemTypes.GetDescription( i ) | html %]</h4>
1018 <h4>Any item type</h4>
1020 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1022 [% END # /FOREACH i %]
1023 [% END # /IF ( itemtypes.empty ) %]
1025 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
1026 [% SET branchcodes = [] %]
1028 [% FOREACH h IN biblioloo.reserveloop %]
1029 [% branchcodes.push( h.branchcode ) %]
1031 [% branchcodes = branchcodes.unique %]
1032 [% IF ( branchcodes.empty ) %]
1034 There are no holds on this title.
1038 [% FOREACH b IN branchcodes.sort %]
1039 <div class="holds_by_library">
1040 <h4 class="library_holds">[% Branches.GetName( b ) | html %]</h4>
1041 [% SET holds_by_branch = [] %]
1042 [% FOREACH h IN biblioloo.reserveloop %]
1043 [% IF h.branchcode == b %]
1044 [% holds_by_branch.push( h ) %]
1048 [% SET itemtypes = [] %]
1049 [% FOREACH h IN holds_by_branch %]
1050 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1051 [% itemtypes.push( hold_itemtype ) %]
1053 [% itemtypes = itemtypes.unique %]
1055 [% FOREACH i IN itemtypes.sort %]
1056 <div class="holds_by_itemtype">
1057 <h5 class="itemtype_holds">
1059 [% ItemTypes.GetDescription( i ) | html %]
1061 <span>Any item type</span>
1065 [% SET holds_by_itemtype = [] %]
1066 [% FOREACH h IN holds_by_branch %]
1067 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1068 [% IF hold_itemtype == i %]
1069 [% holds_by_itemtype.push( h ) %]
1072 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1073 </div> <!-- /.holds_by_itemtype -->
1075 </div> <!-- /.holds_by_library -->
1076 [% END # /FOREACH b %]
1077 [% END # /IF ( branchcodes.empty ) %]
1081 [% IF ( biblioloo.reserveloop.size ) %]
1082 [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
1085 There are no holds on this title.
1089 [% END # /IF HoldsSplitQueue %]
1090 </div> <!-- /hold_title -->
1091 [% END # /IF biblioloo.reserveloop %]
1092 [% END # FOREACH biblioloo %]
1093 </form> <!-- /#existing_holds -->
1094 [% END # IF reserveloop %]
1095 [% END # UNLESS patron %]
1099 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
1100 </div> <!-- /.col-md-10.col-md-offset-1 -->
1102 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1103 <div class="col-sm-2 col-sm-pull-10">
1105 [% INCLUDE 'biblio-view-menu.inc' %]
1107 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1109 </div> <!-- /.row -->
1111 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
1112 <div class="modal-dialog" role="document">
1113 <div class="modal-content">
1114 <div class="modal-header">
1115 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1116 <h3>Confirm deletion</h3>
1119 <div class="modal-body">
1120 <p>Are you sure you want to cancel this hold?</p>
1122 <fieldset class="action">
1123 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1124 [% IF hold_cancellation %]
1125 <label for="cancellation-reason">Cancellation reason: </label>
1126 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
1127 <option value="">No reason given</option>
1128 [% FOREACH reason IN hold_cancellation %]
1129 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1136 <div class="modal-footer">
1137 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
1138 <a href="#" data-dismiss="modal">Cancel</a>
1144 [% MACRO jsinclude BLOCK %]
1145 [% INCLUDE 'datatables.inc' %]
1146 [% INCLUDE 'calendar.inc' %]
1147 [% INCLUDE 'columns_settings.inc' %]
1148 [% Asset.js("lib/hc-sticky.js") | $raw %]
1149 [% INCLUDE 'select2.inc' %]
1150 [% Asset.js("js/holds.js") | $raw%]
1152 [% SET url_biblio_params = "biblionumber=" _ biblionumbers.join("&biblionumber=") %]
1154 [% SET url_biblio_params = url_biblio_params _ "&multi_hold=1" %]
1159 var biblionumbers = [[% biblionumbers.join(', ') | $raw %]];
1160 var borrowernumber = "[% patron.borrowernumber | $raw %]";
1161 var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1162 var override_items = {[% FOREACH biblio IN biblioloop %][% FOREACH itemloo IN biblio.itemloop %][% IF ( itemloo.override ) %]
1163 [% itemloo.itemnumber | html %]: {
1164 homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1165 holdallowed: "[% itemloo.holdallowed | html %]"
1167 [% END %][% END %][% END %]
1170 damaged: _("Item damaged"),
1171 ageRestricted: _("Age restricted"),
1172 tooManyHoldsForThisRecord: _("Exceeded max holds per record"),
1173 tooManyReservesToday: _("Daily hold limit reached for patron"),
1174 tooManyReserves: _("Too many holds"),
1175 notReservable: _("Not holdable"),
1176 noReservesAllowed: _("No reserves allowed"),
1177 cannotReserveFromOtherBranches: _("Patron is from different library"),
1178 itemAlreadyOnHold: _("Patron already has hold for this item"),
1179 cannotBeTransferred: _("Cannot be transferred to pickup library"),
1180 pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed")
1183 var MSG_CANCEL_SELECTED = _("Cancel selected (%s)");
1184 $.fn.select2.defaults.set("width", "100%" );
1185 $.fn.select2.defaults.set("dropdownAutoWidth", true );
1187 $(document).ready(function() {
1188 $('#cancellation-reason-fieldset').hide();
1189 $('.rank-request').on('change', function() {
1190 if ( $(".rank-request option:selected[value='del']").length ) {
1191 $('#cancellation-reason-fieldset').show();
1193 $('#cancellation-reason-fieldset').hide();
1197 if( $("#circ_holds_select").length > 0 ){
1198 [% SET active = clubs ? 1 : 0 %]
1199 /* Set active tab based on whether a club search was submitted */
1200 var tabs = $("#circ_holds_select li:eq(" + [% active | $raw %] + ") a").tab("show");
1201 $( tabs[0].hash ).find("input.focus").focus();
1203 /* Change active focus when tabs change */
1204 $("#circ_holds_select a[data-toggle='tab']").on("shown.bs.tab", function (e) {
1205 active_tab = e.target.hash;
1206 $( active_tab ).find("input.focus").focus();
1211 function ToggleHoldsToPlace() {
1212 if ( $("#requestany").prop('checked') ) {
1213 $("#holds_to_place_count").prop('disabled', false);
1215 $("#holds_to_place_count").prop('disabled', true);
1218 ToggleHoldsToPlace();
1219 $("#requestany").on('change', function(){
1220 ToggleHoldsToPlace();
1223 [% IF Koha.Preference('UseBranchTransferLimits') %]
1224 $("#pickup").on('change', function(){
1225 var pickup = $("#pickup").val();
1226 var url = "?pickup=" + pickup;
1227 url += "&borrowernumber=" + borrowernumber;
1228 url += "&biblionumber=" + biblionumbers[0];
1229 window.location.replace(url);
1233 var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1235 "sDom": '<"top pager"ilf>t',
1238 //Override fieldset styling for dataTables search box
1239 $("div.top.pager").css("margin-left","1em");
1240 $(".dataTables_filter label").css({
1242 "margin-right":"0em"
1245 $("#club-request-form").on("submit", function() {
1247 $('.clubalert, .holdalert').addClass('hide');
1249 pickup_library_id: $('select[name="pickup"]').val()
1251 if($('input[name="checkitem"]:checked').length)
1252 data.item_id = $('input[name="checkitem"]:checked').val();
1253 if($('input[name="borrowernumber"]').length)
1254 data.patron_id = $('input[name="borrowernumber"]').val();
1255 if($('textarea[name="notes"]').length)
1256 data.notes = $('textarea[name="notes"]').val()||null;
1257 if($('input[name="itemtype"]').length) {
1258 data.item_type = $('input[name="itemtype"]').val()||null;
1260 if($('input[name="default_patron_home"]:checked').length) {
1261 data.default_patron_home = 1;
1264 const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1;
1265 var newloc = 'request.pl?';
1266 biblionumbers.forEach(function (biblionumber) {
1267 newloc += '&biblionumber=' + biblionumber;
1270 biblionumbers.forEach(function(biblionumber) {
1271 data.biblio_id = biblionumber;
1273 url: $t.attr('action'),
1274 method: $t.attr('method').toUpperCase(),
1275 contentType: 'application/json',
1276 data: JSON.stringify(data)
1278 for(let i = 0; i < count; i++) {
1280 .then(function(result) {
1281 document.location = newloc;
1283 .fail(function(err) {
1284 var message = err.responseJSON.error;
1285 var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/);
1286 if(match && ERROR_MAP[match[1]]) {
1287 message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>'
1289 $('.clubalert, .holdalert').removeClass('hide').html(message);
1297 [% UNLESS ( multi_hold ) %]
1298 $("#hold-request-form").on("submit", function(){
1299 return check($(this));
1302 $("#hold-request-form").on("submit", function(){
1303 return checkMultiHold();
1307 $(".pickup_location_dropdown").each( function () {
1308 $(this).pickup_locations_dropdown();
1311 $("#pickup_multi").select2({
1316 $('.multi_pickup_select').select2({
1321 $("#pickup_multi").on("change", function() {
1322 var selection = $(this).val();
1323 if ( selection != '' ) {
1324 $(".multi_pickup_select").each(function() {
1325 var valid_pickup_locations = $(this).data('pickup-locations');
1326 if ( valid_pickup_locations.includes(selection) ) {
1327 $(this).val(selection);
1328 $(this).trigger("change");
1334 $("#pickup").each( function () {
1335 $(this).pickup_locations_dropdown();
1338 $(".pickup_locations").each(function () {
1339 $(this).pickup_locations_dropdown();
1343 function check( table ) {
1347 if ( $("#requestany").attr("checked") !== "checked" ) {
1348 // requestany not selected, go through the item-specific cases
1349 if ( $('input[type="radio"]:checked').length > 0 ) {
1350 // got item-specific hold requests in the form!
1351 // verify they have a pickup location selected
1353 if (table.find('input[type="radio"]:checked')
1355 .find(".pickup_locations").val() === null) {
1357 msg = _("- Please select a pickup location for the item" + "\n")
1361 msg = (_("- Please select an item to place a hold") + "\n");
1366 $('#hold-request-form').preventDoubleFormSubmit();
1374 function checkMultiHold() {
1376 var selected_bibs = $(".multi_hold_item_checkbox:checked");
1377 if ( selected_bibs.length > 0 ) {
1378 // there are biblios selected in the form!
1379 // verify they have a pickup location selected
1381 var pickup_not_set = 0;
1382 selected_bibs.each(function() {
1383 if ( $(this).closest('tr').find(".multi_pickup_select").val() === "" ) {
1387 var bibnum = $(this).attr("title");
1390 if ( pickup_not_set > 0 ) {
1391 alert( _("Please make sure all selected titles have a pickup location set" + "\n") );
1396 alert( _("Please select at least one title" + "\n") );
1400 var badSpans = $(".not_holdable");
1402 $(badSpans).each(function() {
1403 var bibnum = $(this).attr("title");
1404 badBibs += bibnum + "/";
1407 $("#bad_bibs").val(badBibs);
1409 $('#hold-request-form').preventDoubleFormSubmit();
1414 $(document).ready(function() {
1416 $("#always_show_holds").change(function(){
1417 if( $(this).prop('checked') ){
1418 document.cookie = 'always_show_holds=DO';
1420 document.cookie = 'always_show_holds=DONT';
1423 $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1424 var itemnumber = this.value;
1427 switch (override_items[itemnumber].holdallowed) {
1428 case "not_allowed": msg = _("This item normally cannot be put on hold."); break;
1429 case "from_home_library": msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
1432 msg += "\n\n" + _("Place hold on this item?");
1434 return confirm(msg);
1436 $("button.warning").click(function() {
1437 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1439 $("#requestany").click(function() {
1441 $("input[name=checkitem]").each(function() {
1442 $(this).prop("checked", false);
1446 $("input[name=checkitem]").click(function() {
1448 $("input[name=checkitem]").each(function() {
1453 if(onechecked == 1){
1454 $("#requestany").prop("checked", false);
1455 $("#holds_to_place_count").prop('disabled', true);
1457 $("#requestany").prop("checked",true);
1458 $("#holds_to_place_count").prop('disabled', false);
1461 var prev_rank_request;
1462 $("select[name=rank-request]").on("focus", function() {
1463 prev_rank_request = $(this).val();
1464 var row = $(this).parents("tr:first");
1465 }).change(function() {
1466 var row = $(this).parents("tr:first");
1467 var value = parseInt($(this).val());
1468 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
1469 if( !isNaN(value) ) { //If moved to 'del'
1470 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)
1471 if (prev_rank_request > value) {
1472 row.insertBefore(after);
1474 row.insertAfter(after);
1478 var next_priority = 1;
1479 $("select[name=rank-request]").each(function () {
1480 if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
1481 $(this).val(next_priority);
1486 $(".clear-date").on("click",function(e){
1488 var fieldID = this.id.replace("clear-date-","");
1489 $("#" + fieldID).val("");
1492 // Confirm cancellation of hold
1494 $(".cancel-hold").on("click",function(e) {
1496 cancel_link = $(this);
1497 $('#cancelModal').modal();
1500 $("#cancelModalConfirmBtn").on("click",function(e) {
1502 if(cancel_link.data('bulk')) {
1503 [% SET data_url = 'biblionumber=' _ biblionumbers.join('&biblionumber=') %]
1504 link = `request.pl?[% data_url | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1506 let borrowernumber = cancel_link.data('borrowernumber');
1507 let biblionumber = cancel_link.data('biblionumber');
1508 let reserve_id = cancel_link.data('id');
1509 link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`;
1511 let reason = $("#modal-cancellation-reason").val();
1513 link += "&cancellation-reason=" + reason
1515 window.location.href = link;
1519 [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems || nobiblio ) %]
1520 [% IF ( PatronAutoComplete ) %]
1521 $( "#search_patron_filter" ).autocomplete({
1522 source: "/cgi-bin/koha/circ/ysearch.pl",
1524 select: function( event, ui ) {
1525 document.location.href = '/cgi-bin/koha/reserve/request.pl?[% url_biblio_params | url %]&borrowernumber=' + ui.item.borrowernumber;
1528 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
1529 return $( "<li></li>" )
1530 .data( "ui-autocomplete-item", item )
1533 + ( item.surname ? item.surname.escapeHtml() : "" )
1535 + ( item.firstname ? item.firstname.escapeHtml() : "" )
1536 + " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")"
1539 + ( item.address ? item.address.escapeHtml() : "" )
1541 + ( item.city ? item.city.escapeHtml() : "" )
1543 + ( item.zipcode ? item.zipcode.escapeHtml() : "" )
1545 + ( item.country ? item.country.escapeHtml() : "" )
1553 Sticky = $("#toolbar");
1555 stickTo: "#existing_holds",
1556 stickyClass: "floating"
1559 if(!localStorage.selectedHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) {
1560 localStorage.selectedHolds = [];
1563 $('.holds_table .select_hold').each(function() {
1564 if(localStorage.selectedHolds.includes($(this).data('id'))) {
1565 $(this).prop('checked', true);
1569 $('.holds_table .select_hold_all').each(function() {
1570 var table = $(this).parents('.holds_table');
1571 var count = $('.select_hold:not(:checked)', table).length;
1572 $('.select_hold_all', table).prop('checked', !count);
1575 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1577 $('.holds_table .select_hold_all').click(function() {
1578 var table = $(this).parents('.holds_table');
1579 var count = $('.select_hold:checked', table).length;
1580 $('.select_hold', table).prop('checked', !count);
1581 $(this).prop('checked', !count);
1582 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1583 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1586 $('.holds_table .select_hold').click(function() {
1587 var table = $(this).parents('.holds_table');
1588 var count = $('.select_hold:not(:checked)', table).length;
1589 $('.select_hold_all', table).prop('checked', !count);
1590 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1591 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1594 $('.cancel_selected_holds').click(function(e) {
1596 if($('.holds_table .select_hold:checked').length) {
1597 cancel_link = $(this);
1598 delete localStorage.selectedHolds;
1599 $('#cancelModal').modal();
1607 table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
1610 [% 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 %]
1612 $(document).ready(function() {
1613 $("#holds_patronsearch").on("submit", filter);
1615 $('.printholdslip').click(function(){
1616 var reserve_id = $(this).attr('data-reserve_id');
1617 window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
1623 [% INCLUDE 'intranet-bottom.inc' %]