6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Placing a hold</title>
8 [% INCLUDE 'doc-head-close.inc' %]
9 [% BLOCK cssinclude %][% END %]
12 [% INCLUDE 'bodytag.inc' bodyid='opac-holds' %]
13 [% INCLUDE 'masthead.inc' %]
16 <ul class="breadcrumb">
17 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
18 <li><a href="#">Placing a hold</a></li>
21 <div class="container">
24 <div id="holdmessages" class="alert">
25 <p><strong>Sorry</strong>, you cannot place holds.</strong></p>
29 According to our records, we don't have up-to-date contact information. Please contact the library.
30 <a href="/cgi-bin/koha/opac-memberentry.pl">[% IF ( Koha.Preference('OPACPatronDetails') ) %]Update your contact information[% ELSE %]Go to your contact information[% END %]</a>
31 [% IF ( Koha.Preference('OPACPatronDetails') ) %]<em>(Please note: there may be a delay in restoring your account if you submit online.)</em>[% END %]
37 Your library card has been marked as lost or stolen.<br />
38 <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>
44 Your account has been frozen.
45 [% IF debarred_comment %] Comment: <span id="userdebarred_comment">"
46 [% IF debarred_comment.search('OVERDUES_PROCESS') %]
47 Restriction added by overdues process [% debarred_comment.remove('OVERDUES_PROCESS ') | html_line_break %]
49 [% debarred_comment | html_line_break %]
54 [% IF debarred_date && debarred_date != '9999-12-31' %] End date: <span id="userdebarred_date">[% debarred_date | $KohaDates %]</span>[% END %]
55 <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>
59 [% IF ( too_much_oweing ) %]
60 <li id="too_much_oweing">
61 You have unpaid fines. Amount: [% too_much_oweing | $Price %].
65 [% IF ( too_many_reserves ) %]
66 <li id="too_many_reserves">
67 Sorry, you cannot place more than [% too_many_reserves %] holds.
71 [% IF ( bad_biblionumber ) %]
72 <li id="bad_biblionumber">
73 ERROR: No record found for record id [% bad_biblionumber %].
77 [% IF ( no_items_selected ) %]
78 <li id="no_items_selected">
79 You must select at least one item.
83 [% IF ( no_branch_selected ) %]
84 <li id="no_branch_selected">
85 You must select a library for pickup.
89 [% IF ( no_biblionumber ) %]
90 <li id="no_biblionumber">
91 ERROR: No record id specified.
97 ERROR: Internal error: incomplete hold request.
101 [% IF ( expired_patron ) %]
102 <li id="expired_patron">
103 Your library card has expired. Please contact your librarian if you wish to renew your card.
109 [% IF ( none_available ) %]
110 <div id="none_available" class="alert">
111 <strong>Sorry</strong>, none of these items can be placed on hold.
115 [% END # / IF message %]
117 [% UNLESS ( message ) %]
118 [% UNLESS ( none_available ) %]
119 <h3>Confirm holds for:[% USER_INFO.firstname %] [% USER_INFO.surname %] ([% USER_INFO.cardnumber %])</h3>
120 [% END # / UNLESS none_available %]
122 [% IF (RESERVE_CHARGE) %]
123 <div class="alert" id="reserve_fee">
124 [% IF Koha.Preference('HoldFeeMode') == 'any_time_is_collected' %]
125 You will be charged a hold fee of [% RESERVE_CHARGE %] when you collect this item
127 You will be charged a hold fee of [% RESERVE_CHARGE %] for placing this hold
132 [% IF ( new_reserves_allowed ) %]
133 <div id="new_reserves_allowed" class="alert">
134 <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.
138 <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
139 <input type="hidden" name="place_reserve" value="1"/>
140 <!-- These values are set dynamically by js -->
141 <input type="hidden" name="biblionumbers" id="biblionumbers"/>
142 <input type="hidden" name="selecteditems" id="selections"/>
145 [% FOREACH bibitemloo IN bibitemloop %]
146 <div class="holdrow">
148 [% IF ( bibitemloo.holdable ) %]
149 <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
150 <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber %]"/>
151 <span class="confirmjs_hold" title="[% bibitemloo.biblionumber %]" style="padding:.3em"></span>
152 <span class="confirm_nonjs">
153 <input type="radio" class="confirmbox checkitem [% bibitemloo.biblionumber %]" name="[% bibitemloo.biblionumber %]" checked="checked" id="single_[% bibitemloo.biblionumber %]" value="any" />
154 <label class="confirm_label" for="single_[% bibitemloo.biblionumber %]">Place a hold on </label>
156 [% END # / bibitemloo.holdable %]
158 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% bibitemloo.biblionumber %]">
159 [% bibitemloo.title |html %]
160 [% IF ( bibitemloo.subtitle ) %]
161 [% FOREACH subtitl IN bibitemloo.subtitle %]
162 [% subtitl.subfield %]
166 [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %]
169 [% UNLESS ( bibitemloo.holdable ) %]
170 [% IF ( bibitemloo.ageRestricted ) %]
171 <div class="alert">Sorry, you are too young to reserve this material.</div>
173 [% IF ( bibitemloo.already_reserved ) %]
174 <div class="alert">You have already requested this title.</div>
176 [% UNLESS ( bibitemloo.bib_available ) %]
177 <div class="alert">No available items.</div>
179 [% IF ( bibitemloo.already_patron_possession ) %]
180 <div class="alert">This title cannot be requested because it's already in your possession.</div>
182 <div class="alert">This title cannot be requested.</div>
184 [% END # / UNLESS bibitemloo.bib_available %]
185 [% END # / IF bibitemloo.already_reserved %]
186 [% END # / UNLESS bibitemloo.holdable %]
188 [% IF ( bibitemloo.holdable ) %]
189 <fieldset class="rows">
192 [% UNLESS ( item_level_itypes ) %]
194 <span class="label">Item type: </span>
195 [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
196 [% bibitemloo.translated_description %]
200 [% SET OPACShowHoldQueueDetails = Koha.Preference('OPACShowHoldQueueDetails') %]
201 [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'priority' %]
202 <li class="priority">
203 <span class="label">Your priority: </span>
204 [% bibitemloo.rank %]
208 [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'holds' %]
209 <li class="holds-count">
210 <span class="label">Number of holds: </span>
211 [% bibitemloo.reservecount %]
216 [% UNLESS ( singleBranchMode ) %]
217 [% IF ( bibitemloo.holdable && choose_branch ) %]
219 <label for="branch_[% bibitemloo.biblionumber %]">Pick up location:</label>
220 [% UNLESS ( bibitemloo.holdable ) %]
221 <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
222 [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %]
225 [% SET at_least_one_library_not_available_for_pickup = 0 %]
226 <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
227 [% FOREACH library IN Branches.all( selected => branch) %]
228 [% SET pickup_available_at = bibitemloo.not_available_at.grep(library.branchcode).size ? 0 : 1 %]
229 [% IF library.selected AND pickup_available_at %]
230 <option value="[% library.branchcode %]" selected="selected" >[% library.branchname %]</option>
231 [% ELSIF pickup_available_at %]
232 <option value="[% library.branchcode %]">[% library.branchname %]</option>
234 [% SET at_least_one_library_not_available_for_pickup = 1 %]
235 <option value="[% library.branchcode %]" disabled="disabled" title="At least one item is available at this library">[% library.branchname %]</option>
239 [% IF at_least_one_library_not_available_for_pickup %]
240 <br>Note: Library policy does not allow hold/pickup of an item available locally. Please come to the library to retrieve these items
242 [% END # / UNLESS bibitemloo.holdable %]
244 [% END # / IF bibitemloo.holdable && choose_branch %]
245 [% END # / UNLESS singleBranchMode %]
248 <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber %]" style="display:none;" href="#">Show more options</a>
250 <div id="hold-options-[% bibitemloo.biblionumber %]" class="hold-options">
253 [% IF ( reserve_in_future ) %]
255 <label for="from[% bibitemloo.biblionumber %]">Hold starts on date:</label>
256 <input name="reserve_date_[% bibitemloo.biblionumber %]" id="from[% bibitemloo.biblionumber %]" size="10" class="holddatefrom"/>
257 <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
262 <label for="to[% bibitemloo.biblionumber %]">Hold not needed after:</label>
263 <input name="expiration_date_[% bibitemloo.biblionumber %]" id="to[% bibitemloo.biblionumber %]" size="10" class="holddateto" />
264 <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
267 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
269 [% FOREACH item IN bibitemloo.itemLoop %]
270 [% itemtypes.push( item.itype ) %]
273 <label for="itemtype">Request specific item type:</label>
274 <select name="itemtype" size="1" id="itemtype">
275 <option value="">Any item type</option>
276 [% FOREACH i IN itemtypes.unique.sort %]
277 <option value="[% i %]">[% ItemTypes.GetDescription( i ) %]</option>
283 [% IF ( OpacHoldNotes ) %]
285 <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
286 <label for="holdnotes_[% bibitemloo.biblionumber %]">Hold notes:</label>
287 [% IF bibitemloo.reqholdnotes %]
288 <span id="reqholdnotes_[% bibitemloo.biblionumber %]">Please enter additional information about the requested item:</span>
290 <textarea id="holdnotes_[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]" >[% bibitemloo.holdnotes %]</textarea>
293 [% END # / IF OpacHoldNotes %]
295 [% IF bibitemloo.itemholdable %]
297 <li class="lradio place_on_type" style="display:none;">
298 [% IF NOT bibitemloo.force_hold %]
299 <label class="radio inline" for="reqany_[% bibitemloo.biblionumber %]">Next available item</label>
300 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
301 id="reqany_[% bibitemloo.biblionumber %]"
307 <label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber %]">A specific item</label>
308 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
309 id="reqspecific_[% bibitemloo.biblionumber %]"
310 class="selectspecific"
314 [% END # / IF bibitemloo.itemholdable %]
317 [% IF bibitemloo.itemholdable %]
318 <table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber %]">
319 <caption>Select a specific item:</caption>
322 [% IF ( item_level_itypes ) %]
326 [% UNLESS ( singleBranchMode ) %]
327 <th>Home library</th>
328 <th>Last location</th>
331 [% IF ( itemdata_enumchron ) %]
337 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
338 <tr class="[% itemLoo.backgroundcolor %]">
339 <td class="copynumber">
340 [% IF ( itemLoo.available ) %]
341 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]" value="[% itemLoo.itemnumber %]" />
343 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]"
344 style="display:none;" />
345 <img src="[% interface %]/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
348 [% IF ( itemLoo.copynumber ) %]
349 [% itemLoo.copynumber %]
353 [% IF ( item_level_itypes ) %]
355 [% UNLESS ( noItemTypeImages ) %]
356 [% IF ( itemLoo.imageurl ) %]
357 <img src="[% itemLoo.imageurl %]" alt="" />
360 [% itemLoo.translated_description %]
364 <td class="barcode">[% itemLoo.barcode %]</td>
365 [% UNLESS ( singleBranchMode ) %]
366 <td class="homebranch">[% Branches.GetName( itemLoo.homeBranchName ) %]</td>
367 <td class="holdingbranch">[% Branches.GetName( itemLoo.holdingBranchName ) %]</td>
369 <td class="call_no">[% itemLoo.callNumber %]</td>
370 [% IF ( itemdata_enumchron ) %]
371 <td class="vol_info">[% itemLoo.enumchron %]</td>
373 <td class="information">
374 [% IF ( itemLoo.dateDue ) %]
375 <span class="checkedout">Due [% itemLoo.dateDue %]</span>
376 [% ELSIF ( itemLoo.transfertwhen ) %]
377 <span class="intransit">In transit from [% Branches.GetName( itemLoo.transfertfrom ) %] to [% Branches.GetName( itemLoo.transfertto ) %] since [% itemLoo.transfertwhen %]</span>
380 [% IF ( itemLoo.message ) %]
381 <span class="lost">Unavailable (lost or missing)</span>
384 [% IF ( itemLoo.notforloan ) %]
385 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
388 [% IF ( itemLoo.reservedate ) %]
389 <span class="waiting">
390 [% IF ( itemLoo.waitingdate ) %]
396 [% IF ( itemLoo.waitingdate ) %]
401 [% itemLoo.ExpectedAtLibrary %] since
402 [% IF ( itemLoo.waitingdate ) %]
403 [% itemLoo.waitingdate | $KohaDates %]
405 [% IF ( itemLoo.reservedate ) %]
406 [% itemLoo.reservedate %]
411 <span class="notonhold">Not on hold</span>
412 [% END # / IF ( itemLoo.reservedate )%]
415 [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
416 </table> <!-- / #copiesrow_[% bibitemloo.biblionumber %] -->
417 [% END # / IF ( bibitemloo.itemholdable )%]
418 </div> <!-- / #hold-options-[% bibitemloo.biblionumber %] -->
420 [% END # / IF ( bibitemloo.holdable ) %]
421 </div> <!-- / .holdrow -->
422 [% END # / FOREACH bibitemloo IN bibitemloop %]
423 </div><!-- #bigloop -->
425 [% UNLESS ( none_available ) %]
426 <input type="submit" value="Confirm hold" class="btn placehold" />
430 [% END # / UNLESS message %]
431 </div> <!-- / #holds -->
432 </div> <!-- / .container -->
433 </div> <!-- / .main -->
434 [% INCLUDE 'opac-bottom.inc' %]
435 [% BLOCK jsinclude %]
436 [% INCLUDE 'calendar.inc' %]
437 <script type="text/javascript">
439 var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection.");
441 // Clear the contents of an input field
442 $(".clearfield").on("click",function(e){
443 $(this).closest("td").find("input").val("");
447 // Select the first item available
448 function select_first_available(id){
449 var radios = $("input:radio[name='checkitem_" + id + "']");
450 $(radios).first().attr("checked", "checked");
453 $(document).ready(function() {
454 $("#hold-request-form").preventDoubleFormSubmit();
455 var copiesRowId = null;
456 var wasSpecific = false;
457 var lastCopiesRowId = null;
459 $(".toggle-hold-options").show();
460 $(".hold-options").hide();
461 $(".holddatefrom,.holddateto").prop("readOnly", true);
463 $(".checkitem").parent().click(function(e){
464 if(e.target.tagName.toLowerCase() == 'td'){
465 $(this).find("input.checkitem").each( function() {
466 $(this).attr('checked', 'checked');
471 // click on a first td check the confirmjs checkbox
472 $("td.hold").click(function(e){
473 if(e.target.tagName.toLowerCase() == 'td'){
474 $(this).find("input.confirmjs").each( function() {
475 $(this).attr('checked', !$(this).attr('checked'));
481 $(".toggle-hold-options").on("click",function(e){
483 toggleLink = $(this);
484 var optionsID = this.id.replace("toggle-hold-options-","");
485 $("#hold-options-"+optionsID).toggle(0, function() {
486 toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
490 // Hides all 'specific copy' table rows on load.
491 $(".copiesrow").hide();
493 [% FOREACH bibitemloo IN bibitemloop %]
494 [% IF bibitemloo.force_hold %]
495 $("#toggle-hold-options-[% bibitemloo.biblionumber %]").click();
496 $("#reqspecific_[% bibitemloo.biblionumber %]").click();
497 $("#copiesrow_[% bibitemloo.biblionumber %]").show();
499 [% IF bibitemloo.reqholdnotes %]
500 $("#holdnotes_[% bibitemloo.biblionumber %]").attr( 'required', true );
504 $(".date-format").each(function(){
505 if($(this).hasClass("to")){ var op = "to"; }
506 if($(this).hasClass("from")){ var op = "from"; }
507 var bibNum = $(this).data("biblionumber");
508 $(this).html("<a href=\"#\" class=\"clear-date\" data-op=\"" + op + "\" id=\"clear" + bibNum + "\">" + _("Clear date") + "</a>");
511 $(".clear-date").on("click",function(e){
513 var fieldID = this.id.replace("clear","");
514 var op = $(this).data("op");
515 $("#" + op + fieldID).val("");
518 // Replace non-JS single-selection with multi-selection capability.
519 $(".reserve_mode").val("multi");
520 $(".confirm_nonjs").remove();
521 $(".confirmjs_hold").each(function(){
522 var bib = $(this).attr("title");
523 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
524 html += "value=\"" + bib + "\" id=\"" + bib + "\" /> " + _("Place a hold on") + " </label> ";
527 $(".confirmjs_nohold").each(function(){
528 var bib = $(this).attr("title");
529 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
530 html += "value=\"" + bib + "\" id=\"" + bib + "\" />" + _("Place a hold on: ") + "</label>";
534 // expand or collapse the copiesrow tr
535 function toggle_copiesrow(biblioNum) {
536 var checkbox = $("input:checkbox[value='"+biblioNum+"']");
537 newCopiesRowId = "#copiesrow_" + biblioNum;
538 var select_specific = $("#reqspecific_"+biblioNum).is(":checked");
539 // If the checkbox is checked AND we want a specific item, we display the items block
540 if ( $(checkbox).is(":checked") && select_specific ) {
541 $(newCopiesRowId).show();
543 $(newCopiesRowId).hide();
547 $("#place_on_hdr").show();
549 $(".place_on_type").show();
550 // onload, selectany is checked
551 $(".selectany").attr("checked", "checked");
553 // If the user is *allowed* to choose a specific item
554 // The first one is preselected
555 $("table.copiesrow").each(function(){
556 var id = suffixOf($(this).attr("id"), "_");
557 select_first_available(id);
560 // On confirmsjs change
561 $(".confirmjs").change(function(){
562 var id = suffixOf($(this).attr("id"), "_");
563 // If I m checked, I enable radio buttons
564 if ( $(this).is(":checked") ) {
565 $("#reqspecific_" + id).attr("disabled", false);
566 $("#reqany_" + id).attr("disabled", false);
568 // Else its are disabled
570 $("#reqspecific_" + id).attr("disabled", "disabled");
571 $("#reqany_" + id).attr("disabled", "disabled");
573 // expand or collaspe the items block
574 toggle_copiesrow(id);
577 // When 'specific copy' or 'first available' radio button is clicked
578 $(".selectspecific, .selectany").click(function() {
579 var id = suffixOf($(this).attr("id"), "_");
580 toggle_copiesrow(id);
583 // Show or hide holds notes
584 $(".shownotes").click(function(){
585 biblioNum = suffixOf($(this).attr("id"), "_");
586 $("#notesrow_"+biblioNum).toggle();
589 // When 'Place Hold' button is clicked
590 $(".placehold").click(function(){
591 var biblionumbers = "";
594 [% IF new_reserves_allowed %]
595 if ($(".confirmjs:checked").size() > [% new_reserves_allowed %] ) {
596 alert(MSG_MAX_HOLDS_EXCEEDED);
601 if ($(".confirmjs:checked").size() == 0) {
602 alert(MSG_NO_RECORD_SELECTED);
606 // Find the items with the 'Hold' box checked
608 $(".confirmjs:checked").each(function() {
609 var biblioNum = $(this).val();
610 biblionumbers += biblioNum + "/";
611 selections += biblioNum + "/";
613 // If required hold note is empty, make it visible
614 if( $("#holdnotes_"+biblioNum).attr( 'required' ) && $("#holdnotes_"+biblioNum).val() == '' ) {
615 if( !$("#hold-options-"+biblioNum).is(':visible')) {
616 $("#toggle-hold-options-"+biblioNum).click();
620 // If the 'specific copy' radio button is checked
621 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
622 // Find the selected copy
623 var item = $(".checkitem_" + biblioNum + ":checked");
624 if ($(item).size() == 0) {
625 alert(MSG_NO_ITEM_SELECTED);
629 selections += $(item).val();
634 // Add the pickup location
635 var branchSel = $("#branch_" + biblioNum);
636 if (branchSel.size() > 0) {
637 selections += $(branchSel).val();
643 if (badBib) { // alert has been raised already
647 $("#selections").val(selections);
648 $("#biblionumbers").val(biblionumbers);
653 [% FOREACH bibitemloo IN bibitemloop %]
654 [% IF ( bibitemloo.holdable ) %]
655 // http://jqueryui.com/demos/datepicker/#date-range
656 var dates[% bibitemloo.biblionumber %] = $( "#from[% bibitemloo.biblionumber %], #to[% bibitemloo.biblionumber %]" ).datepicker({
660 onSelect: function( selectedDate ) {
661 var option = this.id == "from[% bibitemloo.biblionumber %]" ? "minDate" : "maxDate",
662 instance = $( this ).data( "datepicker" );
663 date = $.datepicker.parseDate(
664 instance.settings.dateFormat ||
665 $.datepicker._defaults.dateFormat,
666 selectedDate, instance.settings );
667 dates[% bibitemloo.biblionumber %].not( this ).datepicker( "option", option, date );