10 [% USE AuthorisedValues %]
12 [% USE TablesSettings %]
13 [% SET footerjs = 1 %]
14 [% INCLUDE 'doc-head-open.inc' %]
15 [% UNLESS ( multi_hold ) %]
16 <title>Place a hold on [% INCLUDE 'biblio-title-head.inc' %] › Holds › Circulation › Koha</title>
18 <title>Confirm holds › Holds › Circulation › Koha</title>
20 [% INCLUDE 'doc-head-close.inc' %]
23 <body id="circ_request" class="catalog">
25 [% INCLUDE 'header.inc' %]
26 [% INCLUDE 'circ-search.inc' %]
28 [% UNLESS ( multi_hold ) %]
29 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
32 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
35 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
38 [% INCLUDE 'biblio-title.inc' link =1 %]
41 <a href="#" aria-current="page">
48 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
51 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
54 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
57 <a href="#" aria-current="page">
63 [% END # UNLESS multi_hold %]
65 <div class="main container-fluid">
67 [% IF ( multi_hold ) # No sidebar menu when placing multiple holds %]
68 <div class="col-md-10 col-md-offset-1">
70 <div class="col-sm-10 col-sm-push-2">
76 <div class="dialog alert">
78 <strong>Cannot place hold:</strong> one or more records without items attached.
80 <strong>Cannot place hold:</strong> this record has no items attached.
85 [% IF ( messagetransfert ) %]
86 <div class="dialog message">
87 <h2>Hold found for ([% nextreservtitle | html %]), please transfer</h2>
88 <p>Hold placed by : <strong> [% nextreservsurname | html %] [% nextreservfirstname | html %]</strong> at : <strong> [% branchname | html %] </strong>, Please transfer this item.
90 <form name="cancelReservewithtransfert" action="branchreserves.pl" method="post">
91 <input type="submit" class="button" />
96 [% UNLESS ( multi_hold ) %]
97 <h1>Place a hold on [% INCLUDE 'biblio-title.inc' link = 1 %]</h1>
99 <h1>Confirm holds</h1>
102 [% UNLESS club OR patron OR patron.borrowernumber OR noitems %]
103 [% IF ( messageborrower ) %]
104 <div class="dialog alert">
105 <h3>Patron not found</h3>
106 <p>No patron with this name, please, try another</p>
110 [% IF ( messageclub ) %]
111 <div class="dialog alert">
112 <h3>Club not found</h3>
113 <p>No club with this name, please, try another</p>
116 <fieldset class="brief">
118 <label>Search patrons or clubs</label>
120 <label>Search patrons</label>
122 <div id="circ_holds_select" class="toptabs">
124 <li><a href="#holds_patronsearch_pane">Patrons</a></li>
126 <li><a href="#holds_clubsearch_pane">Clubs</a></li>
129 <div id="holds_patronsearch_pane">
130 <form id="holds_patronsearch" action="request.pl?biblionumbers=[% biblionumbers | html %]" method="post">
131 <div class="hint">Enter patron card number or partial name:</div>
132 <input type="text" size="40" id="patron" class="focus" name="findborrower" autocomplete="off" />
133 <input type="submit" value="Search" />
135 <input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
137 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
140 </form> <!-- /#holds_patronsearch -->
142 [% INCLUDE 'circ-patron-search-results.inc' destination = "holds" %]
146 <div id="holds_clubsearch_pane">
147 <form id="holds_clubsearch" action="request.pl?biblionumber=[% biblionumber | html %]" method="post">
148 <div class="hint">Enter club ID or partial name:</div>
149 <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" />
150 <input type="submit" value="Search" />
152 <input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
154 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
157 </form> <!-- /#holds_patronsearch -->
159 [% INCLUDE 'clubs-table.inc' destination = "holds" %]
166 <div class="dialog alert hide clubalert">
168 <fieldset class="rows">
169 <legend>Hold details</legend>
170 <form action="/api/v1/clubs/[% club.id | html %]/holds" method="post" name="form" id="club-request-form">
172 [% IF ( multi_hold ) %]
173 <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
174 <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
175 <input type="hidden" name="request" value="any"/>
176 [% FOREACH biblioloo IN biblioloop %]
177 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
178 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
181 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
182 <input type="hidden" name="title" value="[% biblio.title | html %]" />
183 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
184 [% END # /IF multi_hold %]
187 <span class="label">Club: </span> [% club.name | html %]
190 <span class="label">Description: </span> [% club.description | html %]
193 <label for="pickup">Pickup at:</label>
194 <select name="pickup" id="pickup_club">
195 [% PROCESS options_for_libraries libraries => Branches.all({ selected => club.branchcode, search_params => { pickup_location => 1 } }) %]
199 <label for="default_patron_home">Pickup at patron's home library when possible:</label>
200 <input type="checkbox" id="default_patron_home" name="default_patron_home"/>
203 <h2 style="padding: 0 1em;">Members</h2>
205 [% FOREACH member IN members %]
206 [% SET patron = member.patron %]
207 <li style="padding: 0.5em 1em;">
208 <div><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a></div>
209 [% IF member.exceeded_maxreserves %]
211 <i class="fa fa-error"></i>
212 <strong>Too many holds: </strong> Patron can only place a maximum of [% maxreserves | html %] total holds.
215 [% IF ( member.expiry ) %]
217 <i class="fa fa-warning"></i>
218 <strong>Account has expired</strong>
221 [% IF patron.is_debarred %]
223 <i class="fa fa-warning"></i>
224 <strong>Patron has restrictions</strong>
227 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
229 <i class="fa fa-warning"></i>
230 <strong>Patron has outstanding fines: [% member.amount_outstanding | $Price %]</strong>
234 [% IF ( member.diffbranch ) %]
236 <i class="fa fa-warning"></i>
237 <strong>Pickup library is different.</strong> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )
243 [% UNLESS ( multi_hold ) %]
244 <fieldset class="action">
245 <input type="submit" value="Place hold" />
248 <table id="requesttitles">
252 [% UNLESS ( item_level_itypes ) %]
258 [% FOREACH biblioloo IN biblioloop %]
259 [% IF ( biblioloo.warn ) %]
265 [% UNLESS ( biblioloo.warn ) %]
266 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
272 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
274 [% IF ( biblioloo.publicationyear ) %]
276 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
280 [% IF ( biblioloo.warn ) %]
281 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
284 [% UNLESS ( item_level_itypes ) %]
286 <img src="[% biblioloo.imageurl | html %]" alt="[% biblioloo.itypename | html %]" title="[% biblioloo.itypename | html %]" />
289 <td>[% biblioloo.rank | html %]</td>
291 [% IF ( biblioloo.checked_previously ) %]
292 <span>Patron has previously checked out this title</span><br/>
294 [% IF ( biblioloo.alreadyres ) %]
297 [% IF ( biblioloo.none_avail ) %]
302 [% IF ( biblioloo.alreadyres ) %]
304 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
305 <strong>already has a hold</strong> on this item
308 [% IF ( biblioloo.none_avail ) %]
309 <li> <strong>No items are available</strong> to be placed on hold</li>
312 [% IF ( biblioloo.alreadyres ) %]
315 [% IF ( biblioloo.none_avail ) %]
321 [% END # /FOREACH biblioloo %]
322 </table> <!-- /#requesttitles -->
326 [% ELSIF NOT noitems # /UNLESS patron %]
328 [% IF ( checked_previously && !multi_hold ) %]
329 <div class="dialog alert">
331 <li>Patron has previously checked out this title</li>
336 [% IF ( no_reserves_allowed || exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted ) %]
337 <div class="dialog alert">
339 [% UNLESS ( multi_hold ) %]
340 <h3>Cannot place hold</h3>
342 [% IF ( no_reserves_allowed ) %]
343 <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>
344 [% ELSIF ( exceeded_maxreserves ) %]
345 <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>
346 [% ELSIF ( exceeded_holds_per_record ) %]
347 <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>
348 [% ELSIF ( alreadypossession ) %]
349 <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>
350 [% ELSIF ( alreadyreserved ) %]
351 <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>
352 [% ELSIF ( ageRestricted ) %]
353 <li><strong>Age restricted</strong></li>
354 [% ELSIF ( none_available ) %]
355 <li> <strong>No items are available</strong> to be placed on hold.</li>
356 [% ELSIF ( maxreserves ) %]
357 <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>
358 [% END # /IF exceeded_maxreserves %]
360 [% ELSE # UNLESS multi_hold %]
361 <h3>Cannot place hold on some items</h3>
362 [% IF (no_reserves_allowed ) %]
363 <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>
364 [% ELSIF ( exceeded_maxreserves ) %]
365 <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>
366 [% ELSIF ( exceeded_holds_per_record ) %]
367 [% FOREACH biblioloo IN biblioloop %]
368 [% IF (biblioloo.tooManyHoldsForThisRecord) %]
369 <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>
372 [% END # /IF exceeded_maxreserves %]
373 [% END # /UNLESS multi_hold %]
375 [% END # /IF ( exceeded_maxreserves || ... %]
377 [% IF ( expiry || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
378 <div class="dialog message">
381 <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>
384 [% IF patron.is_debarred %]
385 <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>
388 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
389 <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>
392 [% IF ( diffbranch ) %]
393 <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>
395 </ul> <!-- /.dialog.message -->
397 [% END # /IF expiry || diffbranch ... %]
399 [% IF ( messageborrower ) %]
400 <div class="dialog alert">
401 <h3>Patron not found:</h3>
402 <p>Name or barcode not found. Please try an other </p>
406 <div class="dialog alert hide holdalert">
409 <fieldset class="rows">
410 <legend>Hold details</legend>
411 <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
413 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
414 <input type="hidden" name="type" value="str8" />
416 [% IF ( multi_hold ) %]
417 <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
418 <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
419 <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
420 <input type="hidden" name="request" value="any"/>
421 [% FOREACH biblioloo IN biblioloop %]
422 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
423 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
426 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
427 <input type="hidden" name="title" value="[% biblio.title | html %]" />
428 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
429 [% END # /IF multi_hold %]
433 <span class="label">Patron:</span>
434 [% IF ( patron.borrowernumber ) %]
435 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a>
441 [% UNLESS ( multi_hold ) %]
443 <span class="label">Estimated priority:</span>
444 <strong>[% fixedRank | html %]</strong>
449 <label for="holdnotes">Notes:</label>
450 <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
453 <label for="pickup">Pickup at:</label>
454 [% UNLESS ( multi_hold ) %]
455 <select name="pickup" id="pickup" data-biblio-id="[% biblio.biblionumber | html %]" data-patron-id="[% patron.borrowernumber | html %]">
456 [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
458 <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
459 <option value="" selected="selected"></option>
460 [% FOREACH pickup_location IN multi_pickup_locations %]
461 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
467 [% UNLESS ( multi_hold ) %]
468 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
470 <label for="itemtype">Request specific item type:</label>
471 <select name="itemtype" id="itemtype">
472 <option value="">Any item type</option>
473 [%- FOREACH itemtype IN available_itemtypes %]
474 <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
479 [% END # /UNLESS multi_hold %]
481 [% IF ( reserve_in_future ) %]
483 <label for="from">Hold starts on date:</label>
484 <input name="reserve_date" id="from" size="10" class="datepickerfrom" type="text" >
485 <input type="hidden" class="datepickerfrom_hidden" />
486 <a href="#" id="clear-date-from" class="clear-date">Clear date</a>
491 <label for="to">Hold expires on date:</label>
492 <input name="expiration_date" id="to" size="10" class="datepickerto" type="text" />
493 <input type="hidden" class="datepickerto_hidden" />
494 <a href="#" id="clear-date-to" class="clear-date">Clear date</a>
497 [% UNLESS ( multi_hold ) %]
499 <label for="requestany">Hold next available item </label>
500 [% IF force_hold_level == 'item' %]
501 <input type="checkbox" id="requestany" name="request" disabled="true" />
502 [% ELSIF force_hold_level == 'record' %]
503 <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
504 <input type="hidden" name="request" value="Any"/>
506 <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
508 <input type="hidden" name="biblioitem" value="[% biblioitemnumber | html %]" />
509 <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
512 [% IF remaining_holds_for_record > 1 %]
514 <label for="holds_to_place_count">Holds to place (count)</label>
515 <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" />
518 <input type="hidden" name="holds_to_place_count" value="1" />
520 [% END # /UNLESS multi_hold %]
522 <li id="non_priority_list_item">
523 <label for="non_priority">Non priority hold:</label>
524 <input name="non_priority" id="non_priority" type="checkbox" />
525 <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
529 [% UNLESS ( multi_hold ) %]
530 <fieldset class="action">
531 [% IF ( patron.borrowernumber ) %]
532 [% IF ( override_required ) %]
533 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
534 [% ELSIF ( none_available ) %]
535 <button type="submit" disabled="disabled" class="btn btn-default btn-disabled">Place hold</button>
537 <button type="submit" class="btn btn-default">Place hold</button>
542 [% FOREACH bibitemloo IN bibitemloop %]
544 [% UNLESS ( item_level_itypes ) %]
546 <span class="label">Item type:</span>
547 [% bibitemloo.description | html %]
551 [% IF ( bibitemloo.publicationyear ) %]
553 <span class="label">Publication year:</span>
554 [% bibitemloo.publicationyear | html %]
559 <h2 style="padding: 0 1em;">
560 Place a hold on a specific item
561 [% IF bibitemloo.force_hold_level == 'item' %]
562 <span class="error"><em>(Required)</em></span>
566 <table id="requestspecific">
570 [% IF ( item_level_itypes ) %]
574 <th>Home library</th>
575 <th>Last location</th>
576 [% IF itemdata_ccode %]
581 [% IF itemdata_enumchron %]
585 <th>Allowed pickup locations</th>
589 [% SET selected = 0 %]
590 [% FOREACH itemloo IN bibitemloo.itemloop %]
591 [% UNLESS ( itemloo.hide ) %]
592 <tr class="[% itemloo.backgroundcolor | html %]">
594 [% IF itemloo.force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
596 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
597 Hold must be record level
599 [% ELSIF ( itemloo.available ) %]
600 <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
601 [% ELSIF ( itemloo.override ) %]
602 <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
603 <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
606 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
607 [% IF itemloo.not_holdable %]
608 [% IF itemloo.not_holdable == 'damaged' %]
610 [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
612 [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
613 Exceeded max holds per record
614 [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
615 Daily hold limit reached for patron
616 [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
618 [% ELSIF itemloo.not_holdable == 'notReservable' %]
620 [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
621 Patron is from different library
622 [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
623 Cannot place hold from patron's library
624 [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
625 Patron already has hold for this item
626 [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
627 Cannot be transferred to pickup library
628 [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
629 Only pickup locations within the same hold group are allowed
630 [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
631 No reserves are allowed on this item
632 [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %]
633 Library is not a pickup location
634 [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
635 No valid pickup location
637 [% itemloo.not_holdable | html %]
641 [% END # /IF itemloo.force_hold_level %]
643 [% IF ( item_level_itypes ) %]
645 [% UNLESS ( noItemTypeImages ) %]
646 [% IF ( itemloo.imageurl ) %]<img src="[% itemloo.imageurl | html %]" alt="" /> <br /> [% END %]
648 [% itemloo.itypename | html %]
652 [% itemloo.barcode | html %]
655 [% Branches.GetName( itemloo.homebranch ) | html %]
658 [% Branches.GetName( itemloo.holdingbranch ) | html %]
660 [% IF itemdata_ccode %]
662 [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
666 [% itemloo.itemcallnumber | html %]
669 [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %]
671 [% IF itemdata_enumchron %]
673 [% itemloo.enumchron | html %]
676 [% IF ( itemloo.onloan ) %]
677 <td data-order="[% itemloo.date_due | html %]">
678 <span class="checkedout">Due [% itemloo.date_due | $KohaDates as_due_date => 1 %]</span>
681 [% IF ( itemloo.transfertwhen ) %]
682 In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
683 to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %]
687 [% IF ( itemloo.reservedate ) %]
688 [% IF ( itemloo.nocancel ) %]
689 Can't be cancelled when item is in transit
691 [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %]
692 [% IF ( itemloo.canreservefromotherbranches ) %]
693 for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedFor.borrowernumber | uri %]">[% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %]</a>
695 [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %]
696 [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since
697 [% IF ( itemloo.waitingdate ) %]
698 [% itemloo.waitingdate | $KohaDates %]
700 [% IF ( itemloo.reservedate ) %]
701 [% itemloo.reservedate | html %]
704 <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
705 [% END # /IF itemloo.nocancel %]
708 [% END # /IF itemloo.reservedate %]
710 [% IF itemloo.item_level_holds == "N" %]
711 <br/>Item level hold not allowed from OPAC
712 [% ELSIF itemloo.item_level_holds == "F" %]
713 <br/>Item level hold forced from OPAC
716 [% IF ( itemloo.itemlost ) %]
717 <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
720 [% IF ( itemloo.damaged ) %]
721 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
724 [% IF ( itemloo.withdrawn ) %]
725 <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
728 [% IF ( itemloo.notforloan ) %]
729 <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
733 [% IF (itemloo.pickup_locations_count > 0) %]
734 <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations"
735 data-item-id="[% itemloo.itemnumber | html %]"
736 data-patron-id="[% patron.borrowernumber | html %]">
737 [% IF (itemloo.default_pickup_location) %]
738 <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option>
744 [% END # / UNLESS itemloo.hide %]
745 [% END # /FOREACH itemloo %]
747 </table> <!-- /#requestspecific -->
749 [% IF ( bibitemloo.hiddencount ) %]
751 <p class="hiddencount">
752 <a href="request.pl?biblionumber=[% bibitemloo.biblionumber | uri %]&borrowernumber=[% bibitemloo.borrowernumber | uri %]&showallitems=1">Show all items ([% bibitemloo.hiddencount | html %] hidden)</a>
755 [% END # /IF bibitemloo.hiddencount %]
756 [% END # /FOREACH bibitemloo %]
758 [% ELSE # /UNLESS multi_hold %]
760 <table id="requesttitles">
764 [% UNLESS ( item_level_itypes ) %]
769 <th>Pickup location</th>
771 [% FOREACH biblioloo IN biblioloop %]
772 [% IF ( biblioloo.warn ) %]
778 [% UNLESS ( biblioloo.warn ) %]
779 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
785 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
787 [% IF ( biblioloo.publicationyear ) %]
789 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
793 [% IF ( biblioloo.warn ) %]
794 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
797 [% UNLESS ( item_level_itypes ) %]
799 <img src="[% biblioloo.imageurl | html %]" alt="[% biblioloo.itypename | html %]" title="[% biblioloo.itypename | html %]" />
802 <td>[% biblioloo.rank | html %]</td>
804 [% IF ( biblioloo.checked_previously ) %]
805 <span>Patron has previously checked out this title</span><br/>
807 [% IF ( biblioloo.alreadyres ) %]
810 [% IF ( biblioloo.none_avail ) %]
815 [% IF ( biblioloo.alreadyres ) %]
817 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
818 <strong>already has a hold</strong> on this item
821 [% IF ( biblioloo.none_avail ) %]
822 <li> <strong>No items are available</strong> to be placed on hold</li>
825 [% IF ( biblioloo.alreadyres ) %]
828 [% IF ( biblioloo.none_avail ) %]
834 <select name="pickup_[% biblioloo.biblionumber | html %]"
835 class="multi_pickup_select"
836 data-biblio-id="[% biblioloo.biblionumber | html %]"
837 data-patron-id="[% patron.borrowernumber | html %]"
838 data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
839 <option value=""></option>
840 [% FOREACH pickup_location IN biblioloo.pickup_locations %]
841 <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
846 [% END # /FOREACH biblioloo %]
847 </table> <!-- /#requesttitles -->
849 [% END # /UNLESS multi_hold %]
851 <fieldset class="action">
852 [% IF ( patron AND patron.borrowernumber ) %]
853 [% IF ( override_required ) %]
854 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
855 [% ELSIF ( none_available ) %]
856 <button type="submit" disabled="disabled" class="btn btn-default btn-disabled">Place hold</button>
858 [% IF ( multi_hold ) %]
859 <button type="submit" class="btn btn-default" id="multi_hold_submit">Place hold</button>
861 <button type="submit" class="btn btn-default">Place hold</button>
864 [% END # /IF patron %]
865 </fieldset> <!-- /.action -->
866 </form> <!-- /#hold-request-form -->
867 </fieldset> <!-- /.rows -->
870 [% UNLESS ( patron ) %]
871 [% IF ( reserveloop ) %]
872 <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
873 [% IF ( multi_hold ) %]
874 <input type = "hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
877 <h2>Existing holds</h2>
878 <div id="toolbar" class="btn-toolbar">
879 <input type="submit" name="submit" value="Update hold(s)" />
880 <fieldset id="cancellation-reason-fieldset" class="action">
881 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
882 [% IF hold_cancellation %]
883 <label for="cancellation-reason">Cancellation reason: </label>
884 <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
885 <option value="">No reason given</option>
886 [% FOREACH reason IN hold_cancellation %]
887 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
894 [% FOREACH biblioloo IN biblioloop %]
895 [% IF ( biblioloo.reserveloop ) %]
896 [% IF ( multi_hold ) %]
898 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
899 [% biblioloo.title | html %]
904 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
905 [% SET branchcodes = [] %]
907 [% FOREACH h IN biblioloo.reserveloop %]
908 [% branchcodes.push( h.branchcode ) %]
910 [% branchcodes = branchcodes.unique %]
912 [% FOREACH b IN branchcodes.sort %]
913 [% SET holds_by_branch = [] %]
914 [% FOREACH h IN biblioloo.reserveloop %]
915 [% IF h.branchcode == b %]
916 [% holds_by_branch.push( h ) %]
920 <legend>[% Branches.GetName( b ) | html %]</legend>
921 [% INCLUDE holds_table.inc holds=holds_by_branch %]
923 [% END # /FOREACh b %]
924 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
925 [% SET itemtypes = [] %]
927 [% FOREACH h IN biblioloo.reserveloop %]
928 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
929 [% itemtypes.push( hold_itemtype ) %]
931 [% itemtypes = itemtypes.unique %]
933 [% FOREACH i IN itemtypes.sort %]
934 [% SET holds_by_itemtype = [] %]
935 [% FOREACH h IN biblioloo.reserveloop %]
936 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
937 [% IF hold_itemtype == i %]
938 [% holds_by_itemtype.push( h ) %]
944 <legend>[% ItemTypes.GetDescription( i ) | html %]</legend>
946 <legend>Any item type</legend>
948 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
950 [% END # /FOREACH i %]
951 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
952 [% SET branchcodes = [] %]
954 [% FOREACH h IN biblioloo.reserveloop %]
955 [% branchcodes.push( h.branchcode ) %]
957 [% branchcodes = branchcodes.unique %]
959 [% FOREACH b IN branchcodes.sort %]
961 <legend>[% Branches.GetName( b ) | html %]</legend>
962 [% SET holds_by_branch = [] %]
963 [% FOREACH h IN biblioloo.reserveloop %]
964 [% IF h.branchcode == b %]
965 [% holds_by_branch.push( h ) %]
969 [% SET itemtypes = [] %]
970 [% FOREACH h IN holds_by_branch %]
971 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
972 [% itemtypes.push( hold_itemtype ) %]
974 [% itemtypes = itemtypes.unique %]
976 [% FOREACH i IN itemtypes.sort %]
978 <h3>[% ItemTypes.GetDescription( i ) | html %]</h3>
980 <h3>Any item type</h3>
983 [% SET holds_by_itemtype = [] %]
984 [% FOREACH h IN holds_by_branch %]
985 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
986 [% IF hold_itemtype == i %]
987 [% holds_by_itemtype.push( h ) %]
990 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
993 [% END # /FOREACH b %]
995 [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
996 [% END # /IF HoldsSplitQueue %]
998 [% END # /IF biblioloo.reserveloop %]
999 [% END # FOREACH biblioloo %]
1000 </fieldset> <!-- /.rows -->
1001 </form> <!-- /name=TTime -->
1002 [% END # IF reserveloop %]
1003 [% END # UNLESS patron %]
1007 [% IF ( multi_hold ) # No sidebar menu when placing multiple holds %]
1008 </div> <!-- /.col-md-10.col-md-offset-1 -->
1010 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1011 <div class="col-sm-2 col-sm-pull-10">
1013 [% INCLUDE 'biblio-view-menu.inc' %]
1015 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1017 </div> <!-- /.row -->
1019 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
1020 <div class="modal-dialog" role="document">
1021 <div class="modal-content">
1022 <div class="modal-header">
1023 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1024 <h3>Confirm deletion</h3>
1027 <div class="modal-body">
1028 <p>Are you sure you want to cancel this hold?</p>
1030 <fieldset class="action">
1031 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1032 [% IF hold_cancellation %]
1033 <label for="cancellation-reason">Cancellation reason: </label>
1034 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
1035 <option value="">No reason given</option>
1036 [% FOREACH reason IN hold_cancellation %]
1037 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1044 <div class="modal-footer">
1045 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
1046 <a href="#" data-dismiss="modal">Cancel</a>
1052 [% MACRO jsinclude BLOCK %]
1053 [% INCLUDE 'datatables.inc' %]
1054 [% INCLUDE 'calendar.inc' %]
1055 [% INCLUDE 'columns_settings.inc' %]
1056 [% Asset.js("lib/hc-sticky.js") | $raw %]
1057 [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1058 [% INCLUDE 'select2.inc' %]
1061 var biblionumber = "[% biblionumber | $raw %]";
1062 var borrowernumber = "[% patron.borrowernumber | $raw %]";
1063 var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1064 var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo IN bibitemloo.itemloop %][% IF ( itemloo.override ) %]
1065 [% itemloo.itemnumber | html %]: {
1066 homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1067 holdallowed: "[% itemloo.holdallowed | html %]"
1069 [% END %][% END %][% END %]
1072 damaged: _("Item damaged"),
1073 ageRestricted: _("Age restricted"),
1074 tooManyHoldsForThisRecord: _("Exceeded max holds per record"),
1075 tooManyReservesToday: _("Daily hold limit reached for patron"),
1076 tooManyReserves: _("Too many holds"),
1077 notReservable: _("Not holdable"),
1078 noReservesAllowed: _("No reserves allowed"),
1079 onShelfHoldsNotAllowed: _("Not holdable"),
1080 cannotReserveFromOtherBranches: _("Patron is from different library"),
1081 itemAlreadyOnHold: _("Patron already has hold for this item"),
1082 cannotBeTransferred: _("Cannot be transferred to pickup library"),
1083 pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed")
1085 columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
1086 $.fn.select2.defaults.set("width", "100%" );
1087 $.fn.select2.defaults.set("dropdownAutoWidth", true );
1089 $(document).ready(function() {
1090 $('#cancellation-reason-fieldset').hide();
1091 $('.rank-request').on('change', function() {
1092 if ( $(".rank-request option:selected[value='del']").length ) {
1093 $('#cancellation-reason-fieldset').show();
1095 $('#cancellation-reason-fieldset').hide();
1099 [% SET active = clubs ? 1 : 0 %]
1100 $('#circ_holds_select').tabs({
1101 active: [% active | $raw %],
1102 activate: function(){
1103 $(this).find("input.focus").focus();
1106 $(this).find("input.focus").focus();
1109 function ToggleHoldsToPlace() {
1110 if ( $("#requestany").prop('checked') ) {
1111 $("#holds_to_place_count").prop('disabled', false);
1113 $("#holds_to_place_count").prop('disabled', true);
1116 ToggleHoldsToPlace();
1117 $("#requestany").on('change', function(){
1118 ToggleHoldsToPlace();
1121 [% IF Koha.Preference('UseBranchTransferLimits') %]
1122 $("#pickup").on('change', function(){
1123 var pickup = $("#pickup").val();
1124 var url = "?pickup=" + pickup;
1125 url += "&borrowernumber=" + borrowernumber;
1126 url += "&biblionumber=" + biblionumber;
1127 window.location.replace(url);
1131 [% IF AutoResumeSuspendedHolds %]
1132 $(".suspend_until_datepicker, .datepickerfrom, .datepickerto").datepicker("option", "minDate", 1);
1135 $(".datepickerto").datepicker("option", "altField", ".datepickerto_hidden");
1136 $(".datepickerto").datepicker("option", "altFormat", "yy-mm-dd");
1138 $(".datepickerfrom").datepicker("option", "altField", ".datepickerfrom_hidden");
1139 $(".datepickerfrom").datepicker("option", "altFormat", "yy-mm-dd");
1141 var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1143 "sDom": '<"top pager"ilf>t',
1146 //Override fieldset styling for dataTables search box
1147 $("div.top.pager").css("margin-left","1em");
1148 $(".dataTables_filter label").css({
1150 "margin-right":"0em"
1153 $("#club-request-form").on("submit", function() {
1155 $('.clubalert, .holdalert').addClass('hide');
1156 let biblionumbers = [biblionumber];
1157 let biblionumbers_text;
1159 pickup_library_id: $('select[name="pickup"]').val()
1161 if($('input[name="checkitem"]:checked').length)
1162 data.item_id = $('input[name="checkitem"]:checked').val();
1163 if($('input[name="borrowernumber"]').length)
1164 data.patron_id = $('input[name="borrowernumber"]').val();
1165 if($('textarea[name="notes"]').length)
1166 data.notes = $('textarea[name="notes"]').val()||null;
1167 if($('.datepickerto_hidden').length)
1168 data.expiration_date = $('.datepickerto_hidden').val()||null;
1169 if($('.datepickerfrom_hidden').length)
1170 data.hold_date = $('.datepickerfrom_hidden').val()||null;
1171 if($('input[name="itemtype"]').length) {
1172 data.item_type = $('input[name="itemtype"]').val()||null;
1174 if($('input[name="default_patron_home"]:checked').length) {
1175 data.default_patron_home = 1;
1177 if($('input[name="biblionumbers"]').length) {
1178 biblionumbers_text = $('input[name="biblionumbers"]').val();
1179 biblionumbers = biblionumbers_text.replace(/\/$/, '').split('/')
1182 const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1;
1183 biblionumbers.forEach(function(biblionumber) {
1184 data.biblio_id = biblionumber;
1186 url: $t.attr('action'),
1187 method: $t.attr('method').toUpperCase(),
1188 contentType: 'application/json',
1189 data: JSON.stringify(data)
1191 for(let i = 0; i < count; i++) {
1193 .then(function(result) {
1194 let url = 'request.pl?biblionumber='+biblionumber;
1195 if(biblionumbers_text) {
1196 url = 'request.pl?biblionumbers='+biblionumbers_text;
1198 document.location = url;
1200 .fail(function(err) {
1201 var message = err.responseJSON.error;
1202 var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/);
1203 if(match && ERROR_MAP[match[1]]) {
1204 message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>'
1206 $('.clubalert, .holdalert').removeClass('hide').html(message);
1214 [% UNLESS ( multi_hold ) %]
1215 $("#hold-request-form").on("submit", function(){
1216 return check($(this));
1219 $("#hold-request-form").on("submit", function(){
1220 return checkMultiHold();
1224 function display_pickup_location (state) {
1226 if ( state.needs_override === true ) {
1228 '<span>' + state.text + '</span> <span style="float:right;" title="' +
1229 _("This pickup location is not allowed according to circulation rules") +
1230 '"><i class="fa fa-exclamation-circle" aria-hidden="true"></i></span>'
1234 $text = $('<span>'+state.text+'</span>');
1240 $(".pickup_location_dropdown").each( function () {
1241 var this_dropdown = $(this);
1242 var hold_id = $(this).data('hold_id');
1244 this_dropdown.select2({
1247 url: '/api/v1/holds/' + encodeURIComponent(hold_id) + '/pickup_locations',
1248 delay: 300, // wait 300 milliseconds before triggering the request
1250 data: function (params) {
1251 var search_term = (params.term === undefined) ? '' : params.term;
1253 "q": JSON.stringify({"name":{"-like":search_term+'%'}}),
1258 processResults: function (data) {
1260 data.forEach( function ( pickup_location ) {
1263 "id": pickup_location.library_id.escapeHtml(),
1264 "text": pickup_location.name.escapeHtml(),
1265 "needs_override": pickup_location.needs_override
1269 return { "results": results };
1272 templateResult: display_pickup_location
1276 $("#pickup_multi").select2({
1281 $('.multi_pickup_select').select2({
1286 $("#pickup_multi").on("change", function() {
1287 var selection = $(this).val();
1288 if ( selection != '' ) {
1289 $(".multi_pickup_select").each(function() {
1290 var valid_pickup_locations = $(this).data('pickup-locations');
1291 if ( valid_pickup_locations.includes(selection) ) {
1292 $(this).val(selection);
1293 $(this).trigger("change");
1299 $("#pickup").each( function () {
1300 var this_dropdown = $(this);
1301 var patron_id = $(this).data('patron-id');
1302 var biblio_id = $(this).data('biblio-id');
1304 this_dropdown.select2({
1308 url: '/api/v1/biblios/' + encodeURIComponent(biblio_id) + '/pickup_locations',
1309 delay: 300, // wait 300 milliseconds before triggering the request
1311 data: function (params) {
1312 var search_term = (params.term === undefined) ? '' : params.term;
1314 "q": JSON.stringify({"name":{"-like":search_term+'%'}}),
1315 "_order_by": "name",
1316 "patron_id": patron_id
1320 processResults: function (data) {
1322 data.forEach( function ( pickup_location ) {
1325 "id": pickup_location.library_id.escapeHtml(),
1326 "text": pickup_location.name.escapeHtml(),
1327 "needs_override": pickup_location.needs_override
1331 return { "results": results };
1334 templateResult: display_pickup_location
1337 $(".pickup_locations").each( function () {
1338 var this_dropdown = $(this);
1339 var patron_id = $(this).data('patron-id');
1340 var item_id = $(this).data('item-id');
1342 this_dropdown.select2({
1345 url: '/api/v1/items/' + encodeURIComponent(item_id) + '/pickup_locations',
1346 delay: 300, // wait 300 milliseconds before triggering the request
1348 data: function (params) {
1349 var search_term = (params.term === undefined) ? '' : params.term;
1351 "q": JSON.stringify({"name":{"-like":search_term+'%'}}),
1352 "_order_by": "name",
1353 "patron_id": patron_id
1357 processResults: function (data) {
1359 data.forEach( function ( pickup_location ) {
1362 "id": pickup_location.library_id.escapeHtml(),
1363 "text": pickup_location.name.escapeHtml(),
1364 "needs_override": pickup_location.needs_override
1368 return { "results": results };
1371 templateResult: display_pickup_location
1376 function check( table ) {
1380 if ( $("#requestany").attr("checked") !== "checked" ) {
1381 // requestany not selected, go through the item-specific cases
1382 if ( $('input[type="radio"]:checked').length > 0 ) {
1383 // got item-specific hold requests in the form!
1384 // verify they have a pickup location selected
1386 if (table.find('input[type="radio"]:checked')
1388 .find(".pickup_locations").val() === null) {
1390 msg = _("- Please select a pickup location for the item" + "\n")
1394 msg = (_("- Please select an item to place a hold") + "\n");
1399 $('#hold-request-form').preventDoubleFormSubmit();
1407 function checkMultiHold() {
1409 var biblionumbers = "";
1410 var selected_bibs = $(".multi_hold_item_checkbox:checked");
1411 if ( selected_bibs.length > 0 ) {
1412 // there are biblios selected in the form!
1413 // verify they have a pickup location selected
1415 var pickup_not_set = 0;
1416 selected_bibs.each(function() {
1417 if ( $(this).closest('tr').find(".multi_pickup_select").val() === "" ) {
1421 var bibnum = $(this).attr("title");
1422 biblionumbers += bibnum + "/";
1425 if ( pickup_not_set > 0 ) {
1426 alert( _("Please make sure all selected titles have a pickup location set" + "\n") );
1431 alert( _("Please select at least one title" + "\n") );
1435 var badSpans = $(".not_holdable");
1437 $(badSpans).each(function() {
1438 var bibnum = $(this).attr("title");
1439 badBibs += bibnum + "/";
1442 $("#multi_hold_bibs").val(biblionumbers);
1443 $("#bad_bibs").val(badBibs);
1445 $('#hold-request-form').preventDoubleFormSubmit();
1450 $(document).ready(function() {
1451 $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1452 var itemnumber = this.value;
1455 switch (override_items[itemnumber].holdallowed) {
1456 case "not_allowed": msg = _("This item normally cannot be put on hold."); break;
1457 case "from_home_library": msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
1460 msg += "\n\n" + _("Place hold on this item?");
1462 return confirm(msg);
1464 $("button.warning").click(function() {
1465 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1467 $("#requestany").click(function() {
1469 $("input[name=checkitem]").each(function() {
1470 $(this).prop("checked", false);
1474 $("input[name=checkitem]").click(function() {
1476 $("input[name=checkitem]").each(function() {
1481 if(onechecked == 1){
1482 $("#requestany").prop("checked", false);
1483 $("#holds_to_place_count").prop('disabled', true);
1485 $("#requestany").prop("checked",true);
1486 $("#holds_to_place_count").prop('disabled', false);
1489 var prev_rank_request;
1490 $("select[name=rank-request]").on("focus", function() {
1491 prev_rank_request = $(this).val();
1492 var row = $(this).parents("tr:first");
1493 }).change(function() {
1494 var row = $(this).parents("tr:first");
1495 var value = parseInt($(this).val());
1496 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
1497 if( !isNaN(value) ) { //If moved to 'del'
1498 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)
1499 if (prev_rank_request > value) {
1500 row.insertBefore(after);
1502 row.insertAfter(after);
1506 var next_priority = 1;
1507 $("select[name=rank-request]").each(function () {
1508 if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
1509 $(this).val(next_priority);
1514 $(".clear-date").on("click",function(e){
1516 var fieldID = this.id.replace("clear-date-","");
1517 $("#" + fieldID).val("");
1520 // Confirm cancellation of hold
1522 $(".cancel-hold").on("click",function(e) {
1524 cancel_link = $(this);
1525 $('#cancelModal').modal();
1528 $("#cancelModalConfirmBtn").on("click",function(e) {
1529 let borrowernumber = cancel_link.data('borrowernumber');
1530 let biblionumber = cancel_link.data('biblionumber');
1531 let reserve_id = cancel_link.data('id');
1532 let reason = $("#modal-cancellation-reason").val();
1533 let link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`;
1535 link += "&cancellation-reason=" + reason
1537 window.location.href = link;
1541 [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems ) %]
1542 [% IF ( PatronAutoComplete ) %]
1543 $( "#patron" ).autocomplete({
1544 source: "/cgi-bin/koha/circ/ysearch.pl",
1546 select: function( event, ui ) {
1547 $( "#patron" ).val( ui.item.cardnumber );
1548 $( "#holds_patronsearch" ).submit();
1552 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
1553 return $( "<li></li>" )
1554 .data( "ui-autocomplete-item", item )
1557 + ( item.surname ? item.surname.escapeHtml() : "" )
1559 + ( item.firstname ? item.firstname.escapeHtml() : "" )
1560 + " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")"
1563 + ( item.address ? item.address.escapeHtml() : "" )
1565 + ( item.city ? item.city.escapeHtml() : "" )
1567 + ( item.zipcode ? item.zipcode.escapeHtml() : "" )
1569 + ( item.country ? item.country.escapeHtml() : "" )
1576 Sticky = $("#toolbar");
1578 stickTo: "#existing_holds",
1579 stickyClass: "floating"
1585 [% INCLUDE 'intranet-bottom.inc' %]