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[% IF clubcount %] or clubs[% END %]</label>
117 <div id="circ_holds_select" class="toptabs">
119 <li><a href="#holds_patronsearch_pane">Patrons</a></li>
121 <li><a href="#holds_clubsearch_pane">Clubs</a></li>
124 <div id="holds_patronsearch_pane">
125 <form id="holds_patronsearch" action="request.pl?biblionumbers=[% biblionumbers | html %]" method="post">
126 <div class="hint">Enter patron card number or partial name:</div>
127 <input type="text" size="40" id="patron" class="focus" name="findborrower" autocomplete="off" />
128 <input type="submit" value="Search" />
130 <input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
132 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
135 </form> <!-- /#holds_patronsearch -->
137 [% INCLUDE 'circ-patron-search-results.inc' destination = "holds" %]
141 <div id="holds_clubsearch_pane">
142 <form id="holds_clubsearch" action="request.pl?biblionumber=[% biblionumber | html %]" method="post">
143 <div class="hint">Enter club ID or partial name:</div>
144 <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" />
145 <input type="submit" value="Search" />
147 <input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
149 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
152 </form> <!-- /#holds_patronsearch -->
154 [% INCLUDE 'clubs-table.inc' destination = "holds" %]
161 <div class="dialog alert hide clubalert">
163 <fieldset class="rows">
164 <legend>Hold details</legend>
165 <form action="/api/v1/clubs/[% club.id | html %]/holds" method="post" name="form" id="club-request-form">
167 [% IF ( multi_hold ) %]
168 <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
169 <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
170 <input type="hidden" name="request" value="any"/>
171 [% FOREACH biblioloo IN biblioloop %]
172 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
173 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
176 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
177 <input type="hidden" name="title" value="[% biblio.title | html %]" />
178 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
179 [% END # /IF multi_hold %]
182 <span class="label">Club: </span> [% club.name | html %]
185 <span class="label">Description: </span> [% club.description | html %]
188 <label for="pickup">Pickup at:</label>
189 <select name="pickup" id="pickup">
190 [% PROCESS options_for_libraries libraries => Branches.all({ selected => club.branchcode, search_params => { pickup_location => 1 } }) %]
194 <label for="default_patron_home">Pickup at patron's home library when possible:</label>
195 <input type="checkbox" id="default_patron_home" name="default_patron_home"/>
198 <h2 style="padding: 0 1em;">Members</h2>
200 [% FOREACH member IN members %]
201 [% SET patron = member.patron %]
202 <li style="padding: 0.5em 1em;">
203 <div><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a></div>
204 [% IF member.exceeded_maxreserves %]
206 <i class="fa fa-error"></i>
207 <strong>Too many holds: </strong> Patron can only place a maximum of [% maxreserves | html %] total holds.
210 [% IF ( member.expiry ) %]
212 <i class="fa fa-warning"></i>
213 <strong>Account has expired</strong>
216 [% IF patron.is_debarred %]
218 <i class="fa fa-warning"></i>
219 <strong>Patron has restrictions</strong>
222 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
224 <i class="fa fa-warning"></i>
225 <strong>Patron has outstanding fines: [% member.amount_outstanding | $Price %]</strong>
229 [% IF ( member.diffbranch ) %]
231 <i class="fa fa-warning"></i>
232 <strong>Pickup library is different.</strong> Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )
238 [% UNLESS ( multi_hold ) %]
239 <fieldset class="action">
240 <input type="submit" value="Place hold" />
243 <table id="requesttitles">
247 [% UNLESS ( item_level_itypes ) %]
253 [% FOREACH biblioloo IN biblioloop %]
254 [% IF ( biblioloo.warn ) %]
260 [% UNLESS ( biblioloo.warn ) %]
261 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
267 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
269 [% IF ( biblioloo.publicationyear ) %]
271 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
275 [% IF ( biblioloo.warn ) %]
276 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
279 [% UNLESS ( item_level_itypes ) %]
281 <img src="[% biblioloo.imageurl | html %]" alt="[% biblioloo.itypename | html %]" title="[% biblioloo.itypename | html %]" />
284 <td>[% biblioloo.rank | html %]</td>
286 [% IF ( biblioloo.checked_previously ) %]
287 <span>Patron has previously checked out this title</span><br/>
289 [% IF ( biblioloo.alreadyres ) %]
292 [% IF ( biblioloo.none_avail ) %]
297 [% IF ( biblioloo.alreadyres ) %]
299 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
300 <strong>already has a hold</strong> on this item
303 [% IF ( biblioloo.none_avail ) %]
304 <li> <strong>No items are available</strong> to be placed on hold</li>
307 [% IF ( biblioloo.alreadyres ) %]
310 [% IF ( biblioloo.none_avail ) %]
316 [% END # /FOREACH biblioloo %]
317 </table> <!-- /#requesttitles -->
321 [% ELSIF NOT noitems # /UNLESS patron %]
323 [% IF ( checked_previously && !multi_hold ) %]
324 <div class="dialog alert">
326 <li>Patron has previously checked out this title</li>
331 [% IF ( no_reserves_allowed || exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted ) %]
332 <div class="dialog alert">
334 [% UNLESS ( multi_hold ) %]
335 <h3>Cannot place hold</h3>
337 [% IF ( no_reserves_allowed ) %]
338 <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>
339 [% ELSIF ( exceeded_maxreserves ) %]
340 <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>
341 [% ELSIF ( exceeded_holds_per_record ) %]
342 <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>
343 [% ELSIF ( alreadypossession ) %]
344 <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>
345 [% ELSIF ( alreadyreserved ) %]
346 <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>
347 [% ELSIF ( ageRestricted ) %]
348 <li><strong>Age restricted</strong></li>
349 [% ELSIF ( none_available ) %]
350 <li> <strong>No items are available</strong> to be placed on hold.</li>
351 [% ELSIF ( maxreserves ) %]
352 <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>
353 [% END # /IF exceeded_maxreserves %]
355 [% ELSE # UNLESS multi_hold %]
356 <h3>Cannot place hold on some items</h3>
357 [% IF (no_reserves_allowed ) %]
358 <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>
359 [% ELSIF ( exceeded_maxreserves ) %]
360 <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>
361 [% ELSIF ( exceeded_holds_per_record ) %]
362 [% FOREACH biblioloo IN biblioloop %]
363 [% IF (biblioloo.tooManyHoldsForThisRecord) %]
364 <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>
367 [% END # /IF exceeded_maxreserves %]
368 [% END # /UNLESS multi_hold %]
370 [% END # /IF ( exceeded_maxreserves || ... %]
372 [% IF ( expiry || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
373 <div class="dialog message">
376 <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>
379 [% IF patron.is_debarred %]
380 <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>
383 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
384 <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>
387 [% IF ( diffbranch ) %]
388 <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>
390 </ul> <!-- /.dialog.message -->
392 [% END # /IF expiry || diffbranch ... %]
394 [% IF ( messageborrower ) %]
395 <div class="dialog alert">
396 <h3>Patron not found:</h3>
397 <p>Name or barcode not found. Please try an other </p>
401 <div class="dialog alert hide holdalert">
404 <fieldset class="rows">
405 <legend>Hold details</legend>
406 <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
408 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
409 <input type="hidden" name="type" value="str8" />
411 [% IF ( multi_hold ) %]
412 <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
413 <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
414 <input type="hidden" name="request" value="any"/>
415 [% FOREACH biblioloo IN biblioloop %]
416 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
417 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
420 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
421 <input type="hidden" name="title" value="[% biblio.title | html %]" />
422 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
423 [% END # /IF multi_hold %]
427 <span class="label">Patron:</span>
428 [% IF ( patron.borrowernumber ) %]
429 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a>
435 [% UNLESS ( multi_hold ) %]
437 <span class="label">Estimated priority:</span>
438 <strong>[% fixedRank | html %]</strong>
443 <label for="holdnotes">Notes:</label>
444 <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
447 <label for="pickup">Pickup at:</label>
448 [% UNLESS ( multi_hold ) %]
449 <select name="pickup" id="pickup" data-biblio-id="[% biblio.biblionumber | html %]" data-patron-id="[% patron.borrowernumber | html %]">
450 [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
452 <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
453 [% PROCESS options_for_libraries libraries => Branches.all({ selected => pickup, search_params => { pickup_location => 1 } }) %]
458 [% UNLESS ( multi_hold ) %]
459 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
461 <label for="itemtype">Request specific item type:</label>
462 <select name="itemtype" id="itemtype">
463 <option value="">Any item type</option>
464 [%- FOREACH itemtype IN available_itemtypes %]
465 <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
470 [% END # /UNLESS multi_hold %]
472 [% IF ( reserve_in_future ) %]
474 <label for="from">Hold starts on date:</label>
475 <input name="reserve_date" id="from" size="10" class="datepickerfrom" type="text" >
476 <input type="hidden" class="datepickerfrom_hidden" />
477 <a href="#" id="clear-date-from" class="clear-date">Clear date</a>
482 <label for="to">Hold expires on date:</label>
483 <input name="expiration_date" id="to" size="10" class="datepickerto" type="text" />
484 <input type="hidden" class="datepickerto_hidden" />
485 <a href="#" id="clear-date-to" class="clear-date">Clear date</a>
488 [% UNLESS ( multi_hold ) %]
490 <label for="requestany">Hold next available item </label>
491 [% IF force_hold_level == 'item' %]
492 <input type="checkbox" id="requestany" name="request" disabled="true" />
493 [% ELSIF force_hold_level == 'record' %]
494 <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
495 <input type="hidden" name="request" value="Any"/>
497 <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
499 <input type="hidden" name="biblioitem" value="[% biblioitemnumber | html %]" />
500 <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
503 [% IF remaining_holds_for_record > 1 %]
505 <label for="holds_to_place_count">Holds to place (count)</label>
506 <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" />
509 <input type="hidden" name="holds_to_place_count" value="1" />
511 [% END # /UNLESS multi_hold %]
513 <li id="non_priority_list_item">
514 <label for="non_priority">Non priority hold:</label>
515 <input name="non_priority" id="non_priority" type="checkbox" />
516 <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
520 [% UNLESS ( multi_hold ) %]
521 <fieldset class="action">
522 [% IF ( patron.borrowernumber ) %]
523 [% IF ( override_required ) %]
524 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
525 [% ELSIF ( none_available ) %]
526 <button type="submit" disabled="disabled" class="btn btn-default btn-disabled">Place hold</button>
528 <button type="submit" class="btn btn-default">Place hold</button>
533 [% FOREACH bibitemloo IN bibitemloop %]
535 [% UNLESS ( item_level_itypes ) %]
537 <span class="label">Item type:</span>
538 [% bibitemloo.description | html %]
542 [% IF ( bibitemloo.publicationyear ) %]
544 <span class="label">Publication year:</span>
545 [% bibitemloo.publicationyear | html %]
550 <h2 style="padding: 0 1em;">
551 Place a hold on a specific item
552 [% IF bibitemloo.force_hold_level == 'item' %]
553 <span class="error"><em>(Required)</em></span>
557 <table id="requestspecific">
561 [% IF ( item_level_itypes ) %]
565 <th>Home library</th>
566 <th>Last location</th>
567 [% IF itemdata_ccode %]
572 [% IF itemdata_enumchron %]
576 <th>Allowed pickup locations</th>
580 [% SET selected = 0 %]
581 [% FOREACH itemloo IN bibitemloo.itemloop %]
582 [% UNLESS ( itemloo.hide ) %]
583 <tr class="[% itemloo.backgroundcolor | html %]">
585 [% IF itemloo.force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
587 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
588 Hold must be record level
590 [% ELSIF ( itemloo.available ) %]
591 <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
592 [% ELSIF ( itemloo.override ) %]
593 <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
594 <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
597 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
598 [% IF itemloo.not_holdable %]
599 [% IF itemloo.not_holdable == 'damaged' %]
601 [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
603 [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
604 Exceeded max holds per record
605 [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
606 Daily hold limit reached for patron
607 [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
609 [% ELSIF itemloo.not_holdable == 'notReservable' %]
611 [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
612 Patron is from different library
613 [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
614 Cannot place hold from patron's library
615 [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
616 Patron already has hold for this item
617 [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
618 Cannot be transferred to pickup library
619 [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
620 Only pickup locations within the same hold group are allowed
621 [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
622 No reserves are allowed on this item
624 [% itemloo.not_holdable | html %]
628 [% END # /IF itemloo.force_hold_level %]
630 [% IF ( item_level_itypes ) %]
632 [% UNLESS ( noItemTypeImages ) %]
633 [% IF ( itemloo.imageurl ) %]<img src="[% itemloo.imageurl | html %]" alt="" /> <br /> [% END %]
635 [% itemloo.itypename | html %]
639 [% itemloo.barcode | html %]
642 [% Branches.GetName( itemloo.homebranch ) | html %]
645 [% Branches.GetName( itemloo.holdingbranch ) | html %]
647 [% IF itemdata_ccode %]
649 [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
653 [% itemloo.itemcallnumber | html %]
656 [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %]
658 [% IF itemdata_enumchron %]
660 [% itemloo.enumchron | html %]
663 [% IF ( itemloo.onloan ) %]
664 <td data-order="[% itemloo.date_due | html %]">
665 <span class="checkedout">Due [% itemloo.date_due | $KohaDates as_due_date => 1 %]</span>
668 [% IF ( itemloo.transfertwhen ) %]
669 In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
670 to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %]
674 [% IF ( itemloo.reservedate ) %]
675 [% IF ( itemloo.nocancel ) %]
676 Can't be cancelled when item is in transit
678 [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %]
679 [% IF ( itemloo.canreservefromotherbranches ) %]
680 for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedFor.borrowernumber | uri %]">[% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %]</a>
682 [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %]
683 [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since
684 [% IF ( itemloo.waitingdate ) %]
685 [% itemloo.waitingdate | $KohaDates %]
687 [% IF ( itemloo.reservedate ) %]
688 [% itemloo.reservedate | html %]
691 <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
692 [% END # /IF itemloo.nocancel %]
695 [% END # /IF itemloo.reservedate %]
697 [% IF itemloo.item_level_holds == "N" %]
698 <br/>Item level hold not allowed from OPAC
699 [% ELSIF itemloo.item_level_holds == "F" %]
700 <br/>Item level hold forced from OPAC
703 [% IF ( itemloo.itemlost ) %]
704 <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
707 [% IF ( itemloo.damaged ) %]
708 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
711 [% IF ( itemloo.withdrawn ) %]
712 <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
715 [% IF ( itemloo.notforloan ) %]
716 <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
720 [% IF itemloo.any_pickup_location %]
723 [% itemloo.pickup_locations | html %]
727 [% END # / UNLESS itemloo.hide %]
728 [% END # /FOREACH itemloo %]
730 </table> <!-- /#requestspecific -->
732 [% IF ( bibitemloo.hiddencount ) %]
734 <p class="hiddencount">
735 <a href="request.pl?biblionumber=[% bibitemloo.biblionumber | uri %]&borrowernumber=[% bibitemloo.borrowernumber | uri %]&showallitems=1">Show all items ([% bibitemloo.hiddencount | html %] hidden)</a>
738 [% END # /IF bibitemloo.hiddencount %]
739 [% END # /FOREACH bibitemloo %]
741 [% ELSE # /UNLESS multi_hold %]
743 <table id="requesttitles">
747 [% UNLESS ( item_level_itypes ) %]
753 [% FOREACH biblioloo IN biblioloop %]
754 [% IF ( biblioloo.warn ) %]
760 [% UNLESS ( biblioloo.warn ) %]
761 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
767 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
769 [% IF ( biblioloo.publicationyear ) %]
771 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
775 [% IF ( biblioloo.warn ) %]
776 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
779 [% UNLESS ( item_level_itypes ) %]
781 <img src="[% biblioloo.imageurl | html %]" alt="[% biblioloo.itypename | html %]" title="[% biblioloo.itypename | html %]" />
784 <td>[% biblioloo.rank | html %]</td>
786 [% IF ( biblioloo.checked_previously ) %]
787 <span>Patron has previously checked out this title</span><br/>
789 [% IF ( biblioloo.alreadyres ) %]
792 [% IF ( biblioloo.none_avail ) %]
797 [% IF ( biblioloo.alreadyres ) %]
799 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
800 <strong>already has a hold</strong> on this item
803 [% IF ( biblioloo.none_avail ) %]
804 <li> <strong>No items are available</strong> to be placed on hold</li>
807 [% IF ( biblioloo.alreadyres ) %]
810 [% IF ( biblioloo.none_avail ) %]
816 [% END # /FOREACH biblioloo %]
817 </table> <!-- /#requesttitles -->
819 [% END # /UNLESS multi_hold %]
821 <fieldset class="action">
822 [% IF ( patron AND patron.borrowernumber ) %]
823 [% IF ( override_required ) %]
824 <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
825 [% ELSIF ( none_available ) %]
826 <button type="submit" disabled="disabled" class="btn btn-default btn-disabled">Place hold</button>
828 [% IF ( multi_hold ) %]
829 <button type="submit" class="btn btn-default" id="multi_hold_submit">Place hold</button>
831 <button type="submit" class="btn btn-default">Place hold</button>
834 [% END # /IF patron %]
835 </fieldset> <!-- /.action -->
836 </form> <!-- /#hold-request-form -->
837 </fieldset> <!-- /.rows -->
840 [% UNLESS ( patron ) %]
841 [% IF ( reserveloop ) %]
842 <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
843 [% IF ( multi_hold ) %]
844 <input type = "hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
847 <h2>Existing holds</h2>
848 <div id="toolbar" class="btn-toolbar">
849 <input type="submit" name="submit" value="Update hold(s)" />
850 <fieldset id="cancellation-reason-fieldset" class="action">
851 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
852 [% IF hold_cancellation %]
853 <label for="cancellation-reason">Cancellation reason: </label>
854 <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason">
855 <option value="">No reason given</option>
856 [% FOREACH reason IN hold_cancellation %]
857 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
864 [% FOREACH biblioloo IN biblioloop %]
865 [% IF ( biblioloo.reserveloop ) %]
866 [% IF ( multi_hold ) %]
868 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
869 [% biblioloo.title | html %]
874 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
875 [% SET branchcodes = [] %]
877 [% FOREACH h IN biblioloo.reserveloop %]
878 [% branchcodes.push( h.branchcode ) %]
880 [% branchcodes = branchcodes.unique %]
882 [% FOREACH b IN branchcodes.sort %]
883 [% SET holds_by_branch = [] %]
884 [% FOREACH h IN biblioloo.reserveloop %]
885 [% IF h.branchcode == b %]
886 [% holds_by_branch.push( h ) %]
890 <legend>[% Branches.GetName( b ) | html %]</legend>
891 [% INCLUDE holds_table.inc holds=holds_by_branch %]
893 [% END # /FOREACh b %]
894 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
895 [% SET itemtypes = [] %]
897 [% FOREACH h IN biblioloo.reserveloop %]
898 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
899 [% itemtypes.push( hold_itemtype ) %]
901 [% itemtypes = itemtypes.unique %]
903 [% FOREACH i IN itemtypes.sort %]
904 [% SET holds_by_itemtype = [] %]
905 [% FOREACH h IN biblioloo.reserveloop %]
906 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
907 [% IF hold_itemtype == i %]
908 [% holds_by_itemtype.push( h ) %]
914 <legend>[% ItemTypes.GetDescription( i ) | html %]</legend>
916 <legend>Any item type</legend>
918 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
920 [% END # /FOREACH i %]
921 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
922 [% SET branchcodes = [] %]
924 [% FOREACH h IN biblioloo.reserveloop %]
925 [% branchcodes.push( h.branchcode ) %]
927 [% branchcodes = branchcodes.unique %]
929 [% FOREACH b IN branchcodes.sort %]
931 <legend>[% Branches.GetName( b ) | html %]</legend>
932 [% SET holds_by_branch = [] %]
933 [% FOREACH h IN biblioloo.reserveloop %]
934 [% IF h.branchcode == b %]
935 [% holds_by_branch.push( h ) %]
939 [% SET itemtypes = [] %]
940 [% FOREACH h IN holds_by_branch %]
941 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
942 [% itemtypes.push( hold_itemtype ) %]
944 [% itemtypes = itemtypes.unique %]
946 [% FOREACH i IN itemtypes.sort %]
948 <h3>[% ItemTypes.GetDescription( i ) | html %]</h3>
950 <h3>Any item type</h3>
953 [% SET holds_by_itemtype = [] %]
954 [% FOREACH h IN holds_by_branch %]
955 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
956 [% IF hold_itemtype == i %]
957 [% holds_by_itemtype.push( h ) %]
960 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
963 [% END # /FOREACH b %]
965 [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
966 [% END # /IF HoldsSplitQueue %]
968 [% END # /IF biblioloo.reserveloop %]
969 [% END # FOREACH biblioloo %]
970 </fieldset> <!-- /.rows -->
971 </form> <!-- /name=TTime -->
972 [% END # IF reserveloop %]
973 [% END # UNLESS patron %]
977 [% IF ( multi_hold ) # No sidebar menu when placing multiple holds %]
978 </div> <!-- /.col-md-10.col-md-offset-1 -->
980 </div> <!-- /.col-sm-10.col-sm-push-2 -->
981 <div class="col-sm-2 col-sm-pull-10">
983 [% INCLUDE 'biblio-view-menu.inc' %]
985 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
987 </div> <!-- /.row -->
989 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
990 <div class="modal-dialog" role="document">
991 <div class="modal-content">
992 <div class="modal-header">
993 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
994 <h3>Confirm deletion</h3>
997 <div class="modal-body">
998 <p>Are you sure you want to cancel this hold?</p>
1000 <fieldset class="action">
1001 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1002 [% IF hold_cancellation %]
1003 <label for="cancellation-reason">Cancellation reason: </label>
1004 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
1005 <option value="">No reason given</option>
1006 [% FOREACH reason IN hold_cancellation %]
1007 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1014 <div class="modal-footer">
1015 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
1016 <a href="#" data-dismiss="modal">Cancel</a>
1022 [% MACRO jsinclude BLOCK %]
1023 [% INCLUDE 'datatables.inc' %]
1024 [% INCLUDE 'calendar.inc' %]
1025 [% INCLUDE 'columns_settings.inc' %]
1026 [% Asset.js("lib/hc-sticky.js") | $raw %]
1027 [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1028 [% INCLUDE 'select2.inc' %]
1031 var biblionumber = "[% biblionumber | $raw %]";
1032 var borrowernumber = "[% patron.borrowernumber | $raw %]";
1033 var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1034 var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo IN bibitemloo.itemloop %][% IF ( itemloo.override ) %]
1035 [% itemloo.itemnumber | html %]: {
1036 homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1037 holdallowed: "[% itemloo.holdallowed | html %]"
1039 [% END %][% END %][% END %]
1041 var MSG_NO_ITEMS_AVAILABLE = _("A hold cannot be requested on any of these items.");
1043 damaged: _("Item damaged"),
1044 ageRestricted: _("Age restricted"),
1045 tooManyHoldsForThisRecord: _("Exceeded max holds per record"),
1046 tooManyReservesToday: _("Daily hold limit reached for patron"),
1047 tooManyReserves: _("Too many holds"),
1048 notReservable: _("Not holdable"),
1049 noReservesAllowed: _("No reserves allowed"),
1050 cannotReserveFromOtherBranches: _("Patron is from different library"),
1051 itemAlreadyOnHold: _("Patron already has hold for this item"),
1052 cannotBeTransferred: _("Cannot be transferred to pickup library"),
1053 pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed")
1055 columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
1056 $.fn.select2.defaults.set("width", "100%" );
1057 $.fn.select2.defaults.set("dropdownAutoWidth", true );
1059 $(document).ready(function() {
1060 $('#cancellation-reason-fieldset').hide();
1061 $('.rank-request').on('change', function() {
1062 if ( $(".rank-request option:selected[value='del']").length ) {
1063 $('#cancellation-reason-fieldset').show();
1065 $('#cancellation-reason-fieldset').hide();
1069 [% SET active = clubs ? 1 : 0 %]
1070 $('#circ_holds_select').tabs({
1071 active: [% active | $raw %],
1072 activate: function(){
1073 $(this).find("input.focus").focus();
1076 $(this).find("input.focus").focus();
1079 function ToggleHoldsToPlace() {
1080 if ( $("#requestany").prop('checked') ) {
1081 $("#holds_to_place_count").prop('disabled', false);
1083 $("#holds_to_place_count").prop('disabled', true);
1086 ToggleHoldsToPlace();
1087 $("#requestany").on('change', function(){
1088 ToggleHoldsToPlace();
1091 [% IF Koha.Preference('UseBranchTransferLimits') %]
1092 $("#pickup").on('change', function(){
1093 var pickup = $("#pickup").val();
1094 var url = "?pickup=" + pickup;
1095 url += "&borrowernumber=" + borrowernumber;
1096 url += "&biblionumber=" + biblionumber;
1097 window.location.replace(url);
1101 [% IF AutoResumeSuspendedHolds %]
1102 $(".suspend_until_datepicker, .datepickerfrom, .datepickerto").datepicker("option", "minDate", 1);
1105 $(".datepickerto").datepicker("option", "altField", ".datepickerto_hidden");
1106 $(".datepickerto").datepicker("option", "altFormat", "yy-mm-dd");
1108 $(".datepickerfrom").datepicker("option", "altField", ".datepickerfrom_hidden");
1109 $(".datepickerfrom").datepicker("option", "altFormat", "yy-mm-dd");
1111 var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1113 "sDom": '<"top pager"ilf>t',
1116 //Override fieldset styling for dataTables search box
1117 $("div.top.pager").css("margin-left","1em");
1118 $(".dataTables_filter label").css({
1120 "margin-right":"0em"
1123 $("#club-request-form").on("submit", function() {
1125 $('.clubalert, .holdalert').addClass('hide');
1126 let biblionumbers = [biblionumber];
1127 let biblionumbers_text;
1129 pickup_library_id: $('select[name="pickup"]').val()
1131 if($('input[name="checkitem"]:checked').length)
1132 data.item_id = $('input[name="checkitem"]:checked').val();
1133 if($('input[name="borrowernumber"]').length)
1134 data.patron_id = $('input[name="borrowernumber"]').val();
1135 if($('textarea[name="notes"]').length)
1136 data.notes = $('textarea[name="notes"]').val()||null;
1137 if($('.datepickerto_hidden').length)
1138 data.expiration_date = $('.datepickerto_hidden').val()||null;
1139 if($('.datepickerfrom_hidden').length)
1140 data.hold_date = $('.datepickerfrom_hidden').val()||null;
1141 if($('input[name="itemtype"]').length) {
1142 data.item_type = $('input[name="itemtype"]').val()||null;
1144 if($('input[name="default_patron_home"]:checked').length) {
1145 data.default_patron_home = 1;
1147 if($('input[name="biblionumbers"]').length) {
1148 biblionumbers_text = $('input[name="biblionumbers"]').val();
1149 biblionumbers = biblionumbers_text.replace(/\/$/, '').split('/')
1152 const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1;
1153 biblionumbers.forEach(function(biblionumber) {
1154 data.biblio_id = biblionumber;
1156 url: $t.attr('action'),
1157 method: $t.attr('method').toUpperCase(),
1158 contentType: 'application/json',
1159 data: JSON.stringify(data)
1161 for(let i = 0; i < count; i++) {
1163 .then(function(result) {
1164 let url = 'request.pl?biblionumber='+biblionumber;
1165 if(biblionumbers_text) {
1166 url = 'request.pl?biblionumbers='+biblionumbers_text;
1168 document.location = url;
1170 .fail(function(err) {
1171 var message = err.responseJSON.error;
1172 var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/);
1173 if(match && ERROR_MAP[match[1]]) {
1174 message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>'
1176 $('.clubalert, .holdalert').removeClass('hide').html(message);
1184 [% UNLESS ( multi_hold ) %]
1185 $("#hold-request-form").on("submit", function(){
1189 $("#hold-request-form").on("submit", function(){
1190 return checkMultiHold();
1194 function display_pickup_location (state) {
1196 if ( state.needs_override === true ) {
1198 '<span>' + state.text + '</span> <span style="float:right;" title="' +
1199 _("This pickup location is not allowed according to circulation rules") +
1200 '"><i class="fa fa-exclamation-circle" aria-hidden="true"></i></span>'
1204 $text = $('<span>'+state.text+'</span>');
1210 $(".pickup_location_dropdown").each( function () {
1211 var this_dropdown = $(this);
1212 var hold_id = $(this).data('hold_id');
1214 this_dropdown.select2({
1217 url: '/api/v1/holds/' + encodeURIComponent(hold_id) + '/pickup_locations',
1218 delay: 300, // wait 300 milliseconds before triggering the request
1220 data: function (params) {
1221 var search_term = (params.term === undefined) ? '' : params.term;
1223 "q": JSON.stringify({"name":{"-like":search_term+'%'}}),
1228 processResults: function (data) {
1230 data.forEach( function ( pickup_location ) {
1233 "id": pickup_location.library_id.escapeHtml(),
1234 "text": pickup_location.name.escapeHtml(),
1235 "needs_override": pickup_location.needs_override
1239 return { "results": results };
1242 templateResult: display_pickup_location
1245 $("#pickup_multi").select2({
1249 $("#pickup").each( function () {
1250 var this_dropdown = $(this);
1251 var patron_id = $(this).data('patron-id');
1252 var biblio_id = $(this).data('biblio-id');
1254 this_dropdown.select2({
1258 url: '/api/v1/biblios/' + encodeURIComponent(biblio_id) + '/pickup_locations',
1259 delay: 300, // wait 300 milliseconds before triggering the request
1261 data: function (params) {
1262 var search_term = (params.term === undefined) ? '' : params.term;
1264 "q": JSON.stringify({"name":{"-like":search_term+'%'}}),
1265 "_order_by": "name",
1266 "patron_id": patron_id
1270 processResults: function (data) {
1272 data.forEach( function ( pickup_location ) {
1275 "id": pickup_location.library_id.escapeHtml(),
1276 "text": pickup_location.name.escapeHtml(),
1277 "needs_override": pickup_location.needs_override
1281 return { "results": results };
1284 templateResult: display_pickup_location
1291 var count_reserv = 0;
1293 // check if we have checkitem form
1294 if (document.form.checkitem){
1295 for (i=0;i<document.form.checkitem.length;i++){
1296 if (document.form.checkitem[i].checked == true) {
1300 // for only one item, check the checkitem without consider the loop checkitem
1302 if (document.form.checkitem.checked == true) {
1308 if (document.form.requestany.checked == true){
1312 if (count_reserv == "0"){
1313 msg += (_("- Please select an item to place a hold") + "\n");
1317 $('#hold-request-form').preventDoubleFormSubmit();
1325 function checkMultiHold() {
1326 var spans = $(".multi_hold_item_checkbox:checked");
1327 if ($(spans).size() == 0) {
1328 alert(MSG_NO_ITEMS_AVAILABLE);
1332 var biblionumbers = "";
1333 $(spans).each(function() {
1334 var bibnum = $(this).attr("title");
1335 biblionumbers += bibnum + "/";
1338 var badSpans = $(".not_holdable");
1340 $(badSpans).each(function() {
1341 var bibnum = $(this).attr("title");
1342 badBibs += bibnum + "/";
1345 $("#multi_hold_bibs").val(biblionumbers);
1346 $("#bad_bibs").val(badBibs);
1348 $('#hold-request-form').preventDoubleFormSubmit();
1353 $(document).ready(function() {
1354 $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1355 var itemnumber = this.value;
1358 switch (override_items[itemnumber].holdallowed) {
1359 case "not_allowed": msg = _("This item normally cannot be put on hold."); break;
1360 case "from_home_library": msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
1363 msg += "\n\n" + _("Place hold on this item?");
1365 return confirm(msg);
1367 $("button.warning").click(function() {
1368 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1370 $("#requestany").click(function() {
1372 $("input[name=checkitem]").each(function() {
1373 $(this).prop("checked", false);
1377 $("input[name=checkitem]").click(function() {
1379 $("input[name=checkitem]").each(function() {
1384 if(onechecked == 1){
1385 $("#requestany").prop("checked", false);
1386 $("#holds_to_place_count").prop('disabled', true);
1388 $("#requestany").prop("checked",true);
1389 $("#holds_to_place_count").prop('disabled', false);
1392 var prev_rank_request;
1393 $("select[name=rank-request]").on("focus", function() {
1394 prev_rank_request = $(this).val();
1395 var row = $(this).parents("tr:first");
1396 }).change(function() {
1397 var row = $(this).parents("tr:first");
1398 var value = parseInt($(this).val());
1399 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
1400 if( !isNaN(value) ) { //If moved to 'del'
1401 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)
1402 if (prev_rank_request > value) {
1403 row.insertBefore(after);
1405 row.insertAfter(after);
1409 var next_priority = 1;
1410 $("select[name=rank-request]").each(function () {
1411 if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
1412 $(this).val(next_priority);
1417 $(".clear-date").on("click",function(e){
1419 var fieldID = this.id.replace("clear-date-","");
1420 $("#" + fieldID).val("");
1423 // Confirm cancellation of hold
1425 $(".cancel-hold").on("click",function(e) {
1427 cancel_link = $(this);
1428 $('#cancelModal').modal();
1431 $("#cancelModalConfirmBtn").on("click",function(e) {
1432 let borrowernumber = cancel_link.data('borrowernumber');
1433 let biblionumber = cancel_link.data('biblionumber');
1434 let reserve_id = cancel_link.data('id');
1435 let reason = $("#modal-cancellation-reason").val();
1436 let link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`;
1438 link += "&cancellation-reason=" + reason
1440 window.location.href = link;
1444 [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems ) %]
1445 [% IF ( PatronAutoComplete ) %]
1446 $( "#patron" ).autocomplete({
1447 source: "/cgi-bin/koha/circ/ysearch.pl",
1449 select: function( event, ui ) {
1450 $( "#patron" ).val( ui.item.cardnumber );
1451 $( "#holds_patronsearch" ).submit();
1455 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
1456 return $( "<li></li>" )
1457 .data( "ui-autocomplete-item", item )
1460 + ( item.surname ? item.surname.escapeHtml() : "" )
1462 + ( item.firstname ? item.firstname.escapeHtml() : "" )
1463 + " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")"
1466 + ( item.address ? item.address.escapeHtml() : "" )
1468 + ( item.city ? item.city.escapeHtml() : "" )
1470 + ( item.zipcode ? item.zipcode.escapeHtml() : "" )
1472 + ( item.country ? item.country.escapeHtml() : "" )
1479 Sticky = $("#toolbar");
1481 stickTo: "#existing_holds",
1482 stickyClass: "floating"
1488 [% INCLUDE 'intranet-bottom.inc' %]