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 <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
222 [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %]
224 [% END # / UNLESS bibitemloo.holdable %]
226 [% END # / IF bibitemloo.holdable && choose_branch %]
227 [% END # / UNLESS singleBranchMode %]
230 <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber %]" style="display:none;" href="#">Show more options</a>
232 <div id="hold-options-[% bibitemloo.biblionumber %]" class="hold-options">
235 [% IF ( reserve_in_future ) %]
237 <label for="from[% bibitemloo.biblionumber %]">Hold starts on date:</label>
238 <input name="reserve_date_[% bibitemloo.biblionumber %]" id="from[% bibitemloo.biblionumber %]" size="10" class="holddatefrom"/>
239 <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
244 <label for="to[% bibitemloo.biblionumber %]">Hold not needed after:</label>
245 <input name="expiration_date_[% bibitemloo.biblionumber %]" id="to[% bibitemloo.biblionumber %]" size="10" class="holddateto" />
246 <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
249 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
251 [% FOREACH item IN bibitemloo.itemLoop %]
252 [% itemtypes.push( item.itype ) %]
255 <label for="itemtype">Request specific item type:</label>
256 <select name="itemtype" size="1" id="itemtype">
257 <option value="">Any item type</option>
258 [% FOREACH i IN itemtypes.unique.sort %]
259 <option value="[% i %]">[% ItemTypes.GetDescription( i ) %]</option>
265 [% IF ( OpacHoldNotes ) %]
267 <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
268 <label for="holdnotes[% bibitemloo.biblionumber %]">Hold notes:</label>
269 <span id="forcenotesreason_[% bibitemloo.biblionumber %]" class="forcenotesreason"></span>
270 <textarea id="holdnotes[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]">[% bibitemloo.holdnotes %]</textarea>
271 <input type="hidden" id="notesmandatory_[% bibitemloo.biblionumber %]" value="[% bibitemloo.mandatorynotes %]"/>
274 [% END # / IF OpacHoldNotes %]
276 [% IF bibitemloo.itemholdable %]
278 <li class="lradio place_on_type" style="display:none;">
279 [% IF NOT bibitemloo.force_hold %]
280 <label class="radio inline" for="reqany_[% bibitemloo.biblionumber %]">Next available item</label>
281 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
282 id="reqany_[% bibitemloo.biblionumber %]"
288 <label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber %]">A specific item</label>
289 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
290 id="reqspecific_[% bibitemloo.biblionumber %]"
291 class="selectspecific"
295 [% END # / IF bibitemloo.itemholdable %]
298 [% IF bibitemloo.itemholdable %]
299 <table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber %]">
300 <caption>Select a specific item:</caption>
303 [% IF ( item_level_itypes ) %]
307 [% UNLESS ( singleBranchMode ) %]
308 <th>Home library</th>
309 <th>Last location</th>
312 [% IF ( itemdata_enumchron ) %]
318 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
319 <tr class="[% itemLoo.backgroundcolor %]">
320 <td class="copynumber">
321 [% IF ( itemLoo.available ) %]
322 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]" value="[% itemLoo.itemnumber %]" />
324 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]"
325 style="display:none;" />
326 <img src="[% interface %]/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
329 [% IF ( itemLoo.copynumber ) %]
330 [% itemLoo.copynumber %]
334 [% IF ( item_level_itypes ) %]
336 [% UNLESS ( noItemTypeImages ) %]
337 [% IF ( itemLoo.imageurl ) %]
338 <img src="[% itemLoo.imageurl %]" alt="" />
341 [% itemLoo.translated_description %]
345 <td class="barcode">[% itemLoo.barcode %]</td>
346 [% UNLESS ( singleBranchMode ) %]
347 <td class="homebranch">[% itemLoo.homeBranchName %]</td>
348 <td class="holdingbranch">[% itemLoo.holdingBranchName %]</td>
350 <td class="call_no">[% itemLoo.callNumber %]</td>
351 [% IF ( itemdata_enumchron ) %]
352 <td class="vol_info">[% itemLoo.enumchron %]</td>
354 <td class="information">
355 [% IF ( itemLoo.dateDue ) %]
356 <span class="checkedout">Due [% itemLoo.dateDue %]</span>
357 [% ELSIF ( itemLoo.transfertwhen ) %]
358 <span class="intransit">In transit from [% itemLoo.transfertfrom %] to [% itemLoo.transfertto %] since [% itemLoo.transfertwhen %]</span>
361 [% IF ( itemLoo.message ) %]
362 <span class="lost">Unavailable (lost or missing)</span>
365 [% IF ( itemLoo.notforloan ) %]
366 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
369 [% IF ( itemLoo.reservedate ) %]
370 <span class="waiting">
371 [% IF ( itemLoo.waitingdate ) %]
377 [% IF ( itemLoo.waitingdate ) %]
382 [% itemLoo.ExpectedAtLibrary %] since
383 [% IF ( itemLoo.waitingdate ) %]
384 [% itemLoo.waitingdate | $KohaDates %]
386 [% IF ( itemLoo.reservedate ) %]
387 [% itemLoo.reservedate %]
392 <span class="notonhold">Not on hold</span>
393 [% END # / IF ( itemLoo.reservedate )%]
396 [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
397 </table> <!-- / #copiesrow_[% bibitemloo.biblionumber %] -->
398 [% END # / IF ( bibitemloo.itemholdable )%]
399 </div> <!-- / #hold-options-[% bibitemloo.biblionumber %] -->
401 [% END # / IF ( bibitemloo.holdable ) %]
402 </div> <!-- / .holdrow -->
403 [% END # / FOREACH bibitemloo IN bibitemloop %]
404 </div><!-- #bigloop -->
406 [% UNLESS ( none_available ) %]
407 <input type="submit" value="Place hold" class="btn placehold" />
411 [% END # / UNLESS message %]
412 </div> <!-- / #holds -->
413 </div> <!-- / .container -->
414 </div> <!-- / .main -->
415 [% INCLUDE 'opac-bottom.inc' %]
416 [% BLOCK jsinclude %]
417 [% INCLUDE 'calendar.inc' %]
418 <script type="text/javascript">
420 var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection.");
421 var ForceHoldNotesReasons=new Array(
422 _("This title consists of multiple volumes/parts. Please indicate which part you need. Clicking on specific item information may be helpful."),
423 "*** Add a new reason above this line ***" );
424 // NOTE: Do not renumber reasons; this will affect use of existing ones.
426 // Clear the contents of an input field
427 $(".clearfield").on("click",function(e){
428 $(this).closest("td").find("input").val("");
432 // Select the first item available
433 function select_first_available(id){
434 var radios = $("input:radio[name='checkitem_" + id + "']");
435 $(radios).first().attr("checked", "checked");
438 $(document).ready(function() {
439 $("#hold-request-form").preventDoubleFormSubmit();
440 var copiesRowId = null;
441 var wasSpecific = false;
442 var lastCopiesRowId = null;
444 $(".toggle-hold-options").show();
445 $(".hold-options").hide();
446 $(".holddatefrom,.holddateto").prop("readOnly", true);
448 $(".checkitem").parent().click(function(e){
449 if(e.target.tagName.toLowerCase() == 'td'){
450 $(this).find("input.checkitem").each( function() {
451 $(this).attr('checked', 'checked');
456 // click on a first td check the confirmjs checkbox
457 $("td.hold").click(function(e){
458 if(e.target.tagName.toLowerCase() == 'td'){
459 $(this).find("input.confirmjs").each( function() {
460 $(this).attr('checked', !$(this).attr('checked'));
466 $(".toggle-hold-options").on("click",function(e){
468 toggleLink = $(this);
469 var optionsID = this.id.replace("toggle-hold-options-","");
470 $("#hold-options-"+optionsID).toggle(0, function() {
471 toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
475 // Hides all 'specific copy' table rows on load.
476 $(".copiesrow").hide();
478 [% FOREACH bibitemloo IN bibitemloop %]
479 [% IF bibitemloo.force_hold %]
480 $("#toggle-hold-options-[% bibitemloo.biblionumber %]").click();
481 $("#reqspecific_[% bibitemloo.biblionumber %]").click();
482 $("#copiesrow_[% bibitemloo.biblionumber %]").show();
486 // Insert reasons for forced hold notes
487 $(".forcenotesreason").each(function(){
488 biblioNum = suffixOf($(this).attr("id"), "_");
489 var j=$("#notesmandatory_"+biblioNum).val();
491 $(this).html(ForceHoldNotesReasons[j-1]);
495 $(".date-format").each(function(){
496 if($(this).hasClass("to")){ var op = "to"; }
497 if($(this).hasClass("from")){ var op = "from"; }
498 var bibNum = $(this).data("biblionumber");
499 $(this).html("<a href=\"#\" class=\"clear-date\" data-op=\"" + op + "\" id=\"clear" + bibNum + "\">" + _("Clear date") + "</a>");
502 $(".clear-date").on("click",function(e){
504 var fieldID = this.id.replace("clear","");
505 var op = $(this).data("op");
506 $("#" + op + fieldID).val("");
509 // Replace non-JS single-selection with multi-selection capability.
510 $(".reserve_mode").val("multi");
511 $(".confirm_nonjs").remove();
512 $(".confirmjs_hold").each(function(){
513 var bib = $(this).attr("title");
514 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
515 html += "value=\"" + bib + "\" id=\"" + bib + "\" /> " + _("Place a hold on") + " </label> ";
518 $(".confirmjs_nohold").each(function(){
519 var bib = $(this).attr("title");
520 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
521 html += "value=\"" + bib + "\" id=\"" + bib + "\" />" + _("Place a hold on: ") + "</label>";
525 // expand or collapse the copiesrow tr
526 function toggle_copiesrow(biblioNum) {
527 var checkbox = $("input:checkbox[value='"+biblioNum+"']");
528 newCopiesRowId = "#copiesrow_" + biblioNum;
529 var select_specific = $("#reqspecific_"+biblioNum).is(":checked");
530 // If the checkbox is checked AND we want a specific item, we display the items block
531 if ( $(checkbox).is(":checked") && select_specific ) {
532 $(newCopiesRowId).show();
534 $(newCopiesRowId).hide();
538 $("#place_on_hdr").show();
540 $(".place_on_type").show();
541 // onload, selectany is checked
542 $(".selectany").attr("checked", "checked");
544 // If the user is *allowed* to choose a specific item
545 // The first one is preselected
546 $("table.copiesrow").each(function(){
547 var id = suffixOf($(this).attr("id"), "_");
548 select_first_available(id);
551 // On confirmsjs change
552 $(".confirmjs").change(function(){
553 var id = suffixOf($(this).attr("id"), "_");
554 // If I m checked, I enable radio buttons
555 if ( $(this).is(":checked") ) {
556 $("#reqspecific_" + id).attr("disabled", false);
557 $("#reqany_" + id).attr("disabled", false);
559 // Else its are disabled
561 $("#reqspecific_" + id).attr("disabled", "disabled");
562 $("#reqany_" + id).attr("disabled", "disabled");
564 // expand or collaspe the items block
565 toggle_copiesrow(id);
568 // When 'specific copy' or 'first available' radio button is clicked
569 $(".selectspecific, .selectany").click(function() {
570 var id = suffixOf($(this).attr("id"), "_");
571 toggle_copiesrow(id);
574 // Show or hide holds notes
575 $(".shownotes").click(function(){
576 biblioNum = suffixOf($(this).attr("id"), "_");
577 $("#notesrow_"+biblioNum).toggle();
580 // When 'Place Hold' button is clicked
581 $(".placehold").click(function(){
582 var biblionumbers = "";
585 [% IF new_reserves_allowed %]
586 if ($(".confirmjs:checked").size() > [% new_reserves_allowed %] ) {
587 alert(MSG_MAX_HOLDS_EXCEEDED);
592 if ($(".confirmjs:checked").size() == 0) {
593 alert(MSG_NO_RECORD_SELECTED);
597 // Find the items with the 'Hold' box checked
599 $(".confirmjs:checked").each(function() {
600 var biblioNum = $(this).val();
601 biblionumbers += biblioNum + "/";
602 selections += biblioNum + "/";
604 // If the 'specific copy' radio button is checked
605 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
606 // Find the selected copy
607 var item = $(".checkitem_" + biblioNum + ":checked");
608 if ($(item).size() == 0) {
612 selections += $(item).val();
617 // Add the pickup location
618 var branchSel = $("#branch_" + biblioNum);
619 if (branchSel.size() > 0) {
620 selections += $(branchSel).val();
627 alert(MSG_NO_ITEM_SELECTED);
631 $("#selections").val(selections);
632 $("#biblionumbers").val(biblionumbers);
637 [% FOREACH bibitemloo IN bibitemloop %]
638 [% IF ( bibitemloo.holdable ) %]
639 // http://jqueryui.com/demos/datepicker/#date-range
640 var dates[% bibitemloo.biblionumber %] = $( "#from[% bibitemloo.biblionumber %], #to[% bibitemloo.biblionumber %]" ).datepicker({
644 onSelect: function( selectedDate ) {
645 var option = this.id == "from[% bibitemloo.biblionumber %]" ? "minDate" : "maxDate",
646 instance = $( this ).data( "datepicker" );
647 date = $.datepicker.parseDate(
648 instance.settings.dateFormat ||
649 $.datepicker._defaults.dateFormat,
650 selectedDate, instance.settings );
651 dates[% bibitemloo.biblionumber %].not( this ).datepicker( "option", option, date );