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">"
45 [% IF debarred_comment.search('OVERDUES_PROCESS') %]
46 Restriction added by overdues process [% debarred_comment.remove('OVERDUES_PROCESS ') | html_line_break %]
48 [% debarred_comment | html_line_break %]
53 [% IF debarred_date && debarred_date != '9999-12-31' %] End date: <span id="userdebarred_date">[% debarred_date | $KohaDates %]</span>[% END %]
54 <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>
58 [% IF ( too_much_oweing ) %]
59 <li id="too_much_oweing">
60 You have unpaid fines. Amount: [% too_much_oweing | $Price %].
64 [% IF ( too_many_reserves ) %]
65 <li id="too_many_reserves">
66 Sorry, you cannot place more than [% too_many_reserves %] holds.
70 [% IF ( bad_biblionumber ) %]
71 <li id="bad_biblionumber">
72 ERROR: No record found for record id [% bad_biblionumber %].
76 [% IF ( no_items_selected ) %]
77 <li id="no_items_selected">
78 You must select at least one item.
82 [% IF ( no_branch_selected ) %]
83 <li id="no_branch_selected">
84 You must select a library for pickup.
88 [% IF ( no_biblionumber ) %]
89 <li id="no_biblionumber">
90 ERROR: No record id specified.
96 ERROR: Internal error: incomplete hold request.
100 [% IF ( expired_patron ) %]
101 <li id="expired_patron">
102 Your library card has expired. Please contact your librarian if you wish to renew your card.
108 [% IF ( none_available ) %]
109 <div id="none_available" class="alert">
110 <strong>Sorry</strong>, none of these items can be placed on hold.
114 [% END # / IF message %]
116 [% UNLESS ( message ) %]
117 [% UNLESS ( none_available ) %]
118 <h3>Confirm holds for:[% USER_INFO.firstname %] [% USER_INFO.surname %] ([% USER_INFO.cardnumber %])</h3>
119 [% END # / UNLESS none_available %]
121 [% IF (RESERVE_CHARGE) %]
122 <div class="alert" id="reserve_fee">
123 There is a charge of [% RESERVE_CHARGE %] for placing this hold
127 [% IF ( new_reserves_allowed ) %]
128 <div id="new_reserves_allowed" class="alert">
129 <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.
133 <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
134 <input type="hidden" name="place_reserve" value="1"/>
135 <!-- These values are set dynamically by js -->
136 <input type="hidden" name="biblionumbers" id="biblionumbers"/>
137 <input type="hidden" name="selecteditems" id="selections"/>
140 [% FOREACH bibitemloo IN bibitemloop %]
141 <div class="holdrow">
143 [% IF ( bibitemloo.holdable ) %]
144 <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
145 <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber %]"/>
146 <span class="confirmjs_hold" title="[% bibitemloo.biblionumber %]" style="padding:.3em"></span>
147 <span class="confirm_nonjs">
148 <input type="radio" class="confirmbox checkitem [% bibitemloo.biblionumber %]" name="[% bibitemloo.biblionumber %]" checked="checked" id="single_[% bibitemloo.biblionumber %]" value="any" />
149 <label class="confirm_label" for="single_[% bibitemloo.biblionumber %]">Place a hold on </label>
151 [% END # / bibitemloo.holdable %]
153 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% bibitemloo.biblionumber %]">
154 [% bibitemloo.title |html %]
155 [% IF ( bibitemloo.subtitle ) %]
156 [% FOREACH subtitl IN bibitemloo.subtitle %]
157 [% subtitl.subfield %]
161 [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %]
164 [% UNLESS ( bibitemloo.holdable ) %]
165 [% IF ( bibitemloo.ageRestricted ) %]
166 <div class="alert">Sorry, you are too young to reserve this material.</div>
168 [% IF ( bibitemloo.already_reserved ) %]
169 <div class="alert">You have already requested this title.</div>
171 [% UNLESS ( bibitemloo.bib_available ) %]
172 <div class="alert">No available items.</div>
174 [% IF ( bibitemloo.already_patron_possession ) %]
175 <div class="alert">This title cannot be requested because it's already in your possession.</div>
177 <div class="alert">This title cannot be requested.</div>
179 [% END # / UNLESS bibitemloo.bib_available %]
180 [% END # / IF bibitemloo.already_reserved %]
181 [% END # / UNLESS bibitemloo.holdable %]
183 [% IF ( bibitemloo.holdable ) %]
184 <fieldset class="rows">
187 [% UNLESS ( item_level_itypes ) %]
189 <span class="label">Item type: </span>
190 [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
191 [% bibitemloo.translated_description %]
195 [% SET OPACShowHoldQueueDetails = Koha.Preference('OPACShowHoldQueueDetails') %]
196 [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'priority' %]
197 <li class="priority">
198 <span class="label">Your priority: </span>
199 [% bibitemloo.rank %]
203 [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'holds' %]
204 <li class="holds-count">
205 <span class="label">Number of holds: </span>
206 [% bibitemloo.reservecount %]
211 [% UNLESS ( singleBranchMode ) %]
212 [% IF ( bibitemloo.holdable && choose_branch ) %]
214 <label for="branch_[% bibitemloo.biblionumber %]">Pick up location:</label>
215 [% UNLESS ( bibitemloo.holdable ) %]
216 <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
217 [% FOREACH branchloo IN bibitemloo.branchloop %]
218 [% IF ( branchloo.selected ) %]
219 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
221 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
226 <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
227 [% FOREACH branchloo IN bibitemloo.branchloop %]
228 [% IF ( branchloo.selected ) %]
229 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
231 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
235 [% END # / UNLESS bibitemloo.holdable %]
237 [% END # / IF bibitemloo.holdable && choose_branch %]
238 [% END # / UNLESS singleBranchMode %]
241 <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber %]" style="display:none;" href="#">Show more options</a>
243 <div id="hold-options-[% bibitemloo.biblionumber %]" class="hold-options">
246 [% IF ( reserve_in_future ) %]
248 <label for="from[% bibitemloo.biblionumber %]">Hold starts on date:</label>
249 <input name="reserve_date_[% bibitemloo.biblionumber %]" id="from[% bibitemloo.biblionumber %]" size="10" class="holddatefrom"/>
250 <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
255 <label for="to[% bibitemloo.biblionumber %]">Hold not needed after:</label>
256 <input name="expiration_date_[% bibitemloo.biblionumber %]" id="to[% bibitemloo.biblionumber %]" size="10" class="holddateto" />
257 <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
260 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
262 [% FOREACH item IN bibitemloo.itemLoop %]
263 [% itemtypes.push( item.itype ) %]
266 <label for="itemtype">Request specific item type:</label>
267 <select name="itemtype" size="1" id="itemtype">
268 <option value="">Any item type</option>
269 [% FOREACH i IN itemtypes.unique.sort %]
270 <option value="[% i %]">[% ItemTypes.GetDescription( i ) %]</option>
276 [% IF ( OpacHoldNotes ) %]
278 <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
279 <label for="holdnotes[% bibitemloo.biblionumber %]">Hold notes:</label>
280 <span id="forcenotesreason_[% bibitemloo.biblionumber %]" class="forcenotesreason"></span>
281 <textarea id="holdnotes[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]">[% bibitemloo.holdnotes %]</textarea>
282 <input type="hidden" id="notesmandatory_[% bibitemloo.biblionumber %]" value="[% bibitemloo.mandatorynotes %]"/>
285 [% END # / IF OpacHoldNotes %]
289 [% IF bibitemloo.itemholdable %]
291 <li class="lradio place_on_type" style="display:none;">
292 [% IF NOT bibitemloo.force_hold %]
293 <label class="radio inline" for="reqany_[% bibitemloo.biblionumber %]">Next available item</label>
294 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
295 id="reqany_[% bibitemloo.biblionumber %]"
301 <label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber %]">A specific item</label>
302 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
303 id="reqspecific_[% bibitemloo.biblionumber %]"
304 class="selectspecific"
308 [% END # / IF bibitemloo.itemholdable %]
311 [% IF bibitemloo.itemholdable %]
312 <table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber %]">
313 <caption>Select a specific item:</caption>
316 [% IF ( item_level_itypes ) %]
320 [% UNLESS ( singleBranchMode ) %]
321 <th>Home library</th>
322 <th>Last location</th>
325 [% IF ( itemdata_enumchron ) %]
331 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
332 <tr class="[% itemLoo.backgroundcolor %]">
333 <td class="copynumber">
334 [% IF ( itemLoo.available ) %]
335 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]" value="[% itemLoo.itemnumber %]" />
337 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]"
338 style="display:none;" />
339 <img src="[% interface %]/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
342 [% IF ( itemLoo.copynumber ) %]
343 [% itemLoo.copynumber %]
347 [% IF ( item_level_itypes ) %]
349 [% UNLESS ( noItemTypeImages ) %]
350 [% IF ( itemLoo.imageurl ) %]
351 <img src="[% itemLoo.imageurl %]" alt="" />
354 [% itemLoo.translated_description %]
358 <td class="barcode">[% itemLoo.barcode %]</td>
359 [% UNLESS ( singleBranchMode ) %]
360 <td class="homebranch">[% itemLoo.homeBranchName %]</td>
361 <td class="holdingbranch">[% itemLoo.holdingBranchName %]</td>
363 <td class="call_no">[% itemLoo.callNumber %]</td>
364 [% IF ( itemdata_enumchron ) %]
365 <td class="vol_info">[% itemLoo.enumchron %]</td>
367 <td class="information">
368 [% IF ( itemLoo.dateDue ) %]
369 <span class="checkedout">Due [% itemLoo.dateDue %]</span>
370 [% ELSIF ( itemLoo.transfertwhen ) %]
371 <span class="intransit">In transit from [% itemLoo.transfertfrom %] to [% itemLoo.transfertto %] since [% itemLoo.transfertwhen %]</span>
374 [% IF ( itemLoo.message ) %]
375 <span class="lost">Unavailable (lost or missing)</span>
378 [% IF ( itemLoo.notforloan ) %]
379 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
382 [% IF ( itemLoo.reservedate ) %]
383 <span class="waiting">
384 [% IF ( itemLoo.waitingdate ) %]
390 [% IF ( itemLoo.waitingdate ) %]
395 [% itemLoo.ExpectedAtLibrary %] since
396 [% IF ( itemLoo.waitingdate ) %]
397 [% itemLoo.waitingdate | $KohaDates %]
399 [% IF ( itemLoo.reservedate ) %]
400 [% itemLoo.reservedate %]
405 <span class="notonhold">Not on hold</span>
406 [% END # / IF ( itemLoo.reservedate )%]
409 [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
410 </table> <!-- / #copiesrow_[% bibitemloo.biblionumber %] -->
411 [% END # / IF ( bibitemloo.itemholdable )%]
412 </div> <!-- / #hold-options-[% bibitemloo.biblionumber %] -->
414 [% END # / IF ( bibitemloo.holdable ) %]
415 </div> <!-- / .holdrow -->
416 [% END # / FOREACH bibitemloo IN bibitemloop %]
417 </div><!-- #bigloop -->
419 [% UNLESS ( none_available ) %]
420 <input type="submit" value="Place hold" class="btn placehold" />
424 [% END # / UNLESS message %]
425 </div> <!-- / #holds -->
426 </div> <!-- / .container -->
427 </div> <!-- / .main -->
428 [% INCLUDE 'opac-bottom.inc' %]
429 [% BLOCK jsinclude %]
430 [% INCLUDE 'calendar.inc' %]
431 <script type="text/javascript">
433 var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection.");
434 var ForceHoldNotesReasons=new Array(
435 _("This title consists of multiple volumes/parts. Please indicate which part you need. Clicking on specific item information may be helpful."),
436 "*** Add a new reason above this line ***" );
437 // NOTE: Do not renumber reasons; this will affect use of existing ones.
439 // Clear the contents of an input field
440 $(".clearfield").on("click",function(e){
441 $(this).closest("td").find("input").val("");
445 // Select the first item available
446 function select_first_available(id){
447 var radios = $("input:radio[name='checkitem_" + id + "']");
448 $(radios).first().attr("checked", "checked");
451 $(document).ready(function() {
452 $("#hold-request-form").preventDoubleFormSubmit();
453 var copiesRowId = null;
454 var wasSpecific = false;
455 var lastCopiesRowId = null;
457 $(".toggle-hold-options").show();
458 $(".hold-options").hide();
459 $(".holddatefrom,.holddateto").prop("readOnly", true);
461 $(".checkitem").parent().click(function(e){
462 if(e.target.tagName.toLowerCase() == 'td'){
463 $(this).find("input.checkitem").each( function() {
464 $(this).attr('checked', 'checked');
469 // click on a first td check the confirmjs checkbox
470 $("td.hold").click(function(e){
471 if(e.target.tagName.toLowerCase() == 'td'){
472 $(this).find("input.confirmjs").each( function() {
473 $(this).attr('checked', !$(this).attr('checked'));
479 $(".toggle-hold-options").on("click",function(e){
481 toggleLink = $(this);
482 var optionsID = this.id.replace("toggle-hold-options-","");
483 $("#hold-options-"+optionsID).toggle(0, function() {
484 toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
488 // Hides all 'specific copy' table rows on load.
489 $(".copiesrow").hide();
491 [% FOREACH bibitemloo IN bibitemloop %]
492 [% IF bibitemloo.force_hold %]
493 $("#toggle-hold-options-[% bibitemloo.biblionumber %]").click();
494 $("#reqspecific_[% bibitemloo.biblionumber %]").click();
495 $("#copiesrow_[% bibitemloo.biblionumber %]").show();
499 // Insert reasons for forced hold notes
500 $(".forcenotesreason").each(function(){
501 biblioNum = suffixOf($(this).attr("id"), "_");
502 var j=$("#notesmandatory_"+biblioNum).val();
504 $(this).html(ForceHoldNotesReasons[j-1]);
508 $(".date-format").each(function(){
509 if($(this).hasClass("to")){ var op = "to"; }
510 if($(this).hasClass("from")){ var op = "from"; }
511 var bibNum = $(this).data("biblionumber");
512 $(this).html("<a href=\"#\" class=\"clear-date\" data-op=\"" + op + "\" id=\"clear" + bibNum + "\">" + _("Clear date") + "</a>");
515 $(".clear-date").on("click",function(e){
517 var fieldID = this.id.replace("clear","");
518 var op = $(this).data("op");
519 $("#" + op + fieldID).val("");
522 // Replace non-JS single-selection with multi-selection capability.
523 $(".reserve_mode").val("multi");
524 $(".confirm_nonjs").remove();
525 $(".confirmjs_hold").each(function(){
526 var bib = $(this).attr("title");
527 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
528 html += "value=\"" + bib + "\" id=\"" + bib + "\" /> " + _("Place a hold on") + " </label> ";
531 $(".confirmjs_nohold").each(function(){
532 var bib = $(this).attr("title");
533 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
534 html += "value=\"" + bib + "\" id=\"" + bib + "\" />" + _("Place a hold on: ") + "</label>";
538 // expand or collapse the copiesrow tr
539 function toggle_copiesrow(biblioNum) {
540 var checkbox = $("input:checkbox[value='"+biblioNum+"']");
541 newCopiesRowId = "#copiesrow_" + biblioNum;
542 var select_specific = $("#reqspecific_"+biblioNum).is(":checked");
543 // If the checkbox is checked AND we want a specific item, we display the items block
544 if ( $(checkbox).is(":checked") && select_specific ) {
545 $(newCopiesRowId).show();
547 $(newCopiesRowId).hide();
551 $("#place_on_hdr").show();
553 $(".place_on_type").show();
554 // onload, selectany is checked
555 $(".selectany").attr("checked", "checked");
557 // If the user is *allowed* to choose a specific item
558 // The first one is preselected
559 $("table.copiesrow").each(function(){
560 var id = suffixOf($(this).attr("id"), "_");
561 select_first_available(id);
564 // On confirmsjs change
565 $(".confirmjs").change(function(){
566 var id = suffixOf($(this).attr("id"), "_");
567 // If I m checked, I enable radio buttons
568 if ( $(this).is(":checked") ) {
569 $("#reqspecific_" + id).attr("disabled", false);
570 $("#reqany_" + id).attr("disabled", false);
572 // Else its are disabled
574 $("#reqspecific_" + id).attr("disabled", "disabled");
575 $("#reqany_" + id).attr("disabled", "disabled");
577 // expand or collaspe the items block
578 toggle_copiesrow(id);
581 // When 'specific copy' or 'first available' radio button is clicked
582 $(".selectspecific, .selectany").click(function() {
583 var id = suffixOf($(this).attr("id"), "_");
584 toggle_copiesrow(id);
587 // Show or hide holds notes
588 $(".shownotes").click(function(){
589 biblioNum = suffixOf($(this).attr("id"), "_");
590 $("#notesrow_"+biblioNum).toggle();
593 // When 'Place Hold' button is clicked
594 $(".placehold").click(function(){
595 var biblionumbers = "";
598 [% IF new_reserves_allowed %]
599 if ($(".confirmjs:checked").size() > [% new_reserves_allowed %] ) {
600 alert(MSG_MAX_HOLDS_EXCEEDED);
605 if ($(".confirmjs:checked").size() == 0) {
606 alert(MSG_NO_RECORD_SELECTED);
610 // Find the items with the 'Hold' box checked
612 $(".confirmjs:checked").each(function() {
613 var biblioNum = $(this).val();
614 biblionumbers += biblioNum + "/";
615 selections += biblioNum + "/";
617 // If the 'specific copy' radio button is checked
618 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
619 // Find the selected copy
620 var item = $(".checkitem_" + biblioNum + ":checked");
621 if ($(item).size() == 0) {
625 selections += $(item).val();
630 // Add the pickup location
631 var branchSel = $("#branch_" + biblioNum);
632 if (branchSel.size() > 0) {
633 selections += $(branchSel).val();
640 alert(MSG_NO_ITEM_SELECTED);
644 $("#selections").val(selections);
645 $("#biblionumbers").val(biblionumbers);
650 [% FOREACH bibitemloo IN bibitemloop %]
651 [% IF ( bibitemloo.holdable ) %]
652 // http://jqueryui.com/demos/datepicker/#date-range
653 var dates[% bibitemloo.biblionumber %] = $( "#from[% bibitemloo.biblionumber %], #to[% bibitemloo.biblionumber %]" ).datepicker({
657 onSelect: function( selectedDate ) {
658 var option = this.id == "from[% bibitemloo.biblionumber %]" ? "minDate" : "maxDate",
659 instance = $( this ).data( "datepicker" );
660 date = $.datepicker.parseDate(
661 instance.settings.dateFormat ||
662 $.datepicker._defaults.dateFormat,
663 selectedDate, instance.settings );
664 dates[% bibitemloo.biblionumber %].not( this ).datepicker( "option", option, date );