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 [% IF showholds || showpriority %]
177 <li class="priority">
178 <span class="label">Holds and priority: </span>
179 [% IF showpriority %] [% bibitemloo.rank %] [% END %]
180 [% IF showholds && showpriority %] out of [% END %]
181 [% IF showholds %] [% bibitemloo.reservecount %] [% END %]
186 [% UNLESS ( singleBranchMode ) %]
187 [% IF ( bibitemloo.holdable && choose_branch ) %]
189 <label for="branch_[% bibitemloo.biblionumber %]">Pick up location:</label>
190 [% UNLESS ( bibitemloo.holdable ) %]
191 <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
192 [% FOREACH branchloo IN bibitemloo.branchloop %]
193 [% IF ( branchloo.selected ) %]
194 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
196 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
201 <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
202 [% FOREACH branchloo IN bibitemloo.branchloop %]
203 [% IF ( branchloo.selected ) %]
204 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
206 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
210 [% END # / UNLESS bibitemloo.holdable %]
212 [% END # / IF bibitemloo.holdable && choose_branch %]
213 [% END # / UNLESS singleBranchMode %]
216 <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber %]" style="display:none;" href="#">Show more options</a>
218 <div id="hold-options-[% bibitemloo.biblionumber %]" class="hold-options">
221 [% IF ( reserve_in_future ) %]
223 <label for="from[% bibitemloo.biblionumber %]">Hold starts on date:</label>
224 <input name="reserve_date_[% bibitemloo.biblionumber %]" id="from[% bibitemloo.biblionumber %]" size="10" class="holddatefrom"/>
225 <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
230 <label for="to[% bibitemloo.biblionumber %]">Hold not needed after:</label>
231 <input name="expiration_date_[% bibitemloo.biblionumber %]" id="to[% bibitemloo.biblionumber %]" size="10" class="holddateto" />
232 <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
235 [% IF ( OpacHoldNotes ) %]
237 <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
238 <label for="holdnotes[% bibitemloo.biblionumber %]">Hold notes:</label>
239 <span id="forcenotesreason_[% bibitemloo.biblionumber %]" class="forcenotesreason"></span>
240 <textarea id="holdnotes[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]">[% bibitemloo.holdnotes %]</textarea>
241 <input type="hidden" id="notesmandatory_[% bibitemloo.biblionumber %]" value="[% bibitemloo.mandatorynotes %]"/>
244 [% END # / IF OpacHoldNotes %]
246 [% IF OPACItemHolds == '1' or OPACItemHolds == 'force' %]
248 <li class="lradio place_on_type" style="display:none;">
249 <label class="radio inline" for="reqany_[% bibitemloo.biblionumber %]">Next available item</label>
250 [% IF OPACItemHolds == "1" %]
251 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
252 id="reqany_[% bibitemloo.biblionumber %]"
258 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
259 id="reqany_[% bibitemloo.biblionumber %]"
264 <label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber %]">A specific item</label>
265 [% IF OPACItemHolds == "force" %]
266 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
267 id="reqspecific_[% bibitemloo.biblionumber %]"
268 class="selectspecific"
273 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
274 id="reqspecific_[% bibitemloo.biblionumber %]"
275 class="selectspecific"
280 [% END # / IF OPACItemHolds %]
283 [% IF OPACItemHolds == '1' || OPACItemHolds == 'force' %]
284 <table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber %]">
285 <caption>Select a specific item:</caption>
288 [% IF ( item_level_itypes ) %]
292 [% UNLESS ( singleBranchMode ) %]
293 <th>Home library</th>
294 <th>Last location</th>
297 [% IF ( itemdata_enumchron ) %]
303 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
304 <tr class="[% itemLoo.backgroundcolor %]">
305 <td class="copynumber">
306 [% IF ( itemLoo.available ) %]
307 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]" value="[% itemLoo.itemnumber %]" />
309 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]"
310 style="display:none;" />
311 <img src="[% interface %]/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
314 [% IF ( itemLoo.copynumber ) %]
315 [% itemLoo.copynumber %]
319 [% IF ( item_level_itypes ) %]
321 [% UNLESS ( noItemTypeImages ) %]
322 [% IF ( itemLoo.imageurl ) %]
323 <img src="[% itemLoo.imageurl %]" alt="" />
326 [% itemLoo.description %]
330 <td class="barcode">[% itemLoo.barcode %]</td>
331 [% UNLESS ( singleBranchMode ) %]
332 <td class="homebranch">[% itemLoo.homeBranchName %]</td>
333 <td class="holdingbranch">[% itemLoo.holdingBranchName %]</td>
335 <td class="call_no">[% itemLoo.callNumber %]</td>
336 [% IF ( itemdata_enumchron ) %]
337 <td class="vol_info">[% itemLoo.enumchron %]</td>
339 <td class="information">
340 [% IF ( itemLoo.dateDue ) %]
341 <span class="checkedout">Due [% itemLoo.dateDue %]</span>
342 [% ELSIF ( itemLoo.transfertwhen ) %]
343 <span class="intransit">In transit from [% itemLoo.transfertfrom %] to [% itemLoo.transfertto %] since [% itemLoo.transfertwhen %]</span>
346 [% IF ( itemLoo.message ) %]
347 <span class="lost">Unavailable (lost or missing)</span>
350 [% IF ( itemLoo.notforloan ) %]
351 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
354 [% IF ( itemLoo.reservedate ) %]
355 <span class="waiting">
356 [% IF ( itemLoo.waitingdate ) %]
362 [% IF ( itemLoo.waitingdate ) %]
367 [% itemLoo.ExpectedAtLibrary %] since
368 [% IF ( itemLoo.waitingdate ) %]
369 [% itemLoo.waitingdate | $KohaDates %]
371 [% IF ( itemLoo.reservedate ) %]
372 [% itemLoo.reservedate %]
377 <span class="notonhold">Not on hold</span>
378 [% END # / IF ( itemLoo.reservedate )%]
381 [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
382 </table> <!-- / #copiesrow_[% bibitemloo.biblionumber %] -->
383 [% END # / IF ( OPACItemHolds )%]
384 </div> <!-- / #hold-options-[% bibitemloo.biblionumber %] -->
386 [% END # / IF ( bibitemloo.holdable ) %]
387 </div> <!-- / .holdrow -->
388 [% END # / FOREACH bibitemloo IN bibitemloop %]
389 </div><!-- #bigloop -->
391 [% UNLESS ( none_available ) %]
392 <input type="submit" value="Place hold" class="btn placehold" />
396 [% END # / UNLESS message %]
397 </div> <!-- / #holds -->
398 </div> <!-- / .container -->
399 </div> <!-- / .main -->
400 [% INCLUDE 'opac-bottom.inc' %]
401 [% BLOCK jsinclude %]
402 [% INCLUDE 'calendar.inc' %]
403 <script type="text/javascript">
405 var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection.");
406 var ForceHoldNotesReasons=new Array(
407 _("This title consists of multiple volumes/parts. Please indicate which part you need. Clicking on specific item information may be helpful."),
408 "*** Add a new reason above this line ***" );
409 // NOTE: Do not renumber reasons; this will affect use of existing ones.
411 // Clear the contents of an input field
412 $(".clearfield").on("click",function(e){
413 $(this).closest("td").find("input").val("");
417 // Select the first item available
418 function select_first_available(id){
419 var radios = $("input:radio[name='checkitem_" + id + "']");
420 $(radios).first().attr("checked", "checked");
423 $(document).ready(function() {
424 $("#hold-request-form").preventDoubleFormSubmit();
425 var copiesRowId = null;
426 var wasSpecific = false;
427 var lastCopiesRowId = null;
429 $(".toggle-hold-options").show();
430 $(".hold-options").hide();
431 $(".holddatefrom,.holddateto").prop("readOnly", true);
433 $(".checkitem").parent().click(function(e){
434 if(e.target.tagName.toLowerCase() == 'td'){
435 $(this).find("input.checkitem").each( function() {
436 $(this).attr('checked', 'checked');
441 // click on a first td check the confirmjs checkbox
442 $("td.hold").click(function(e){
443 if(e.target.tagName.toLowerCase() == 'td'){
444 $(this).find("input.confirmjs").each( function() {
445 $(this).attr('checked', !$(this).attr('checked'));
451 $(".toggle-hold-options").on("click",function(e){
453 toggleLink = $(this);
454 var optionsID = this.id.replace("toggle-hold-options-","");
455 $("#hold-options-"+optionsID).toggle(0, function() {
456 toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
460 // Hides all 'specific copy' table rows on load.
461 $(".copiesrow").hide();
463 [% IF OPACItemHolds == 'force' %]
464 [% FOREACH bibitemloo IN bibitemloop %]
465 [% IF bibitemloo.holdable %]
466 $("#toggle-hold-options-[% bibitemloo.biblionumber %]").click();
467 $("#copiesrow_[% bibitemloo.biblionumber %]").show();
472 // Insert reasons for forced hold notes
473 $(".forcenotesreason").each(function(){
474 biblioNum = suffixOf($(this).attr("id"), "_");
475 var j=$("#notesmandatory_"+biblioNum).val();
477 $(this).html(ForceHoldNotesReasons[j-1]);
481 $(".date-format").each(function(){
482 if($(this).hasClass("to")){ var op = "to"; }
483 if($(this).hasClass("from")){ var op = "from"; }
484 var bibNum = $(this).data("biblionumber");
485 $(this).html("<a href=\"#\" class=\"clear-date\" data-op=\"" + op + "\" id=\"clear" + bibNum + "\">" + _("Clear date") + "</a>");
488 $(".clear-date").on("click",function(e){
490 var fieldID = this.id.replace("clear","");
491 var op = $(this).data("op");
492 $("#" + op + fieldID).val("");
495 // Replace non-JS single-selection with multi-selection capability.
496 $(".reserve_mode").val("multi");
497 $(".confirm_nonjs").remove();
498 $(".confirmjs_hold").each(function(){
499 var bib = $(this).attr("title");
500 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
501 html += "value=\"" + bib + "\" id=\"" + bib + "\" /> " + _("Place a hold on") + " </label> ";
504 $(".confirmjs_nohold").each(function(){
505 var bib = $(this).attr("title");
506 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
507 html += "value=\"" + bib + "\" id=\"" + bib + "\" />" + _("Place a hold on: ") + "</label>";
511 // expand or collapse the copiesrow tr
512 function toggle_copiesrow(biblioNum) {
513 var checkbox = $("input:checkbox[value='"+biblioNum+"']");
514 newCopiesRowId = "#copiesrow_" + biblioNum;
515 var select_specific = $("#reqspecific_"+biblioNum).is(":checked");
516 // If the checkbox is checked AND we want a specific item, we display the items block
517 if ( $(checkbox).is(":checked") && select_specific ) {
518 $(newCopiesRowId).show();
520 $(newCopiesRowId).hide();
524 $("#place_on_hdr").show();
526 [% IF OPACItemHolds == '1' %]
527 $(".place_on_type").show();
528 // onload, selectany is checked
529 $(".selectany").attr("checked", "checked");
532 // If the user is *allowed* to choose a specific item
533 // The first one is preselected
534 [% IF OPACItemHolds =="1" %]
535 $("table.copiesrow").each(function(){
536 var id = suffixOf($(this).attr("id"), "_");
537 select_first_available(id);
541 // On confirmsjs change
542 $(".confirmjs").change(function(){
543 var id = suffixOf($(this).attr("id"), "_");
544 // If I m checked, I enable radio buttons
545 if ( $(this).is(":checked") ) {
546 $("#reqspecific_" + id).attr("disabled", false);
547 $("#reqany_" + id).attr("disabled", false);
549 // Else its are disabled
551 $("#reqspecific_" + id).attr("disabled", "disabled");
552 $("#reqany_" + id).attr("disabled", "disabled");
554 // expand or collaspe the items block
555 toggle_copiesrow(id);
558 // When 'specific copy' or 'first available' radio button is clicked
559 $(".selectspecific, .selectany").click(function() {
560 var id = suffixOf($(this).attr("id"), "_");
561 toggle_copiesrow(id);
564 // Show or hide holds notes
565 $(".shownotes").click(function(){
566 biblioNum = suffixOf($(this).attr("id"), "_");
567 $("#notesrow_"+biblioNum).toggle();
570 // When 'Place Hold' button is clicked
571 $(".placehold").click(function(){
572 var biblionumbers = "";
575 [% IF new_reserves_allowed %]
576 if ($(".confirmjs:checked").size() > [% new_reserves_allowed %] ) {
577 alert(MSG_MAX_HOLDS_EXCEEDED);
582 if ($(".confirmjs:checked").size() == 0) {
583 alert(MSG_NO_RECORD_SELECTED);
587 // Find the items with the 'Hold' box checked
589 $(".confirmjs:checked").each(function() {
590 var biblioNum = $(this).val();
591 biblionumbers += biblioNum + "/";
592 selections += biblioNum + "/";
594 // If the 'specific copy' radio button is checked
595 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
596 // Find the selected copy
597 var item = $(".checkitem_" + biblioNum + ":checked");
598 if ($(item).size() == 0) {
602 selections += $(item).val();
607 // Add the pickup location
608 var branchSel = $("#branch_" + biblioNum);
609 if (branchSel.size() > 0) {
610 selections += $(branchSel).val();
617 alert(MSG_NO_ITEM_SELECTED);
621 $("#selections").val(selections);
622 $("#biblionumbers").val(biblionumbers);
627 [% FOREACH bibitemloo IN bibitemloop %]
628 [% IF ( bibitemloo.holdable ) %]
629 // http://jqueryui.com/demos/datepicker/#date-range
630 var dates[% bibitemloo.biblionumber %] = $( "#from[% bibitemloo.biblionumber %], #to[% bibitemloo.biblionumber %]" ).datepicker({
634 onSelect: function( selectedDate ) {
635 var option = this.id == "from[% bibitemloo.biblionumber %]" ? "minDate" : "maxDate",
636 instance = $( this ).data( "datepicker" );
637 date = $.datepicker.parseDate(
638 instance.settings.dateFormat ||
639 $.datepicker._defaults.dateFormat,
640 selectedDate, instance.settings );
641 dates[% bibitemloo.biblionumber %].not( this ).datepicker( "option", option, date );