3 [% INCLUDE 'doc-head-open.inc' %]
4 [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Placing a hold
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% BLOCK cssinclude %][% END %]
9 [% INCLUDE 'bodytag.inc' bodyid='opac-holds' %]
10 [% INCLUDE 'masthead.inc' %]
13 <ul class="breadcrumb">
14 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
15 <li><a href="#">Placing a hold</a></li>
18 <div class="container">
23 <div id="gna" class="alert">
24 <p><strong>Sorry</strong>, you cannot place holds because the library doesn't have up-to-date <a href="/cgi-bin/koha/opac-memberentry.pl">contact information</a> on file.</p>
25 <p>Please contact your librarian, or use the <a href="/cgi-bin/koha/opac-memberentry.pl">online update form</a> to submit current information (<em>Please note:</em> there may be a delay in restoring your account if you submit online)</p>
30 <div id="lost" class="alert">
31 <p><strong>Sorry</strong>, you cannot place holds because your library card has been marked as lost or stolen.</p>
32 <p>If this is an error, please take your card to the circulation desk at your local library and the error will be corrected.</p>
37 <div id="debarred" class="alert">
38 <p><strong>Sorry</strong>, you cannot place holds because your account has been frozen.</p>
39 <p>Usually the reason for freezing an account is old overdues or damage fees. If <a href="/cgi-bin/koha/opac-user.pl">your account page</a> shows your account to be clear, please consult a librarian.</p>
43 [% IF ( too_much_oweing ) %]
44 <div id="too_much_oweing" class="alert">
45 Sorry, you cannot place holds because you owe [% too_much_oweing %].
49 [% IF ( too_many_reserves ) %]
50 <div id="too_many_reserves" class="alert">
51 Sorry, you cannot place more than [% too_many_reserves %] holds.
55 [% IF ( bad_biblionumber ) %]
56 <div id="bad_biblionumber" class="alert">
57 ERROR: No biblio record found for biblionumber [% bad_biblionumber %].</div>
60 [% IF ( no_items_selected ) %]
61 <div id="no_items_selected" class="alert">
62 You must select at least one item.
66 [% IF ( no_branch_selected ) %]
67 <div id="no_branch_selected" class="alert">
68 You must select a library for pickup.
72 [% IF ( no_biblionumber ) %]
73 <div id="no_biblionumber" class="alert">ERROR: No biblionumber received.</div>
77 <div id="bad_data" class="alert">ERROR: Internal error: incomplete hold request.</div>
80 [% IF ( expired_patron ) %]
81 <div id="expired_patron" class="alert"><strong>Sorry</strong>, you cannot place holds because your library card has expired.</p><p>Please contact your librarian if you wish to renew your card.</div>
86 [% IF ( none_available ) %]
87 <div id="none_available" class="alert"><strong>Sorry</strong>, none of these items can be placed on hold.
91 [% END # / IF message %]
93 [% UNLESS ( message ) %]
94 [% UNLESS ( none_available ) %]
95 <h3>Confirm holds for:
96 [% FOREACH USER_INF IN USER_INFO %]
97 [% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %])
100 [% END # / UNLESS none_available %]
102 [% IF (RESERVE_CHARGE) %]
103 <div class="alert" id="reserve_fee">
104 There is a charge of [% RESERVE_CHARGE %] for placing this hold
108 [% IF ( new_reserves_allowed ) %]
109 <div id="new_reserves_allowed" class="alert">
110 <strong>Sorry,</strong> you can only place [% new_reserves_allowed %] more holds. Please uncheck the checkboxes for the items you wish to not place holds on.
114 <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
115 <input type="hidden" name="place_reserve" value="1"/>
116 <!-- These values are set dynamically by js -->
117 <input type="hidden" name="biblionumbers" id="biblionumbers"/>
118 <input type="hidden" name="selecteditems" id="selections"/>
121 [% FOREACH bibitemloo IN bibitemloop %]
122 <div class="holdrow">
124 [% IF ( bibitemloo.holdable ) %]
125 <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
126 <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber %]"/>
127 <span class="confirmjs_hold" title="[% bibitemloo.biblionumber %]" style="padding:.3em"></span>
128 <span class="confirm_nonjs">
129 <input type="radio" class="confirmbox checkitem [% bibitemloo.biblionumber %]" name="[% bibitemloo.biblionumber %]" checked="checked" id="single_[% bibitemloo.biblionumber %]" value="any" />
130 <label class="confirm_label" for="single_[% bibitemloo.biblionumber %]">Place a hold on </label>
132 [% END # / bibitemloo.holdable %]
134 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% bibitemloo.biblionumber %]">
135 [% bibitemloo.title |html %]
136 [% IF ( bibitemloo.subtitle ) %]
137 [% FOREACH subtitl IN bibitemloo.subtitle %]
138 [% subtitl.subfield %]
142 [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %]
145 [% UNLESS ( bibitemloo.holdable ) %]
146 [% IF ( bibitemloo.ageRestricted ) %]
147 <div class="alert">Sorry, you are too young to reserve this material.</div>
149 [% IF ( bibitemloo.already_reserved ) %]
150 <div class="alert">You have already requested this title.</div>
152 [% UNLESS ( bibitemloo.bib_available ) %]
153 <div class="alert">No available items.</div>
155 [% IF ( bibitemloo.already_patron_possession ) %]
156 <div class="alert">This title cannot be requested because it's already in your possession.</div>
158 <div class="alert">This title cannot be requested.</div>
160 [% END # / UNLESS bibitemloo.bib_available %]
161 [% END # / IF bibitemloo.already_reserved %]
162 [% END # / UNLESS bibitemloo.holdable %]
164 [% IF ( bibitemloo.holdable ) %]
165 <fieldset class="rows">
168 [% UNLESS ( item_level_itypes ) %]
170 <span class="label">Item type: </span>
171 [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
172 [% bibitemloo.description %]
176 [% SET OPACShowHoldQueueDetails = Koha.Preference('OPACShowHoldQueueDetails') %]
177 [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'priority' %]
178 <li class="priority">
179 <span class="label">Your priority: </span>
180 [% bibitemloo.rank %]
184 [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'holds' %]
185 <li class="holds-count">
186 <span class="label">Number of holds: </span>
187 [% bibitemloo.reservecount %]
192 [% UNLESS ( singleBranchMode ) %]
193 [% IF ( bibitemloo.holdable && choose_branch ) %]
195 <label for="branch_[% bibitemloo.biblionumber %]">Pick up location:</label>
196 [% UNLESS ( bibitemloo.holdable ) %]
197 <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
198 [% FOREACH branchloo IN bibitemloo.branchloop %]
199 [% IF ( branchloo.selected ) %]
200 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
202 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
207 <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
208 [% FOREACH branchloo IN bibitemloo.branchloop %]
209 [% IF ( branchloo.selected ) %]
210 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
212 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
216 [% END # / UNLESS bibitemloo.holdable %]
218 [% END # / IF bibitemloo.holdable && choose_branch %]
219 [% END # / UNLESS singleBranchMode %]
222 <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber %]" style="display:none;" href="#">Show more options</a>
224 <div id="hold-options-[% bibitemloo.biblionumber %]" class="hold-options">
227 [% IF ( reserve_in_future ) %]
229 <label for="from[% bibitemloo.biblionumber %]">Hold starts on date:</label>
230 <input name="reserve_date_[% bibitemloo.biblionumber %]" id="from[% bibitemloo.biblionumber %]" size="10" class="holddatefrom"/>
231 <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
236 <label for="to[% bibitemloo.biblionumber %]">Hold not needed after:</label>
237 <input name="expiration_date_[% bibitemloo.biblionumber %]" id="to[% bibitemloo.biblionumber %]" size="10" class="holddateto" />
238 <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
241 [% IF ( OpacHoldNotes ) %]
243 <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
244 <label for="holdnotes[% bibitemloo.biblionumber %]">Hold notes:</label>
245 <span id="forcenotesreason_[% bibitemloo.biblionumber %]" class="forcenotesreason"></span>
246 <textarea id="holdnotes[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]">[% bibitemloo.holdnotes %]</textarea>
247 <input type="hidden" id="notesmandatory_[% bibitemloo.biblionumber %]" value="[% bibitemloo.mandatorynotes %]"/>
250 [% END # / IF OpacHoldNotes %]
252 [% IF OPACItemHolds == '1' or OPACItemHolds == 'force' %]
254 <li class="lradio place_on_type" style="display:none;">
255 <label class="radio inline" for="reqany_[% bibitemloo.biblionumber %]">Next available item</label>
256 [% IF OPACItemHolds == "1" %]
257 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
258 id="reqany_[% bibitemloo.biblionumber %]"
264 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
265 id="reqany_[% bibitemloo.biblionumber %]"
270 <label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber %]">A specific item</label>
271 [% IF OPACItemHolds == "force" %]
272 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
273 id="reqspecific_[% bibitemloo.biblionumber %]"
274 class="selectspecific"
279 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
280 id="reqspecific_[% bibitemloo.biblionumber %]"
281 class="selectspecific"
286 [% END # / IF OPACItemHolds %]
289 [% IF OPACItemHolds == '1' || OPACItemHolds == 'force' %]
290 <table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber %]">
291 <caption>Select a specific item:</caption>
294 [% IF ( item_level_itypes ) %]
298 [% UNLESS ( singleBranchMode ) %]
299 <th>Home library</th>
300 <th>Last location</th>
303 [% IF ( itemdata_enumchron ) %]
309 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
310 <tr class="[% itemLoo.backgroundcolor %]">
311 <td class="copynumber">
312 [% IF ( itemLoo.available ) %]
313 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]" value="[% itemLoo.itemnumber %]" />
315 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]"
316 style="display:none;" />
317 <img src="[% interface %]/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
320 [% IF ( itemLoo.copynumber ) %]
321 [% itemLoo.copynumber %]
325 [% IF ( item_level_itypes ) %]
327 [% UNLESS ( noItemTypeImages ) %]
328 [% IF ( itemLoo.imageurl ) %]
329 <img src="[% itemLoo.imageurl %]" alt="" />
332 [% itemLoo.description %]
336 <td class="barcode">[% itemLoo.barcode %]</td>
337 [% UNLESS ( singleBranchMode ) %]
338 <td class="homebranch">[% itemLoo.homeBranchName %]</td>
339 <td class="holdingbranch">[% itemLoo.holdingBranchName %]</td>
341 <td class="call_no">[% itemLoo.callNumber %]</td>
342 [% IF ( itemdata_enumchron ) %]
343 <td class="vol_info">[% itemLoo.enumchron %]</td>
345 <td class="information">
346 [% IF ( itemLoo.dateDue ) %]
347 <span class="checkedout">Due [% itemLoo.dateDue %]</span>
348 [% ELSIF ( itemLoo.transfertwhen ) %]
349 <span class="intransit">In transit from [% itemLoo.transfertfrom %] to [% itemLoo.transfertto %] since [% itemLoo.transfertwhen %]</span>
352 [% IF ( itemLoo.message ) %]
353 <span class="lost">Unavailable (lost or missing)</span>
356 [% IF ( itemLoo.notforloan ) %]
357 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
360 [% IF ( itemLoo.reservedate ) %]
361 <span class="waiting">
362 [% IF ( itemLoo.waitingdate ) %]
368 [% IF ( itemLoo.waitingdate ) %]
373 [% itemLoo.ExpectedAtLibrary %] since
374 [% IF ( itemLoo.waitingdate ) %]
375 [% itemLoo.waitingdate | $KohaDates %]
377 [% IF ( itemLoo.reservedate ) %]
378 [% itemLoo.reservedate %]
383 <span class="notonhold">Not on hold</span>
384 [% END # / IF ( itemLoo.reservedate )%]
387 [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
388 </table> <!-- / #copiesrow_[% bibitemloo.biblionumber %] -->
389 [% END # / IF ( OPACItemHolds )%]
390 </div> <!-- / #hold-options-[% bibitemloo.biblionumber %] -->
392 [% END # / IF ( bibitemloo.holdable ) %]
393 </div> <!-- / .holdrow -->
394 [% END # / FOREACH bibitemloo IN bibitemloop %]
395 </div><!-- #bigloop -->
397 [% UNLESS ( none_available ) %]
398 <input type="submit" value="Place hold" class="btn placehold" />
402 [% END # / UNLESS message %]
403 </div> <!-- / #holds -->
404 </div> <!-- / .container -->
405 </div> <!-- / .main -->
406 [% INCLUDE 'opac-bottom.inc' %]
407 [% BLOCK jsinclude %]
408 [% INCLUDE 'calendar.inc' %]
409 <script type="text/javascript">
411 var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection.");
412 var ForceHoldNotesReasons=new Array(
413 _("This title consists of multiple volumes/parts. Please indicate which part you need. Clicking on specific item information may be helpful."),
414 "*** Add a new reason above this line ***" );
415 // NOTE: Do not renumber reasons; this will affect use of existing ones.
417 // Clear the contents of an input field
418 $(".clearfield").on("click",function(e){
419 $(this).closest("td").find("input").val("");
423 // Select the first item available
424 function select_first_available(id){
425 var radios = $("input:radio[name='checkitem_" + id + "']");
426 $(radios).first().attr("checked", "checked");
429 $(document).ready(function() {
430 $("#hold-request-form").preventDoubleFormSubmit();
431 var copiesRowId = null;
432 var wasSpecific = false;
433 var lastCopiesRowId = null;
435 $(".toggle-hold-options").show();
436 $(".hold-options").hide();
437 $(".holddatefrom,.holddateto").prop("readOnly", true);
439 $(".checkitem").parent().click(function(e){
440 if(e.target.tagName.toLowerCase() == 'td'){
441 $(this).find("input.checkitem").each( function() {
442 $(this).attr('checked', 'checked');
447 // click on a first td check the confirmjs checkbox
448 $("td.hold").click(function(e){
449 if(e.target.tagName.toLowerCase() == 'td'){
450 $(this).find("input.confirmjs").each( function() {
451 $(this).attr('checked', !$(this).attr('checked'));
457 $(".toggle-hold-options").on("click",function(e){
459 toggleLink = $(this);
460 var optionsID = this.id.replace("toggle-hold-options-","");
461 $("#hold-options-"+optionsID).toggle(0, function() {
462 toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
466 // Hides all 'specific copy' table rows on load.
467 $(".copiesrow").hide();
469 [% IF OPACItemHolds == 'force' %]
470 [% FOREACH bibitemloo IN bibitemloop %]
471 [% IF bibitemloo.holdable %]
472 $("#toggle-hold-options-[% bibitemloo.biblionumber %]").click();
473 $("#copiesrow_[% bibitemloo.biblionumber %]").show();
478 // Insert reasons for forced hold notes
479 $(".forcenotesreason").each(function(){
480 biblioNum = suffixOf($(this).attr("id"), "_");
481 var j=$("#notesmandatory_"+biblioNum).val();
483 $(this).html(ForceHoldNotesReasons[j-1]);
487 $(".date-format").each(function(){
488 if($(this).hasClass("to")){ var op = "to"; }
489 if($(this).hasClass("from")){ var op = "from"; }
490 var bibNum = $(this).data("biblionumber");
491 $(this).html("<a href=\"#\" class=\"clear-date\" data-op=\"" + op + "\" id=\"clear" + bibNum + "\">" + _("Clear date") + "</a>");
494 $(".clear-date").on("click",function(e){
496 var fieldID = this.id.replace("clear","");
497 var op = $(this).data("op");
498 $("#" + op + fieldID).val("");
501 // Replace non-JS single-selection with multi-selection capability.
502 $(".reserve_mode").val("multi");
503 $(".confirm_nonjs").remove();
504 $(".confirmjs_hold").each(function(){
505 var bib = $(this).attr("title");
506 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
507 html += "value=\"" + bib + "\" id=\"" + bib + "\" /> " + _("Place a hold on") + " </label> ";
510 $(".confirmjs_nohold").each(function(){
511 var bib = $(this).attr("title");
512 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
513 html += "value=\"" + bib + "\" id=\"" + bib + "\" />" + _("Place a hold on: ") + "</label>";
517 // expand or collapse the copiesrow tr
518 function toggle_copiesrow(biblioNum) {
519 var checkbox = $("input:checkbox[value='"+biblioNum+"']");
520 newCopiesRowId = "#copiesrow_" + biblioNum;
521 var select_specific = $("#reqspecific_"+biblioNum).is(":checked");
522 // If the checkbox is checked AND we want a specific item, we display the items block
523 if ( $(checkbox).is(":checked") && select_specific ) {
524 $(newCopiesRowId).show();
526 $(newCopiesRowId).hide();
530 $("#place_on_hdr").show();
532 [% IF OPACItemHolds == '1' %]
533 $(".place_on_type").show();
534 // onload, selectany is checked
535 $(".selectany").attr("checked", "checked");
538 // If the user is *allowed* to choose a specific item
539 // The first one is preselected
540 [% IF OPACItemHolds =="1" %]
541 $("table.copiesrow").each(function(){
542 var id = suffixOf($(this).attr("id"), "_");
543 select_first_available(id);
547 // On confirmsjs change
548 $(".confirmjs").change(function(){
549 var id = suffixOf($(this).attr("id"), "_");
550 // If I m checked, I enable radio buttons
551 if ( $(this).is(":checked") ) {
552 $("#reqspecific_" + id).attr("disabled", false);
553 $("#reqany_" + id).attr("disabled", false);
555 // Else its are disabled
557 $("#reqspecific_" + id).attr("disabled", "disabled");
558 $("#reqany_" + id).attr("disabled", "disabled");
560 // expand or collaspe the items block
561 toggle_copiesrow(id);
564 // When 'specific copy' or 'first available' radio button is clicked
565 $(".selectspecific, .selectany").click(function() {
566 var id = suffixOf($(this).attr("id"), "_");
567 toggle_copiesrow(id);
570 // Show or hide holds notes
571 $(".shownotes").click(function(){
572 biblioNum = suffixOf($(this).attr("id"), "_");
573 $("#notesrow_"+biblioNum).toggle();
576 // When 'Place Hold' button is clicked
577 $(".placehold").click(function(){
578 var biblionumbers = "";
581 [% IF new_reserves_allowed %]
582 if ($(".confirmjs:checked").size() > [% new_reserves_allowed %] ) {
583 alert(MSG_MAX_HOLDS_EXCEEDED);
588 if ($(".confirmjs:checked").size() == 0) {
589 alert(MSG_NO_RECORD_SELECTED);
593 // Find the items with the 'Hold' box checked
595 $(".confirmjs:checked").each(function() {
596 var biblioNum = $(this).val();
597 biblionumbers += biblioNum + "/";
598 selections += biblioNum + "/";
600 // If the 'specific copy' radio button is checked
601 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
602 // Find the selected copy
603 var item = $(".checkitem_" + biblioNum + ":checked");
604 if ($(item).size() == 0) {
608 selections += $(item).val();
613 // Add the pickup location
614 var branchSel = $("#branch_" + biblioNum);
615 if (branchSel.size() > 0) {
616 selections += $(branchSel).val();
623 alert(MSG_NO_ITEM_SELECTED);
627 $("#selections").val(selections);
628 $("#biblionumbers").val(biblionumbers);
633 [% FOREACH bibitemloo IN bibitemloop %]
634 [% IF ( bibitemloo.holdable ) %]
635 // http://jqueryui.com/demos/datepicker/#date-range
636 var dates[% bibitemloo.biblionumber %] = $( "#from[% bibitemloo.biblionumber %], #to[% bibitemloo.biblionumber %]" ).datepicker({
640 onSelect: function( selectedDate ) {
641 var option = this.id == "from[% bibitemloo.biblionumber %]" ? "minDate" : "maxDate",
642 instance = $( this ).data( "datepicker" );
643 date = $.datepicker.parseDate(
644 instance.settings.dateFormat ||
645 $.datepicker._defaults.dateFormat,
646 selectedDate, instance.settings );
647 dates[% bibitemloo.biblionumber %].not( this ).datepicker( "option", option, date );