8 [% USE AuthorisedValues %]
10 [% SET footerjs = 1 %]
11 [% INCLUDE 'doc-head-open.inc' %]
12 [% UNLESS ( multi_hold ) %]
13 <title>Koha › Circulation › Holds › Place a hold on [% INCLUDE 'biblio-title-head.inc' %]</title>
15 <title>Koha › Circulation › Holds › Confirm holds</title>
17 [% INCLUDE 'doc-head-close.inc' %]
20 <body id="circ_request" class="catalog">
21 [% INCLUDE 'header.inc' %]
22 [% INCLUDE 'circ-search.inc' %]
24 [% UNLESS ( multi_hold ) %]
25 <div id="breadcrumbs">
26 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
27 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a> ›
28 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]">[% biblio.title | html %]</a> ›
29 Place a hold on [% INCLUDE 'biblio-title.inc' %]
32 <div id="breadcrumbs">
33 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
34 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a> ›
37 [% END # UNLESS multi_hold %]
39 <div class="main container-fluid">
41 [% IF ( multi_hold ) # No sidebar menu when placing multiple holds %]
42 <div class="col-md-10 col-md-offset-1">
44 <div class="col-sm-10 col-sm-push-2">
50 <div class="dialog alert">
52 <strong>Cannot place hold:</strong> one or more records without items attached.
54 <strong>Cannot place hold:</strong> this record has no items attached.
59 [% IF ( messagetransfert ) %]
60 <div class="dialog message">
61 <h2>Hold found for ([% nextreservtitle | html %]), please transfer</h2>
62 <p>Hold placed by : <strong> [% nextreservsurname | html %] [% nextreservfirstname | html %]</strong> at : <strong> [% branchname | html %] </strong>, Please transfer this item.
64 <form name="cancelReservewithtransfert" action="branchreserves.pl" method="post">
65 <input type="submit" class="button" />
70 [% UNLESS ( multi_hold ) %]
71 <h1>Place a hold on [% INCLUDE 'biblio-default-view.inc' %][% INCLUDE 'biblio-title.inc' %]</a></h1>
73 <h1>Confirm holds</h1>
76 [% UNLESS patron OR patron.borrowernumber OR noitems %]
77 [% IF ( messageborrower ) %]
78 <div class="dialog alert">
79 <h3>Patron not found</h3>
80 <p>No patron with this name, please, try another</p>
84 <form id="holds_patronsearch" action="request.pl?biblionumber=[% biblionumber | html %]" method="post">
85 <fieldset id="circ_holds_selectborrower" class="brief">
86 [% UNLESS borrowers %]
87 <label for="patron">Patron: </label>
88 <div class="hint">Enter patron card number or partial name:</div>
89 <input type="text" size="40" id="patron" class="focus" name="findborrower" autocomplete="off" />
90 <input type="submit" value="Search" />
92 <input type="hidden" name="multi_hold" value="[% multi_hold | html %]"/>
93 <input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
95 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
98 [% INCLUDE 'circ-patron-search-results.inc' destination = "holds" %]
100 </fieldset> <!-- /#circ_holds_selectborrower -->
102 [% IF ( multi_hold ) %]
103 <input type="hidden" name="multi_hold" value="[% multi_hold | html %]"/>
104 <input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
106 </form> <!-- /#holds_patronsearch -->
108 [% ELSIF NOT noitems # /UNLESS patron %]
110 [% IF ( checked_previously && !multi_hold ) %]
111 <div class="dialog alert">
113 <li>Patron has previously checked out this title</li>
118 [% IF ( exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted ) %]
119 <div class="dialog alert">
121 [% UNLESS ( multi_hold ) %]
122 <h3>Cannot place hold</h3>
124 [% IF ( exceeded_maxreserves ) %]
125 <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>
126 [% ELSIF ( exceeded_holds_per_record ) %]
127 <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>
128 [% ELSIF ( alreadypossession ) %]
129 <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>
130 [% ELSIF ( alreadyreserved ) %]
131 <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>
132 [% ELSIF ( ageRestricted ) %]
133 <li><strong>Age restricted</strong></li>
134 [% ELSIF ( none_available ) %]
135 <li> <strong>No items are available</strong> to be placed on hold.</li>
136 [% ELSIF ( maxreserves ) %]
137 <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>
138 [% END # /IF exceeded_maxreserves %]
140 [% ELSE # UNLESS multi_hold %]
141 <h3>Cannot place hold on some items</h3>
142 [% IF ( exceeded_maxreserves ) %]
143 <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>
144 [% ELSIF ( exceeded_holds_per_record ) %]
145 [% FOREACH biblioloo IN biblioloop %]
146 [% IF (biblioloo.tooManyHoldsForThisRecord) %]
147 <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>
150 [% END # /IF exceeded_maxreserves %]
151 [% END # /UNLESS multi_hold %]
153 [% END # /IF ( exceeded_maxreserves || ... %]
155 [% IF ( expiry || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
156 <div class="dialog message">
159 <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>
162 [% IF patron.is_debarred %]
163 <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>
166 [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
167 <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>
170 [% IF ( diffbranch ) %]
171 <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>
173 </ul> <!-- /.dialog.message -->
175 [% END # /IF expiry || diffbranch ... %]
177 [% IF ( messageborrower ) %]
178 <div class="dialog alert">
179 <h3>Patron not found:</h3>
180 <p>Name or barcode not found. Please try an other </p>
184 <fieldset class="rows">
185 <legend>Hold details</legend>
186 <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
188 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
189 <input type="hidden" name="type" value="str8" />
191 [% IF ( multi_hold ) %]
192 <input type="hidden" name="multi_hold" value="[% multi_hold | html %]"/>
193 <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
194 <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
195 <input type="hidden" name="request" value="any"/>
196 [% FOREACH biblioloo IN biblioloop %]
197 <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
198 <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
201 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
202 <input type="hidden" name="title" value="[% biblio.title | html %]" />
203 <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
204 [% END # /IF multi_hold %]
208 <span class="label">Patron:</span>
209 [% IF ( patron.borrowernumber ) %]
210 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a>
216 [% UNLESS ( multi_hold ) %]
218 <span class="label">Estimated priority:</span>
219 <strong>[% fixedRank | html %]</strong>
224 <label for="holdnotes">Notes:</label>
225 <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
228 <label for="pickup">Pickup at:</label>
229 <select name="pickup" size="1" id="pickup">
230 [% PROCESS options_for_libraries libraries => Branches.all({ selected => pickup, search_params => { pickup_location => 1 } }) %]
234 [% UNLESS ( multi_hold ) %]
235 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
237 <label for="itemtype">Request specific item type:</label>
238 <select name="itemtype" size="1" id="itemtype">
239 <option value="">Any item type</option>
240 [%- FOREACH itemtype IN available_itemtypes %]
241 <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
246 [% END # /UNLESS multi_hold %]
248 [% IF ( reserve_in_future ) %]
250 <label for="from">Hold starts on date:</label>
251 <input name="reserve_date" id="from" size="10" class="datepickerfrom" type="text" >
252 <a href="#" id="clear-date-from" class="clear-date">Clear date</a>
257 <label for="to">Hold expires on date:</label>
258 <input name="expiration_date" id="to" size="10" class="datepickerto" type="text" />
259 <a href="#" id="clear-date-to" class="clear-date">Clear date</a>
262 [% UNLESS ( multi_hold ) %]
264 <label for="requestany">Hold next available item </label>
265 [% IF force_hold_level == 'item' %]
266 <input type="checkbox" id="requestany" name="request" disabled="true" />
267 [% ELSIF force_hold_level == 'record' %]
268 <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
269 <input type="hidden" name="request" value="Any"/>
271 <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
273 <input type="hidden" name="biblioitem" value="[% biblioitemnumber | html %]" />
274 <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
277 [% IF remaining_holds_for_record > 1 %]
279 <label for="holds_to_place_count">Holds to place (count)</label>
280 <input id="holds_to_place_count" type="number" name="holds_to_place_count" min="1" max="[% remaining_holds_for_record | html %]" step="1" value="1" />
283 <input type="hidden" name="holds_to_place_count" value="1" />
285 [% END # /UNLESS multi_hold %]
288 [% UNLESS ( multi_hold ) %]
289 <fieldset class="action">
290 [% IF ( patron.borrowernumber ) %]
291 [% IF ( override_required ) %]
292 <input type="submit" class="warning" value="Place hold" />
293 [% ELSIF ( none_available ) %]
294 <input type="submit" disabled="disabled" value="Place hold" />
296 <input type="submit" value="Place hold" />
301 [% FOREACH bibitemloo IN bibitemloop %]
303 [% UNLESS ( item_level_itypes ) %]
305 <span class="label">Item type:</span>
306 [% bibitemloo.description | html %]
310 [% IF ( bibitemloo.publicationyear ) %]
312 <span class="label">Publication year:</span>
313 [% bibitemloo.publicationyear | html %]
318 <h2 style="padding: 0 1em;">
319 Place a hold on a specific item
320 [% IF bibitemloo.force_hold_level == 'item' %]
321 <span class="error"><i>(Required)</i></span>
325 <table id="requestspecific">
329 [% IF ( item_level_itypes ) %]
333 <th>Home library</th>
334 <th>Last location</th>
335 [% IF itemdata_ccode %]
340 [% IF itemdata_enumchron %]
343 <th class="title-string">Information</th>
347 [% SET selected = 0 %]
348 [% FOREACH itemloo IN bibitemloo.itemloop %]
349 [% UNLESS ( itemloo.hide ) %]
350 <tr class="[% itemloo.backgroundcolor | html %]">
352 [% IF itemloo.force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
354 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
355 Hold must be record level
357 [% ELSIF ( itemloo.available ) %]
358 <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
359 [% ELSIF ( itemloo.override ) %]
360 <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
361 <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
364 <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
365 [% IF itemloo.not_holdable %]
366 [% IF itemloo.not_holdable == 'damaged' %]
368 [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
370 [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
371 Exceeded max holds per record
372 [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
373 Daily hold limit reached for patron
374 [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
376 [% ELSIF itemloo.not_holdable == 'notReservable' %]
378 [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
379 Patron is from different library
380 [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
381 Patron already has hold for this item
382 [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
383 Cannot be transferred to pickup library
385 [% itemloo.not_holdable | html %]
389 [% END # /IF itemloo.force_hold_level %]
391 [% IF ( item_level_itypes ) %]
393 [% UNLESS ( noItemTypeImages ) %]
394 [% IF ( itemloo.imageurl ) %]<img src="[% itemloo.imageurl | html %]" alt="" /> <br /> [% END %]
396 [% itemloo.itypename | html %]
400 [% itemloo.barcode | html %]
403 [% Branches.GetName( itemloo.homebranch ) | html %]
406 [% Branches.GetName( itemloo.holdingbranch ) | html %]
408 [% IF itemdata_ccode %]
410 [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetByCode( 'CCODE', itemloo.ccode ) | html %][% END %]
414 [% itemloo.itemcallnumber | html %]
417 [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %]
419 [% IF itemdata_enumchron %]
421 [% itemloo.enumchron | html %]
425 [% IF ( itemloo.onloan ) %]
426 <span title="[% itemloo.date_due | html %]" class="checkedout">Due [% itemloo.date_due | $KohaDates as_due_date => 1 %]</span>
428 <span title="0000-00-00">
429 [% IF ( itemloo.transfertwhen ) %]
430 In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
431 to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %]
436 [% IF ( itemloo.reservedate ) %]
437 [% IF ( itemloo.nocancel ) %]
438 Can't be cancelled when item is in transit
440 [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %]
441 [% IF ( itemloo.canreservefromotherbranches ) %]
442 for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedFor.borrowernumber | uri %]">[% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %]</a>
444 [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %]
445 [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since
446 [% IF ( itemloo.waitingdate ) %]
447 [% itemloo.waitingdate | $KohaDates %]
449 [% IF ( itemloo.reservedate ) %]
450 [% itemloo.reservedate | html %]
453 <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
454 [% END # /IF itemloo.nocancel %]
457 [% END # /IF itemloo.reservedate %]
459 [% IF itemloo.item_level_holds == "N" %]
460 <br/>Item level hold not allowed from OPAC
461 [% ELSIF itemloo.item_level_holds == "F" %]
462 <br/>Item level hold forced from OPAC
465 [% IF ( itemloo.itemlost ) %]
466 <span class="lost">[% AuthorisedValues.GetByCode( 'LOST', itemloo.itemlost ) | html %]</span>
469 [% IF ( itemloo.damaged ) %]
470 <span class="dmg">[% AuthorisedValues.GetByCode( 'DAMAGED', itemloo.damaged ) | html %]</span>
473 [% IF ( itemloo.notforloan ) %]
474 <span class="nfl">Not for loan ([% AuthorisedValues.GetByCode( 'NOT_LOAN', itemloo.notforloan ) | html %])</span>
478 [% END # / UNLESS itemloo.hide %]
479 [% END # /FOREACH itemloo %]
481 </table> <!-- /#requestspecific -->
483 [% IF ( bibitemloo.hiddencount ) %]
485 <p class="hiddencount">
486 <a href="request.pl?biblionumber=[% bibitemloo.biblionumber | uri %]&borrowernumber=[% bibitemloo.borrowernumber | uri %]&showallitems=1">Show all items ([% bibitemloo.hiddencount | html %] hidden)</a>
489 [% END # /IF bibitemloo.hiddencount %]
490 [% END # /FOREACH bibitemloo %]
492 [% ELSE # /UNLESS multi_hold %]
494 <table id="requesttitles">
498 [% UNLESS ( item_level_itypes ) %]
504 [% FOREACH biblioloo IN biblioloop %]
505 [% IF ( biblioloo.warn ) %]
511 [% UNLESS ( biblioloo.warn ) %]
512 <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
518 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
520 [% IF ( biblioloo.publicationyear ) %]
522 <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
526 [% IF ( biblioloo.warn ) %]
527 <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
530 [% UNLESS ( item_level_itypes ) %]
532 <img src="[% biblioloo.imageurl | html %]" alt="[% biblioloo.itypename | html %]" title="[% biblioloo.itypename | html %]" />
535 <td>[% biblioloo.rank | html %]</td>
537 [% IF ( biblioloo.checked_previously ) %]
538 <span>Patron has previously checked out this title</span><br/>
540 [% IF ( biblioloo.alreadyres ) %]
543 [% IF ( biblioloo.none_avail ) %]
548 [% IF ( biblioloo.alreadyres ) %]
550 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>
551 <strong>already has a hold</strong> on this item
554 [% IF ( biblioloo.none_avail ) %]
555 <li> <strong>No items are available</strong> to be placed on hold</li>
558 [% IF ( biblioloo.alreadyres ) %]
561 [% IF ( biblioloo.none_avail ) %]
567 [% END # /FOREACH biblioloo %]
568 </table> <!-- /#requesttitles -->
570 [% END # /UNLESS multi_hold %]
572 <fieldset class="action">
573 [% IF ( patron AND patron.borrowernumber ) %]
574 [% IF ( override_required ) %]
575 <input type="submit" class="warning" value="Place hold" />
576 [% ELSIF ( none_available ) %]
577 <input type="submit" disabled="disabled" value="Place hold" />
579 [% IF ( multi_hold ) %]
580 <input type="submit" value="Place hold" id="multi_hold_submit"/>
582 <input type="submit" value="Place hold" />
585 [% END # /IF patron %]
586 </fieldset> <!-- /.action -->
587 </form> <!-- /#hold-request-form -->
588 </fieldset> <!-- /.rows -->
591 [% UNLESS ( patron ) %]
592 [% IF ( reserveloop ) %]
593 <form name="T[% time | html %]" action="modrequest.pl" method="post">
594 [% IF ( multi_hold ) %]
595 <input type = "hidden" name="multi_hold" value="1"/>
596 <input type = "hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
599 <fieldset class="rows">
600 <legend>Existing holds</legend>
602 [% FOREACH biblioloo IN biblioloop %]
603 [% IF ( biblioloo.reserveloop ) %]
604 [% IF ( multi_hold ) %]
606 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">
607 [% biblioloo.title | html %]
612 [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
613 [% SET branchcodes = [] %]
615 [% FOREACH h IN biblioloo.reserveloop %]
616 [% branchcodes.push( h.branchcode ) %]
618 [% branchcodes = branchcodes.unique %]
620 [% FOREACH b IN branchcodes.sort %]
621 [% SET holds_by_branch = [] %]
622 [% FOREACH h IN biblioloo.reserveloop %]
623 [% IF h.branchcode == b %]
624 [% holds_by_branch.push( h ) %]
628 <legend>[% Branches.GetName( b ) | html %]</legend>
629 [% INCLUDE holds_table.inc holds=holds_by_branch %]
631 [% END # /FOREACh b %]
632 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
633 [% SET itemtypes = [] %]
635 [% FOREACH h IN biblioloo.reserveloop %]
636 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
637 [% itemtypes.push( hold_itemtype ) %]
639 [% itemtypes = itemtypes.unique %]
641 [% FOREACH i IN itemtypes.sort %]
642 [% SET holds_by_itemtype = [] %]
643 [% FOREACH h IN biblioloo.reserveloop %]
644 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
645 [% IF hold_itemtype == i %]
646 [% holds_by_itemtype.push( h ) %]
652 <legend>[% ItemTypes.GetDescription( i ) | html %]</legend>
654 <legend>Any item type</legend>
656 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
658 [% END # /FOREACH i %]
659 [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
660 [% SET branchcodes = [] %]
662 [% FOREACH h IN biblioloo.reserveloop %]
663 [% branchcodes.push( h.branchcode ) %]
665 [% branchcodes = branchcodes.unique %]
667 [% FOREACH b IN branchcodes.sort %]
668 <fieldset class="contrast">
669 <legend>[% Branches.GetName( b ) | html %]</legend>
670 [% SET holds_by_branch = [] %]
671 [% FOREACH h IN biblioloo.reserveloop %]
672 [% IF h.branchcode == b %]
673 [% holds_by_branch.push( h ) %]
677 [% SET itemtypes = [] %]
678 [% FOREACH h IN holds_by_branch %]
679 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
680 [% itemtypes.push( hold_itemtype ) %]
682 [% itemtypes = itemtypes.unique %]
684 [% FOREACH i IN itemtypes.sort %]
685 <fieldset class="standard">
687 <legend>[% ItemTypes.GetDescription( i ) | html %]</legend>
689 <legend>Any item type</legend>
692 [% SET holds_by_itemtype = [] %]
693 [% FOREACH h IN holds_by_branch %]
694 [% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
695 [% IF hold_itemtype == i %]
696 [% holds_by_itemtype.push( h ) %]
699 [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
703 [% END # /FOREACH b %]
705 [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
706 [% END # /IF HoldsSplitQueue %]
708 [% END # /IF biblioloo.reserveloop %]
709 [% END # FOREACH biblioloo %]
711 <fieldset class="action">
712 <input type="submit" name="submit" value="Update hold(s)" />
714 </fieldset> <!-- /.rows -->
715 </form> <!-- /name=TTime -->
716 [% END # IF reserveloop %]
717 [% END # UNLESS patron %]
721 [% IF ( multi_hold ) # No sidebar menu when placing multiple holds %]
722 </div> <!-- /.col-md-10.col-md-offset-1 -->
724 </div> <!-- /.col-sm-10.col-sm-push-2 -->
725 <div class="col-sm-2 col-sm-pull-10">
727 [% INCLUDE 'biblio-view-menu.inc' %]
729 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
731 </div> <!-- /.row -->
734 [% MACRO jsinclude BLOCK %]
735 [% INCLUDE 'datatables.inc' %]
736 [% INCLUDE 'calendar.inc' %]
737 [% INCLUDE 'columns_settings.inc' %]
738 [% Asset.js("js/circ-patron-search-results.js") | $raw %]
740 var biblionumber = "[% biblionumber | $raw %]";
741 var borrowernumber = "[% patron.borrowernumber | $raw %]";
742 var MSG_CONFIRM_DELETE_HOLD = _("Are you sure you want to cancel this hold?");
743 var patron_homebranch = "[% Branches.GetName( patron.branchcode ) |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]";
744 var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo IN bibitemloo.itemloop %][% IF ( itemloo.override ) %]
745 [% itemloo.itemnumber | html %]: {
746 homebranch: "[% Branches.GetName( itemloo.homebranch ) |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]",
747 holdallowed: [% itemloo.holdallowed | html %]
749 [% END %][% END %][% END %]
751 var MSG_NO_ITEMS_AVAILABLE = _("A hold cannot be requested on any of these items.");
752 columns_settings_borrowers_table = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]
754 $(document).ready(function() {
755 function ToggleHoldsToPlace() {
756 if ( $("#requestany").prop('checked') ) {
757 $("#holds_to_place_count").prop('disabled', false);
759 $("#holds_to_place_count").prop('disabled', true);
762 ToggleHoldsToPlace();
763 $("#requestany").on('change', function(){
764 ToggleHoldsToPlace();
767 [% IF Koha.Preference('UseBranchTransferLimits') %]
768 $("#pickup").on('change', function(){
769 var pickup = $("#pickup").val();
770 var url = "?pickup=" + pickup;
771 url += "&borrowernumber=" + borrowernumber;
772 url += "&biblionumber=" + biblionumber;
773 window.location.replace(url);
777 [% IF AutoResumeSuspendedHolds %]
778 $(".suspend_until_datepicker, .datepickerfrom, .datepickerto").datepicker("option", "minDate", 1);
781 var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
783 "sDom": '<"top pager"ilf>t',
785 { "sType": "title-string", "aTargets" : [ "title-string" ] }
789 //Override fieldset styling for dataTables search box
790 $("div.top.pager").css("margin-left","1em");
791 $(".dataTables_filter label").css({
796 [% UNLESS ( multi_hold ) %]
797 $("#hold-request-form").on("submit", function(){
801 $("#hold-request-form").on("submit", function(){
802 return checkMultiHold();
810 var count_reserv = 0;
812 // check if we have checkitem form
813 if (document.form.checkitem){
814 for (i=0;i<document.form.checkitem.length;i++){
815 if (document.form.checkitem[i].checked == true) {
819 // for only one item, check the checkitem without consider the loop checkitem
821 if (document.form.checkitem.checked == true) {
827 if (document.form.requestany.checked == true){
831 if (count_reserv == "0"){
832 msg += (_("- Please select an item to place a hold") + "\n");
836 $('#hold-request-form').preventDoubleFormSubmit();
844 function checkMultiHold() {
845 var spans = $(".multi_hold_item_checkbox:checked");
846 if ($(spans).size() == 0) {
847 alert(MSG_NO_ITEMS_AVAILABLE);
851 var biblionumbers = "";
852 $(spans).each(function() {
853 var bibnum = $(this).attr("title");
854 biblionumbers += bibnum + "/";
857 var badSpans = $(".not_holdable");
859 $(badSpans).each(function() {
860 var bibnum = $(this).attr("title");
861 badBibs += bibnum + "/";
864 $("#multi_hold_bibs").val(biblionumbers);
865 $("#bad_bibs").val(badBibs);
867 $('#hold-request-form').preventDoubleFormSubmit();
872 $(document).ready(function() {
873 $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
874 var itemnumber = this.value;
877 switch (override_items[itemnumber].holdallowed) {
878 case 0: msg = _("This item normally cannot be put on hold."); break;
879 case 1: msg = _("This item normally cannot be put on hold except for patrons from %s.").format(override_items[itemnumber].homebranch); break;
882 msg += "\n\n" + _("Place hold on this item?");
886 $("input.warning").click(function() {
887 return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
889 $("#requestany").click(function() {
891 $("input[name=checkitem]").each(function() {
892 $(this).prop("checked", false);
896 $("input[name=checkitem]").click(function() {
898 $("input[name=checkitem]").each(function() {
904 $("#requestany").prop("checked", false);
905 $("#holds_to_place_count").prop('disabled', true);
907 $("#requestany").prop("checked",true);
908 $("#holds_to_place_count").prop('disabled', false);
911 var prev_rank_request;
912 $("select[name=rank-request]").on("focus", function() {
913 prev_rank_request = $(this).val();
914 var row = $(this).parents("tr:first");
915 }).change(function() {
916 var row = $(this).parents("tr:first");
917 var value = parseInt($(this).val());
918 var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
919 if( !isNaN(value) ) { //If moved to 'del'
920 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)
921 if (prev_rank_request > value) {
922 row.insertBefore(after);
924 row.insertAfter(after);
928 var next_priority = 1;
929 $("select[name=rank-request]").each(function () {
930 if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
931 $(this).val(next_priority);
936 $(".clear-date").on("click",function(e){
938 var fieldID = this.id.replace("clear-date-","");
939 $("#" + fieldID).val("");
942 // Confirm cancelation of hold
943 $(".cancel-hold").on("click",function(e) {
944 return confirmDelete(MSG_CONFIRM_DELETE_HOLD);
947 [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems ) %]
948 [% IF ( CircAutocompl ) %]
949 $( "#patron" ).autocomplete({
950 source: "/cgi-bin/koha/circ/ysearch.pl",
952 select: function( event, ui ) {
953 $( "#patron" ).val( ui.item.cardnumber );
954 $( "#holds_patronsearch" ).submit();
958 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
959 return $( "<li></li>" )
960 .data( "ui-autocomplete-item", item )
961 .append( "<a>" + item.surname + ", " + item.firstname +
962 " (" + item.cardnumber + ") <small>" + item.address +
963 " " + item.city + " " + item.zipcode + " " +
964 item.country + "</small></a>" )
974 [% INCLUDE 'intranet-bottom.inc' %]