9 [% USE AuthorisedValues %]
11 [% USE TablesSettings %]
12 [% SET footerjs = 1 %]
13 [% INCLUDE 'doc-head-open.inc' %]
14 [% UNLESS ( multi_hold ) %]
15 <title>Place a hold on [% INCLUDE 'biblio-title-head.inc' %] › Holds › Circulation › Koha</title>
17 <title>Confirm holds › Holds › Circulation › Koha</title>
19 [% INCLUDE 'doc-head-close.inc' %]
22 <body id="circ_request" class="catalog">
24 [% INCLUDE 'header.inc' %]
25 [% INCLUDE 'circ-search.inc' %]
27 [% UNLESS ( multi_hold ) %]
28 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
31 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
34 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
37 [% INCLUDE 'biblio-title.inc' link =1 %]
40 <a href="#" aria-current="page">
47 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
50 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
53 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
56 <a href="#" aria-current="page">
62 [% END # UNLESS multi_hold %]
64 <div class="main container-fluid">
66 [% IF ( multi_hold ) # No sidebar menu when placing multiple holds %]
67 <div class="col-md-10 col-md-offset-1">
69 <div class="col-sm-10 col-sm-push-2">
75 <div class="dialog alert">
77 <strong>Cannot place hold:</strong> one or more records without items attached.
79 <strong>Cannot place hold:</strong> this record has no items attached.
84 [% IF ( messagetransfert ) %]
85 <div class="dialog message">
86 <h2>Hold found for ([% nextreservtitle | html %]), please transfer</h2>
87 <p>Hold placed by : <strong> [% nextreservsurname | html %] [% nextreservfirstname | html %]</strong> at : <strong> [% branchname | html %] </strong>, Please transfer this item.
89 <form name="cancelReservewithtransfert" action="branchreserves.pl" method="post">
90 <input type="submit" class="button" />
95 [% UNLESS ( multi_hold ) %]
96 <h1>Place a hold on [% INCLUDE 'biblio-title.inc' link = 1 %]</h1>
98 <h1>Confirm holds</h1>
101 [% UNLESS club OR patron OR patron.borrowernumber OR noitems %]
102 [% IF ( messageborrower ) %]
103 <div class="dialog alert">
104 <h3>Patron not found</h3>
105 <p>No patron with this name, please, try another</p>
109 [% IF ( messageclub ) %]
110 <div class="dialog alert">
111 <h3>Club not found</h3>
112 <p>No club with this name, please, try another</p>
115 <fieldset class="brief">
116 <label>Search patrons or clubs</label>
117 <div id="circ_holds_select" class="toptabs">
119 <li><a href="#holds_patronsearch_pane">Patrons</a></li>
120 <li><a href="#holds_clubsearch_pane">Clubs</a></li>
122 <div id="holds_patronsearch_pane">
123 <form id="holds_patronsearch" action="request.pl?biblionumbers=[% biblionumbers | html %]" method="post">
124 <div class="hint">Enter patron card number or partial name:</div>
125 <input type="text" size="40" id="patron" class="focus" name="findborrower" autocomplete="off" />
126 <input type="submit" value="Search" />
128 <input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
130 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
133 </form> <!-- /#holds_patronsearch -->
135 [% INCLUDE 'circ-patron-search-results.inc' destination = "holds" %]
138 <div id="holds_clubsearch_pane">
139 <form id="holds_clubsearch" action="request.pl?biblionumber=[% biblionumber | html %]" method="post">
140 <div class="hint">Enter club ID or partial name:</div>
141 <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" />
142 <input type="submit" value="Search" />
144 <input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
146 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
149 </form> <!-- /#holds_patronsearch -->
151 [% INCLUDE 'clubs-table.inc' destination = "holds" %]
157 <div class="dialog alert hide clubalert">
159 <fieldset class="rows">
160 <legend>Hold details</legend>
161 <form action="/api/v1/clubs/[% club.id | html %]/holds" method="post" name="form" id="club-request-form">
163 [% IF ( multi_hold ) %]
164 <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
165 <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
166 <input type="hidden" name="request" value="any"/>
167 [% FOREACH biblioloo IN biblioloop %]
168 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
169 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
172 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
173 <input type="hidden" name="title" value="[% biblio.title | html %]" />
174 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
175 [% END # /IF multi_hold %]
178 <span class="label">Club: </span> [% club.name | html %]
181 <span class="label">Description: </span> [% club.description | html %]
184 <label for="pickup">Pickup at:</label>
185 <select name="pickup" id="pickup">
186 [% PROCESS options_for_libraries libraries => Branches.all({ selected => club.branchcode, search_params => { pickup_location => 1 } }) %]
190 <label for="default_patron_home">Pickup at patron's home library when possible:</label>
191 <input type="checkbox" id="default_patron_home" name="default_patron_home"/>
194 <h2 style="padding: 0 1em;">Members</h2>
196 [% FOREACH member IN members %]
197 [% SET patron = member.patron %]
198 <li style="padding: 0.5em 1em;">
199 <div><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a></div>
200 [% IF member.exceeded_maxreserves %]
202 <i class="fa fa-error"></i>
203 <strong>Too many holds: </strong> Patron can only place a maximum of [% maxreserves | html %] total holds.
206 [% IF ( member.expiry ) %]
208 <i class="fa fa-warning"></i>
209 <strong>Account has expired</strong>
212 [% IF patron.is_debarred %]
214 <i class="fa fa-warning"></i>
215 <strong>Patron has restrictions</strong>
218 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
220 <i class="fa fa-warning"></i>
221 <strong>Patron has outstanding fines: [% member.amount_outstanding | $Price %]</strong>
225 [% IF ( member.diffbranch ) %]
227 <i class="fa fa-warning"></i>
228 <strong>Pickup library is different.</strong> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )
234 [% UNLESS ( multi_hold ) %]
235 <fieldset class="action">
236 <input type="submit" value="Place hold" />
239 <table id="requesttitles">
243 [% UNLESS ( item_level_itypes ) %]
249 [% FOREACH biblioloo IN biblioloop %]
250 [% IF ( biblioloo.warn ) %]
256 [% UNLESS ( biblioloo.warn ) %]
257 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
263 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
265 [% IF ( biblioloo.publicationyear ) %]
267 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
271 [% IF ( biblioloo.warn ) %]
272 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
275 [% UNLESS ( item_level_itypes ) %]
277 <img src="[% biblioloo.imageurl | html %]" alt="[% biblioloo.itypename | html %]" title="[% biblioloo.itypename | html %]" />
280 <td>[% biblioloo.rank | html %]</td>
282 [% IF ( biblioloo.checked_previously ) %]
283 <span>Patron has previously checked out this title</span><br/>
285 [% IF ( biblioloo.alreadyres ) %]
288 [% IF ( biblioloo.none_avail ) %]
293 [% IF ( biblioloo.alreadyres ) %]
295 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
296 <strong>already has a hold</strong> on this item
299 [% IF ( biblioloo.none_avail ) %]
300 <li> <strong>No items are available</strong> to be placed on hold</li>
303 [% IF ( biblioloo.alreadyres ) %]
306 [% IF ( biblioloo.none_avail ) %]
312 [% END # /FOREACH biblioloo %]
313 </table> <!-- /#requesttitles -->
317 [% ELSIF NOT noitems # /UNLESS patron %]
319 [% IF ( checked_previously && !multi_hold ) %]
320 <div class="dialog alert">
322 <li>Patron has previously checked out this title</li>
327 [% IF ( no_reserves_allowed || exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted ) %]
328 <div class="dialog alert">
330 [% UNLESS ( multi_hold ) %]
331 <h3>Cannot place hold</h3>
333 [% IF ( no_reserves_allowed ) %]
334 <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>
335 [% ELSIF ( exceeded_maxreserves ) %]
336 <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>
337 [% ELSIF ( exceeded_holds_per_record ) %]
338 <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>
339 [% ELSIF ( alreadypossession ) %]
340 <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>
341 [% ELSIF ( alreadyreserved ) %]
342 <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>
343 [% ELSIF ( ageRestricted ) %]
344 <li><strong>Age restricted</strong></li>
345 [% ELSIF ( none_available ) %]
346 <li> <strong>No items are available</strong> to be placed on hold.</li>
347 [% ELSIF ( maxreserves ) %]
348 <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>
349 [% END # /IF exceeded_maxreserves %]
351 [% ELSE # UNLESS multi_hold %]
352 <h3>Cannot place hold on some items</h3>
353 [% IF (no_reserves_allowed ) %]
354 <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>
355 [% ELSIF ( exceeded_maxreserves ) %]
356 <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>
357 [% ELSIF ( exceeded_holds_per_record ) %]
358 [% FOREACH biblioloo IN biblioloop %]
359 [% IF (biblioloo.tooManyHoldsForThisRecord) %]
360 <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>
363 [% END # /IF exceeded_maxreserves %]
364 [% END # /UNLESS multi_hold %]
366 [% END # /IF ( exceeded_maxreserves || ... %]
368 [% IF ( expiry || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
369 <div class="dialog message">
372 <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>
375 [% IF patron.is_debarred %]
376 <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>
379 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
380 <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>
383 [% IF ( diffbranch ) %]
384 <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>
386 </ul> <!-- /.dialog.message -->
388 [% END # /IF expiry || diffbranch ... %]
390 [% IF ( messageborrower ) %]
391 <div class="dialog alert">
392 <h3>Patron not found:</h3>
393 <p>Name or barcode not found. Please try an other </p>
397 <div class="dialog alert hide holdalert">
400 <fieldset class="rows">
401 <legend>Hold details</legend>
402 <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
404 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
405 <input type="hidden" name="type" value="str8" />
407 [% IF ( multi_hold ) %]
408 <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
409 <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
410 <input type="hidden" name="request" value="any"/>
411 [% FOREACH biblioloo IN biblioloop %]
412 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
413 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
416 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
417 <input type="hidden" name="title" value="[% biblio.title | html %]" />
418 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
419 [% END # /IF multi_hold %]
423 <span class="label">Patron:</span>
424 [% IF ( patron.borrowernumber ) %]
425 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a>
431 [% UNLESS ( multi_hold ) %]
433 <span class="label">Estimated priority:</span>
434 <strong>[% fixedRank | html %]</strong>
439 <label for="holdnotes">Notes:</label>
440 <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
443 <label for="pickup">Pickup at:</label>
444 [% UNLESS ( multi_hold ) %]
445 <select name="pickup" size="1" id="pickup" data-biblio-id="[% biblio.biblionumber | html %]" data-patron-id="[% patron.borrowernumber | html %]">
446 <option selected="selected" value="[% pickup | html %]">[% Branches.GetName(pickup) | html %]</option>
448 <select name="pickup" size="1" id="pickup" data-patron-id="[% patron.borrowernumber | html %]">
449 [% PROCESS options_for_libraries libraries => Branches.all({ selected => pickup, search_params => { pickup_location => 1 } }) %]
454 [% UNLESS ( multi_hold ) %]
455 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
457 <label for="itemtype">Request specific item type:</label>
458 <select name="itemtype" id="itemtype">
459 <option value="">Any item type</option>
460 [%- FOREACH itemtype IN available_itemtypes %]
461 <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
466 [% END # /UNLESS multi_hold %]
468 [% IF ( reserve_in_future ) %]
470 <label for="from">Hold starts on date:</label>
471 <input name="reserve_date" id="from" size="10" class="datepickerfrom" type="text" >
472 <input type="hidden" class="datepickerfrom_hidden" />
473 <a href="#" id="clear-date-from" class="clear-date">Clear date</a>
478 <label for="to">Hold expires on date:</label>
479 <input name="expiration_date" id="to" size="10" class="datepickerto" type="text" />
480 <input type="hidden" class="datepickerto_hidden" />
481 <a href="#" id="clear-date-to" class="clear-date">Clear date</a>
484 [% UNLESS ( multi_hold ) %]
486 <label for="requestany">Hold next available item </label>
487 [% IF force_hold_level == 'item' %]
488 <input type="checkbox" id="requestany" name="request" disabled="true" />
489 [% ELSIF force_hold_level == 'record' %]
490 <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
491 <input type="hidden" name="request" value="Any"/>
493 <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
495 <input type="hidden" name="biblioitem" value="[% biblioitemnumber | html %]" />
496 <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
499 [% IF remaining_holds_for_record > 1 %]
501 <label for="holds_to_place_count">Holds to place (count)</label>
502 <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" />
505 <input type="hidden" name="holds_to_place_count" value="1" />
507 [% END # /UNLESS multi_hold %]
509 <li id="non_priority_list_item">
510 <label for="non_priority">Non priority hold:</label>
511 <input name="non_priority" id="non_priority" type="checkbox" />
512 <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
516 [% UNLESS ( multi_hold ) %]
517 <fieldset class="action">
518 [% IF ( patron.borrowernumber ) %]
519 [% IF ( override_required ) %]
520 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
521 [% ELSIF ( none_available ) %]
522 <button type="submit" disabled="disabled" class="btn btn-default btn-disabled">Place hold</button>
524 <button type="submit" class="btn btn-default">Place hold</button>
529 [% FOREACH bibitemloo IN bibitemloop %]
531 [% UNLESS ( item_level_itypes ) %]
533 <span class="label">Item type:</span>
534 [% bibitemloo.description | html %]
538 [% IF ( bibitemloo.publicationyear ) %]
540 <span class="label">Publication year:</span>
541 [% bibitemloo.publicationyear | html %]
546 <h2 style="padding: 0 1em;">
547 Place a hold on a specific item
548 [% IF bibitemloo.force_hold_level == 'item' %]
549 <span class="error"><em>(Required)</em></span>
553 <table id="requestspecific">
557 [% IF ( item_level_itypes ) %]
561 <th>Home library</th>
562 <th>Last location</th>
563 [% IF itemdata_ccode %]
568 [% IF itemdata_enumchron %]
572 <th>Allowed pickup locations</th>
576 [% SET selected = 0 %]
577 [% FOREACH itemloo IN bibitemloo.itemloop %]
578 [% UNLESS ( itemloo.hide ) %]
579 <tr class="[% itemloo.backgroundcolor | html %]">
581 [% IF itemloo.force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
583 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
584 Hold must be record level
586 [% ELSIF ( itemloo.available ) %]
587 <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
588 [% ELSIF ( itemloo.override ) %]
589 <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
590 <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
593 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
594 [% IF itemloo.not_holdable %]
595 [% IF itemloo.not_holdable == 'damaged' %]
597 [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
599 [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
600 Exceeded max holds per record
601 [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
602 Daily hold limit reached for patron
603 [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
605 [% ELSIF itemloo.not_holdable == 'notReservable' %]
607 [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
608 Patron is from different library
609 [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
610 Cannot place hold from patron's library
611 [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
612 Patron already has hold for this item
613 [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
614 Cannot be transferred to pickup library
615 [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
616 Only pickup locations within the same hold group are allowed
617 [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
618 No reserves are allowed on this item
620 [% itemloo.not_holdable | html %]
624 [% END # /IF itemloo.force_hold_level %]
626 [% IF ( item_level_itypes ) %]
628 [% UNLESS ( noItemTypeImages ) %]
629 [% IF ( itemloo.imageurl ) %]<img src="[% itemloo.imageurl | html %]" alt="" /> <br /> [% END %]
631 [% itemloo.itypename | html %]
635 [% itemloo.barcode | html %]
638 [% Branches.GetName( itemloo.homebranch ) | html %]
641 [% Branches.GetName( itemloo.holdingbranch ) | html %]
643 [% IF itemdata_ccode %]
645 [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
649 [% itemloo.itemcallnumber | html %]
652 [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %]
654 [% IF itemdata_enumchron %]
656 [% itemloo.enumchron | html %]
659 [% IF ( itemloo.onloan ) %]
660 <td data-order="[% itemloo.date_due | html %]">
661 <span class="checkedout">Due [% itemloo.date_due | $KohaDates as_due_date => 1 %]</span>
664 [% IF ( itemloo.transfertwhen ) %]
665 In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
666 to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %]
670 [% IF ( itemloo.reservedate ) %]
671 [% IF ( itemloo.nocancel ) %]
672 Can't be cancelled when item is in transit
674 [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %]
675 [% IF ( itemloo.canreservefromotherbranches ) %]
676 for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedFor.borrowernumber | uri %]">[% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %]</a>
678 [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %]
679 [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since
680 [% IF ( itemloo.waitingdate ) %]
681 [% itemloo.waitingdate | $KohaDates %]
683 [% IF ( itemloo.reservedate ) %]
684 [% itemloo.reservedate | html %]
687 <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
688 [% END # /IF itemloo.nocancel %]
691 [% END # /IF itemloo.reservedate %]
693 [% IF itemloo.item_level_holds == "N" %]
694 <br/>Item level hold not allowed from OPAC
695 [% ELSIF itemloo.item_level_holds == "F" %]
696 <br/>Item level hold forced from OPAC
699 [% IF ( itemloo.itemlost ) %]
700 <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
703 [% IF ( itemloo.damaged ) %]
704 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
707 [% IF ( itemloo.withdrawn ) %]
708 <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
711 [% IF ( itemloo.notforloan ) %]
712 <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
716 [% IF itemloo.any_pickup_location %]
719 [% itemloo.pickup_locations | html %]
723 [% END # / UNLESS itemloo.hide %]
724 [% END # /FOREACH itemloo %]
726 </table> <!-- /#requestspecific -->
728 [% IF ( bibitemloo.hiddencount ) %]
730 <p class="hiddencount">
731 <a href="request.pl?biblionumber=[% bibitemloo.biblionumber | uri %]&borrowernumber=[% bibitemloo.borrowernumber | uri %]&showallitems=1">Show all items ([% bibitemloo.hiddencount | html %] hidden)</a>
734 [% END # /IF bibitemloo.hiddencount %]
735 [% END # /FOREACH bibitemloo %]
737 [% ELSE # /UNLESS multi_hold %]
739 <table id="requesttitles">
743 [% UNLESS ( item_level_itypes ) %]
749 [% FOREACH biblioloo IN biblioloop %]
750 [% IF ( biblioloo.warn ) %]
756 [% UNLESS ( biblioloo.warn ) %]
757 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
763 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
765 [% IF ( biblioloo.publicationyear ) %]
767 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
771 [% IF ( biblioloo.warn ) %]
772 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
775 [% UNLESS ( item_level_itypes ) %]
777 <img src="[% biblioloo.imageurl | html %]" alt="[% biblioloo.itypename | html %]" title="[% biblioloo.itypename | html %]" />
780 <td>[% biblioloo.rank | html %]</td>
782 [% IF ( biblioloo.checked_previously ) %]
783 <span>Patron has previously checked out this title</span><br/>
785 [% IF ( biblioloo.alreadyres ) %]
788 [% IF ( biblioloo.none_avail ) %]
793 [% IF ( biblioloo.alreadyres ) %]
795 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
796 <strong>already has a hold</strong> on this item
799 [% IF ( biblioloo.none_avail ) %]
800 <li> <strong>No items are available</strong> to be placed on hold</li>
803 [% IF ( biblioloo.alreadyres ) %]
806 [% IF ( biblioloo.none_avail ) %]
812 [% END # /FOREACH biblioloo %]
813 </table> <!-- /#requesttitles -->
815 [% END # /UNLESS multi_hold %]
817 <fieldset class="action">
818 [% IF ( patron AND patron.borrowernumber ) %]
819 [% IF ( override_required ) %]
820 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
821 [% ELSIF ( none_available ) %]
822 <button type="submit" disabled="disabled" class="btn btn-default btn-disabled">Place hold</button>
824 [% IF ( multi_hold ) %]
825 <button type="submit" class="btn btn-default" id="multi_hold_submit">Place hold</button>
827 <button type="submit" class="btn btn-default">Place hold</button>
830 [% END # /IF patron %]
831 </fieldset> <!-- /.action -->
832 </form> <!-- /#hold-request-form -->
833 </fieldset> <!-- /.rows -->
836 [% UNLESS ( patron ) %]
837 [% IF ( reserveloop ) %]
838 <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
839 [% IF ( multi_hold ) %]
840 <input type = "hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
843 <h2>Existing holds</h2>
844 <div id="toolbar" class="btn-toolbar">
845 <input type="submit" name="submit" value="Update hold(s)" />
846 <fieldset id="cancellation-reason-fieldset" class="action">
847 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
848 [% IF hold_cancellation %]
849 <label for="cancellation-reason">Cancellation reason: </label>
850 <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
851 <option value="">No reason given</option>
852 [% FOREACH reason IN hold_cancellation %]
853 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
860 [% FOREACH biblioloo IN biblioloop %]
861 [% IF ( biblioloo.reserveloop ) %]
862 [% IF ( multi_hold ) %]
864 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
865 [% biblioloo.title | html %]
870 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
871 [% SET branchcodes = [] %]
873 [% FOREACH h IN biblioloo.reserveloop %]
874 [% branchcodes.push( h.branchcode ) %]
876 [% branchcodes = branchcodes.unique %]
878 [% FOREACH b IN branchcodes.sort %]
879 [% SET holds_by_branch = [] %]
880 [% FOREACH h IN biblioloo.reserveloop %]
881 [% IF h.branchcode == b %]
882 [% holds_by_branch.push( h ) %]
886 <legend>[% Branches.GetName( b ) | html %]</legend>
887 [% INCLUDE holds_table.inc holds=holds_by_branch %]
889 [% END # /FOREACh b %]
890 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
891 [% SET itemtypes = [] %]
893 [% FOREACH h IN biblioloo.reserveloop %]
894 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
895 [% itemtypes.push( hold_itemtype ) %]
897 [% itemtypes = itemtypes.unique %]
899 [% FOREACH i IN itemtypes.sort %]
900 [% SET holds_by_itemtype = [] %]
901 [% FOREACH h IN biblioloo.reserveloop %]
902 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
903 [% IF hold_itemtype == i %]
904 [% holds_by_itemtype.push( h ) %]
910 <legend>[% ItemTypes.GetDescription( i ) | html %]</legend>
912 <legend>Any item type</legend>
914 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
916 [% END # /FOREACH i %]
917 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
918 [% SET branchcodes = [] %]
920 [% FOREACH h IN biblioloo.reserveloop %]
921 [% branchcodes.push( h.branchcode ) %]
923 [% branchcodes = branchcodes.unique %]
925 [% FOREACH b IN branchcodes.sort %]
927 <legend>[% Branches.GetName( b ) | html %]</legend>
928 [% SET holds_by_branch = [] %]
929 [% FOREACH h IN biblioloo.reserveloop %]
930 [% IF h.branchcode == b %]
931 [% holds_by_branch.push( h ) %]
935 [% SET itemtypes = [] %]
936 [% FOREACH h IN holds_by_branch %]
937 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
938 [% itemtypes.push( hold_itemtype ) %]
940 [% itemtypes = itemtypes.unique %]
942 [% FOREACH i IN itemtypes.sort %]
944 <h3>[% ItemTypes.GetDescription( i ) | html %]</h3>
946 <h3>Any item type</h3>
949 [% SET holds_by_itemtype = [] %]
950 [% FOREACH h IN holds_by_branch %]
951 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
952 [% IF hold_itemtype == i %]
953 [% holds_by_itemtype.push( h ) %]
956 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
959 [% END # /FOREACH b %]
961 [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
962 [% END # /IF HoldsSplitQueue %]
964 [% END # /IF biblioloo.reserveloop %]
965 [% END # FOREACH biblioloo %]
966 </fieldset> <!-- /.rows -->
967 </form> <!-- /name=TTime -->
968 [% END # IF reserveloop %]
969 [% END # UNLESS patron %]
973 [% IF ( multi_hold ) # No sidebar menu when placing multiple holds %]
974 </div> <!-- /.col-md-10.col-md-offset-1 -->
976 </div> <!-- /.col-sm-10.col-sm-push-2 -->
977 <div class="col-sm-2 col-sm-pull-10">
979 [% INCLUDE 'biblio-view-menu.inc' %]
981 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
983 </div> <!-- /.row -->
985 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
986 <div class="modal-dialog" role="document">
987 <div class="modal-content">
988 <div class="modal-header">
989 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
990 <h3>Confirm deletion</h3>
993 <div class="modal-body">
994 <p>Are you sure you want to cancel this hold?</p>
996 <fieldset class="action">
997 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
998 [% IF hold_cancellation %]
999 <label for="cancellation-reason">Cancellation reason: </label>
1000 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
1001 <option value="">No reason given</option>
1002 [% FOREACH reason IN hold_cancellation %]
1003 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1010 <div class="modal-footer">
1011 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
1012 <a href="#" data-dismiss="modal">Cancel</a>
1018 [% MACRO jsinclude BLOCK %]
1019 [% INCLUDE 'datatables.inc' %]
1020 [% INCLUDE 'calendar.inc' %]
1021 [% INCLUDE 'columns_settings.inc' %]
1022 [% Asset.js("lib/hc-sticky.js") | $raw %]
1023 [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1024 [% INCLUDE 'select2.inc' %]
1027 var biblionumber = "[% biblionumber | $raw %]";
1028 var borrowernumber = "[% patron.borrowernumber | $raw %]";
1029 var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1030 var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo IN bibitemloo.itemloop %][% IF ( itemloo.override ) %]
1031 [% itemloo.itemnumber | html %]: {
1032 homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1033 holdallowed: "[% itemloo.holdallowed | html %]"
1035 [% END %][% END %][% END %]
1037 var MSG_NO_ITEMS_AVAILABLE = _("A hold cannot be requested on any of these items.");
1039 damaged: _("Item damaged"),
1040 ageRestricted: _("Age restricted"),
1041 tooManyHoldsForThisRecord: _("Exceeded max holds per record"),
1042 tooManyReservesToday: _("Daily hold limit reached for patron"),
1043 tooManyReserves: _("Too many holds"),
1044 notReservable: _("Not holdable"),
1045 noReservesAllowed: _("No reserves allowed"),
1046 cannotReserveFromOtherBranches: _("Patron is from different library"),
1047 itemAlreadyOnHold: _("Patron already has hold for this item"),
1048 cannotBeTransferred: _("Cannot be transferred to pickup library"),
1049 pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed")
1051 columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
1052 $.fn.select2.defaults.set("width", "100%" );
1053 $.fn.select2.defaults.set("dropdownAutoWidth", true );
1055 $(document).ready(function() {
1056 $('#cancellation-reason-fieldset').hide();
1057 $('.rank-request').on('change', function() {
1058 if ( $(".rank-request option:selected[value='del']").length ) {
1059 $('#cancellation-reason-fieldset').show();
1061 $('#cancellation-reason-fieldset').hide();
1065 [% SET active = clubs ? 1 : 0 %]
1066 $('#circ_holds_select').tabs({
1067 active: [% active | $raw %],
1068 activate: function(){
1069 $(this).find("input.focus").focus();
1072 $(this).find("input.focus").focus();
1075 function ToggleHoldsToPlace() {
1076 if ( $("#requestany").prop('checked') ) {
1077 $("#holds_to_place_count").prop('disabled', false);
1079 $("#holds_to_place_count").prop('disabled', true);
1082 ToggleHoldsToPlace();
1083 $("#requestany").on('change', function(){
1084 ToggleHoldsToPlace();
1087 [% IF Koha.Preference('UseBranchTransferLimits') %]
1088 $("#pickup").on('change', function(){
1089 var pickup = $("#pickup").val();
1090 var url = "?pickup=" + pickup;
1091 url += "&borrowernumber=" + borrowernumber;
1092 url += "&biblionumber=" + biblionumber;
1093 window.location.replace(url);
1097 [% IF AutoResumeSuspendedHolds %]
1098 $(".suspend_until_datepicker, .datepickerfrom, .datepickerto").datepicker("option", "minDate", 1);
1101 $(".datepickerto").datepicker("option", "altField", ".datepickerto_hidden");
1102 $(".datepickerto").datepicker("option", "altFormat", "yy-mm-dd");
1104 $(".datepickerfrom").datepicker("option", "altField", ".datepickerfrom_hidden");
1105 $(".datepickerfrom").datepicker("option", "altFormat", "yy-mm-dd");
1107 var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1109 "sDom": '<"top pager"ilf>t',
1112 //Override fieldset styling for dataTables search box
1113 $("div.top.pager").css("margin-left","1em");
1114 $(".dataTables_filter label").css({
1116 "margin-right":"0em"
1119 $("#club-request-form").on("submit", function() {
1121 $('.clubalert, .holdalert').addClass('hide');
1122 let biblionumbers = [biblionumber];
1123 let biblionumbers_text;
1125 pickup_library_id: $('select[name="pickup"]').val()
1127 if($('input[name="checkitem"]:checked').length)
1128 data.item_id = $('input[name="checkitem"]:checked').val();
1129 if($('input[name="borrowernumber"]').length)
1130 data.patron_id = $('input[name="borrowernumber"]').val();
1131 if($('textarea[name="notes"]').length)
1132 data.notes = $('textarea[name="notes"]').val()||null;
1133 if($('.datepickerto_hidden').length)
1134 data.expiration_date = $('.datepickerto_hidden').val()||null;
1135 if($('.datepickerfrom_hidden').length)
1136 data.hold_date = $('.datepickerfrom_hidden').val()||null;
1137 if($('input[name="itemtype"]').length) {
1138 data.item_type = $('input[name="itemtype"]').val()||null;
1140 if($('input[name="default_patron_home"]:checked').length) {
1141 data.default_patron_home = 1;
1143 if($('input[name="biblionumbers"]').length) {
1144 biblionumbers_text = $('input[name="biblionumbers"]').val();
1145 biblionumbers = biblionumbers_text.replace(/\/$/, '').split('/')
1148 const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1;
1149 biblionumbers.forEach(function(biblionumber) {
1150 data.biblio_id = biblionumber;
1152 url: $t.attr('action'),
1153 method: $t.attr('method').toUpperCase(),
1154 contentType: 'application/json',
1155 data: JSON.stringify(data)
1157 for(let i = 0; i < count; i++) {
1159 .then(function(result) {
1160 let url = 'request.pl?biblionumber='+biblionumber;
1161 if(biblionumbers_text) {
1162 url = 'request.pl?biblionumbers='+biblionumbers_text;
1164 document.location = url;
1166 .fail(function(err) {
1167 var message = err.responseJSON.error;
1168 var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/);
1169 if(match && ERROR_MAP[match[1]]) {
1170 message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>'
1172 $('.clubalert, .holdalert').removeClass('hide').html(message);
1180 [% UNLESS ( multi_hold ) %]
1181 $("#hold-request-form").on("submit", function(){
1185 $("#hold-request-form").on("submit", function(){
1186 return checkMultiHold();
1190 function display_pickup_location (state) {
1192 if ( state.needs_override === true ) {
1194 '<span>' + state.text + '</span> <span style="float:right;" title="' +
1195 _("This pickup location is not allowed according to circulation rules") +
1196 '"><i class="fa fa-exclamation-circle" aria-hidden="true"></i></span>'
1200 $text = $('<span>'+state.text+'</span>');
1206 $(".pickup_location_dropdown").each( function () {
1207 var this_dropdown = $(this);
1208 var hold_id = $(this).data('hold_id');
1210 this_dropdown.select2({
1213 url: '/api/v1/holds/' + encodeURIComponent(hold_id) + '/pickup_locations',
1214 delay: 300, // wait 300 milliseconds before triggering the request
1216 data: function (params) {
1217 var search_term = (params.term === undefined) ? '' : params.term;
1219 "q": JSON.stringify({"name":{"-like":search_term+'%'}}),
1224 processResults: function (data) {
1226 data.forEach( function ( pickup_location ) {
1229 "id": pickup_location.library_id.escapeHtml(),
1230 "text": pickup_location.name.escapeHtml(),
1231 "needs_override": pickup_location.needs_override
1235 return { "results": results };
1238 templateResult: display_pickup_location
1241 $("#pickup").each( function () {
1242 var this_dropdown = $(this);
1243 var patron_id = $(this).data('patron-id');
1244 var biblio_id = $(this).data('biblio-id');
1246 this_dropdown.select2({
1250 url: '/api/v1/biblios/' + encodeURIComponent(biblio_id) + '/pickup_locations',
1251 delay: 300, // wait 300 milliseconds before triggering the request
1253 data: function (params) {
1254 var search_term = (params.term === undefined) ? '' : params.term;
1256 "q": JSON.stringify({"name":{"-like":search_term+'%'}}),
1257 "_order_by": "name",
1258 "patron_id": patron_id
1262 processResults: function (data) {
1264 data.forEach( function ( pickup_location ) {
1267 "id": pickup_location.library_id.escapeHtml(),
1268 "text": pickup_location.name.escapeHtml(),
1269 "needs_override": pickup_location.needs_override
1273 return { "results": results };
1276 templateResult: display_pickup_location
1283 var count_reserv = 0;
1285 // check if we have checkitem form
1286 if (document.form.checkitem){
1287 for (i=0;i<document.form.checkitem.length;i++){
1288 if (document.form.checkitem[i].checked == true) {
1292 // for only one item, check the checkitem without consider the loop checkitem
1294 if (document.form.checkitem.checked == true) {
1300 if (document.form.requestany.checked == true){
1304 if (count_reserv == "0"){
1305 msg += (_("- Please select an item to place a hold") + "\n");
1309 $('#hold-request-form').preventDoubleFormSubmit();
1317 function checkMultiHold() {
1318 var spans = $(".multi_hold_item_checkbox:checked");
1319 if ($(spans).size() == 0) {
1320 alert(MSG_NO_ITEMS_AVAILABLE);
1324 var biblionumbers = "";
1325 $(spans).each(function() {
1326 var bibnum = $(this).attr("title");
1327 biblionumbers += bibnum + "/";
1330 var badSpans = $(".not_holdable");
1332 $(badSpans).each(function() {
1333 var bibnum = $(this).attr("title");
1334 badBibs += bibnum + "/";
1337 $("#multi_hold_bibs").val(biblionumbers);
1338 $("#bad_bibs").val(badBibs);
1340 $('#hold-request-form').preventDoubleFormSubmit();
1345 $(document).ready(function() {
1346 $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1347 var itemnumber = this.value;
1350 switch (override_items[itemnumber].holdallowed) {
1351 case "not_allowed": msg = _("This item normally cannot be put on hold."); break;
1352 case "from_home_library": msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
1355 msg += "\n\n" + _("Place hold on this item?");
1357 return confirm(msg);
1359 $("button.warning").click(function() {
1360 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1362 $("#requestany").click(function() {
1364 $("input[name=checkitem]").each(function() {
1365 $(this).prop("checked", false);
1369 $("input[name=checkitem]").click(function() {
1371 $("input[name=checkitem]").each(function() {
1376 if(onechecked == 1){
1377 $("#requestany").prop("checked", false);
1378 $("#holds_to_place_count").prop('disabled', true);
1380 $("#requestany").prop("checked",true);
1381 $("#holds_to_place_count").prop('disabled', false);
1384 var prev_rank_request;
1385 $("select[name=rank-request]").on("focus", function() {
1386 prev_rank_request = $(this).val();
1387 var row = $(this).parents("tr:first");
1388 }).change(function() {
1389 var row = $(this).parents("tr:first");
1390 var value = parseInt($(this).val());
1391 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
1392 if( !isNaN(value) ) { //If moved to 'del'
1393 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)
1394 if (prev_rank_request > value) {
1395 row.insertBefore(after);
1397 row.insertAfter(after);
1401 var next_priority = 1;
1402 $("select[name=rank-request]").each(function () {
1403 if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
1404 $(this).val(next_priority);
1409 $(".clear-date").on("click",function(e){
1411 var fieldID = this.id.replace("clear-date-","");
1412 $("#" + fieldID).val("");
1415 // Confirm cancellation of hold
1417 $(".cancel-hold").on("click",function(e) {
1419 cancel_link = $(this);
1420 $('#cancelModal').modal();
1423 $("#cancelModalConfirmBtn").on("click",function(e) {
1424 let borrowernumber = cancel_link.data('borrowernumber');
1425 let biblionumber = cancel_link.data('biblionumber');
1426 let reserve_id = cancel_link.data('id');
1427 let reason = $("#modal-cancellation-reason").val();
1428 let link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`;
1430 link += "&cancellation-reason=" + reason
1432 window.location.href = link;
1436 [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems ) %]
1437 [% IF ( PatronAutoComplete ) %]
1438 $( "#patron" ).autocomplete({
1439 source: "/cgi-bin/koha/circ/ysearch.pl",
1441 select: function( event, ui ) {
1442 $( "#patron" ).val( ui.item.cardnumber );
1443 $( "#holds_patronsearch" ).submit();
1447 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
1448 return $( "<li></li>" )
1449 .data( "ui-autocomplete-item", item )
1452 + ( item.surname ? item.surname.escapeHtml() : "" )
1454 + ( item.firstname ? item.firstname.escapeHtml() : "" )
1455 + " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")"
1458 + ( item.address ? item.address.escapeHtml() : "" )
1460 + ( item.city ? item.city.escapeHtml() : "" )
1462 + ( item.zipcode ? item.zipcode.escapeHtml() : "" )
1464 + ( item.country ? item.country.escapeHtml() : "" )
1471 Sticky = $("#toolbar");
1473 stickTo: "#existing_holds",
1474 stickyClass: "floating"
1480 [% INCLUDE 'intranet-bottom.inc' %]