2 [% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog › Placing a hold
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% BLOCK cssinclude %][% END %]
8 [% INCLUDE 'masthead.inc' %]
11 <ul class="breadcrumb">
12 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
13 <li><a href="#">Placing a hold</a></li>
16 <div class="container">
21 <div id="gna" class="alert">
22 <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>
23 <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>
28 <div id="lost" class="alert">
29 <p><strong>Sorry</strong>, you cannot place holds because your library card has been marked as lost or stolen.</p>
30 <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>
35 <div id="debarred" class="alert">
36 <p><strong>Sorry</strong>, you cannot place holds because your account has been frozen.</p>
37 <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>
41 [% IF ( too_much_oweing ) %]
42 <div id="too_much_oweing" class="alert">
43 Sorry, you cannot place holds because you owe [% too_much_oweing %].
47 [% IF ( too_many_reserves ) %]
48 <div id="too_many_reserves" class="alert">
49 Sorry, you cannot place more than [% too_many_reserves %] holds.
53 [% IF ( bad_biblionumber ) %]
54 <div id="bad_biblionumber" class="alert">
55 ERROR: No biblio record found for biblionumber [% bad_biblionumber %].</div>
58 [% IF ( no_items_selected ) %]
59 <div id="no_items_selected" class="alert">
60 You must select at least one item.
64 [% IF ( no_branch_selected ) %]
65 <div id="no_branch_selected" class="alert">
66 You must select a library for pickup.
70 [% IF ( no_biblionumber ) %]
71 <div id="no_biblionumber" class="alert">ERROR: No biblionumber received.</div>
75 <div id="bad_data" class="alert">ERROR: Internal error: incomplete hold request.</div>
80 [% IF ( none_available ) %]
81 <div id="none_available" class="alert"><strong>Sorry</strong>, none of these items can be placed on hold.
85 [% END # / IF message %]
87 [% UNLESS ( message ) %]
88 [% UNLESS ( none_available ) %]
89 <h3>Confirm holds for:
90 [% FOREACH USER_INF IN USER_INFO %]
91 [% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %])
94 [% END # / UNLESS none_available %]
96 [% IF (RESERVE_CHARGE) %]
97 <div class="alert" id="reserve_fee">
98 There is a charge of [% RESERVE_CHARGE %] for placing this hold
102 <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
103 <input type="hidden" name="place_reserve" value="1"/>
104 <!-- These values are set dynamically by js -->
105 <input type="hidden" name="biblionumbers" id="biblionumbers"/>
106 <input type="hidden" name="selecteditems" id="selections"/>
109 [% FOREACH bibitemloo IN bibitemloop %]
110 <div class="holdrow">
112 [% IF ( bibitemloo.holdable ) %]
113 <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
114 <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber %]"/>
115 <span class="confirmjs_hold" title="[% bibitemloo.biblionumber %]" style="padding:.3em"></span>
116 <span class="confirm_nonjs">
117 <input type="radio" class="confirmbox checkitem [% bibitemloo.biblionumber %]" name="[% bibitemloo.biblionumber %]" checked="checked" id="single_[% bibitemloo.biblionumber %]" value="any" />
118 <label class="confirm_label" for="single_[% bibitemloo.biblionumber %]">Place a hold on </label>
120 [% END # / bibitemloo.holdable %]
122 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% bibitemloo.biblionumber %]">
123 [% bibitemloo.title |html %]
124 [% IF ( bibitemloo.subtitle ) %]
125 [% FOREACH subtitl IN bibitemloo.subtitle %]
126 [% subtitl.subfield %]
130 [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %]
133 [% UNLESS ( bibitemloo.holdable ) %]
134 [% IF ( bibitemloo.already_reserved ) %]
135 <div class="alert">You have already requested this title.</div>
137 [% UNLESS ( bibitemloo.bib_available ) %]
138 <div class="alert">No available items.</div>
140 [% IF ( bibitemloo.already_patron_possession ) %]
141 <div class="alert">This title cannot be requested because it's already in your possession.</div>
143 <div class="alert">This title cannot be requested.</div>
145 [% END # / UNLESS bibitemloo.bib_available %]
146 [% END # / IF bibitemloo.already_reserved %]
147 [% END # / UNLESS bibitemloo.holdable %]
149 [% IF ( bibitemloo.holdable ) %]
150 <fieldset class="rows">
153 [% UNLESS ( item_level_itypes ) %]
155 <span class="label">Item type: </span>
156 [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
157 [% bibitemloo.description %]
161 [% IF showholds || showpriority %]
162 <li class="priority">
163 <span class="label">Holds and priority: </span>
164 [% IF showpriority %] [% bibitemloo.rank %] [% END %]
165 [% IF showholds && showpriority %] out of [% END %]
166 [% IF showholds %] [% bibitemloo.reservecount %] [% END %]
171 [% UNLESS ( singleBranchMode ) %]
172 [% IF ( bibitemloo.holdable && choose_branch ) %]
174 <label for="branch_[% bibitemloo.biblionumber %]">Pick up location:</label>
175 [% UNLESS ( bibitemloo.holdable ) %]
176 <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
177 [% FOREACH branchloo IN bibitemloo.branchloop %]
178 [% IF ( branchloo.selected ) %]
179 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
181 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
186 <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
187 [% FOREACH branchloo IN bibitemloo.branchloop %]
188 [% IF ( branchloo.selected ) %]
189 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
191 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
195 [% END # / UNLESS bibitemloo.holdable %]
197 [% END # / IF bibitemloo.holdable && choose_branch %]
198 [% END # / UNLESS singleBranchMode %]
201 <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber %]" style="display:none;" href="#">Show more options</a>
203 <div id="hold-options-[% bibitemloo.biblionumber %]" class="hold-options">
206 [% IF ( reserve_in_future ) %]
208 <label for="from[% bibitemloo.biblionumber %]">Hold starts on date:</label>
209 <input name="reserve_date_[% bibitemloo.biblionumber %]" id="from[% bibitemloo.biblionumber %]" size="10" class="holddatefrom"/>
210 <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
215 <label for="to[% bibitemloo.biblionumber %]">Hold not needed after:</label>
216 <input name="expiration_date_[% bibitemloo.biblionumber %]" id="to[% bibitemloo.biblionumber %]" size="10" class="holddateto" />
217 <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
220 [% IF ( OpacHoldNotes ) %]
222 <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
223 <label for="holdnotes[% bibitemloo.biblionumber %]">Hold notes:</label>
224 <span id="forcenotesreason_[% bibitemloo.biblionumber %]" class="forcenotesreason"></span>
225 <textarea id="holdnotes[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]">[% bibitemloo.holdnotes %]</textarea>
226 <input type="hidden" id="notesmandatory_[% bibitemloo.biblionumber %]" value="[% bibitemloo.mandatorynotes %]"/>
229 [% END # / IF OpacHoldNotes %]
231 [% IF ( OPACItemHolds ) %]
234 <label class="radio inline" for="reqany_[% bibitemloo.biblionumber %]">Next available copy</label>
235 [% UNLESS ( bibitemloo.holdable ) %]
236 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqany_[% bibitemloo.biblionumber %]" class="selectany" value="Any" disabled="disabled" />
238 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqany_[% bibitemloo.biblionumber %]" class="selectany" value="Any" checked="checked" />
241 <label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber %]">A specific copy</label>
242 [% UNLESS ( bibitemloo.holdable ) %]
243 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqspecific_[% bibitemloo.biblionumber %]" class="selectspecific" disabled="disabled" value="Specific" />
245 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqspecific_[% bibitemloo.biblionumber %]" class="selectspecific" value="Specific" />
248 [% END # / IF OPACItemHolds %]
251 [% IF ( OPACItemHolds ) %]
252 <table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber %]">
253 <caption>Select a specific copy:</caption>
256 [% IF ( item_level_itypes ) %]
260 [% UNLESS ( singleBranchMode ) %]
261 <th>Home library</th>
262 <th>Last location</th>
265 [% IF ( itemdata_enumchron ) %]
271 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
272 <tr class="[% itemLoo.backgroundcolor %]">
274 [% IF ( itemLoo.available ) %]
275 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]" value="[% itemLoo.itemnumber %]" />
277 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]" />
278 <img src="[% interface %]/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
281 [% IF ( itemLoo.copynumber ) %]
282 [% itemLoo.copynumber %]
286 [% IF ( item_level_itypes ) %]
288 [% UNLESS ( noItemTypeImages ) %]
289 [% IF ( itemLoo.imageurl ) %]
290 <img src="[% itemLoo.imageurl %]" alt="" />
293 [% itemLoo.description %]
297 <td class="barcode">[% itemLoo.barcode %]</td>
298 [% UNLESS ( singleBranchMode ) %]
299 <td class="homebranch">[% itemLoo.homeBranchName %]</td>
300 <td class="holdingbranch">[% itemLoo.holdingBranchName %]</td>
302 <td class="call_no">[% itemLoo.callNumber %]</td>
303 [% IF ( itemdata_enumchron ) %]
304 <td class="vol_info">[% itemLoo.enumchron %]</td>
306 <td class="information">
307 [% IF ( itemLoo.dateDue ) %]
308 <span class="checkedout">Due [% itemLoo.dateDue %]</span>
309 [% ELSIF ( itemLoo.transfertwhen ) %]
310 <span class="intransit">In transit from [% itemLoo.transfertfrom %] to [% itemLoo.transfertto %] since [% itemLoo.transfertwhen %]</span>
313 [% IF ( itemLoo.message ) %]
314 <span class="lost">Unavailable (lost or missing)</span>
317 [% IF ( itemLoo.notforloan ) %]
318 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
321 [% IF ( itemLoo.reservedate ) %]
322 <span class="waiting">
323 [% IF ( itemLoo.waitingdate ) %]
329 [% IF ( itemLoo.waitingdate ) %]
334 [% itemLoo.ExpectedAtLibrary %] since
335 [% IF ( itemLoo.waitingdate ) %]
336 [% itemLoo.waitingdate %]
338 [% IF ( itemLoo.reservedate ) %]
339 [% itemLoo.reservedate %]
344 <span class="notonhold">Not on hold</span>
345 [% END # / IF ( itemLoo.reservedate )%]
348 [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
349 </table> <!-- / #copiesrow_[% bibitemloo.biblionumber %] -->
350 [% END # / IF ( OPACItemHolds )%]
351 </div> <!-- / #hold-options-[% bibitemloo.biblionumber %] -->
353 [% END # / IF ( bibitemloo.holdable ) %]
354 </div> <!-- / .holdrow -->
355 [% END # / FOREACH bibitemloo IN bibitemloop %]
356 </div><!-- #bigloop -->
358 [% UNLESS ( none_available ) %]
359 <input type="submit" value="Place hold" class="btn placehold" />
363 [% END # / UNLESS message %]
364 </div> <!-- / #holds -->
365 </div> <!-- / .container -->
366 </div> <!-- / .main -->
367 [% INCLUDE 'opac-bottom.inc' %]
368 [% BLOCK jsinclude %]
369 [% INCLUDE 'calendar.inc' %]
370 <script type="text/javascript">
372 var MSG_NO_COPY_SELECTED = _("Expecting a specific copy selection.");
373 var ForceHoldNotesReasons=new Array(
374 _("This title consists of multiple volumes/parts. Please indicate which part you need. Clicking on specific copy information may be helpful."),
375 "*** Add a new reason above this line ***" );
376 // NOTE: Do not renumber reasons; this will affect use of existing ones.
378 // Clear the contents of an input field
379 $(".clearfield").on("click",function(e){
380 $(this).closest("td").find("input").val("");
383 $(document).ready(function() {
384 $("#hold-request-form").preventDoubleFormSubmit();
385 var copiesRowId = null;
386 var wasSpecific = false;
387 var lastCopiesRowId = null;
388 $(".checkitem").parent().click(function(e){
389 if(e.target.tagName.toLowerCase() == 'td'){
390 $(this).find("input.checkitem").each( function() {
391 $(this).attr('checked', !$(this).attr('checked'));
395 // Hides all 'specific copy' table rows on load.
396 $(".copiesrow").hide();
398 // Insert reasons for forced hold notes
399 $(".forcenotesreason").each(function(){
400 biblioNum = suffixOf($(this).attr("id"), "_");
401 var j=$("#notesmandatory_"+biblioNum).val();
403 $(this).html(ForceHoldNotesReasons[j-1]);
407 $("#place_on_hdr").show();
408 $(".place_on_type").show();
409 $("#place_on_hdr,.place_on_type,.toggle-hold-options").show();
410 $(".hold-options").hide();
411 $(".holddatefrom,.holddateto").prop("readOnly", true);
413 $(".date-format").each(function(){
414 if($(this).hasClass("to")){ var op = "to"; }
415 if($(this).hasClass("from")){ var op = "from"; }
416 var bibNum = $(this).data("biblionumber");
417 $(this).html("<a href=\"#\" class=\"clear-date\" data-op=\"" + op + "\" id=\"clear" + bibNum + "\">" + _("Clear date") + "</a>");
420 $(".clear-date").on("click",function(e){
422 var fieldID = this.id.replace("clear","");
423 var op = $(this).data("op");
424 $("#" + op + fieldID).val("");
427 // Replace non-JS single-selection with multi-selection capability.
428 $(".reserve_mode").val("multi");
429 $(".confirm_nonjs").remove();
430 $(".confirmjs_hold").each(function(){
431 var bib = $(this).attr("title");
432 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
433 html += "value=\"" + bib + "\"/> " + _("Place a hold on") + " </label> ";
436 $(".confirmjs_nohold").each(function(){
437 var bib = $(this).attr("title");
438 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
439 html += "value=\"" + bib + "\"/>" + _("Place a hold on: ") + "</label>";
443 // Make sure a specific item was selected where specified
444 // before moving on to a new item.
445 function changeSelection (newCopiesRowId, isSpecific) {
446 if (copiesRowId && ((copiesRowId != newCopiesRowId) || (wasSpecific != isSpecific))) {
447 var biblioNum = suffixOf(copiesRowId, "_");
449 // If the 'specific copy' radio button was checked
450 if (wasSpecific && (copiesRowId != newCopiesRowId)) {
451 // Find the selected copy
452 var item = $(".checkitem_" + biblioNum + ":checked");
453 if ($(item).size() == 0) {
454 alert(MSG_NO_COPY_SELECTED);
459 copiesRowId = newCopiesRowId;
460 wasSpecific = isSpecific;
464 // When 'specific copy' radio button is clicked
465 $(".selectspecific").click(function() {
467 // Make sure all other specific copy table rows are hidden
468 biblioNum = suffixOf($(this).attr("id"), "_");
469 newCopiesRowId = "#copiesrow_" + biblioNum;
471 if (!changeSelection(newCopiesRowId, true)) {
475 // Show the specific copy table for this radio button.
476 $(newCopiesRowId).show();
479 // When 'first available' radion button is clicked
480 $(".selectany").click(function() {
481 // Make sure all other specific copy table rows are hidden
482 biblioNum = suffixOf($(this).attr("id"), "_");
483 newCopiesRowId = "#copiesrow_" + biblioNum;
485 if (!changeSelection(newCopiesRowId, false)) {
489 // Hide the copies table row
490 $(newCopiesRowId).hide();
493 // When 'Place Hold' button is clicked
494 $(".placehold").click(function(){
495 var biblionumbers = "";
498 if ($(".confirmjs:checked").size() == 0) {
499 alert(MSG_NO_RECORD_SELECTED);
503 // Find the items with the 'Hold' box checked
505 $(".confirmjs:checked").each(function() {
506 var biblioNum = $(this).val();
507 biblionumbers += biblioNum + "/";
508 selections += biblioNum + "/";
510 // If the 'specific copy' radio button is checked
511 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
512 // Find the selected copy
513 var item = $(".checkitem_" + biblioNum + ":checked");
514 if ($(item).size() == 0) {
518 selections += $(item).val();
523 // Add the pickup location
524 var branchSel = $("#branch_" + biblioNum);
525 if (branchSel.size() > 0) {
526 selections += $(branchSel).val();
533 alert(MSG_NO_COPY_SELECTED);
537 $("#selections").val(selections);
538 $("#biblionumbers").val(biblionumbers);
543 $(".toggle-hold-options").on("click",function(e){
545 toggleLink = $(this);
546 var optionsID = this.id.replace("toggle-hold-options-","");
547 $("#hold-options-"+optionsID).toggle(0, function() {
548 toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
552 [% FOREACH bibitemloo IN bibitemloop %]
553 [% IF ( bibitemloo.holdable ) %]
554 // http://jqueryui.com/demos/datepicker/#date-range
555 var dates[% bibitemloo.biblionumber %] = $( "#from[% bibitemloo.biblionumber %], #to[% bibitemloo.biblionumber %]" ).datepicker({
559 onSelect: function( selectedDate ) {
560 var option = this.id == "from[% bibitemloo.biblionumber %]" ? "minDate" : "maxDate",
561 instance = $( this ).data( "datepicker" );
562 date = $.datepicker.parseDate(
563 instance.settings.dateFormat ||
564 $.datepicker._defaults.dateFormat,
565 selectedDate, instance.settings );
566 dates[% bibitemloo.biblionumber %].not( this ).datepicker( "option", option, date );