4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Placing a hold</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% BLOCK cssinclude %][% END %]
10 [% INCLUDE 'bodytag.inc' bodyid='opac-holds' %]
11 [% INCLUDE 'masthead.inc' %]
14 <ul class="breadcrumb">
15 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
16 <li><a href="#">Placing a hold</a></li>
19 <div class="container">
22 <div id="holdmessages" class="alert">
23 <p><strong>Sorry</strong>, you cannot place holds.</strong></p>
27 According to our records, we don't have up-to-date contact information. Please contact the library.
28 <a href="/cgi-bin/koha/opac-memberentry.pl">[% IF ( Koha.Preference('OPACPatronDetails') ) %]Update your contact information[% ELSE %]Go to your contact information[% END %]</a>
29 [% IF ( Koha.Preference('OPACPatronDetails') ) %]<em>(Please note: there may be a delay in restoring your account if you submit online.)</em>[% END %]
35 Your library card has been marked as lost or stolen.<br />
36 <em>If this is an error, please take your card to the circulation desk at your local library and the error will be corrected.</em>
42 Your account has been frozen.
43 [% IF debarred_comment %] Comment: <span id="userdebarred_comment">"[% debarred_comment %]"</span>[% END %]
44 [% IF debarred_date && debarred_date != '9999-12-31' %] End date: <span id="userdebarred_date">[% debarred_date | $KohaDates %]</span>[% END %]
45 <br /><em>Usually the reason for freezing an account is old overdues or damage fees. If shows your account to be clear, please contact the library.</em> <a href="/cgi-bin/koha/opac-account.pl">Go to your account page</a>
49 [% IF ( too_much_oweing ) %]
50 <li id="too_much_oweing">
51 You have unpaid fines. Amount: [% too_much_oweing | $Price %].
55 [% IF ( too_many_reserves ) %]
56 <li id="too_many_reserves">
57 Sorry, you cannot place more than [% too_many_reserves %] holds.
61 [% IF ( bad_biblionumber ) %]
62 <li id="bad_biblionumber">
63 ERROR: No record found for record id [% bad_biblionumber %].
67 [% IF ( no_items_selected ) %]
68 <li id="no_items_selected">
69 You must select at least one item.
73 [% IF ( no_branch_selected ) %]
74 <li id="no_branch_selected">
75 You must select a library for pickup.
79 [% IF ( no_biblionumber ) %]
80 <li id="no_biblionumber">
81 ERROR: No record id specified.
87 ERROR: Internal error: incomplete hold request.
91 [% IF ( expired_patron ) %]
92 <li id="expired_patron">
93 Your library card has expired. Please contact your librarian if you wish to renew your card.
99 [% IF ( none_available ) %]
100 <div id="none_available" class="alert">
101 <strong>Sorry</strong>, none of these items can be placed on hold.
105 [% END # / IF message %]
107 [% UNLESS ( message ) %]
108 [% UNLESS ( none_available ) %]
109 <h3>Confirm holds for:[% USER_INFO.firstname %] [% USER_INFO.surname %] ([% USER_INFO.cardnumber %])</h3>
110 [% END # / UNLESS none_available %]
112 [% IF (RESERVE_CHARGE) %]
113 <div class="alert" id="reserve_fee">
114 There is a charge of [% RESERVE_CHARGE %] for placing this hold
118 [% IF ( new_reserves_allowed ) %]
119 <div id="new_reserves_allowed" class="alert">
120 <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.
124 <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
125 <input type="hidden" name="place_reserve" value="1"/>
126 <!-- These values are set dynamically by js -->
127 <input type="hidden" name="biblionumbers" id="biblionumbers"/>
128 <input type="hidden" name="selecteditems" id="selections"/>
131 [% FOREACH bibitemloo IN bibitemloop %]
132 <div class="holdrow">
134 [% IF ( bibitemloo.holdable ) %]
135 <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
136 <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber %]"/>
137 <span class="confirmjs_hold" title="[% bibitemloo.biblionumber %]" style="padding:.3em"></span>
138 <span class="confirm_nonjs">
139 <input type="radio" class="confirmbox checkitem [% bibitemloo.biblionumber %]" name="[% bibitemloo.biblionumber %]" checked="checked" id="single_[% bibitemloo.biblionumber %]" value="any" />
140 <label class="confirm_label" for="single_[% bibitemloo.biblionumber %]">Place a hold on </label>
142 [% END # / bibitemloo.holdable %]
144 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% bibitemloo.biblionumber %]">
145 [% bibitemloo.title |html %]
146 [% IF ( bibitemloo.subtitle ) %]
147 [% FOREACH subtitl IN bibitemloo.subtitle %]
148 [% subtitl.subfield %]
152 [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %]
155 [% UNLESS ( bibitemloo.holdable ) %]
156 [% IF ( bibitemloo.ageRestricted ) %]
157 <div class="alert">Sorry, you are too young to reserve this material.</div>
159 [% IF ( bibitemloo.already_reserved ) %]
160 <div class="alert">You have already requested this title.</div>
162 [% UNLESS ( bibitemloo.bib_available ) %]
163 <div class="alert">No available items.</div>
165 [% IF ( bibitemloo.already_patron_possession ) %]
166 <div class="alert">This title cannot be requested because it's already in your possession.</div>
168 <div class="alert">This title cannot be requested.</div>
170 [% END # / UNLESS bibitemloo.bib_available %]
171 [% END # / IF bibitemloo.already_reserved %]
172 [% END # / UNLESS bibitemloo.holdable %]
174 [% IF ( bibitemloo.holdable ) %]
175 <fieldset class="rows">
178 [% UNLESS ( item_level_itypes ) %]
180 <span class="label">Item type: </span>
181 [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
182 [% bibitemloo.translated_description %]
186 [% SET OPACShowHoldQueueDetails = Koha.Preference('OPACShowHoldQueueDetails') %]
187 [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'priority' %]
188 <li class="priority">
189 <span class="label">Your priority: </span>
190 [% bibitemloo.rank %]
194 [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'holds' %]
195 <li class="holds-count">
196 <span class="label">Number of holds: </span>
197 [% bibitemloo.reservecount %]
202 [% UNLESS ( singleBranchMode ) %]
203 [% IF ( bibitemloo.holdable && choose_branch ) %]
205 <label for="branch_[% bibitemloo.biblionumber %]">Pick up location:</label>
206 [% UNLESS ( bibitemloo.holdable ) %]
207 <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
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>
217 <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
218 [% FOREACH branchloo IN bibitemloo.branchloop %]
219 [% IF ( branchloo.selected ) %]
220 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
222 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
226 [% END # / UNLESS bibitemloo.holdable %]
228 [% END # / IF bibitemloo.holdable && choose_branch %]
229 [% END # / UNLESS singleBranchMode %]
232 <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber %]" style="display:none;" href="#">Show more options</a>
234 <div id="hold-options-[% bibitemloo.biblionumber %]" class="hold-options">
237 [% IF ( reserve_in_future ) %]
239 <label for="from[% bibitemloo.biblionumber %]">Hold starts on date:</label>
240 <input name="reserve_date_[% bibitemloo.biblionumber %]" id="from[% bibitemloo.biblionumber %]" size="10" class="holddatefrom"/>
241 <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
246 <label for="to[% bibitemloo.biblionumber %]">Hold not needed after:</label>
247 <input name="expiration_date_[% bibitemloo.biblionumber %]" id="to[% bibitemloo.biblionumber %]" size="10" class="holddateto" />
248 <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
251 [% IF ( OpacHoldNotes ) %]
253 <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
254 <label for="holdnotes[% bibitemloo.biblionumber %]">Hold notes:</label>
255 <span id="forcenotesreason_[% bibitemloo.biblionumber %]" class="forcenotesreason"></span>
256 <textarea id="holdnotes[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]">[% bibitemloo.holdnotes %]</textarea>
257 <input type="hidden" id="notesmandatory_[% bibitemloo.biblionumber %]" value="[% bibitemloo.mandatorynotes %]"/>
260 [% END # / IF OpacHoldNotes %]
264 [% IF bibitemloo.itemholdable %]
266 <li class="lradio place_on_type" style="display:none;">
267 [% IF NOT bibitemloo.force_hold %]
268 <label class="radio inline" for="reqany_[% bibitemloo.biblionumber %]">Next available item</label>
269 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
270 id="reqany_[% bibitemloo.biblionumber %]"
276 <label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber %]">A specific item</label>
277 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
278 id="reqspecific_[% bibitemloo.biblionumber %]"
279 class="selectspecific"
283 [% END # / IF bibitemloo.itemholdable %]
286 [% IF bibitemloo.itemholdable %]
287 <table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber %]">
288 <caption>Select a specific item:</caption>
291 [% IF ( item_level_itypes ) %]
295 [% UNLESS ( singleBranchMode ) %]
296 <th>Home library</th>
297 <th>Last location</th>
300 [% IF ( itemdata_enumchron ) %]
306 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
307 <tr class="[% itemLoo.backgroundcolor %]">
308 <td class="copynumber">
309 [% IF ( itemLoo.available ) %]
310 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]" value="[% itemLoo.itemnumber %]" />
312 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]"
313 style="display:none;" />
314 <img src="[% interface %]/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
317 [% IF ( itemLoo.copynumber ) %]
318 [% itemLoo.copynumber %]
322 [% IF ( item_level_itypes ) %]
324 [% UNLESS ( noItemTypeImages ) %]
325 [% IF ( itemLoo.imageurl ) %]
326 <img src="[% itemLoo.imageurl %]" alt="" />
329 [% itemLoo.translated_description %]
333 <td class="barcode">[% itemLoo.barcode %]</td>
334 [% UNLESS ( singleBranchMode ) %]
335 <td class="homebranch">[% itemLoo.homeBranchName %]</td>
336 <td class="holdingbranch">[% itemLoo.holdingBranchName %]</td>
338 <td class="call_no">[% itemLoo.callNumber %]</td>
339 [% IF ( itemdata_enumchron ) %]
340 <td class="vol_info">[% itemLoo.enumchron %]</td>
342 <td class="information">
343 [% IF ( itemLoo.dateDue ) %]
344 <span class="checkedout">Due [% itemLoo.dateDue %]</span>
345 [% ELSIF ( itemLoo.transfertwhen ) %]
346 <span class="intransit">In transit from [% itemLoo.transfertfrom %] to [% itemLoo.transfertto %] since [% itemLoo.transfertwhen %]</span>
349 [% IF ( itemLoo.message ) %]
350 <span class="lost">Unavailable (lost or missing)</span>
353 [% IF ( itemLoo.notforloan ) %]
354 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
357 [% IF ( itemLoo.reservedate ) %]
358 <span class="waiting">
359 [% IF ( itemLoo.waitingdate ) %]
365 [% IF ( itemLoo.waitingdate ) %]
370 [% itemLoo.ExpectedAtLibrary %] since
371 [% IF ( itemLoo.waitingdate ) %]
372 [% itemLoo.waitingdate | $KohaDates %]
374 [% IF ( itemLoo.reservedate ) %]
375 [% itemLoo.reservedate %]
380 <span class="notonhold">Not on hold</span>
381 [% END # / IF ( itemLoo.reservedate )%]
384 [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
385 </table> <!-- / #copiesrow_[% bibitemloo.biblionumber %] -->
386 [% END # / IF ( bibitemloo.itemholdable )%]
387 </div> <!-- / #hold-options-[% bibitemloo.biblionumber %] -->
389 [% END # / IF ( bibitemloo.holdable ) %]
390 </div> <!-- / .holdrow -->
391 [% END # / FOREACH bibitemloo IN bibitemloop %]
392 </div><!-- #bigloop -->
394 [% UNLESS ( none_available ) %]
395 <input type="submit" value="Place hold" class="btn placehold" />
399 [% END # / UNLESS message %]
400 </div> <!-- / #holds -->
401 </div> <!-- / .container -->
402 </div> <!-- / .main -->
403 [% INCLUDE 'opac-bottom.inc' %]
404 [% BLOCK jsinclude %]
405 [% INCLUDE 'calendar.inc' %]
406 <script type="text/javascript">
408 var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection.");
409 var ForceHoldNotesReasons=new Array(
410 _("This title consists of multiple volumes/parts. Please indicate which part you need. Clicking on specific item information may be helpful."),
411 "*** Add a new reason above this line ***" );
412 // NOTE: Do not renumber reasons; this will affect use of existing ones.
414 // Clear the contents of an input field
415 $(".clearfield").on("click",function(e){
416 $(this).closest("td").find("input").val("");
420 // Select the first item available
421 function select_first_available(id){
422 var radios = $("input:radio[name='checkitem_" + id + "']");
423 $(radios).first().attr("checked", "checked");
426 $(document).ready(function() {
427 $("#hold-request-form").preventDoubleFormSubmit();
428 var copiesRowId = null;
429 var wasSpecific = false;
430 var lastCopiesRowId = null;
432 $(".toggle-hold-options").show();
433 $(".hold-options").hide();
434 $(".holddatefrom,.holddateto").prop("readOnly", true);
436 $(".checkitem").parent().click(function(e){
437 if(e.target.tagName.toLowerCase() == 'td'){
438 $(this).find("input.checkitem").each( function() {
439 $(this).attr('checked', 'checked');
444 // click on a first td check the confirmjs checkbox
445 $("td.hold").click(function(e){
446 if(e.target.tagName.toLowerCase() == 'td'){
447 $(this).find("input.confirmjs").each( function() {
448 $(this).attr('checked', !$(this).attr('checked'));
454 $(".toggle-hold-options").on("click",function(e){
456 toggleLink = $(this);
457 var optionsID = this.id.replace("toggle-hold-options-","");
458 $("#hold-options-"+optionsID).toggle(0, function() {
459 toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
463 // Hides all 'specific copy' table rows on load.
464 $(".copiesrow").hide();
466 [% FOREACH bibitemloo IN bibitemloop %]
467 [% IF bibitemloo.force_hold %]
468 $("#toggle-hold-options-[% bibitemloo.biblionumber %]").click();
469 $("#reqspecific_[% bibitemloo.biblionumber %]").click();
470 $("#copiesrow_[% bibitemloo.biblionumber %]").show();
474 // Insert reasons for forced hold notes
475 $(".forcenotesreason").each(function(){
476 biblioNum = suffixOf($(this).attr("id"), "_");
477 var j=$("#notesmandatory_"+biblioNum).val();
479 $(this).html(ForceHoldNotesReasons[j-1]);
483 $(".date-format").each(function(){
484 if($(this).hasClass("to")){ var op = "to"; }
485 if($(this).hasClass("from")){ var op = "from"; }
486 var bibNum = $(this).data("biblionumber");
487 $(this).html("<a href=\"#\" class=\"clear-date\" data-op=\"" + op + "\" id=\"clear" + bibNum + "\">" + _("Clear date") + "</a>");
490 $(".clear-date").on("click",function(e){
492 var fieldID = this.id.replace("clear","");
493 var op = $(this).data("op");
494 $("#" + op + fieldID).val("");
497 // Replace non-JS single-selection with multi-selection capability.
498 $(".reserve_mode").val("multi");
499 $(".confirm_nonjs").remove();
500 $(".confirmjs_hold").each(function(){
501 var bib = $(this).attr("title");
502 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
503 html += "value=\"" + bib + "\" id=\"" + bib + "\" /> " + _("Place a hold on") + " </label> ";
506 $(".confirmjs_nohold").each(function(){
507 var bib = $(this).attr("title");
508 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
509 html += "value=\"" + bib + "\" id=\"" + bib + "\" />" + _("Place a hold on: ") + "</label>";
513 // expand or collapse the copiesrow tr
514 function toggle_copiesrow(biblioNum) {
515 var checkbox = $("input:checkbox[value='"+biblioNum+"']");
516 newCopiesRowId = "#copiesrow_" + biblioNum;
517 var select_specific = $("#reqspecific_"+biblioNum).is(":checked");
518 // If the checkbox is checked AND we want a specific item, we display the items block
519 if ( $(checkbox).is(":checked") && select_specific ) {
520 $(newCopiesRowId).show();
522 $(newCopiesRowId).hide();
526 $("#place_on_hdr").show();
528 $(".place_on_type").show();
529 // onload, selectany is checked
530 $(".selectany").attr("checked", "checked");
532 // If the user is *allowed* to choose a specific item
533 // The first one is preselected
534 $("table.copiesrow").each(function(){
535 var id = suffixOf($(this).attr("id"), "_");
536 select_first_available(id);
539 // On confirmsjs change
540 $(".confirmjs").change(function(){
541 var id = suffixOf($(this).attr("id"), "_");
542 // If I m checked, I enable radio buttons
543 if ( $(this).is(":checked") ) {
544 $("#reqspecific_" + id).attr("disabled", false);
545 $("#reqany_" + id).attr("disabled", false);
547 // Else its are disabled
549 $("#reqspecific_" + id).attr("disabled", "disabled");
550 $("#reqany_" + id).attr("disabled", "disabled");
552 // expand or collaspe the items block
553 toggle_copiesrow(id);
556 // When 'specific copy' or 'first available' radio button is clicked
557 $(".selectspecific, .selectany").click(function() {
558 var id = suffixOf($(this).attr("id"), "_");
559 toggle_copiesrow(id);
562 // Show or hide holds notes
563 $(".shownotes").click(function(){
564 biblioNum = suffixOf($(this).attr("id"), "_");
565 $("#notesrow_"+biblioNum).toggle();
568 // When 'Place Hold' button is clicked
569 $(".placehold").click(function(){
570 var biblionumbers = "";
573 [% IF new_reserves_allowed %]
574 if ($(".confirmjs:checked").size() > [% new_reserves_allowed %] ) {
575 alert(MSG_MAX_HOLDS_EXCEEDED);
580 if ($(".confirmjs:checked").size() == 0) {
581 alert(MSG_NO_RECORD_SELECTED);
585 // Find the items with the 'Hold' box checked
587 $(".confirmjs:checked").each(function() {
588 var biblioNum = $(this).val();
589 biblionumbers += biblioNum + "/";
590 selections += biblioNum + "/";
592 // If the 'specific copy' radio button is checked
593 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
594 // Find the selected copy
595 var item = $(".checkitem_" + biblioNum + ":checked");
596 if ($(item).size() == 0) {
600 selections += $(item).val();
605 // Add the pickup location
606 var branchSel = $("#branch_" + biblioNum);
607 if (branchSel.size() > 0) {
608 selections += $(branchSel).val();
615 alert(MSG_NO_ITEM_SELECTED);
619 $("#selections").val(selections);
620 $("#biblionumbers").val(biblionumbers);
625 [% FOREACH bibitemloo IN bibitemloop %]
626 [% IF ( bibitemloo.holdable ) %]
627 // http://jqueryui.com/demos/datepicker/#date-range
628 var dates[% bibitemloo.biblionumber %] = $( "#from[% bibitemloo.biblionumber %], #to[% bibitemloo.biblionumber %]" ).datepicker({
632 onSelect: function( selectedDate ) {
633 var option = this.id == "from[% bibitemloo.biblionumber %]" ? "minDate" : "maxDate",
634 instance = $( this ).data( "datepicker" );
635 date = $.datepicker.parseDate(
636 instance.settings.dateFormat ||
637 $.datepicker._defaults.dateFormat,
638 selectedDate, instance.settings );
639 dates[% bibitemloo.biblionumber %].not( this ).datepicker( "option", option, date );