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 %]
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>
82 [% IF ( none_available ) %]
83 <div id="none_available" class="alert"><strong>Sorry</strong>, none of these items can be placed on hold.
87 [% END # / IF message %]
89 [% UNLESS ( message ) %]
90 [% UNLESS ( none_available ) %]
91 <h3>Confirm holds for:
92 [% FOREACH USER_INF IN USER_INFO %]
93 [% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %])
96 [% END # / UNLESS none_available %]
98 [% IF (RESERVE_CHARGE) %]
99 <div class="alert" id="reserve_fee">
100 There is a charge of [% RESERVE_CHARGE %] for placing this hold
104 <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
105 <input type="hidden" name="place_reserve" value="1"/>
106 <!-- These values are set dynamically by js -->
107 <input type="hidden" name="biblionumbers" id="biblionumbers"/>
108 <input type="hidden" name="selecteditems" id="selections"/>
111 [% FOREACH bibitemloo IN bibitemloop %]
112 <div class="holdrow">
114 [% IF ( bibitemloo.holdable ) %]
115 <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
116 <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber %]"/>
117 <span class="confirmjs_hold" title="[% bibitemloo.biblionumber %]" style="padding:.3em"></span>
118 <span class="confirm_nonjs">
119 <input type="radio" class="confirmbox checkitem [% bibitemloo.biblionumber %]" name="[% bibitemloo.biblionumber %]" checked="checked" id="single_[% bibitemloo.biblionumber %]" value="any" />
120 <label class="confirm_label" for="single_[% bibitemloo.biblionumber %]">Place a hold on </label>
122 [% END # / bibitemloo.holdable %]
124 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% bibitemloo.biblionumber %]">
125 [% bibitemloo.title |html %]
126 [% IF ( bibitemloo.subtitle ) %]
127 [% FOREACH subtitl IN bibitemloo.subtitle %]
128 [% subtitl.subfield %]
132 [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %]
135 [% UNLESS ( bibitemloo.holdable ) %]
136 [% IF ( bibitemloo.already_reserved ) %]
137 <div class="alert">You have already requested this title.</div>
139 [% UNLESS ( bibitemloo.bib_available ) %]
140 <div class="alert">No available items.</div>
142 [% IF ( bibitemloo.already_patron_possession ) %]
143 <div class="alert">This title cannot be requested because it's already in your possession.</div>
145 <div class="alert">This title cannot be requested.</div>
147 [% END # / UNLESS bibitemloo.bib_available %]
148 [% END # / IF bibitemloo.already_reserved %]
149 [% END # / UNLESS bibitemloo.holdable %]
151 [% IF ( bibitemloo.holdable ) %]
152 <fieldset class="rows">
155 [% UNLESS ( item_level_itypes ) %]
157 <span class="label">Item type: </span>
158 [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
159 [% bibitemloo.description %]
163 [% IF showholds || showpriority %]
164 <li class="priority">
165 <span class="label">Holds and priority: </span>
166 [% IF showpriority %] [% bibitemloo.rank %] [% END %]
167 [% IF showholds && showpriority %] out of [% END %]
168 [% IF showholds %] [% bibitemloo.reservecount %] [% END %]
173 [% UNLESS ( singleBranchMode ) %]
174 [% IF ( bibitemloo.holdable && choose_branch ) %]
176 <label for="branch_[% bibitemloo.biblionumber %]">Pick up location:</label>
177 [% UNLESS ( bibitemloo.holdable ) %]
178 <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
179 [% FOREACH branchloo IN bibitemloo.branchloop %]
180 [% IF ( branchloo.selected ) %]
181 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
183 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
188 <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
189 [% FOREACH branchloo IN bibitemloo.branchloop %]
190 [% IF ( branchloo.selected ) %]
191 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
193 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
197 [% END # / UNLESS bibitemloo.holdable %]
199 [% END # / IF bibitemloo.holdable && choose_branch %]
200 [% END # / UNLESS singleBranchMode %]
203 <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber %]" style="display:none;" href="#">Show more options</a>
205 <div id="hold-options-[% bibitemloo.biblionumber %]" class="hold-options">
208 [% IF ( reserve_in_future ) %]
210 <label for="from[% bibitemloo.biblionumber %]">Hold starts on date:</label>
211 <input name="reserve_date_[% bibitemloo.biblionumber %]" id="from[% bibitemloo.biblionumber %]" size="10" class="holddatefrom"/>
212 <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
217 <label for="to[% bibitemloo.biblionumber %]">Hold not needed after:</label>
218 <input name="expiration_date_[% bibitemloo.biblionumber %]" id="to[% bibitemloo.biblionumber %]" size="10" class="holddateto" />
219 <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
222 [% IF ( OpacHoldNotes ) %]
224 <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
225 <label for="holdnotes[% bibitemloo.biblionumber %]">Hold notes:</label>
226 <span id="forcenotesreason_[% bibitemloo.biblionumber %]" class="forcenotesreason"></span>
227 <textarea id="holdnotes[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]">[% bibitemloo.holdnotes %]</textarea>
228 <input type="hidden" id="notesmandatory_[% bibitemloo.biblionumber %]" value="[% bibitemloo.mandatorynotes %]"/>
231 [% END # / IF OpacHoldNotes %]
233 [% IF ( OPACItemHolds ) %]
236 <label class="radio inline" for="reqany_[% bibitemloo.biblionumber %]">Next available item</label>
237 [% UNLESS ( bibitemloo.holdable ) %]
238 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqany_[% bibitemloo.biblionumber %]" class="selectany" value="Any" disabled="disabled" />
240 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqany_[% bibitemloo.biblionumber %]" class="selectany" value="Any" checked="checked" />
243 <label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber %]">A specific item</label>
244 [% UNLESS ( bibitemloo.holdable ) %]
245 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqspecific_[% bibitemloo.biblionumber %]" class="selectspecific" disabled="disabled" value="Specific" />
247 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqspecific_[% bibitemloo.biblionumber %]" class="selectspecific" value="Specific" />
250 [% END # / IF OPACItemHolds %]
253 [% IF ( OPACItemHolds ) %]
254 <table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber %]">
255 <caption>Select a specific item:</caption>
258 [% IF ( item_level_itypes ) %]
262 [% UNLESS ( singleBranchMode ) %]
263 <th>Home library</th>
264 <th>Last location</th>
267 [% IF ( itemdata_enumchron ) %]
273 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
274 <tr class="[% itemLoo.backgroundcolor %]">
275 <td class="copynumber">
276 [% IF ( itemLoo.available ) %]
277 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]" value="[% itemLoo.itemnumber %]" />
279 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]" />
280 <img src="[% interface %]/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
283 [% IF ( itemLoo.copynumber ) %]
284 [% itemLoo.copynumber %]
288 [% IF ( item_level_itypes ) %]
290 [% UNLESS ( noItemTypeImages ) %]
291 [% IF ( itemLoo.imageurl ) %]
292 <img src="[% itemLoo.imageurl %]" alt="" />
295 [% itemLoo.description %]
299 <td class="barcode">[% itemLoo.barcode %]</td>
300 [% UNLESS ( singleBranchMode ) %]
301 <td class="homebranch">[% itemLoo.homeBranchName %]</td>
302 <td class="holdingbranch">[% itemLoo.holdingBranchName %]</td>
304 <td class="call_no">[% itemLoo.callNumber %]</td>
305 [% IF ( itemdata_enumchron ) %]
306 <td class="vol_info">[% itemLoo.enumchron %]</td>
308 <td class="information">
309 [% IF ( itemLoo.dateDue ) %]
310 <span class="checkedout">Due [% itemLoo.dateDue %]</span>
311 [% ELSIF ( itemLoo.transfertwhen ) %]
312 <span class="intransit">In transit from [% itemLoo.transfertfrom %] to [% itemLoo.transfertto %] since [% itemLoo.transfertwhen %]</span>
315 [% IF ( itemLoo.message ) %]
316 <span class="lost">Unavailable (lost or missing)</span>
319 [% IF ( itemLoo.notforloan ) %]
320 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
323 [% IF ( itemLoo.reservedate ) %]
324 <span class="waiting">
325 [% IF ( itemLoo.waitingdate ) %]
331 [% IF ( itemLoo.waitingdate ) %]
336 [% itemLoo.ExpectedAtLibrary %] since
337 [% IF ( itemLoo.waitingdate ) %]
338 [% itemLoo.waitingdate | $KohaDates %]
340 [% IF ( itemLoo.reservedate ) %]
341 [% itemLoo.reservedate %]
346 <span class="notonhold">Not on hold</span>
347 [% END # / IF ( itemLoo.reservedate )%]
350 [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
351 </table> <!-- / #copiesrow_[% bibitemloo.biblionumber %] -->
352 [% END # / IF ( OPACItemHolds )%]
353 </div> <!-- / #hold-options-[% bibitemloo.biblionumber %] -->
355 [% END # / IF ( bibitemloo.holdable ) %]
356 </div> <!-- / .holdrow -->
357 [% END # / FOREACH bibitemloo IN bibitemloop %]
358 </div><!-- #bigloop -->
360 [% UNLESS ( none_available ) %]
361 <input type="submit" value="Place hold" class="btn placehold" />
365 [% END # / UNLESS message %]
366 </div> <!-- / #holds -->
367 </div> <!-- / .container -->
368 </div> <!-- / .main -->
369 [% INCLUDE 'opac-bottom.inc' %]
370 [% BLOCK jsinclude %]
371 [% INCLUDE 'calendar.inc' %]
372 <script type="text/javascript">
374 var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection.");
375 var ForceHoldNotesReasons=new Array(
376 _("This title consists of multiple volumes/parts. Please indicate which part you need. Clicking on specific item information may be helpful."),
377 "*** Add a new reason above this line ***" );
378 // NOTE: Do not renumber reasons; this will affect use of existing ones.
380 // Clear the contents of an input field
381 $(".clearfield").on("click",function(e){
382 $(this).closest("td").find("input").val("");
385 $(document).ready(function() {
386 $("#hold-request-form").preventDoubleFormSubmit();
387 var copiesRowId = null;
388 var wasSpecific = false;
389 var lastCopiesRowId = null;
390 $(".checkitem").parent().click(function(e){
391 if(e.target.tagName.toLowerCase() == 'td'){
392 $(this).find("input.checkitem").each( function() {
393 $(this).attr('checked', !$(this).attr('checked'));
397 // Hides all 'specific copy' table rows on load.
398 $(".copiesrow").hide();
400 // Insert reasons for forced hold notes
401 $(".forcenotesreason").each(function(){
402 biblioNum = suffixOf($(this).attr("id"), "_");
403 var j=$("#notesmandatory_"+biblioNum).val();
405 $(this).html(ForceHoldNotesReasons[j-1]);
409 $("#place_on_hdr").show();
410 $(".place_on_type").show();
411 $("#place_on_hdr,.place_on_type,.toggle-hold-options").show();
412 $(".hold-options").hide();
413 $(".holddatefrom,.holddateto").prop("readOnly", true);
415 $(".date-format").each(function(){
416 if($(this).hasClass("to")){ var op = "to"; }
417 if($(this).hasClass("from")){ var op = "from"; }
418 var bibNum = $(this).data("biblionumber");
419 $(this).html("<a href=\"#\" class=\"clear-date\" data-op=\"" + op + "\" id=\"clear" + bibNum + "\">" + _("Clear date") + "</a>");
422 $(".clear-date").on("click",function(e){
424 var fieldID = this.id.replace("clear","");
425 var op = $(this).data("op");
426 $("#" + op + fieldID).val("");
429 // Replace non-JS single-selection with multi-selection capability.
430 $(".reserve_mode").val("multi");
431 $(".confirm_nonjs").remove();
432 $(".confirmjs_hold").each(function(){
433 var bib = $(this).attr("title");
434 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
435 html += "value=\"" + bib + "\"/> " + _("Place a hold on") + " </label> ";
438 $(".confirmjs_nohold").each(function(){
439 var bib = $(this).attr("title");
440 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
441 html += "value=\"" + bib + "\"/>" + _("Place a hold on: ") + "</label>";
445 // Make sure a specific item was selected where specified
446 // before moving on to a new item.
447 function changeSelection (newCopiesRowId, isSpecific) {
448 if (copiesRowId && ((copiesRowId != newCopiesRowId) || (wasSpecific != isSpecific))) {
449 var biblioNum = suffixOf(copiesRowId, "_");
451 // If the 'specific copy' radio button was checked
452 if (wasSpecific && (copiesRowId != newCopiesRowId)) {
453 // Find the selected copy
454 var item = $(".checkitem_" + biblioNum + ":checked");
455 if ($(item).size() == 0) {
456 alert(MSG_NO_ITEM_SELECTED);
461 copiesRowId = newCopiesRowId;
462 wasSpecific = isSpecific;
466 // When 'specific copy' radio button is clicked
467 $(".selectspecific").click(function() {
469 // Make sure all other specific copy table rows are hidden
470 biblioNum = suffixOf($(this).attr("id"), "_");
471 newCopiesRowId = "#copiesrow_" + biblioNum;
473 if (!changeSelection(newCopiesRowId, true)) {
477 // Show the specific copy table for this radio button.
478 $(newCopiesRowId).show();
481 // When 'first available' radion button is clicked
482 $(".selectany").click(function() {
483 // Make sure all other specific copy table rows are hidden
484 biblioNum = suffixOf($(this).attr("id"), "_");
485 newCopiesRowId = "#copiesrow_" + biblioNum;
487 if (!changeSelection(newCopiesRowId, false)) {
491 // Hide the copies table row
492 $(newCopiesRowId).hide();
495 // When 'Place Hold' button is clicked
496 $(".placehold").click(function(){
497 var biblionumbers = "";
500 if ($(".confirmjs:checked").size() == 0) {
501 alert(MSG_NO_RECORD_SELECTED);
505 // Find the items with the 'Hold' box checked
507 $(".confirmjs:checked").each(function() {
508 var biblioNum = $(this).val();
509 biblionumbers += biblioNum + "/";
510 selections += biblioNum + "/";
512 // If the 'specific copy' radio button is checked
513 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
514 // Find the selected copy
515 var item = $(".checkitem_" + biblioNum + ":checked");
516 if ($(item).size() == 0) {
520 selections += $(item).val();
525 // Add the pickup location
526 var branchSel = $("#branch_" + biblioNum);
527 if (branchSel.size() > 0) {
528 selections += $(branchSel).val();
535 alert(MSG_NO_ITEM_SELECTED);
539 $("#selections").val(selections);
540 $("#biblionumbers").val(biblionumbers);
545 $(".toggle-hold-options").on("click",function(e){
547 toggleLink = $(this);
548 var optionsID = this.id.replace("toggle-hold-options-","");
549 $("#hold-options-"+optionsID).toggle(0, function() {
550 toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
554 [% FOREACH bibitemloo IN bibitemloop %]
555 [% IF ( bibitemloo.holdable ) %]
556 // http://jqueryui.com/demos/datepicker/#date-range
557 var dates[% bibitemloo.biblionumber %] = $( "#from[% bibitemloo.biblionumber %], #to[% bibitemloo.biblionumber %]" ).datepicker({
561 onSelect: function( selectedDate ) {
562 var option = this.id == "from[% bibitemloo.biblionumber %]" ? "minDate" : "maxDate",
563 instance = $( this ).data( "datepicker" );
564 date = $.datepicker.parseDate(
565 instance.settings.dateFormat ||
566 $.datepicker._defaults.dateFormat,
567 selectedDate, instance.settings );
568 dates[% bibitemloo.biblionumber %].not( this ).datepicker( "option", option, date );