5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Placing a hold</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% BLOCK cssinclude %][% END %]
11 [% INCLUDE 'bodytag.inc' bodyid='opac-holds' %]
12 [% INCLUDE 'masthead.inc' %]
15 <ul class="breadcrumb">
16 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
17 <li><a href="#">Placing a hold</a></li>
20 <div class="container">
23 <div id="holdmessages" class="alert">
24 <p><strong>Sorry</strong>, you cannot place holds.</strong></p>
28 According to our records, we don't have up-to-date contact information. Please contact the library.
29 <a href="/cgi-bin/koha/opac-memberentry.pl">[% IF ( Koha.Preference('OPACPatronDetails') ) %]Update your contact information[% ELSE %]Go to your contact information[% END %]</a>
30 [% IF ( Koha.Preference('OPACPatronDetails') ) %]<em>(Please note: there may be a delay in restoring your account if you submit online.)</em>[% END %]
36 Your library card has been marked as lost or stolen.<br />
37 <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>
43 Your account has been frozen.
44 [% IF debarred_comment %] Comment: <span id="userdebarred_comment">"[% debarred_comment %]"</span>[% END %]
45 [% IF debarred_date && debarred_date != '9999-12-31' %] End date: <span id="userdebarred_date">[% debarred_date | $KohaDates %]</span>[% END %]
46 <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>
50 [% IF ( too_much_oweing ) %]
51 <li id="too_much_oweing">
52 You have unpaid fines. Amount: [% too_much_oweing | $Price %].
56 [% IF ( too_many_reserves ) %]
57 <li id="too_many_reserves">
58 Sorry, you cannot place more than [% too_many_reserves %] holds.
62 [% IF ( bad_biblionumber ) %]
63 <li id="bad_biblionumber">
64 ERROR: No record found for record id [% bad_biblionumber %].
68 [% IF ( no_items_selected ) %]
69 <li id="no_items_selected">
70 You must select at least one item.
74 [% IF ( no_branch_selected ) %]
75 <li id="no_branch_selected">
76 You must select a library for pickup.
80 [% IF ( no_biblionumber ) %]
81 <li id="no_biblionumber">
82 ERROR: No record id specified.
88 ERROR: Internal error: incomplete hold request.
92 [% IF ( expired_patron ) %]
93 <li id="expired_patron">
94 Your library card has expired. Please contact your librarian if you wish to renew your card.
100 [% IF ( none_available ) %]
101 <div id="none_available" class="alert">
102 <strong>Sorry</strong>, none of these items can be placed on hold.
106 [% END # / IF message %]
108 [% UNLESS ( message ) %]
109 [% UNLESS ( none_available ) %]
110 <h3>Confirm holds for:[% USER_INFO.firstname %] [% USER_INFO.surname %] ([% USER_INFO.cardnumber %])</h3>
111 [% END # / UNLESS none_available %]
113 [% IF (RESERVE_CHARGE) %]
114 <div class="alert" id="reserve_fee">
115 There is a charge of [% RESERVE_CHARGE %] for placing this hold
119 [% IF ( new_reserves_allowed ) %]
120 <div id="new_reserves_allowed" class="alert">
121 <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.
125 <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
126 <input type="hidden" name="place_reserve" value="1"/>
127 <!-- These values are set dynamically by js -->
128 <input type="hidden" name="biblionumbers" id="biblionumbers"/>
129 <input type="hidden" name="selecteditems" id="selections"/>
132 [% FOREACH bibitemloo IN bibitemloop %]
133 <div class="holdrow">
135 [% IF ( bibitemloo.holdable ) %]
136 <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
137 <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber %]"/>
138 <span class="confirmjs_hold" title="[% bibitemloo.biblionumber %]" style="padding:.3em"></span>
139 <span class="confirm_nonjs">
140 <input type="radio" class="confirmbox checkitem [% bibitemloo.biblionumber %]" name="[% bibitemloo.biblionumber %]" checked="checked" id="single_[% bibitemloo.biblionumber %]" value="any" />
141 <label class="confirm_label" for="single_[% bibitemloo.biblionumber %]">Place a hold on </label>
143 [% END # / bibitemloo.holdable %]
145 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% bibitemloo.biblionumber %]">
146 [% bibitemloo.title |html %]
147 [% IF ( bibitemloo.subtitle ) %]
148 [% FOREACH subtitl IN bibitemloo.subtitle %]
149 [% subtitl.subfield %]
153 [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %]
156 [% UNLESS ( bibitemloo.holdable ) %]
157 [% IF ( bibitemloo.ageRestricted ) %]
158 <div class="alert">Sorry, you are too young to reserve this material.</div>
160 [% IF ( bibitemloo.already_reserved ) %]
161 <div class="alert">You have already requested this title.</div>
163 [% UNLESS ( bibitemloo.bib_available ) %]
164 <div class="alert">No available items.</div>
166 [% IF ( bibitemloo.already_patron_possession ) %]
167 <div class="alert">This title cannot be requested because it's already in your possession.</div>
169 <div class="alert">This title cannot be requested.</div>
171 [% END # / UNLESS bibitemloo.bib_available %]
172 [% END # / IF bibitemloo.already_reserved %]
173 [% END # / UNLESS bibitemloo.holdable %]
175 [% IF ( bibitemloo.holdable ) %]
176 <fieldset class="rows">
179 [% UNLESS ( item_level_itypes ) %]
181 <span class="label">Item type: </span>
182 [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
183 [% bibitemloo.translated_description %]
187 [% SET OPACShowHoldQueueDetails = Koha.Preference('OPACShowHoldQueueDetails') %]
188 [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'priority' %]
189 <li class="priority">
190 <span class="label">Your priority: </span>
191 [% bibitemloo.rank %]
195 [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'holds' %]
196 <li class="holds-count">
197 <span class="label">Number of holds: </span>
198 [% bibitemloo.reservecount %]
203 [% UNLESS ( singleBranchMode ) %]
204 [% IF ( bibitemloo.holdable && choose_branch ) %]
206 <label for="branch_[% bibitemloo.biblionumber %]">Pick up location:</label>
207 [% UNLESS ( bibitemloo.holdable ) %]
208 <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
209 [% FOREACH branchloo IN bibitemloo.branchloop %]
210 [% IF ( branchloo.selected ) %]
211 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
213 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
218 <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
219 [% FOREACH branchloo IN bibitemloo.branchloop %]
220 [% IF ( branchloo.selected ) %]
221 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
223 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
227 [% END # / UNLESS bibitemloo.holdable %]
229 [% END # / IF bibitemloo.holdable && choose_branch %]
230 [% END # / UNLESS singleBranchMode %]
233 <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber %]" style="display:none;" href="#">Show more options</a>
235 <div id="hold-options-[% bibitemloo.biblionumber %]" class="hold-options">
238 [% IF ( reserve_in_future ) %]
240 <label for="from[% bibitemloo.biblionumber %]">Hold starts on date:</label>
241 <input name="reserve_date_[% bibitemloo.biblionumber %]" id="from[% bibitemloo.biblionumber %]" size="10" class="holddatefrom"/>
242 <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
247 <label for="to[% bibitemloo.biblionumber %]">Hold not needed after:</label>
248 <input name="expiration_date_[% bibitemloo.biblionumber %]" id="to[% bibitemloo.biblionumber %]" size="10" class="holddateto" />
249 <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
252 [% UNLESS ( multi_hold ) %]
254 <label for="itemtype">Request specific item type:</label>
255 <select name="itemtype" size="1" id="itemtype">
256 <option value="">Any item type</option>
257 [%- FOREACH itemtype IN available_itemtypes %]
258 <option value="[% itemtype %]">[% ItemTypes.GetDescription( itemtype ) %]</option>
264 [% IF ( OpacHoldNotes ) %]
266 <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
267 <label for="holdnotes[% bibitemloo.biblionumber %]">Hold notes:</label>
268 <span id="forcenotesreason_[% bibitemloo.biblionumber %]" class="forcenotesreason"></span>
269 <textarea id="holdnotes[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]">[% bibitemloo.holdnotes %]</textarea>
270 <input type="hidden" id="notesmandatory_[% bibitemloo.biblionumber %]" value="[% bibitemloo.mandatorynotes %]"/>
273 [% END # / IF OpacHoldNotes %]
277 [% IF bibitemloo.itemholdable %]
279 <li class="lradio place_on_type" style="display:none;">
280 [% IF NOT bibitemloo.force_hold %]
281 <label class="radio inline" for="reqany_[% bibitemloo.biblionumber %]">Next available item</label>
282 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
283 id="reqany_[% bibitemloo.biblionumber %]"
289 <label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber %]">A specific item</label>
290 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
291 id="reqspecific_[% bibitemloo.biblionumber %]"
292 class="selectspecific"
296 [% END # / IF bibitemloo.itemholdable %]
299 [% IF bibitemloo.itemholdable %]
300 <table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber %]">
301 <caption>Select a specific item:</caption>
304 [% IF ( item_level_itypes ) %]
308 [% UNLESS ( singleBranchMode ) %]
309 <th>Home library</th>
310 <th>Last location</th>
313 [% IF ( itemdata_enumchron ) %]
319 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
320 <tr class="[% itemLoo.backgroundcolor %]">
321 <td class="copynumber">
322 [% IF ( itemLoo.available ) %]
323 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]" value="[% itemLoo.itemnumber %]" />
325 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]"
326 style="display:none;" />
327 <img src="[% interface %]/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
330 [% IF ( itemLoo.copynumber ) %]
331 [% itemLoo.copynumber %]
335 [% IF ( item_level_itypes ) %]
337 [% UNLESS ( noItemTypeImages ) %]
338 [% IF ( itemLoo.imageurl ) %]
339 <img src="[% itemLoo.imageurl %]" alt="" />
342 [% itemLoo.translated_description %]
346 <td class="barcode">[% itemLoo.barcode %]</td>
347 [% UNLESS ( singleBranchMode ) %]
348 <td class="homebranch">[% itemLoo.homeBranchName %]</td>
349 <td class="holdingbranch">[% itemLoo.holdingBranchName %]</td>
351 <td class="call_no">[% itemLoo.callNumber %]</td>
352 [% IF ( itemdata_enumchron ) %]
353 <td class="vol_info">[% itemLoo.enumchron %]</td>
355 <td class="information">
356 [% IF ( itemLoo.dateDue ) %]
357 <span class="checkedout">Due [% itemLoo.dateDue %]</span>
358 [% ELSIF ( itemLoo.transfertwhen ) %]
359 <span class="intransit">In transit from [% itemLoo.transfertfrom %] to [% itemLoo.transfertto %] since [% itemLoo.transfertwhen %]</span>
362 [% IF ( itemLoo.message ) %]
363 <span class="lost">Unavailable (lost or missing)</span>
366 [% IF ( itemLoo.notforloan ) %]
367 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
370 [% IF ( itemLoo.reservedate ) %]
371 <span class="waiting">
372 [% IF ( itemLoo.waitingdate ) %]
378 [% IF ( itemLoo.waitingdate ) %]
383 [% itemLoo.ExpectedAtLibrary %] since
384 [% IF ( itemLoo.waitingdate ) %]
385 [% itemLoo.waitingdate | $KohaDates %]
387 [% IF ( itemLoo.reservedate ) %]
388 [% itemLoo.reservedate %]
393 <span class="notonhold">Not on hold</span>
394 [% END # / IF ( itemLoo.reservedate )%]
397 [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
398 </table> <!-- / #copiesrow_[% bibitemloo.biblionumber %] -->
399 [% END # / IF ( bibitemloo.itemholdable )%]
400 </div> <!-- / #hold-options-[% bibitemloo.biblionumber %] -->
402 [% END # / IF ( bibitemloo.holdable ) %]
403 </div> <!-- / .holdrow -->
404 [% END # / FOREACH bibitemloo IN bibitemloop %]
405 </div><!-- #bigloop -->
407 [% UNLESS ( none_available ) %]
408 <input type="submit" value="Place hold" class="btn placehold" />
412 [% END # / UNLESS message %]
413 </div> <!-- / #holds -->
414 </div> <!-- / .container -->
415 </div> <!-- / .main -->
416 [% INCLUDE 'opac-bottom.inc' %]
417 [% BLOCK jsinclude %]
418 [% INCLUDE 'calendar.inc' %]
419 <script type="text/javascript">
421 var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection.");
422 var ForceHoldNotesReasons=new Array(
423 _("This title consists of multiple volumes/parts. Please indicate which part you need. Clicking on specific item information may be helpful."),
424 "*** Add a new reason above this line ***" );
425 // NOTE: Do not renumber reasons; this will affect use of existing ones.
427 // Clear the contents of an input field
428 $(".clearfield").on("click",function(e){
429 $(this).closest("td").find("input").val("");
433 // Select the first item available
434 function select_first_available(id){
435 var radios = $("input:radio[name='checkitem_" + id + "']");
436 $(radios).first().attr("checked", "checked");
439 $(document).ready(function() {
440 $("#hold-request-form").preventDoubleFormSubmit();
441 var copiesRowId = null;
442 var wasSpecific = false;
443 var lastCopiesRowId = null;
445 $(".toggle-hold-options").show();
446 $(".hold-options").hide();
447 $(".holddatefrom,.holddateto").prop("readOnly", true);
449 $(".checkitem").parent().click(function(e){
450 if(e.target.tagName.toLowerCase() == 'td'){
451 $(this).find("input.checkitem").each( function() {
452 $(this).attr('checked', 'checked');
457 // click on a first td check the confirmjs checkbox
458 $("td.hold").click(function(e){
459 if(e.target.tagName.toLowerCase() == 'td'){
460 $(this).find("input.confirmjs").each( function() {
461 $(this).attr('checked', !$(this).attr('checked'));
467 $(".toggle-hold-options").on("click",function(e){
469 toggleLink = $(this);
470 var optionsID = this.id.replace("toggle-hold-options-","");
471 $("#hold-options-"+optionsID).toggle(0, function() {
472 toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
476 // Hides all 'specific copy' table rows on load.
477 $(".copiesrow").hide();
479 [% FOREACH bibitemloo IN bibitemloop %]
480 [% IF bibitemloo.force_hold %]
481 $("#toggle-hold-options-[% bibitemloo.biblionumber %]").click();
482 $("#reqspecific_[% bibitemloo.biblionumber %]").click();
483 $("#copiesrow_[% bibitemloo.biblionumber %]").show();
487 // Insert reasons for forced hold notes
488 $(".forcenotesreason").each(function(){
489 biblioNum = suffixOf($(this).attr("id"), "_");
490 var j=$("#notesmandatory_"+biblioNum).val();
492 $(this).html(ForceHoldNotesReasons[j-1]);
496 $(".date-format").each(function(){
497 if($(this).hasClass("to")){ var op = "to"; }
498 if($(this).hasClass("from")){ var op = "from"; }
499 var bibNum = $(this).data("biblionumber");
500 $(this).html("<a href=\"#\" class=\"clear-date\" data-op=\"" + op + "\" id=\"clear" + bibNum + "\">" + _("Clear date") + "</a>");
503 $(".clear-date").on("click",function(e){
505 var fieldID = this.id.replace("clear","");
506 var op = $(this).data("op");
507 $("#" + op + fieldID).val("");
510 // Replace non-JS single-selection with multi-selection capability.
511 $(".reserve_mode").val("multi");
512 $(".confirm_nonjs").remove();
513 $(".confirmjs_hold").each(function(){
514 var bib = $(this).attr("title");
515 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
516 html += "value=\"" + bib + "\" id=\"" + bib + "\" /> " + _("Place a hold on") + " </label> ";
519 $(".confirmjs_nohold").each(function(){
520 var bib = $(this).attr("title");
521 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
522 html += "value=\"" + bib + "\" id=\"" + bib + "\" />" + _("Place a hold on: ") + "</label>";
526 // expand or collapse the copiesrow tr
527 function toggle_copiesrow(biblioNum) {
528 var checkbox = $("input:checkbox[value='"+biblioNum+"']");
529 newCopiesRowId = "#copiesrow_" + biblioNum;
530 var select_specific = $("#reqspecific_"+biblioNum).is(":checked");
531 // If the checkbox is checked AND we want a specific item, we display the items block
532 if ( $(checkbox).is(":checked") && select_specific ) {
533 $(newCopiesRowId).show();
535 $(newCopiesRowId).hide();
539 $("#place_on_hdr").show();
541 $(".place_on_type").show();
542 // onload, selectany is checked
543 $(".selectany").attr("checked", "checked");
545 // If the user is *allowed* to choose a specific item
546 // The first one is preselected
547 $("table.copiesrow").each(function(){
548 var id = suffixOf($(this).attr("id"), "_");
549 select_first_available(id);
552 // On confirmsjs change
553 $(".confirmjs").change(function(){
554 var id = suffixOf($(this).attr("id"), "_");
555 // If I m checked, I enable radio buttons
556 if ( $(this).is(":checked") ) {
557 $("#reqspecific_" + id).attr("disabled", false);
558 $("#reqany_" + id).attr("disabled", false);
560 // Else its are disabled
562 $("#reqspecific_" + id).attr("disabled", "disabled");
563 $("#reqany_" + id).attr("disabled", "disabled");
565 // expand or collaspe the items block
566 toggle_copiesrow(id);
569 // When 'specific copy' or 'first available' radio button is clicked
570 $(".selectspecific, .selectany").click(function() {
571 var id = suffixOf($(this).attr("id"), "_");
572 toggle_copiesrow(id);
575 // Show or hide holds notes
576 $(".shownotes").click(function(){
577 biblioNum = suffixOf($(this).attr("id"), "_");
578 $("#notesrow_"+biblioNum).toggle();
581 // When 'Place Hold' button is clicked
582 $(".placehold").click(function(){
583 var biblionumbers = "";
586 [% IF new_reserves_allowed %]
587 if ($(".confirmjs:checked").size() > [% new_reserves_allowed %] ) {
588 alert(MSG_MAX_HOLDS_EXCEEDED);
593 if ($(".confirmjs:checked").size() == 0) {
594 alert(MSG_NO_RECORD_SELECTED);
598 // Find the items with the 'Hold' box checked
600 $(".confirmjs:checked").each(function() {
601 var biblioNum = $(this).val();
602 biblionumbers += biblioNum + "/";
603 selections += biblioNum + "/";
605 // If the 'specific copy' radio button is checked
606 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
607 // Find the selected copy
608 var item = $(".checkitem_" + biblioNum + ":checked");
609 if ($(item).size() == 0) {
613 selections += $(item).val();
618 // Add the pickup location
619 var branchSel = $("#branch_" + biblioNum);
620 if (branchSel.size() > 0) {
621 selections += $(branchSel).val();
628 alert(MSG_NO_ITEM_SELECTED);
632 $("#selections").val(selections);
633 $("#biblionumbers").val(biblionumbers);
638 [% FOREACH bibitemloo IN bibitemloop %]
639 [% IF ( bibitemloo.holdable ) %]
640 // http://jqueryui.com/demos/datepicker/#date-range
641 var dates[% bibitemloo.biblionumber %] = $( "#from[% bibitemloo.biblionumber %], #to[% bibitemloo.biblionumber %]" ).datepicker({
645 onSelect: function( selectedDate ) {
646 var option = this.id == "from[% bibitemloo.biblionumber %]" ? "minDate" : "maxDate",
647 instance = $( this ).data( "datepicker" );
648 date = $.datepicker.parseDate(
649 instance.settings.dateFormat ||
650 $.datepicker._defaults.dateFormat,
651 selectedDate, instance.settings );
652 dates[% bibitemloo.biblionumber %].not( this ).datepicker( "option", option, date );