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="request" value="any"/>
204 [% FOREACH biblioloo IN biblioloop %]
205 [% UNLESS biblioloo.none_avail %]
206 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
207 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
208 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
212 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
213 <input type="hidden" name="title" value="[% biblio.title | html %]" />
214 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
215 [% END # /IF multi_hold %]
218 <span class="label">Club: </span> [% club.name | html %]
221 <span class="label">Description: </span> [% club.description | html %]
224 <label for="pickup">Pickup at:</label>
225 <select name="pickup" id="pickup_club">
226 [% PROCESS options_for_libraries libraries => Branches.all({ selected => club.branchcode, search_params => { pickup_location => 1 } }) %]
230 <label for="default_patron_home">Pickup at patron's home library when possible:</label>
231 <input type="checkbox" id="default_patron_home" name="default_patron_home"/>
234 <h2 style="padding: 0 1em;">Members</h2>
236 [% FOREACH member IN members %]
237 [% SET patron = member.patron %]
238 <li style="padding: 0.5em 1em;">
239 <div><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a></div>
240 [% IF member.exceeded_maxreserves %]
242 <i class="fa fa-error"></i>
243 <strong>Too many holds: </strong> Patron can only place a maximum of [% maxreserves | html %] total holds.
246 [% IF ( patron.is_expired ) %]
248 <i class="fa fa-warning"></i>
249 <strong>Account has expired</strong>
252 [% IF patron.is_debarred %]
254 <i class="fa fa-warning"></i>
255 <strong>Patron has restrictions</strong>
258 [% IF member.amount_outstanding && Koha.Preference('maxoutstanding') && member.amount_outstanding > Koha.Preference('maxoutstanding') %]
260 <i class="fa fa-warning"></i>
261 <strong>Patron has outstanding fines: [% member.amount_outstanding | $Price %]</strong>
265 [% IF ( member.diffbranch ) %]
267 <i class="fa fa-warning"></i>
268 <strong>Pickup library is different.</strong> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )
273 [% UNLESS ( multi_hold ) %]
274 <fieldset class="action">
275 <input type="submit" value="Place hold" />
278 <table id="requesttitles">
282 [% UNLESS Koha.Preference('item-level_itypes') %]
288 [% FOREACH biblioloo IN biblioloop %]
289 [% IF ( biblioloo.warn ) %]
295 [% UNLESS ( biblioloo.warn ) %]
296 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
302 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
303 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
305 [% IF ( biblioloo.publicationyear ) %]
307 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
311 [% IF ( biblioloo.warn ) %]
312 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
315 [% UNLESS Koha.Preference('item-level_itypes') %]
317 <img src="[% biblioloo.itemtype.image_location| html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
320 <td>[% biblioloo.rank | html %]</td>
322 [% IF ( biblioloo.checked_previously ) %]
323 <span>Patron has previously checked out this title</span><br/>
325 [% IF ( biblioloo.alreadyres ) %]
328 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
333 [% IF ( biblioloo.alreadyres ) %]
335 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
336 <strong>already has a hold</strong> on this item
339 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
340 <li> <strong>No items are available</strong> to be placed on hold</li>
343 [% IF ( biblioloo.alreadyres ) %]
346 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
352 [% END # /FOREACH biblioloo %]
353 </table> <!-- /#requesttitles -->
357 [% ELSIF NOT ( noitems || nobiblio ) # /UNLESS patron %]
359 [% IF ( checked_previously && !multi_hold ) %]
360 <div class="dialog alert">
362 <li>Patron has previously checked out this title</li>
367 [% IF ( no_reserves_allowed || exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted || recall ) %]
368 <div class="dialog alert">
370 [% UNLESS ( multi_hold ) %]
371 <h3>Cannot place hold</h3>
373 [% IF ( no_reserves_allowed ) %]
374 <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>
375 [% ELSIF ( exceeded_maxreserves ) %]
376 <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>
377 [% ELSIF ( exceeded_holds_per_record ) %]
378 <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>
379 [% ELSIF ( alreadypossession ) %]
380 <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>
381 [% ELSIF ( alreadyreserved ) %]
382 <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>
383 [% ELSIF ( ageRestricted ) %]
384 <li><strong>Age restricted</strong></li>
385 [% ELSIF ( none_available ) %]
386 <li> <strong>No items are available</strong> to be placed on hold.</li>
387 [% ELSIF ( maxreserves ) %]
388 <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>
389 [% ELSIF ( recall ) %]
390 <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>
391 [% END # /IF exceeded_maxreserves %]
393 [% ELSE # UNLESS multi_hold %]
394 <h3>Cannot place hold on some items</h3>
395 [% IF (no_reserves_allowed ) %]
396 <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>
397 [% ELSIF ( exceeded_maxreserves ) %]
398 <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>
399 [% ELSIF ( exceeded_holds_per_record ) %]
400 [% FOREACH biblioloo IN biblioloop %]
401 [% IF (biblioloo.tooManyHoldsForThisRecord) %]
402 <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>
405 [% ELSIF ( none_available ) %]
406 <li><strong>No items available: </strong>One or more records have no items that can be held</li>
407 [% END # /IF exceeded_maxreserves %]
408 [% END # /UNLESS multi_hold %]
410 [% END # /IF ( exceeded_maxreserves || ... %]
412 [% IF ( patron.is_expired || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
413 <div class="dialog message">
415 [% IF ( patron.is_expired ) %]
416 <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>
419 [% IF patron.is_debarred %]
420 <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>
423 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
424 <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>
427 [% IF ( diffbranch ) %]
428 <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>
430 </ul> <!-- /.dialog.message -->
432 [% END # /IF patron.is_expired || diffbranch ... %]
434 [% IF ( messageborrower ) %]
435 <div class="dialog alert">
436 <h3>Patron not found:</h3>
437 <p>Name or barcode not found. Please try an other </p>
441 <div class="dialog alert hide holdalert">
444 <fieldset class="rows">
445 <legend>Hold details</legend>
446 <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
448 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
449 [% FOREACH biblionumber IN biblionumbers %]
450 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
452 [% IF ( multi_hold ) %]
453 <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
454 <input type="hidden" name="request" value="any"/>
455 [% FOREACH biblioloo IN biblioloop %]
456 [% UNLESS biblioloo.none_avail %]
457 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
458 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
459 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
463 <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
464 <input type="hidden" name="title" value="[% biblio.title | html %]" />
465 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
466 [% END # /IF multi_hold %]
470 <span class="label">Patron:</span>
471 [% IF ( patron.borrowernumber ) %]
472 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a>
478 [% UNLESS ( multi_hold ) %]
480 <span class="label">Estimated priority:</span>
481 <strong>[% fixedRank | html %]</strong>
486 <label for="holdnotes">Notes:</label>
487 <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
490 <label for="pickup">Pickup at:</label>
491 [% UNLESS ( multi_hold ) %]
492 <select name="pickup" id="pickup"
493 data-biblio-id="[% biblio.biblionumber | html %]"
494 data-patron-id="[% patron.borrowernumber | html %]"
495 data-pickup-location-source="biblio">
496 [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
498 <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
499 <option value="" selected="selected"></option>
500 [% FOREACH pickup_location IN multi_pickup_locations %]
501 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
507 [% UNLESS ( multi_hold ) %]
508 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
510 <label for="itemtype">Request specific item type:</label>
511 <select name="itemtype" id="itemtype">
512 <option value="">Any item type</option>
513 [%- FOREACH itemtype IN available_itemtypes %]
514 <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
519 [% END # /UNLESS multi_hold %]
521 [% IF ( reserve_in_future ) %]
523 <label for="from">Hold starts on date:</label>
524 <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" data-date_to="expiration_date" class="flatpickr" data-flatpickr-futuredate="true" />
529 <label for="to">Hold expires on date:</label>
530 <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
533 [% UNLESS ( multi_hold ) %]
535 <label for="requestany">Hold next available item </label>
536 [% IF force_hold_level == 'item' %]
537 <input type="checkbox" id="requestany" name="request" disabled="true" />
538 [% ELSIF force_hold_level == 'record' %]
539 <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
540 <input type="hidden" name="request" value="Any"/>
542 <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
544 <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
547 [% IF remaining_holds_for_record > 1 %]
549 <label for="holds_to_place_count">Holds to place (count)</label>
550 <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" />
553 <input type="hidden" name="holds_to_place_count" value="1" />
555 [% END # /UNLESS multi_hold %]
557 <li id="non_priority_list_item">
558 <label for="non_priority">Non priority hold:</label>
559 <input name="non_priority" id="non_priority" type="checkbox" />
560 <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
564 [% UNLESS ( multi_hold ) %]
565 <fieldset class="action">
566 [% IF ( patron.borrowernumber ) %]
567 [% IF ( override_required ) %]
568 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
569 [% ELSIF ( none_available ) %]
570 <button type="submit" disabled="disabled" class="btn btn-default btn-disabled">Place hold</button>
572 <button type="submit" class="btn btn-default">Place hold</button>
577 [% biblio = biblioloop.0 %]
580 [% UNLESS Koha.Preference('item-level_itypes') %]
582 <span class="label">Item typeX:</span>
583 [% biblio.itemtype.translated_description | html %]
587 [% IF ( biblio.biblioitem.publicationyear ) %]
589 <span class="label">Publication year:</span>
590 [% biblio.biblioitem.publicationyear | html %]
595 <h2 style="padding: 0 1em;">
596 Place a hold on a specific item
597 [% IF force_hold_level == 'item' %]
598 <span class="error"><em>(Required)</em></span>
602 <table id="requestspecific">
606 <th>Allowed pickup locations</th>
607 [% IF Koha.Preference('item-level_itypes') %]
611 <th>Home library</th>
612 <th>Last location</th>
613 [% IF itemdata_ccode %]
618 [% IF itemdata_enumchron %]
625 [% SET selected = 0 %]
626 [% FOREACH itemloo IN biblio.itemloop %]
627 [% UNLESS ( itemloo.hide ) %]
628 <tr class="[% itemloo.backgroundcolor | html %]">
630 [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
632 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
633 Hold must be record level
635 [% ELSIF ( itemloo.available ) %]
636 <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
637 [% ELSIF ( itemloo.override ) %]
638 <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
639 <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
642 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
643 [% IF itemloo.not_holdable %]
644 [% IF itemloo.not_holdable == 'damaged' %]
645 <span>Item damaged</span>
646 [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
647 <span>Age restricted</span>
648 [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
649 <span>Exceeded max holds per record</span>
650 [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
651 <span>Daily hold limit reached for patron</span>
652 [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
653 <span>Too many holds</span>
654 [% ELSIF itemloo.not_holdable == 'notReservable' %]
655 <span>Not holdable</span>
656 [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
657 <span>Patron is from different library</span>
658 [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
659 <span>Cannot place hold from patron's library</span>
660 [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
661 <span>Patron already has hold for this item</span>
662 [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
663 <span>Cannot be transferred to pickup library</span>
664 [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
665 <span>Only pickup locations within the same hold group are allowed</span>
666 [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
667 <span>No holds are allowed on this item</span>
668 [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %]
669 <span>Library is not a pickup location</span>
670 [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
671 <span>No valid pickup location</span>
672 [% ELSIF itemloo.not_holdable == 'notforloan' %]
673 <span>Not for loan</span>
675 <span>[% itemloo.not_holdable | html %]</span>
679 [% END # /IF force_hold_level %]
682 [% IF (itemloo.pickup_locations_count > 0) %]
683 <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations" style="width:100%;"
684 data-item-id="[% itemloo.itemnumber | html %]"
685 data-patron-id="[% patron.borrowernumber | html %]"
686 data-pickup-location-source="item">
687 [% IF (itemloo.default_pickup_location) %]
688 <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option>
693 [% IF Koha.Preference('item-level_itypes') %]
695 [% UNLESS ( noItemTypeImages ) %]
696 [% IF ( itemloo.itemtype.image_location) %]<img src="[% itemloo.itemtype.image_location | html %]" alt="" /> <br /> [% END %]
698 [% itemloo.itemtype.translated_description | html %]
702 [% itemloo.barcode | html %]
705 [% Branches.GetName( itemloo.homebranch ) | html %]
708 [% Branches.GetName( itemloo.holdingbranch ) | html %]
710 [% IF itemdata_ccode %]
712 [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
716 [% itemloo.itemcallnumber | html %]
719 [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %]
721 [% IF itemdata_enumchron %]
723 [% itemloo.enumchron | html %]
726 [% IF ( itemloo.onloan ) %]
727 <td data-order="[% itemloo.date_due | html %]">
728 <span class="checkedout">Due [% itemloo.date_due | $KohaDates as_due_date => 1 %]</span>
731 [% IF ( itemloo.transfertwhen ) %]
732 In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
733 to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %]
737 [% IF ( itemloo.reservedate ) %]
738 [% IF ( itemloo.nocancel ) %]
739 Can't be cancelled when item is in transit
741 [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %]
742 [% IF ( itemloo.canreservefromotherbranches ) %]
743 for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedFor.borrowernumber | uri %]">[% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %]</a>
745 [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %]
746 [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since
747 [% IF ( itemloo.waitingdate ) %]
748 [% itemloo.waitingdate | $KohaDates %]
750 [% IF ( itemloo.reservedate ) %]
751 [% itemloo.reservedate | html %]
754 <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
755 [% END # /IF itemloo.nocancel %]
758 [% END # /IF itemloo.reservedate %]
760 [% IF itemloo.item_level_holds == "N" %]
761 <br/>Item level hold not allowed from OPAC
762 [% ELSIF itemloo.item_level_holds == "F" %]
763 <br/>Item level hold forced from OPAC
766 [% IF ( itemloo.itemlost ) %]
767 <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
770 [% IF ( itemloo.damaged ) %]
771 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
774 [% IF ( itemloo.withdrawn ) %]
775 <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
778 [% IF ( itemloo.notforloan ) %]
779 <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
780 [% ELSIF ( itemloo.notforloanitype ) %]
781 <span class="nfl">Not for loan (Itemtype not for loan)</span>
785 [% END # / UNLESS itemloo.hide %]
786 [% END # /FOREACH itemloo %]
788 </table> <!-- /#requestspecific -->
792 <p class="hiddencount">
793 <a href="request.pl?biblionumber=[% biblio.biblionumber | uri %]&borrowernumber=[% borrowernumber | uri %]&showallitems=1">Show all items ([% biblio.hiddencount | html %] hidden)</a>
796 [% END # /IF hiddencount %]
798 [% ELSE # /UNLESS multi_hold %]
800 <table id="requesttitles">
803 <th>Pickup location</th>
805 [% UNLESS Koha.Preference('item-level_itypes') %]
811 [% FOREACH biblioloo IN biblioloop %]
812 [% IF ( biblioloo.warn ) %]
818 [% UNLESS ( biblioloo.warn ) %]
819 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
823 [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %]
824 <select name="pickup_[% biblioloo.biblionumber | html %]"
825 class="multi_pickup_select"
826 data-biblio-id="[% biblioloo.biblionumber | html %]"
827 data-patron-id="[% patron.borrowernumber | html %]"
828 data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
829 <option value=""></option>
830 [% FOREACH pickup_location IN biblioloo.pickup_locations %]
831 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
839 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
840 [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
842 [% IF ( biblioloo.publicationyear ) %]
844 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
848 [% IF ( biblioloo.warn ) %]
849 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
852 [% UNLESS Koha.Preference('item-level_itypes') %]
854 <img src="[% biblioloo.itemtype.image_location | html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
857 <td>[% biblioloo.rank | html %]</td>
859 [% IF ( biblioloo.checked_previously ) %]
860 <span>Patron has previously checked out this title</span><br/>
862 [% IF ( biblioloo.alreadyres ) %]
865 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
870 [% IF ( biblioloo.alreadyres ) %]
872 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
873 <strong>already has a hold</strong> on this item
876 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
877 <li> <strong>No items are available</strong> to be placed on hold</li>
880 [% IF ( biblioloo.alreadyres ) %]
883 [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
889 [% END # /FOREACH biblioloo %]
890 </table> <!-- /#requesttitles -->
892 [% END # /UNLESS multi_hold %]
894 <fieldset class="action">
895 [% IF ( patron AND patron.borrowernumber ) %]
896 [% IF ( multi_hold ) %]
897 [% IF ( override_required ) %]
898 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
899 [% ELSIF ( no_bibs_available ) %]
900 <button type="submit" class="btn btn-default btn-disabled" disabled="disabled">Place holds</button>
901 [% ELSIF ( none_available ) %]
902 <button type="submit" class="btn btn-default">Place holds</button>
904 <button type="submit" class="btn btn-default" id="multi_hold_submit">Place holds</button>
907 [% IF ( override_required ) %]
908 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
909 [% ELSIF ( none_available ) %]
910 <button type="submit" class="btn btn-default btn-disabled" disabled="disabled">Place hold</button>
912 <button type="submit" class="btn btn-default">Place hold</button>
915 [% END # /IF patron %]
916 </fieldset> <!-- /.action -->
917 </form> <!-- /#hold-request-form -->
918 </fieldset> <!-- /.rows -->
921 [% UNLESS ( patron ) %]
922 [% UNLESS borrowers %]
923 [% SET hold_count = Biblio.HoldsCount( biblio.biblionumber ) | html %]
925 <label for ="always_show_holds">Always show holds</label>
926 [% IF always_show_holds == 'DONT' %]
927 <input type="checkbox" name="always_show_holds" id="always_show_holds" value="DO">
928 [% UNLESS reserveloop %]
929 <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>
932 <input type="checkbox" name="always_show_holds" value="DO" id="always_show_holds" checked="checked">
936 [% IF ( reserveloop ) %]
937 <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
938 [% IF ( multi_hold ) %]
939 [% FOREACH biblionumber IN biblionumbers %]
940 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
945 <div class="dialog message">
946 <p>The job has been enqueued! It will be processed as soon as possible.</p>
947 <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>
951 <h2>Existing holds</h2>
952 <div id="toolbar" class="btn-toolbar">
953 <input type="submit" name="submit" value="Update hold(s)" /> <button class="cancel_selected_holds" data-bulk="true"></button>
954 <fieldset id="cancellation-reason-fieldset" class="action">
955 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
956 [% IF hold_cancellation.count %]
957 <label for="cancellation-reason">Cancellation reason: </label>
958 <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
959 <option value="">No reason given</option>
960 [% FOREACH reason IN hold_cancellation %]
961 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
968 [% FOREACH biblioloo IN biblioloop %]
969 [% IF ( biblioloo.reserveloop ) %]
970 <div class="hold_title" id="hold_title_[% biblioloo.biblionumber | html %]">
971 [% IF ( multi_hold ) %]
973 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
974 [% biblioloo.title | html %]
975 </a> <span class="number_box"><span>[% biblioloo.reserveloop.size | html %] [% tn('Hold', 'Holds', biblioloo.reserveloop.size) | $raw %]</span></span>
979 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
981 [% SET branchcodes = [] %]
983 [% FOREACH h IN biblioloo.reserveloop %]
984 [% branchcodes.push( h.branchcode ) %]
986 [% branchcodes = branchcodes.unique %]
987 [% IF ( branchcodes.empty ) %]
989 There are no holds on this title.
993 [% FOREACH b IN branchcodes.sort %]
994 [% SET holds_by_branch = [] %]
995 [% FOREACH h IN biblioloo.reserveloop %]
996 [% IF h.branchcode == b %]
997 [% holds_by_branch.push( h ) %]
1000 <div class="holds_by_library">
1001 <h4>[% Branches.GetName( b ) | html %]</h4>
1003 [% INCLUDE holds_table.inc holds=holds_by_branch %]
1005 [% END # /FOREACh b %]
1006 [% END # /IF ( branchcodes.empty ) %]
1008 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
1010 [% SET itemtypes = [] %]
1012 [% FOREACH h IN biblioloo.reserveloop %]
1013 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1014 [% itemtypes.push( hold_itemtype ) %]
1016 [% itemtypes = itemtypes.unique %]
1017 [% IF ( itemtypes.empty ) %]
1019 There are no holds on this title.
1023 [% FOREACH i IN itemtypes.sort %]
1024 [% SET holds_by_itemtype = [] %]
1025 [% FOREACH h IN biblioloo.reserveloop %]
1026 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1027 [% IF hold_itemtype == i %]
1028 [% holds_by_itemtype.push( h ) %]
1032 <div class="holds_by_itemtype">
1034 <h4>[% ItemTypes.GetDescription( i ) | html %]</h4>
1036 <h4>Any item type</h4>
1038 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1040 [% END # /FOREACH i %]
1041 [% END # /IF ( itemtypes.empty ) %]
1043 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
1044 [% SET branchcodes = [] %]
1046 [% FOREACH h IN biblioloo.reserveloop %]
1047 [% branchcodes.push( h.branchcode ) %]
1049 [% branchcodes = branchcodes.unique %]
1050 [% IF ( branchcodes.empty ) %]
1052 There are no holds on this title.
1056 [% FOREACH b IN branchcodes.sort %]
1057 <div class="holds_by_library">
1058 <h4 class="library_holds">[% Branches.GetName( b ) | html %]</h4>
1059 [% SET holds_by_branch = [] %]
1060 [% FOREACH h IN biblioloo.reserveloop %]
1061 [% IF h.branchcode == b %]
1062 [% holds_by_branch.push( h ) %]
1066 [% SET itemtypes = [] %]
1067 [% FOREACH h IN holds_by_branch %]
1068 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1069 [% itemtypes.push( hold_itemtype ) %]
1071 [% itemtypes = itemtypes.unique %]
1073 [% FOREACH i IN itemtypes.sort %]
1074 <div class="holds_by_itemtype">
1075 <h5 class="itemtype_holds">
1077 [% ItemTypes.GetDescription( i ) | html %]
1079 <span>Any item type</span>
1083 [% SET holds_by_itemtype = [] %]
1084 [% FOREACH h IN holds_by_branch %]
1085 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
1086 [% IF hold_itemtype == i %]
1087 [% holds_by_itemtype.push( h ) %]
1090 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1091 </div> <!-- /.holds_by_itemtype -->
1093 </div> <!-- /.holds_by_library -->
1094 [% END # /FOREACH b %]
1095 [% END # /IF ( branchcodes.empty ) %]
1099 [% IF ( biblioloo.reserveloop.size ) %]
1100 [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
1103 There are no holds on this title.
1107 [% END # /IF HoldsSplitQueue %]
1108 </div> <!-- /hold_title -->
1109 [% END # /IF biblioloo.reserveloop %]
1110 [% END # FOREACH biblioloo %]
1111 </form> <!-- /#existing_holds -->
1112 [% END # IF reserveloop %]
1113 [% END # UNLESS patron %]
1117 [% IF ( multi_hold || nobiblio ) # No sidebar menu when placing multiple holds or biblio not found %]
1118 </div> <!-- /.col-md-10.col-md-offset-1 -->
1120 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1121 <div class="col-sm-2 col-sm-pull-10">
1123 [% INCLUDE 'biblio-view-menu.inc' %]
1125 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1127 </div> <!-- /.row -->
1129 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
1130 <div class="modal-dialog" role="document">
1131 <div class="modal-content">
1132 <div class="modal-header">
1133 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1134 <h3>Confirm deletion</h3>
1137 <div class="modal-body">
1138 <p>Are you sure you want to cancel this hold?</p>
1140 <fieldset class="action">
1141 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1142 [% IF hold_cancellation.count %]
1143 <label for="cancellation-reason">Cancellation reason: </label>
1144 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
1145 <option value="">No reason given</option>
1146 [% FOREACH reason IN hold_cancellation %]
1147 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1154 <div class="modal-footer">
1155 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
1156 <a href="#" data-dismiss="modal">Cancel</a>
1162 [% MACRO jsinclude BLOCK %]
1163 [% INCLUDE 'datatables.inc' %]
1164 [% INCLUDE 'calendar.inc' %]
1165 [% INCLUDE 'columns_settings.inc' %]
1166 [% Asset.js("lib/hc-sticky.js") | $raw %]
1167 [% INCLUDE 'select2.inc' %]
1168 [% Asset.js("js/holds.js") | $raw%]
1170 [% SET url_biblio_params = "biblionumber=" _ biblionumbers.join("&biblionumber=") %]
1172 [% SET url_biblio_params = url_biblio_params _ "&multi_hold=1" %]
1177 var biblionumbers = [[% biblionumbers.join(', ') | $raw %]];
1178 var borrowernumber = "[% patron.borrowernumber | $raw %]";
1179 var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1180 var override_items = {[% FOREACH biblio IN biblioloop %][% FOREACH itemloo IN biblio.itemloop %][% IF ( itemloo.override ) %]
1181 [% itemloo.itemnumber | html %]: {
1182 homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1183 holdallowed: "[% itemloo.holdallowed | html %]"
1185 [% END %][% END %][% END %]
1188 damaged: _("Item damaged"),
1189 ageRestricted: _("Age restricted"),
1190 tooManyHoldsForThisRecord: _("Exceeded max holds per record"),
1191 tooManyReservesToday: _("Daily hold limit reached for patron"),
1192 tooManyReserves: _("Too many holds"),
1193 notReservable: _("Not holdable"),
1194 noReservesAllowed: _("No reserves allowed"),
1195 cannotReserveFromOtherBranches: _("Patron is from different library"),
1196 itemAlreadyOnHold: _("Patron already has hold for this item"),
1197 cannotBeTransferred: _("Cannot be transferred to pickup library"),
1198 pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed")
1201 var MSG_CANCEL_SELECTED = _("Cancel selected (%s)");
1202 $.fn.select2.defaults.set("width", "100%" );
1203 $.fn.select2.defaults.set("dropdownAutoWidth", true );
1205 $(document).ready(function() {
1206 $('#cancellation-reason-fieldset').hide();
1207 $('.rank-request').on('change', function() {
1208 if ( $(".rank-request option:selected[value='del']").length ) {
1209 $('#cancellation-reason-fieldset').show();
1211 $('#cancellation-reason-fieldset').hide();
1215 if( $("#circ_holds_select").length > 0 ){
1216 [% SET active = clubs ? 1 : 0 %]
1217 /* Set active tab based on whether a club search was submitted */
1218 var tabs = $("#circ_holds_select li:eq(" + [% active | $raw %] + ") a").tab("show");
1219 $( tabs[0].hash ).find("input.focus").focus();
1221 /* Change active focus when tabs change */
1222 $("#circ_holds_select a[data-toggle='tab']").on("shown.bs.tab", function (e) {
1223 active_tab = e.target.hash;
1224 $( active_tab ).find("input.focus").focus();
1229 function ToggleHoldsToPlace() {
1230 if ( $("#requestany").prop('checked') ) {
1231 $("#holds_to_place_count").prop('disabled', false);
1233 $("#holds_to_place_count").prop('disabled', true);
1236 ToggleHoldsToPlace();
1237 $("#requestany").on('change', function(){
1238 ToggleHoldsToPlace();
1241 [% IF Koha.Preference('UseBranchTransferLimits') %]
1242 $("#pickup").on('change', function(){
1243 var pickup = $("#pickup").val();
1244 var url = "?pickup=" + pickup;
1245 url += "&borrowernumber=" + borrowernumber;
1246 url += "&biblionumber=" + biblionumbers[0];
1247 window.location.replace(url);
1251 var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1253 "sDom": '<"top pager"ilf>t',
1256 //Override fieldset styling for dataTables search box
1257 $("div.top.pager").css("margin-left","1em");
1258 $(".dataTables_filter label").css({
1260 "margin-right":"0em"
1263 $("#club-request-form").on("submit", function() {
1265 $('.clubalert, .holdalert').addClass('hide');
1267 pickup_library_id: $('select[name="pickup"]').val()
1269 if($('input[name="checkitem"]:checked').length)
1270 data.item_id = $('input[name="checkitem"]:checked').val();
1271 if($('input[name="borrowernumber"]').length)
1272 data.patron_id = $('input[name="borrowernumber"]').val();
1273 if($('textarea[name="notes"]').length)
1274 data.notes = $('textarea[name="notes"]').val()||null;
1275 if($('input[name="itemtype"]').length) {
1276 data.item_type = $('input[name="itemtype"]').val()||null;
1278 if($('input[name="default_patron_home"]:checked').length) {
1279 data.default_patron_home = 1;
1282 const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1;
1283 var newloc = 'request.pl?';
1284 biblionumbers.forEach(function (biblionumber) {
1285 newloc += '&biblionumber=' + biblionumber;
1288 biblionumbers.forEach(function(biblionumber) {
1289 data.biblio_id = biblionumber;
1291 url: $t.attr('action'),
1292 method: $t.attr('method').toUpperCase(),
1293 contentType: 'application/json',
1294 data: JSON.stringify(data)
1296 for(let i = 0; i < count; i++) {
1298 .then(function(result) {
1299 document.location = newloc;
1301 .fail(function(err) {
1302 var message = err.responseJSON.error;
1303 var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/);
1304 if(match && ERROR_MAP[match[1]]) {
1305 message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>'
1307 $('.clubalert, .holdalert').removeClass('hide').html(message);
1315 [% UNLESS ( multi_hold ) %]
1316 $("#hold-request-form").on("submit", function(){
1317 return check($(this));
1320 $("#hold-request-form").on("submit", function(){
1321 return checkMultiHold();
1325 $(".pickup_location_dropdown").each( function () {
1326 $(this).pickup_locations_dropdown();
1329 $("#pickup_multi").select2({
1334 $('.multi_pickup_select').select2({
1339 $("#pickup_multi").on("change", function() {
1340 var selection = $(this).val();
1341 if ( selection != '' ) {
1342 $(".multi_pickup_select").each(function() {
1343 var valid_pickup_locations = $(this).data('pickup-locations');
1344 if ( valid_pickup_locations.includes(selection) ) {
1345 $(this).val(selection);
1346 $(this).trigger("change");
1352 $("#pickup").each( function () {
1353 $(this).pickup_locations_dropdown();
1356 $(".pickup_locations").each(function () {
1357 $(this).pickup_locations_dropdown();
1361 function check( table ) {
1365 if ( $("#requestany").attr("checked") !== "checked" ) {
1366 // requestany not selected, go through the item-specific cases
1367 if ( $('input[type="radio"]:checked').length > 0 ) {
1368 // got item-specific hold requests in the form!
1369 // verify they have a pickup location selected
1371 if (table.find('input[type="radio"]:checked')
1373 .find(".pickup_locations").val() === null) {
1375 msg = _("- Please select a pickup location for the item" + "\n")
1379 msg = (_("- Please select an item to place a hold") + "\n");
1384 $('#hold-request-form').preventDoubleFormSubmit();
1392 function checkMultiHold() {
1394 var selected_bibs = $(".multi_hold_item_checkbox:checked");
1395 if ( selected_bibs.length > 0 ) {
1396 // there are biblios selected in the form!
1397 // verify they have a pickup location selected
1399 var pickup_not_set = 0;
1400 selected_bibs.each(function() {
1401 if ( $(this).closest('tr').find(".multi_pickup_select").val() === "" ) {
1405 var bibnum = $(this).attr("title");
1408 if ( pickup_not_set > 0 ) {
1409 alert( _("Please make sure all selected titles have a pickup location set" + "\n") );
1414 alert( _("Please select at least one title" + "\n") );
1418 $('#hold-request-form').preventDoubleFormSubmit();
1423 $(document).ready(function() {
1425 $("#always_show_holds").change(function(){
1426 if( $(this).prop('checked') ){
1427 document.cookie = 'always_show_holds=DO';
1429 document.cookie = 'always_show_holds=DONT';
1432 $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1433 var itemnumber = this.value;
1436 switch (override_items[itemnumber].holdallowed) {
1437 case "not_allowed": msg = _("This item normally cannot be put on hold."); break;
1438 case "from_home_library": msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
1441 msg += "\n\n" + _("Place hold on this item?");
1443 return confirm(msg);
1445 $("button.warning").click(function() {
1446 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1448 $("#requestany").click(function() {
1450 $("input[name=checkitem]").each(function() {
1451 $(this).prop("checked", false);
1455 $("input[name=checkitem]").click(function() {
1457 $("input[name=checkitem]").each(function() {
1462 if(onechecked == 1){
1463 $("#requestany").prop("checked", false);
1464 $("#holds_to_place_count").prop('disabled', true);
1466 $("#requestany").prop("checked",true);
1467 $("#holds_to_place_count").prop('disabled', false);
1470 var prev_rank_request;
1471 $("select[name=rank-request]").on("focus", function() {
1472 prev_rank_request = $(this).val();
1473 var row = $(this).parents("tr:first");
1474 }).change(function() {
1475 var row = $(this).parents("tr:first");
1476 var value = parseInt($(this).val());
1477 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
1478 if( !isNaN(value) ) { //If moved to 'del'
1479 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)
1480 if (prev_rank_request > value) {
1481 row.insertBefore(after);
1483 row.insertAfter(after);
1487 var next_priority = 1;
1488 $("select[name=rank-request]").each(function () {
1489 if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
1490 $(this).val(next_priority);
1495 $(".clear-date").on("click",function(e){
1497 var fieldID = this.id.replace("clear-date-","");
1498 $("#" + fieldID).val("");
1501 // Confirm cancellation of hold
1503 $(".cancel-hold").on("click",function(e) {
1505 cancel_link = $(this);
1506 $('#cancelModal').modal();
1509 $("#cancelModalConfirmBtn").on("click",function(e) {
1511 if(cancel_link.data('bulk')) {
1512 [% SET data_url = 'biblionumber=' _ biblionumbers.join('&biblionumber=') %]
1513 link = `request.pl?[% data_url | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`;
1515 let borrowernumber = cancel_link.data('borrowernumber');
1516 let biblionumber = cancel_link.data('biblionumber');
1517 let reserve_id = cancel_link.data('id');
1518 link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`;
1520 let reason = $("#modal-cancellation-reason").val();
1522 link += "&cancellation-reason=" + reason
1524 window.location.href = link;
1528 [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems || nobiblio ) %]
1529 [% IF ( PatronAutoComplete ) %]
1530 $( "#search_patron_filter" ).autocomplete({
1531 source: "/cgi-bin/koha/circ/ysearch.pl",
1533 select: function( event, ui ) {
1534 document.location.href = '/cgi-bin/koha/reserve/request.pl?[% url_biblio_params | url %]&borrowernumber=' + ui.item.borrowernumber;
1537 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
1538 return $( "<li></li>" )
1539 .data( "ui-autocomplete-item", item )
1542 + ( item.surname ? item.surname.escapeHtml() : "" )
1544 + ( item.firstname ? item.firstname.escapeHtml() : "" )
1545 + " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")"
1548 + ( item.address ? item.address.escapeHtml() : "" )
1550 + ( item.city ? item.city.escapeHtml() : "" )
1552 + ( item.zipcode ? item.zipcode.escapeHtml() : "" )
1554 + ( item.country ? item.country.escapeHtml() : "" )
1562 Sticky = $("#toolbar");
1564 stickTo: "#existing_holds",
1565 stickyClass: "floating"
1568 if(!localStorage.selectedHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) {
1569 localStorage.selectedHolds = [];
1572 $('.holds_table .select_hold').each(function() {
1573 if(localStorage.selectedHolds.includes($(this).data('id'))) {
1574 $(this).prop('checked', true);
1578 $('.holds_table .select_hold_all').each(function() {
1579 var table = $(this).parents('.holds_table');
1580 var count = $('.select_hold:not(:checked)', table).length;
1581 $('.select_hold_all', table).prop('checked', !count);
1584 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1586 $('.holds_table .select_hold_all').click(function() {
1587 var table = $(this).parents('.holds_table');
1588 var count = $('.select_hold:checked', table).length;
1589 $('.select_hold', table).prop('checked', !count);
1590 $(this).prop('checked', !count);
1591 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1592 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1595 $('.holds_table .select_hold').click(function() {
1596 var table = $(this).parents('.holds_table');
1597 var count = $('.select_hold:not(:checked)', table).length;
1598 $('.select_hold_all', table).prop('checked', !count);
1599 $('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length));
1600 localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'));
1603 $('.cancel_selected_holds').click(function(e) {
1605 if($('.holds_table .select_hold:checked').length) {
1606 cancel_link = $(this);
1607 delete localStorage.selectedHolds;
1608 $('#cancelModal').modal();
1616 table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
1619 [% 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' %]
1621 $(document).ready(function() {
1622 $("#holds_patronsearch").on("submit", filter);
1624 $('.printholdslip').click(function(){
1625 var reserve_id = $(this).attr('data-reserve_id');
1626 window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
1632 [% INCLUDE 'intranet-bottom.inc' %]