6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% 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>Sorry, you cannot place holds.</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 %]
47 <span id="userdebarred_comment">
49 [% IF debarred_comment.search('OVERDUES_PROCESS') %]
50 Restriction added by overdues process [% debarred_comment.remove('OVERDUES_PROCESS ') | html_line_break %]
52 [% debarred_comment | html_line_break %]
58 [% IF debarred_date && debarred_date != '9999-12-31' %]
60 <span id="userdebarred_date">[% debarred_date | $KohaDates %]</span>
62 <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>
66 [% IF ( too_much_oweing ) %]
67 <li id="too_much_oweing">
68 You have unpaid fines. Amount: [% too_much_oweing | $Price | html %].
72 [% IF ( too_many_reserves ) %]
73 <li id="too_many_reserves">
74 Sorry, you cannot place more than [% too_many_reserves | html %] holds.
78 [% IF ( bad_biblionumber ) %]
79 <li id="bad_biblionumber">
80 ERROR: No record found for record id [% bad_biblionumber | html %].
84 [% IF ( no_items_selected ) %]
85 <li id="no_items_selected">
86 You must select at least one item.
90 [% IF ( no_branch_selected ) %]
91 <li id="no_branch_selected">
92 You must select a library for pickup.
96 [% IF ( no_biblionumber ) %]
97 <li id="no_biblionumber">
98 ERROR: No record id specified.
102 [% IF ( bad_data ) %]
104 ERROR: Internal error: incomplete hold request.
108 [% IF ( expired_patron ) %]
109 <li id="expired_patron">
110 Your library card has expired. Please contact your librarian if you wish to renew your card.
116 [% IF ( none_available && multi_hold ) %]
117 <div id="none_available" class="alert">
118 Sorry, none of these titles can be placed on hold.
122 [% END # / IF message %]
124 [% UNLESS ( message ) %]
125 [% UNLESS ( none_available ) %]
126 <h3>Confirm holds for:[% INCLUDE 'patron-title.inc' patron = logged_in_user %] ([% logged_in_user.cardnumber | html %])</h3>
127 [% END # / UNLESS none_available %]
129 [% IF (RESERVE_CHARGE) %]
130 <div class="alert" id="reserve_fee">
131 [% IF Koha.Preference('HoldFeeMode') == 'any_time_is_collected' %]
132 You will be charged a hold fee of [% RESERVE_CHARGE | html %] when you collect this item
134 You will be charged a hold fee of [% RESERVE_CHARGE | html %] for placing this hold
139 [% IF ( new_reserves_allowed ) %]
140 <div id="new_reserves_allowed" class="alert">
141 <strong>Sorry,</strong> you can only place [% new_reserves_allowed | html %] more holds. Please uncheck the checkboxes for the items you wish to not place holds on.
145 <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
146 <input type="hidden" name="place_reserve" value="1"/>
147 <!-- These values are set dynamically by js -->
148 <input type="hidden" name="biblionumbers" id="biblionumbers"/>
149 <input type="hidden" name="selecteditems" id="selections"/>
152 [% FOREACH bibitemloo IN bibitemloop %]
153 <div class="holdrow">
155 [% IF ( bibitemloo.holdable ) %]
156 <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
157 <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber | html %]"/>
158 <span class="confirmjs_hold" title="[% bibitemloo.biblionumber | html %]" style="padding:.3em"></span>
159 <span class="confirm_nonjs">
160 <input type="radio" class="confirmbox checkitem [% bibitemloo.biblionumber | html %]" name="[% bibitemloo.biblionumber | html %]" checked="checked" id="single_[% bibitemloo.biblionumber | html %]" value="any" />
161 <label class="confirm_label" for="single_[% bibitemloo.biblionumber | html %]">Place a hold on </label>
163 [% END # / bibitemloo.holdable %]
165 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% bibitemloo.biblionumber | html %]">
166 [% bibitemloo.title | html %]
167 [% IF ( bibitemloo.subtitle ) %]
168 [% FOREACH subtitl IN bibitemloo.subtitle %]
169 [% subtitl.subfield | html %]
173 [% IF ( bibitemloo.author ) %], by [% bibitemloo.author | html %][% END %]
176 [% UNLESS ( bibitemloo.holdable ) %]
177 [% IF ( bibitemloo.ageRestricted ) %]
178 <div class="alert">Sorry, you are too young to reserve this material.</div>
180 [% IF ( bibitemloo.already_reserved ) %]
181 <div class="alert">You have already requested this title.</div>
183 [% UNLESS ( bibitemloo.bib_available ) %]
184 <div class="alert">There are no items that can be placed on hold.</div>
186 [% IF ( bibitemloo.already_patron_possession ) %]
187 <div class="alert">This title cannot be requested because it's already in your possession.</div>
189 <div class="alert">This title cannot be requested.</div>
191 [% END # / UNLESS bibitemloo.bib_available %]
192 [% END # / IF bibitemloo.already_reserved %]
193 [% END # / UNLESS bibitemloo.holdable %]
195 [% IF ( bibitemloo.holdable ) %]
196 <fieldset class="rows">
199 [% UNLESS ( item_level_itypes ) %]
201 <span class="label">Item type: </span>
202 [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl | html %]" alt="" />[% END %]
203 [% bibitemloo.translated_description | html %]
207 [% SET OPACShowHoldQueueDetails = Koha.Preference('OPACShowHoldQueueDetails') %]
208 [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'priority' %]
209 <li class="priority">
210 <span class="label">Your priority: </span>
211 [% bibitemloo.rank | html %]
215 [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'holds' %]
216 <li class="holds-count">
217 <span class="label">Number of holds: </span>
218 [% bibitemloo.reservecount | html %]
223 [% UNLESS ( singleBranchMode ) %]
224 [% IF ( bibitemloo.holdable && choose_branch ) %]
226 <label for="branch_[% bibitemloo.biblionumber | html %]">Pick up location:</label>
227 [% UNLESS ( bibitemloo.holdable ) %]
228 <select name="branch" id="branch_[% bibitemloo.biblionumber | html %]" disabled="disabled">
229 [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %]
232 [% SET at_least_one_library_not_available_for_pickup = 0 %]
233 <select name="branch" id="branch_[% bibitemloo.biblionumber | html %]">
234 [% FOREACH library IN Branches.all( selected => branch) %]
235 [% SET pickup_available_at = bibitemloo.not_available_at.grep(library.branchcode).size ? 0 : 1 %]
236 [% IF library.selected AND pickup_available_at %]
237 <option value="[% library.branchcode | html %]" selected="selected" >[% library.branchname | html %]</option>
238 [% ELSIF pickup_available_at %]
239 <option value="[% library.branchcode | html %]">[% library.branchname | html %]</option>
241 [% SET at_least_one_library_not_available_for_pickup = 1 %]
242 <option value="[% library.branchcode | html %]" disabled="disabled" title="At least one item is available at this library">[% library.branchname | html %]</option>
246 [% IF at_least_one_library_not_available_for_pickup %]
247 <br>Note: Library policy does not allow hold/pickup of an item available locally. Please come to the library to retrieve these items
249 [% END # / UNLESS bibitemloo.holdable %]
251 [% END # / IF bibitemloo.holdable && choose_branch %]
252 [% END # / UNLESS singleBranchMode %]
255 <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber | html %]" style="display:none;" href="#">Show more options</a>
257 <div id="hold-options-[% bibitemloo.biblionumber | html %]" class="hold-options">
260 [% IF ( reserve_in_future ) %]
262 <label for="from[% bibitemloo.biblionumber | html %]">Hold starts on date:</label>
263 <input name="reserve_date_[% bibitemloo.biblionumber | html %]" id="from[% bibitemloo.biblionumber | html %]" size="10" class="holddatefrom"/>
264 <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber | html %]">[% INCLUDE 'date-format.inc' %]</span>
269 <label for="to[% bibitemloo.biblionumber | html %]">Hold not needed after:</label>
270 <input name="expiration_date_[% bibitemloo.biblionumber | html %]" id="to[% bibitemloo.biblionumber | html %]" size="10" class="holddateto" />
271 <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber | html %]">[% INCLUDE 'date-format.inc' %]</span>
274 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
275 [% itemtypes = [] | html %]
276 [% FOREACH item IN bibitemloo.itemLoop %]
277 [% itemtypes.push( item.itype ) | html %]
280 <label for="itemtype">Request specific item type:</label>
281 <select name="itemtype" size="1" id="itemtype">
282 <option value="">Any item type</option>
283 [% FOREACH i IN itemtypes.unique.sort %]
284 <option value="[% i | html %]">[% ItemTypes.GetDescription( i ) | html %]</option>
290 [% IF ( OpacHoldNotes ) %]
292 <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber | html %]">
293 <label for="holdnotes_[% bibitemloo.biblionumber | html %]">Hold notes:</label>
294 [% IF bibitemloo.reqholdnotes %]
295 <span id="reqholdnotes_[% bibitemloo.biblionumber | html %]">Please enter additional information about the requested item:</span>
297 <textarea id="holdnotes_[% bibitemloo.biblionumber | html %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber | html %]" >[% bibitemloo.holdnotes | html %]</textarea>
300 [% END # / IF OpacHoldNotes %]
302 [% IF bibitemloo.itemholdable %]
304 <li class="lradio place_on_type" style="display:none;">
305 [% IF NOT bibitemloo.force_hold %]
306 <label class="radio inline" for="reqany_[% bibitemloo.biblionumber | html %]">Next available item</label>
307 <input type="radio" name="reqtype_[% bibitemloo.biblionumber | html %]"
308 id="reqany_[% bibitemloo.biblionumber | html %]"
314 <label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber | html %]">A specific item</label>
315 <input type="radio" name="reqtype_[% bibitemloo.biblionumber | html %]"
316 id="reqspecific_[% bibitemloo.biblionumber | html %]"
317 class="selectspecific"
321 [% END # / IF bibitemloo.itemholdable %]
324 [% IF bibitemloo.itemholdable %]
325 <table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber | html %]">
326 <caption>Select a specific item:</caption>
329 [% IF ( item_level_itypes ) %]
333 [% UNLESS ( singleBranchMode ) %]
334 <th>Home library</th>
335 <th>Last location</th>
338 [% IF ( itemdata_enumchron ) %]
344 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
345 <tr class="[% itemLoo.backgroundcolor | html %]">
346 <td class="copynumber">
347 [% IF ( itemLoo.available ) %]
348 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber | html %]" name="checkitem_[% bibitemloo.biblionumber | html %]" value="[% itemLoo.itemnumber | html %]" />
350 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber | html %]"
351 style="display:none;" />
352 <img src="[% interface | html %]/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
355 [% IF ( itemLoo.copynumber ) %]
356 [% itemLoo.copynumber | html %]
360 [% IF ( item_level_itypes ) %]
362 [% UNLESS ( noItemTypeImages ) %]
363 [% IF ( itemLoo.imageurl ) %]
364 <img src="[% itemLoo.imageurl | html %]" alt="" />
367 [% itemLoo.translated_description | html %]
371 <td class="barcode">[% itemLoo.barcode | html %]</td>
372 [% UNLESS ( singleBranchMode ) %]
373 <td class="homebranch">[% Branches.GetName( itemLoo.homeBranchName ) | html %]</td>
374 <td class="holdingbranch">[% Branches.GetName( itemLoo.holdingBranchName ) | html %]</td>
376 <td class="call_no">[% itemLoo.callNumber | html %]</td>
377 [% IF ( itemdata_enumchron ) %]
378 <td class="vol_info">[% itemLoo.enumchron | html %]</td>
380 <td class="information">
381 [% IF ( itemLoo.dateDue ) %]
382 <span class="checkedout">Due [% itemLoo.dateDue | html %]</span>
383 [% ELSIF ( itemLoo.transfertwhen ) %]
384 <span class="intransit">In transit from [% Branches.GetName( itemLoo.transfertfrom ) | html %] to [% Branches.GetName( itemLoo.transfertto ) | html %] since [% itemLoo.transfertwhen | html %]</span>
387 [% IF ( itemLoo.message ) %]
388 <span class="lost">Unavailable (lost or missing)</span>
391 [% IF ( itemLoo.notforloan ) %]
392 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue | html %])</span>
395 [% IF ( itemLoo.reservedate ) %]
396 <span class="waiting">
397 [% IF ( itemLoo.waitingdate ) %]
403 [% IF ( itemLoo.waitingdate ) %]
408 [% itemLoo.ExpectedAtLibrary | html %] since
409 [% IF ( itemLoo.waitingdate ) %]
410 [% itemLoo.waitingdate | $KohaDates %]
412 [% IF ( itemLoo.reservedate ) %]
413 [% itemLoo.reservedate | html %]
418 <span class="notonhold">Not on hold</span>
419 [% END # / IF ( itemLoo.reservedate )%]
422 [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
423 </table> <!-- / #copiesrow_[% bibitemloo.biblionumber | html %] -->
424 [% END # / IF ( bibitemloo.itemholdable )%]
425 </div> <!-- / #hold-options-[% bibitemloo.biblionumber | html %] -->
427 [% END # / IF ( bibitemloo.holdable ) %]
428 </div> <!-- / .holdrow -->
429 [% END # / FOREACH bibitemloo IN bibitemloop %]
430 </div><!-- #bigloop -->
432 [% UNLESS ( none_available ) %]
433 <input type="submit" value="Confirm hold" class="btn placehold" />
437 [% END # / UNLESS message %]
438 </div> <!-- / #holds -->
439 </div> <!-- / .container -->
440 </div> <!-- / .main -->
441 [% INCLUDE 'opac-bottom.inc' %]
442 [% BLOCK jsinclude %]
443 [% INCLUDE 'calendar.inc' %]
446 var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection.");
448 // Clear the contents of an input field
449 $(".clearfield").on("click",function(e){
450 $(this).closest("td").find("input").val("");
454 // Select the first item available
455 function select_first_available(id){
456 var radios = $("input:radio[name='checkitem_" + id + "']");
457 $(radios).first().attr("checked", "checked");
460 $(document).ready(function() {
461 $("#hold-request-form").preventDoubleFormSubmit();
462 var copiesRowId = null;
463 var wasSpecific = false;
464 var lastCopiesRowId = null;
466 $(".toggle-hold-options").show();
467 $(".hold-options").hide();
468 $(".holddatefrom,.holddateto").prop("readOnly", true);
470 $(".checkitem").parent().click(function(e){
471 if(e.target.tagName.toLowerCase() == 'td'){
472 $(this).find("input.checkitem").each( function() {
473 $(this).attr('checked', 'checked');
478 // click on a first td check the confirmjs checkbox
479 $("td.hold").click(function(e){
480 if(e.target.tagName.toLowerCase() == 'td'){
481 $(this).find("input.confirmjs").each( function() {
482 $(this).attr('checked', !$(this).attr('checked'));
488 $(".toggle-hold-options").on("click",function(e){
490 toggleLink = $(this);
491 var optionsID = this.id.replace("toggle-hold-options-","");
492 $("#hold-options-"+optionsID).toggle(0, function() {
493 toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
497 // Hides all 'specific copy' table rows on load.
498 $(".copiesrow").hide();
500 [% FOREACH bibitemloo IN bibitemloop %]
501 [% IF bibitemloo.force_hold %]
502 $("#toggle-hold-options-[% bibitemloo.biblionumber | html %]").click();
503 $("#reqspecific_[% bibitemloo.biblionumber | html %]").click();
504 $("#copiesrow_[% bibitemloo.biblionumber | html %]").show();
506 [% IF bibitemloo.reqholdnotes %]
507 $("#holdnotes_[% bibitemloo.biblionumber | html %]").attr( 'required', true );
511 $(".date-format").each(function(){
512 if($(this).hasClass("to")){ var op = "to"; }
513 if($(this).hasClass("from")){ var op = "from"; }
514 var bibNum = $(this).data("biblionumber");
515 $(this).html("<a href=\"#\" class=\"clear-date\" data-op=\"" + op + "\" id=\"clear" + bibNum + "\">" + _("Clear date") + "</a>");
518 $(".clear-date").on("click",function(e){
520 var fieldID = this.id.replace("clear","");
521 var op = $(this).data("op");
522 $("#" + op + fieldID).val("");
525 // Replace non-JS single-selection with multi-selection capability.
526 $(".reserve_mode").val("multi");
527 $(".confirm_nonjs").remove();
528 $(".confirmjs_hold").each(function(){
529 var bib = $(this).attr("title");
530 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
531 html += "value=\"" + bib + "\" id=\"" + bib + "\" /> " + _("Place a hold on") + " </label> ";
534 $(".confirmjs_nohold").each(function(){
535 var bib = $(this).attr("title");
536 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
537 html += "value=\"" + bib + "\" id=\"" + bib + "\" />" + _("Place a hold on: ") + "</label>";
541 // expand or collapse the copiesrow tr
542 function toggle_copiesrow(biblioNum) {
543 var checkbox = $("input:checkbox[value='"+biblioNum+"']");
544 newCopiesRowId = "#copiesrow_" + biblioNum;
545 var select_specific = $("#reqspecific_"+biblioNum).is(":checked");
546 // If the checkbox is checked AND we want a specific item, we display the items block
547 if ( $(checkbox).is(":checked") && select_specific ) {
548 $(newCopiesRowId).show();
550 $(newCopiesRowId).hide();
554 $("#place_on_hdr").show();
556 $(".place_on_type").show();
557 // onload, selectany is checked
558 $(".selectany").attr("checked", "checked");
560 // If the user is *allowed* to choose a specific item
561 // The first one is preselected
562 $("table.copiesrow").each(function(){
563 var id = suffixOf($(this).attr("id"), "_");
564 select_first_available(id);
567 // On confirmsjs change
568 $(".confirmjs").change(function(){
569 var id = suffixOf($(this).attr("id"), "_");
570 // If I m checked, I enable radio buttons
571 if ( $(this).is(":checked") ) {
572 $("#reqspecific_" + id).attr("disabled", false);
573 $("#reqany_" + id).attr("disabled", false);
575 // Else its are disabled
577 $("#reqspecific_" + id).attr("disabled", "disabled");
578 $("#reqany_" + id).attr("disabled", "disabled");
580 // expand or collaspe the items block
581 toggle_copiesrow(id);
584 // When 'specific copy' or 'first available' radio button is clicked
585 $(".selectspecific, .selectany").click(function() {
586 var id = suffixOf($(this).attr("id"), "_");
587 toggle_copiesrow(id);
590 // Show or hide holds notes
591 $(".shownotes").click(function(){
592 biblioNum = suffixOf($(this).attr("id"), "_");
593 $("#notesrow_"+biblioNum).toggle();
596 // When 'Place Hold' button is clicked
597 $(".placehold").click(function(){
598 var biblionumbers = "";
601 [% IF new_reserves_allowed %]
602 if ($(".confirmjs:checked").size() > [% new_reserves_allowed | html %] ) {
603 alert(MSG_MAX_HOLDS_EXCEEDED);
608 if ($(".confirmjs:checked").size() == 0) {
609 alert(MSG_NO_RECORD_SELECTED);
613 // Find the items with the 'Hold' box checked
615 $(".confirmjs:checked").each(function() {
616 var biblioNum = $(this).val();
617 biblionumbers += biblioNum + "/";
618 selections += biblioNum + "/";
620 // If required hold note is empty, make it visible
621 if( $("#holdnotes_"+biblioNum).attr( 'required' ) && $("#holdnotes_"+biblioNum).val() == '' ) {
622 if( !$("#hold-options-"+biblioNum).is(':visible')) {
623 $("#toggle-hold-options-"+biblioNum).click();
627 // If the 'specific copy' radio button is checked
628 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
629 // Find the selected copy
630 var item = $(".checkitem_" + biblioNum + ":checked");
631 if ($(item).size() == 0) {
632 alert(MSG_NO_ITEM_SELECTED);
636 selections += $(item).val();
641 // Add the pickup location
642 var branchSel = $("#branch_" + biblioNum);
643 if (branchSel.size() > 0) {
644 selections += $(branchSel).val();
650 if (badBib) { // alert has been raised already
654 $("#selections").val(selections);
655 $("#biblionumbers").val(biblionumbers);
660 [% FOREACH bibitemloo IN bibitemloop %]
661 [% IF ( bibitemloo.holdable ) %]
662 // http://jqueryui.com/demos/datepicker/#date-range
663 var dates[% bibitemloo.biblionumber | html %] = $( "#from[% bibitemloo.biblionumber | html %], #to[% bibitemloo.biblionumber | html %]" ).datepicker({
667 onSelect: function( selectedDate ) {
668 var option = this.id == "from[% bibitemloo.biblionumber | html %]" ? "minDate" : "maxDate",
669 instance = $( this ).data( "datepicker" );
670 date = $.datepicker.parseDate(
671 instance.settings.dateFormat ||
672 $.datepicker._defaults.dateFormat,
673 selectedDate, instance.settings );
674 dates[% bibitemloo.biblionumber | html %].not( this ).datepicker( "option", option, date );