3 [% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog › Placing a hold
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% BLOCK cssinclude %][% END %]
9 [% INCLUDE 'masthead.inc' %]
12 <ul class="breadcrumb">
13 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
14 <li><a href="#">Placing a hold</a></li>
17 <div class="container">
22 <div id="gna" class="alert">
23 <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>
24 <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>
29 <div id="lost" class="alert">
30 <p><strong>Sorry</strong>, you cannot place holds because your library card has been marked as lost or stolen.</p>
31 <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>
36 <div id="debarred" class="alert">
37 <p><strong>Sorry</strong>, you cannot place holds because your account has been frozen.</p>
38 <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>
42 [% IF ( too_much_oweing ) %]
43 <div id="too_much_oweing" class="alert">
44 Sorry, you cannot place holds because you owe [% too_much_oweing %].
48 [% IF ( too_many_reserves ) %]
49 <div id="too_many_reserves" class="alert">
50 Sorry, you cannot place more than [% too_many_reserves %] holds.
54 [% IF ( bad_biblionumber ) %]
55 <div id="bad_biblionumber" class="alert">
56 ERROR: No biblio record found for biblionumber [% bad_biblionumber %].</div>
59 [% IF ( no_items_selected ) %]
60 <div id="no_items_selected" class="alert">
61 You must select at least one item.
65 [% IF ( no_branch_selected ) %]
66 <div id="no_branch_selected" class="alert">
67 You must select a library for pickup.
71 [% IF ( no_biblionumber ) %]
72 <div id="no_biblionumber" class="alert">ERROR: No biblionumber received.</div>
76 <div id="bad_data" class="alert">ERROR: Internal error: incomplete hold request.</div>
81 [% IF ( none_available ) %]
82 <div id="none_available" class="alert"><strong>Sorry</strong>, none of these items can be placed on hold.
86 [% END # / IF message %]
88 [% UNLESS ( message ) %]
89 [% UNLESS ( none_available ) %]
90 <h3>Confirm holds for:
91 [% FOREACH USER_INF IN USER_INFO %]
92 [% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %])
95 [% END # / UNLESS none_available %]
97 [% IF (RESERVE_CHARGE) %]
98 <div class="alert" id="reserve_fee">
99 There is a charge of [% RESERVE_CHARGE %] for placing this hold
103 <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
104 <input type="hidden" name="place_reserve" value="1"/>
105 <!-- These values are set dynamically by js -->
106 <input type="hidden" name="biblionumbers" id="biblionumbers"/>
107 <input type="hidden" name="selecteditems" id="selections"/>
110 [% FOREACH bibitemloo IN bibitemloop %]
111 <div class="holdrow">
113 [% IF ( bibitemloo.holdable ) %]
114 <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
115 <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber %]"/>
116 <span class="confirmjs_hold" title="[% bibitemloo.biblionumber %]" style="padding:.3em"></span>
117 <span class="confirm_nonjs">
118 <input type="radio" class="confirmbox checkitem [% bibitemloo.biblionumber %]" name="[% bibitemloo.biblionumber %]" checked="checked" id="single_[% bibitemloo.biblionumber %]" value="any" />
119 <label class="confirm_label" for="single_[% bibitemloo.biblionumber %]">Place a hold on </label>
121 [% END # / bibitemloo.holdable %]
123 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% bibitemloo.biblionumber %]">
124 [% bibitemloo.title |html %]
125 [% IF ( bibitemloo.subtitle ) %]
126 [% FOREACH subtitl IN bibitemloo.subtitle %]
127 [% subtitl.subfield %]
131 [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %]
134 [% UNLESS ( bibitemloo.holdable ) %]
135 [% IF ( bibitemloo.already_reserved ) %]
136 <div class="alert">You have already requested this title.</div>
138 [% UNLESS ( bibitemloo.bib_available ) %]
139 <div class="alert">No available items.</div>
141 [% IF ( bibitemloo.already_patron_possession ) %]
142 <div class="alert">This title cannot be requested because it's already in your possession.</div>
144 <div class="alert">This title cannot be requested.</div>
146 [% END # / UNLESS bibitemloo.bib_available %]
147 [% END # / IF bibitemloo.already_reserved %]
148 [% END # / UNLESS bibitemloo.holdable %]
150 [% IF ( bibitemloo.holdable ) %]
151 <fieldset class="rows">
154 [% UNLESS ( item_level_itypes ) %]
156 <span class="label">Item type: </span>
157 [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
158 [% bibitemloo.description %]
162 [% IF showholds || showpriority %]
163 <li class="priority">
164 <span class="label">Holds and priority: </span>
165 [% IF showpriority %] [% bibitemloo.rank %] [% END %]
166 [% IF showholds && showpriority %] out of [% END %]
167 [% IF showholds %] [% bibitemloo.reservecount %] [% END %]
172 [% UNLESS ( singleBranchMode ) %]
173 [% IF ( bibitemloo.holdable && choose_branch ) %]
175 <label for="branch_[% bibitemloo.biblionumber %]">Pick up location:</label>
176 [% UNLESS ( bibitemloo.holdable ) %]
177 <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
178 [% FOREACH branchloo IN bibitemloo.branchloop %]
179 [% IF ( branchloo.selected ) %]
180 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
182 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
187 <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
188 [% FOREACH branchloo IN bibitemloo.branchloop %]
189 [% IF ( branchloo.selected ) %]
190 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
192 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
196 [% END # / UNLESS bibitemloo.holdable %]
198 [% END # / IF bibitemloo.holdable && choose_branch %]
199 [% END # / UNLESS singleBranchMode %]
202 <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber %]" style="display:none;" href="#">Show more options</a>
204 <div id="hold-options-[% bibitemloo.biblionumber %]" class="hold-options">
207 [% IF ( reserve_in_future ) %]
209 <label for="from[% bibitemloo.biblionumber %]">Hold starts on date:</label>
210 <input name="reserve_date_[% bibitemloo.biblionumber %]" id="from[% bibitemloo.biblionumber %]" size="10" class="holddatefrom"/>
211 <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
216 <label for="to[% bibitemloo.biblionumber %]">Hold not needed after:</label>
217 <input name="expiration_date_[% bibitemloo.biblionumber %]" id="to[% bibitemloo.biblionumber %]" size="10" class="holddateto" />
218 <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
221 [% IF ( OpacHoldNotes ) %]
223 <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
224 <label for="holdnotes[% bibitemloo.biblionumber %]">Hold notes:</label>
225 <span id="forcenotesreason_[% bibitemloo.biblionumber %]" class="forcenotesreason"></span>
226 <textarea id="holdnotes[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]">[% bibitemloo.holdnotes %]</textarea>
227 <input type="hidden" id="notesmandatory_[% bibitemloo.biblionumber %]" value="[% bibitemloo.mandatorynotes %]"/>
230 [% END # / IF OpacHoldNotes %]
232 [% IF ( OPACItemHolds ) %]
235 <label class="radio inline" for="reqany_[% bibitemloo.biblionumber %]">Next available copy</label>
236 [% UNLESS ( bibitemloo.holdable ) %]
237 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqany_[% bibitemloo.biblionumber %]" class="selectany" value="Any" disabled="disabled" />
239 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqany_[% bibitemloo.biblionumber %]" class="selectany" value="Any" checked="checked" />
242 <label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber %]">A specific copy</label>
243 [% UNLESS ( bibitemloo.holdable ) %]
244 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqspecific_[% bibitemloo.biblionumber %]" class="selectspecific" disabled="disabled" value="Specific" />
246 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqspecific_[% bibitemloo.biblionumber %]" class="selectspecific" value="Specific" />
249 [% END # / IF OPACItemHolds %]
252 [% IF ( OPACItemHolds ) %]
253 <table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber %]">
254 <caption>Select a specific copy:</caption>
257 [% IF ( item_level_itypes ) %]
261 [% UNLESS ( singleBranchMode ) %]
262 <th>Home library</th>
263 <th>Last location</th>
266 [% IF ( itemdata_enumchron ) %]
272 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
273 <tr class="[% itemLoo.backgroundcolor %]">
275 [% IF ( itemLoo.available ) %]
276 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]" value="[% itemLoo.itemnumber %]" />
278 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]" />
279 <img src="[% interface %]/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
282 [% IF ( itemLoo.copynumber ) %]
283 [% itemLoo.copynumber %]
287 [% IF ( item_level_itypes ) %]
289 [% UNLESS ( noItemTypeImages ) %]
290 [% IF ( itemLoo.imageurl ) %]
291 <img src="[% itemLoo.imageurl %]" alt="" />
294 [% itemLoo.description %]
298 <td class="barcode">[% itemLoo.barcode %]</td>
299 [% UNLESS ( singleBranchMode ) %]
300 <td class="homebranch">[% itemLoo.homeBranchName %]</td>
301 <td class="holdingbranch">[% itemLoo.holdingBranchName %]</td>
303 <td class="call_no">[% itemLoo.callNumber %]</td>
304 [% IF ( itemdata_enumchron ) %]
305 <td class="vol_info">[% itemLoo.enumchron %]</td>
307 <td class="information">
308 [% IF ( itemLoo.dateDue ) %]
309 <span class="checkedout">Due [% itemLoo.dateDue %]</span>
310 [% ELSIF ( itemLoo.transfertwhen ) %]
311 <span class="intransit">In transit from [% itemLoo.transfertfrom %] to [% itemLoo.transfertto %] since [% itemLoo.transfertwhen %]</span>
314 [% IF ( itemLoo.message ) %]
315 <span class="lost">Unavailable (lost or missing)</span>
318 [% IF ( itemLoo.notforloan ) %]
319 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
322 [% IF ( itemLoo.reservedate ) %]
323 <span class="waiting">
324 [% IF ( itemLoo.waitingdate ) %]
330 [% IF ( itemLoo.waitingdate ) %]
335 [% itemLoo.ExpectedAtLibrary %] since
336 [% IF ( itemLoo.waitingdate ) %]
337 [% itemLoo.waitingdate | $KohaDates %]
339 [% IF ( itemLoo.reservedate ) %]
340 [% itemLoo.reservedate %]
345 <span class="notonhold">Not on hold</span>
346 [% END # / IF ( itemLoo.reservedate )%]
349 [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
350 </table> <!-- / #copiesrow_[% bibitemloo.biblionumber %] -->
351 [% END # / IF ( OPACItemHolds )%]
352 </div> <!-- / #hold-options-[% bibitemloo.biblionumber %] -->
354 [% END # / IF ( bibitemloo.holdable ) %]
355 </div> <!-- / .holdrow -->
356 [% END # / FOREACH bibitemloo IN bibitemloop %]
357 </div><!-- #bigloop -->
359 [% UNLESS ( none_available ) %]
360 <input type="submit" value="Place hold" class="btn placehold" />
364 [% END # / UNLESS message %]
365 </div> <!-- / #holds -->
366 </div> <!-- / .container -->
367 </div> <!-- / .main -->
368 [% INCLUDE 'opac-bottom.inc' %]
369 [% BLOCK jsinclude %]
370 [% INCLUDE 'calendar.inc' %]
371 <script type="text/javascript">
373 var MSG_NO_COPY_SELECTED = _("Expecting a specific copy selection.");
374 var ForceHoldNotesReasons=new Array(
375 _("This title consists of multiple volumes/parts. Please indicate which part you need. Clicking on specific copy information may be helpful."),
376 "*** Add a new reason above this line ***" );
377 // NOTE: Do not renumber reasons; this will affect use of existing ones.
379 // Clear the contents of an input field
380 $(".clearfield").on("click",function(e){
381 $(this).closest("td").find("input").val("");
384 $(document).ready(function() {
385 $("#hold-request-form").preventDoubleFormSubmit();
386 var copiesRowId = null;
387 var wasSpecific = false;
388 var lastCopiesRowId = null;
389 $(".checkitem").parent().click(function(e){
390 if(e.target.tagName.toLowerCase() == 'td'){
391 $(this).find("input.checkitem").each( function() {
392 $(this).attr('checked', !$(this).attr('checked'));
396 // Hides all 'specific copy' table rows on load.
397 $(".copiesrow").hide();
399 // Insert reasons for forced hold notes
400 $(".forcenotesreason").each(function(){
401 biblioNum = suffixOf($(this).attr("id"), "_");
402 var j=$("#notesmandatory_"+biblioNum).val();
404 $(this).html(ForceHoldNotesReasons[j-1]);
408 $("#place_on_hdr").show();
409 $(".place_on_type").show();
410 $("#place_on_hdr,.place_on_type,.toggle-hold-options").show();
411 $(".hold-options").hide();
412 $(".holddatefrom,.holddateto").prop("readOnly", true);
414 $(".date-format").each(function(){
415 if($(this).hasClass("to")){ var op = "to"; }
416 if($(this).hasClass("from")){ var op = "from"; }
417 var bibNum = $(this).data("biblionumber");
418 $(this).html("<a href=\"#\" class=\"clear-date\" data-op=\"" + op + "\" id=\"clear" + bibNum + "\">" + _("Clear date") + "</a>");
421 $(".clear-date").on("click",function(e){
423 var fieldID = this.id.replace("clear","");
424 var op = $(this).data("op");
425 $("#" + op + fieldID).val("");
428 // Replace non-JS single-selection with multi-selection capability.
429 $(".reserve_mode").val("multi");
430 $(".confirm_nonjs").remove();
431 $(".confirmjs_hold").each(function(){
432 var bib = $(this).attr("title");
433 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
434 html += "value=\"" + bib + "\"/> " + _("Place a hold on") + " </label> ";
437 $(".confirmjs_nohold").each(function(){
438 var bib = $(this).attr("title");
439 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
440 html += "value=\"" + bib + "\"/>" + _("Place a hold on: ") + "</label>";
444 // Make sure a specific item was selected where specified
445 // before moving on to a new item.
446 function changeSelection (newCopiesRowId, isSpecific) {
447 if (copiesRowId && ((copiesRowId != newCopiesRowId) || (wasSpecific != isSpecific))) {
448 var biblioNum = suffixOf(copiesRowId, "_");
450 // If the 'specific copy' radio button was checked
451 if (wasSpecific && (copiesRowId != newCopiesRowId)) {
452 // Find the selected copy
453 var item = $(".checkitem_" + biblioNum + ":checked");
454 if ($(item).size() == 0) {
455 alert(MSG_NO_COPY_SELECTED);
460 copiesRowId = newCopiesRowId;
461 wasSpecific = isSpecific;
465 // When 'specific copy' radio button is clicked
466 $(".selectspecific").click(function() {
468 // Make sure all other specific copy table rows are hidden
469 biblioNum = suffixOf($(this).attr("id"), "_");
470 newCopiesRowId = "#copiesrow_" + biblioNum;
472 if (!changeSelection(newCopiesRowId, true)) {
476 // Show the specific copy table for this radio button.
477 $(newCopiesRowId).show();
480 // When 'first available' radion button is clicked
481 $(".selectany").click(function() {
482 // Make sure all other specific copy table rows are hidden
483 biblioNum = suffixOf($(this).attr("id"), "_");
484 newCopiesRowId = "#copiesrow_" + biblioNum;
486 if (!changeSelection(newCopiesRowId, false)) {
490 // Hide the copies table row
491 $(newCopiesRowId).hide();
494 // When 'Place Hold' button is clicked
495 $(".placehold").click(function(){
496 var biblionumbers = "";
499 if ($(".confirmjs:checked").size() == 0) {
500 alert(MSG_NO_RECORD_SELECTED);
504 // Find the items with the 'Hold' box checked
506 $(".confirmjs:checked").each(function() {
507 var biblioNum = $(this).val();
508 biblionumbers += biblioNum + "/";
509 selections += biblioNum + "/";
511 // If the 'specific copy' radio button is checked
512 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
513 // Find the selected copy
514 var item = $(".checkitem_" + biblioNum + ":checked");
515 if ($(item).size() == 0) {
519 selections += $(item).val();
524 // Add the pickup location
525 var branchSel = $("#branch_" + biblioNum);
526 if (branchSel.size() > 0) {
527 selections += $(branchSel).val();
534 alert(MSG_NO_COPY_SELECTED);
538 $("#selections").val(selections);
539 $("#biblionumbers").val(biblionumbers);
544 $(".toggle-hold-options").on("click",function(e){
546 toggleLink = $(this);
547 var optionsID = this.id.replace("toggle-hold-options-","");
548 $("#hold-options-"+optionsID).toggle(0, function() {
549 toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
553 [% FOREACH bibitemloo IN bibitemloop %]
554 [% IF ( bibitemloo.holdable ) %]
555 // http://jqueryui.com/demos/datepicker/#date-range
556 var dates[% bibitemloo.biblionumber %] = $( "#from[% bibitemloo.biblionumber %], #to[% bibitemloo.biblionumber %]" ).datepicker({
560 onSelect: function( selectedDate ) {
561 var option = this.id == "from[% bibitemloo.biblionumber %]" ? "minDate" : "maxDate",
562 instance = $( this ).data( "datepicker" );
563 date = $.datepicker.parseDate(
564 instance.settings.dateFormat ||
565 $.datepicker._defaults.dateFormat,
566 selectedDate, instance.settings );
567 dates[% bibitemloo.biblionumber %].not( this ).datepicker( "option", option, date );