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 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
254 [% FOREACH item IN bibitemloo.itemLoop %]
255 [% itemtypes.push( item.itype ) %]
258 <label for="itemtype">Request specific item type:</label>
259 <select name="itemtype" size="1" id="itemtype">
260 <option value="">Any item type</option>
261 [% FOREACH i IN itemtypes.unique.sort %]
262 <option value="[% i %]">[% ItemTypes.GetDescription( i ) %]</option>
268 [% IF ( OpacHoldNotes ) %]
270 <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
271 <label for="holdnotes[% bibitemloo.biblionumber %]">Hold notes:</label>
272 <span id="forcenotesreason_[% bibitemloo.biblionumber %]" class="forcenotesreason"></span>
273 <textarea id="holdnotes[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]">[% bibitemloo.holdnotes %]</textarea>
274 <input type="hidden" id="notesmandatory_[% bibitemloo.biblionumber %]" value="[% bibitemloo.mandatorynotes %]"/>
277 [% END # / IF OpacHoldNotes %]
281 [% IF bibitemloo.itemholdable %]
283 <li class="lradio place_on_type" style="display:none;">
284 [% IF NOT bibitemloo.force_hold %]
285 <label class="radio inline" for="reqany_[% bibitemloo.biblionumber %]">Next available item</label>
286 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
287 id="reqany_[% bibitemloo.biblionumber %]"
293 <label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber %]">A specific item</label>
294 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
295 id="reqspecific_[% bibitemloo.biblionumber %]"
296 class="selectspecific"
300 [% END # / IF bibitemloo.itemholdable %]
303 [% IF bibitemloo.itemholdable %]
304 <table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber %]">
305 <caption>Select a specific item:</caption>
308 [% IF ( item_level_itypes ) %]
312 [% UNLESS ( singleBranchMode ) %]
313 <th>Home library</th>
314 <th>Last location</th>
317 [% IF ( itemdata_enumchron ) %]
323 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
324 <tr class="[% itemLoo.backgroundcolor %]">
325 <td class="copynumber">
326 [% IF ( itemLoo.available ) %]
327 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]" value="[% itemLoo.itemnumber %]" />
329 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]"
330 style="display:none;" />
331 <img src="[% interface %]/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
334 [% IF ( itemLoo.copynumber ) %]
335 [% itemLoo.copynumber %]
339 [% IF ( item_level_itypes ) %]
341 [% UNLESS ( noItemTypeImages ) %]
342 [% IF ( itemLoo.imageurl ) %]
343 <img src="[% itemLoo.imageurl %]" alt="" />
346 [% itemLoo.translated_description %]
350 <td class="barcode">[% itemLoo.barcode %]</td>
351 [% UNLESS ( singleBranchMode ) %]
352 <td class="homebranch">[% itemLoo.homeBranchName %]</td>
353 <td class="holdingbranch">[% itemLoo.holdingBranchName %]</td>
355 <td class="call_no">[% itemLoo.callNumber %]</td>
356 [% IF ( itemdata_enumchron ) %]
357 <td class="vol_info">[% itemLoo.enumchron %]</td>
359 <td class="information">
360 [% IF ( itemLoo.dateDue ) %]
361 <span class="checkedout">Due [% itemLoo.dateDue %]</span>
362 [% ELSIF ( itemLoo.transfertwhen ) %]
363 <span class="intransit">In transit from [% itemLoo.transfertfrom %] to [% itemLoo.transfertto %] since [% itemLoo.transfertwhen %]</span>
366 [% IF ( itemLoo.message ) %]
367 <span class="lost">Unavailable (lost or missing)</span>
370 [% IF ( itemLoo.notforloan ) %]
371 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
374 [% IF ( itemLoo.reservedate ) %]
375 <span class="waiting">
376 [% IF ( itemLoo.waitingdate ) %]
382 [% IF ( itemLoo.waitingdate ) %]
387 [% itemLoo.ExpectedAtLibrary %] since
388 [% IF ( itemLoo.waitingdate ) %]
389 [% itemLoo.waitingdate | $KohaDates %]
391 [% IF ( itemLoo.reservedate ) %]
392 [% itemLoo.reservedate %]
397 <span class="notonhold">Not on hold</span>
398 [% END # / IF ( itemLoo.reservedate )%]
401 [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
402 </table> <!-- / #copiesrow_[% bibitemloo.biblionumber %] -->
403 [% END # / IF ( bibitemloo.itemholdable )%]
404 </div> <!-- / #hold-options-[% bibitemloo.biblionumber %] -->
406 [% END # / IF ( bibitemloo.holdable ) %]
407 </div> <!-- / .holdrow -->
408 [% END # / FOREACH bibitemloo IN bibitemloop %]
409 </div><!-- #bigloop -->
411 [% UNLESS ( none_available ) %]
412 <input type="submit" value="Place hold" class="btn placehold" />
416 [% END # / UNLESS message %]
417 </div> <!-- / #holds -->
418 </div> <!-- / .container -->
419 </div> <!-- / .main -->
420 [% INCLUDE 'opac-bottom.inc' %]
421 [% BLOCK jsinclude %]
422 [% INCLUDE 'calendar.inc' %]
423 <script type="text/javascript">
425 var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection.");
426 var ForceHoldNotesReasons=new Array(
427 _("This title consists of multiple volumes/parts. Please indicate which part you need. Clicking on specific item information may be helpful."),
428 "*** Add a new reason above this line ***" );
429 // NOTE: Do not renumber reasons; this will affect use of existing ones.
431 // Clear the contents of an input field
432 $(".clearfield").on("click",function(e){
433 $(this).closest("td").find("input").val("");
437 // Select the first item available
438 function select_first_available(id){
439 var radios = $("input:radio[name='checkitem_" + id + "']");
440 $(radios).first().attr("checked", "checked");
443 $(document).ready(function() {
444 $("#hold-request-form").preventDoubleFormSubmit();
445 var copiesRowId = null;
446 var wasSpecific = false;
447 var lastCopiesRowId = null;
449 $(".toggle-hold-options").show();
450 $(".hold-options").hide();
451 $(".holddatefrom,.holddateto").prop("readOnly", true);
453 $(".checkitem").parent().click(function(e){
454 if(e.target.tagName.toLowerCase() == 'td'){
455 $(this).find("input.checkitem").each( function() {
456 $(this).attr('checked', 'checked');
461 // click on a first td check the confirmjs checkbox
462 $("td.hold").click(function(e){
463 if(e.target.tagName.toLowerCase() == 'td'){
464 $(this).find("input.confirmjs").each( function() {
465 $(this).attr('checked', !$(this).attr('checked'));
471 $(".toggle-hold-options").on("click",function(e){
473 toggleLink = $(this);
474 var optionsID = this.id.replace("toggle-hold-options-","");
475 $("#hold-options-"+optionsID).toggle(0, function() {
476 toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
480 // Hides all 'specific copy' table rows on load.
481 $(".copiesrow").hide();
483 [% FOREACH bibitemloo IN bibitemloop %]
484 [% IF bibitemloo.force_hold %]
485 $("#toggle-hold-options-[% bibitemloo.biblionumber %]").click();
486 $("#reqspecific_[% bibitemloo.biblionumber %]").click();
487 $("#copiesrow_[% bibitemloo.biblionumber %]").show();
491 // Insert reasons for forced hold notes
492 $(".forcenotesreason").each(function(){
493 biblioNum = suffixOf($(this).attr("id"), "_");
494 var j=$("#notesmandatory_"+biblioNum).val();
496 $(this).html(ForceHoldNotesReasons[j-1]);
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 the 'specific copy' radio button is checked
610 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
611 // Find the selected copy
612 var item = $(".checkitem_" + biblioNum + ":checked");
613 if ($(item).size() == 0) {
617 selections += $(item).val();
622 // Add the pickup location
623 var branchSel = $("#branch_" + biblioNum);
624 if (branchSel.size() > 0) {
625 selections += $(branchSel).val();
632 alert(MSG_NO_ITEM_SELECTED);
636 $("#selections").val(selections);
637 $("#biblionumbers").val(biblionumbers);
642 [% FOREACH bibitemloo IN bibitemloop %]
643 [% IF ( bibitemloo.holdable ) %]
644 // http://jqueryui.com/demos/datepicker/#date-range
645 var dates[% bibitemloo.biblionumber %] = $( "#from[% bibitemloo.biblionumber %], #to[% bibitemloo.biblionumber %]" ).datepicker({
649 onSelect: function( selectedDate ) {
650 var option = this.id == "from[% bibitemloo.biblionumber %]" ? "minDate" : "maxDate",
651 instance = $( this ).data( "datepicker" );
652 date = $.datepicker.parseDate(
653 instance.settings.dateFormat ||
654 $.datepicker._defaults.dateFormat,
655 selectedDate, instance.settings );
656 dates[% bibitemloo.biblionumber %].not( this ).datepicker( "option", option, date );