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 There is a charge of [% RESERVE_CHARGE %] for placing this hold
128 [% IF ( new_reserves_allowed ) %]
129 <div id="new_reserves_allowed" class="alert">
130 <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.
134 <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
135 <input type="hidden" name="place_reserve" value="1"/>
136 <!-- These values are set dynamically by js -->
137 <input type="hidden" name="biblionumbers" id="biblionumbers"/>
138 <input type="hidden" name="selecteditems" id="selections"/>
141 [% FOREACH bibitemloo IN bibitemloop %]
142 <div class="holdrow">
144 [% IF ( bibitemloo.holdable ) %]
145 <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
146 <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber %]"/>
147 <span class="confirmjs_hold" title="[% bibitemloo.biblionumber %]" style="padding:.3em"></span>
148 <span class="confirm_nonjs">
149 <input type="radio" class="confirmbox checkitem [% bibitemloo.biblionumber %]" name="[% bibitemloo.biblionumber %]" checked="checked" id="single_[% bibitemloo.biblionumber %]" value="any" />
150 <label class="confirm_label" for="single_[% bibitemloo.biblionumber %]">Place a hold on </label>
152 [% END # / bibitemloo.holdable %]
154 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% bibitemloo.biblionumber %]">
155 [% bibitemloo.title |html %]
156 [% IF ( bibitemloo.subtitle ) %]
157 [% FOREACH subtitl IN bibitemloo.subtitle %]
158 [% subtitl.subfield %]
162 [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %]
165 [% UNLESS ( bibitemloo.holdable ) %]
166 [% IF ( bibitemloo.ageRestricted ) %]
167 <div class="alert">Sorry, you are too young to reserve this material.</div>
169 [% IF ( bibitemloo.already_reserved ) %]
170 <div class="alert">You have already requested this title.</div>
172 [% UNLESS ( bibitemloo.bib_available ) %]
173 <div class="alert">No available items.</div>
175 [% IF ( bibitemloo.already_patron_possession ) %]
176 <div class="alert">This title cannot be requested because it's already in your possession.</div>
178 <div class="alert">This title cannot be requested.</div>
180 [% END # / UNLESS bibitemloo.bib_available %]
181 [% END # / IF bibitemloo.already_reserved %]
182 [% END # / UNLESS bibitemloo.holdable %]
184 [% IF ( bibitemloo.holdable ) %]
185 <fieldset class="rows">
188 [% UNLESS ( item_level_itypes ) %]
190 <span class="label">Item type: </span>
191 [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
192 [% bibitemloo.translated_description %]
196 [% SET OPACShowHoldQueueDetails = Koha.Preference('OPACShowHoldQueueDetails') %]
197 [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'priority' %]
198 <li class="priority">
199 <span class="label">Your priority: </span>
200 [% bibitemloo.rank %]
204 [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'holds' %]
205 <li class="holds-count">
206 <span class="label">Number of holds: </span>
207 [% bibitemloo.reservecount %]
212 [% UNLESS ( singleBranchMode ) %]
213 [% IF ( bibitemloo.holdable && choose_branch ) %]
215 <label for="branch_[% bibitemloo.biblionumber %]">Pick up location:</label>
216 [% UNLESS ( bibitemloo.holdable ) %]
217 <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
218 [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %]
221 [% SET at_least_one_library_not_available_for_pickup = 0 %]
222 <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
223 [% FOREACH library IN Branches.all( selected => branch) %]
224 [% SET pickup_available_at = bibitemloo.not_available_at.grep(library.branchcode).size ? 0 : 1 %]
225 [% IF library.selected AND pickup_available_at %]
226 <option value="[% library.branchcode %]" selected="selected" >[% library.branchname %]</option>
227 [% ELSIF pickup_available_at %]
228 <option value="[% library.branchcode %]">[% library.branchname %]</option>
230 [% SET at_least_one_library_not_available_for_pickup = 1 %]
231 <option value="[% library.branchcode %]" disabled="disabled" title="At least one item is available at this library">[% library.branchname %]</option>
235 [% IF at_least_one_library_not_available_for_pickup %]
236 <br>Note: Library policy does not allow hold/pickup of an item available locally. Please come to the library to retrieve these items
238 [% END # / UNLESS bibitemloo.holdable %]
240 [% END # / IF bibitemloo.holdable && choose_branch %]
241 [% END # / UNLESS singleBranchMode %]
244 <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber %]" style="display:none;" href="#">Show more options</a>
246 <div id="hold-options-[% bibitemloo.biblionumber %]" class="hold-options">
249 [% IF ( reserve_in_future ) %]
251 <label for="from[% bibitemloo.biblionumber %]">Hold starts on date:</label>
252 <input name="reserve_date_[% bibitemloo.biblionumber %]" id="from[% bibitemloo.biblionumber %]" size="10" class="holddatefrom"/>
253 <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
258 <label for="to[% bibitemloo.biblionumber %]">Hold not needed after:</label>
259 <input name="expiration_date_[% bibitemloo.biblionumber %]" id="to[% bibitemloo.biblionumber %]" size="10" class="holddateto" />
260 <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
263 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
265 [% FOREACH item IN bibitemloo.itemLoop %]
266 [% itemtypes.push( item.itype ) %]
269 <label for="itemtype">Request specific item type:</label>
270 <select name="itemtype" size="1" id="itemtype">
271 <option value="">Any item type</option>
272 [% FOREACH i IN itemtypes.unique.sort %]
273 <option value="[% i %]">[% ItemTypes.GetDescription( i ) %]</option>
279 [% IF ( OpacHoldNotes ) %]
281 <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
282 <label for="holdnotes_[% bibitemloo.biblionumber %]">Hold notes:</label>
283 [% IF bibitemloo.reqholdnotes %]
284 <span id="reqholdnotes_[% bibitemloo.biblionumber %]">Please enter additional information about the requested item:</span>
286 <textarea id="holdnotes_[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]" >[% bibitemloo.holdnotes %]</textarea>
289 [% END # / IF OpacHoldNotes %]
291 [% IF bibitemloo.itemholdable %]
293 <li class="lradio place_on_type" style="display:none;">
294 [% IF NOT bibitemloo.force_hold %]
295 <label class="radio inline" for="reqany_[% bibitemloo.biblionumber %]">Next available item</label>
296 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
297 id="reqany_[% bibitemloo.biblionumber %]"
303 <label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber %]">A specific item</label>
304 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
305 id="reqspecific_[% bibitemloo.biblionumber %]"
306 class="selectspecific"
310 [% END # / IF bibitemloo.itemholdable %]
313 [% IF bibitemloo.itemholdable %]
314 <table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber %]">
315 <caption>Select a specific item:</caption>
318 [% IF ( item_level_itypes ) %]
322 [% UNLESS ( singleBranchMode ) %]
323 <th>Home library</th>
324 <th>Last location</th>
327 [% IF ( itemdata_enumchron ) %]
333 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
334 <tr class="[% itemLoo.backgroundcolor %]">
335 <td class="copynumber">
336 [% IF ( itemLoo.available ) %]
337 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]" value="[% itemLoo.itemnumber %]" />
339 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]"
340 style="display:none;" />
341 <img src="[% interface %]/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
344 [% IF ( itemLoo.copynumber ) %]
345 [% itemLoo.copynumber %]
349 [% IF ( item_level_itypes ) %]
351 [% UNLESS ( noItemTypeImages ) %]
352 [% IF ( itemLoo.imageurl ) %]
353 <img src="[% itemLoo.imageurl %]" alt="" />
356 [% itemLoo.translated_description %]
360 <td class="barcode">[% itemLoo.barcode %]</td>
361 [% UNLESS ( singleBranchMode ) %]
362 <td class="homebranch">[% Branches.GetName( itemLoo.homeBranchName ) %]</td>
363 <td class="holdingbranch">[% Branches.GetName( itemLoo.holdingBranchName ) %]</td>
365 <td class="call_no">[% itemLoo.callNumber %]</td>
366 [% IF ( itemdata_enumchron ) %]
367 <td class="vol_info">[% itemLoo.enumchron %]</td>
369 <td class="information">
370 [% IF ( itemLoo.dateDue ) %]
371 <span class="checkedout">Due [% itemLoo.dateDue %]</span>
372 [% ELSIF ( itemLoo.transfertwhen ) %]
373 <span class="intransit">In transit from [% Branches.GetName( itemLoo.transfertfrom ) %] to [% Branches.GetName( itemLoo.transfertto ) %] since [% itemLoo.transfertwhen %]</span>
376 [% IF ( itemLoo.message ) %]
377 <span class="lost">Unavailable (lost or missing)</span>
380 [% IF ( itemLoo.notforloan ) %]
381 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
384 [% IF ( itemLoo.reservedate ) %]
385 <span class="waiting">
386 [% IF ( itemLoo.waitingdate ) %]
392 [% IF ( itemLoo.waitingdate ) %]
397 [% itemLoo.ExpectedAtLibrary %] since
398 [% IF ( itemLoo.waitingdate ) %]
399 [% itemLoo.waitingdate | $KohaDates %]
401 [% IF ( itemLoo.reservedate ) %]
402 [% itemLoo.reservedate %]
407 <span class="notonhold">Not on hold</span>
408 [% END # / IF ( itemLoo.reservedate )%]
411 [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
412 </table> <!-- / #copiesrow_[% bibitemloo.biblionumber %] -->
413 [% END # / IF ( bibitemloo.itemholdable )%]
414 </div> <!-- / #hold-options-[% bibitemloo.biblionumber %] -->
416 [% END # / IF ( bibitemloo.holdable ) %]
417 </div> <!-- / .holdrow -->
418 [% END # / FOREACH bibitemloo IN bibitemloop %]
419 </div><!-- #bigloop -->
421 [% UNLESS ( none_available ) %]
422 <input type="submit" value="Confirm hold" class="btn placehold" />
426 [% END # / UNLESS message %]
427 </div> <!-- / #holds -->
428 </div> <!-- / .container -->
429 </div> <!-- / .main -->
430 [% INCLUDE 'opac-bottom.inc' %]
431 [% BLOCK jsinclude %]
432 [% INCLUDE 'calendar.inc' %]
433 <script type="text/javascript">
435 var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection.");
437 // Clear the contents of an input field
438 $(".clearfield").on("click",function(e){
439 $(this).closest("td").find("input").val("");
443 // Select the first item available
444 function select_first_available(id){
445 var radios = $("input:radio[name='checkitem_" + id + "']");
446 $(radios).first().attr("checked", "checked");
449 $(document).ready(function() {
450 $("#hold-request-form").preventDoubleFormSubmit();
451 var copiesRowId = null;
452 var wasSpecific = false;
453 var lastCopiesRowId = null;
455 $(".toggle-hold-options").show();
456 $(".hold-options").hide();
457 $(".holddatefrom,.holddateto").prop("readOnly", true);
459 $(".checkitem").parent().click(function(e){
460 if(e.target.tagName.toLowerCase() == 'td'){
461 $(this).find("input.checkitem").each( function() {
462 $(this).attr('checked', 'checked');
467 // click on a first td check the confirmjs checkbox
468 $("td.hold").click(function(e){
469 if(e.target.tagName.toLowerCase() == 'td'){
470 $(this).find("input.confirmjs").each( function() {
471 $(this).attr('checked', !$(this).attr('checked'));
477 $(".toggle-hold-options").on("click",function(e){
479 toggleLink = $(this);
480 var optionsID = this.id.replace("toggle-hold-options-","");
481 $("#hold-options-"+optionsID).toggle(0, function() {
482 toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
486 // Hides all 'specific copy' table rows on load.
487 $(".copiesrow").hide();
489 [% FOREACH bibitemloo IN bibitemloop %]
490 [% IF bibitemloo.force_hold %]
491 $("#toggle-hold-options-[% bibitemloo.biblionumber %]").click();
492 $("#reqspecific_[% bibitemloo.biblionumber %]").click();
493 $("#copiesrow_[% bibitemloo.biblionumber %]").show();
495 [% IF bibitemloo.reqholdnotes %]
496 $("#holdnotes_[% bibitemloo.biblionumber %]").attr( 'required', true );
500 $(".date-format").each(function(){
501 if($(this).hasClass("to")){ var op = "to"; }
502 if($(this).hasClass("from")){ var op = "from"; }
503 var bibNum = $(this).data("biblionumber");
504 $(this).html("<a href=\"#\" class=\"clear-date\" data-op=\"" + op + "\" id=\"clear" + bibNum + "\">" + _("Clear date") + "</a>");
507 $(".clear-date").on("click",function(e){
509 var fieldID = this.id.replace("clear","");
510 var op = $(this).data("op");
511 $("#" + op + fieldID).val("");
514 // Replace non-JS single-selection with multi-selection capability.
515 $(".reserve_mode").val("multi");
516 $(".confirm_nonjs").remove();
517 $(".confirmjs_hold").each(function(){
518 var bib = $(this).attr("title");
519 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
520 html += "value=\"" + bib + "\" id=\"" + bib + "\" /> " + _("Place a hold on") + " </label> ";
523 $(".confirmjs_nohold").each(function(){
524 var bib = $(this).attr("title");
525 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
526 html += "value=\"" + bib + "\" id=\"" + bib + "\" />" + _("Place a hold on: ") + "</label>";
530 // expand or collapse the copiesrow tr
531 function toggle_copiesrow(biblioNum) {
532 var checkbox = $("input:checkbox[value='"+biblioNum+"']");
533 newCopiesRowId = "#copiesrow_" + biblioNum;
534 var select_specific = $("#reqspecific_"+biblioNum).is(":checked");
535 // If the checkbox is checked AND we want a specific item, we display the items block
536 if ( $(checkbox).is(":checked") && select_specific ) {
537 $(newCopiesRowId).show();
539 $(newCopiesRowId).hide();
543 $("#place_on_hdr").show();
545 $(".place_on_type").show();
546 // onload, selectany is checked
547 $(".selectany").attr("checked", "checked");
549 // If the user is *allowed* to choose a specific item
550 // The first one is preselected
551 $("table.copiesrow").each(function(){
552 var id = suffixOf($(this).attr("id"), "_");
553 select_first_available(id);
556 // On confirmsjs change
557 $(".confirmjs").change(function(){
558 var id = suffixOf($(this).attr("id"), "_");
559 // If I m checked, I enable radio buttons
560 if ( $(this).is(":checked") ) {
561 $("#reqspecific_" + id).attr("disabled", false);
562 $("#reqany_" + id).attr("disabled", false);
564 // Else its are disabled
566 $("#reqspecific_" + id).attr("disabled", "disabled");
567 $("#reqany_" + id).attr("disabled", "disabled");
569 // expand or collaspe the items block
570 toggle_copiesrow(id);
573 // When 'specific copy' or 'first available' radio button is clicked
574 $(".selectspecific, .selectany").click(function() {
575 var id = suffixOf($(this).attr("id"), "_");
576 toggle_copiesrow(id);
579 // Show or hide holds notes
580 $(".shownotes").click(function(){
581 biblioNum = suffixOf($(this).attr("id"), "_");
582 $("#notesrow_"+biblioNum).toggle();
585 // When 'Place Hold' button is clicked
586 $(".placehold").click(function(){
587 var biblionumbers = "";
590 [% IF new_reserves_allowed %]
591 if ($(".confirmjs:checked").size() > [% new_reserves_allowed %] ) {
592 alert(MSG_MAX_HOLDS_EXCEEDED);
597 if ($(".confirmjs:checked").size() == 0) {
598 alert(MSG_NO_RECORD_SELECTED);
602 // Find the items with the 'Hold' box checked
604 $(".confirmjs:checked").each(function() {
605 var biblioNum = $(this).val();
606 biblionumbers += biblioNum + "/";
607 selections += biblioNum + "/";
609 // If required hold note is empty, make it visible
610 if( $("#holdnotes_"+biblioNum).attr( 'required' ) && $("#holdnotes_"+biblioNum).val() == '' ) {
611 if( !$("#hold-options-"+biblioNum).is(':visible')) {
612 $("#toggle-hold-options-"+biblioNum).click();
616 // If the 'specific copy' radio button is checked
617 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
618 // Find the selected copy
619 var item = $(".checkitem_" + biblioNum + ":checked");
620 if ($(item).size() == 0) {
621 alert(MSG_NO_ITEM_SELECTED);
625 selections += $(item).val();
630 // Add the pickup location
631 var branchSel = $("#branch_" + biblioNum);
632 if (branchSel.size() > 0) {
633 selections += $(branchSel).val();
639 if (badBib) { // alert has been raised already
643 $("#selections").val(selections);
644 $("#biblionumbers").val(biblionumbers);
649 [% FOREACH bibitemloo IN bibitemloop %]
650 [% IF ( bibitemloo.holdable ) %]
651 // http://jqueryui.com/demos/datepicker/#date-range
652 var dates[% bibitemloo.biblionumber %] = $( "#from[% bibitemloo.biblionumber %], #to[% bibitemloo.biblionumber %]" ).datepicker({
656 onSelect: function( selectedDate ) {
657 var option = this.id == "from[% bibitemloo.biblionumber %]" ? "minDate" : "maxDate",
658 instance = $( this ).data( "datepicker" );
659 date = $.datepicker.parseDate(
660 instance.settings.dateFormat ||
661 $.datepicker._defaults.dateFormat,
662 selectedDate, instance.settings );
663 dates[% bibitemloo.biblionumber %].not( this ).datepicker( "option", option, date );