2 [% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog › Placing a hold
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% INCLUDE 'calendar.inc' %]
5 <script type="text/javascript">
7 var MSG_NO_COPY_SELECTED = _("Expecting a specific copy selection.");
8 var ForceHoldNotesReasons=new Array(
9 _("This title consists of multiple volumes/parts. Please indicate which part you need. Clicking on specific copy information may be helpful."),
10 "*** Add a new reason above this line ***" ); // NOTE: Do not renumber reasons; this will affect use of existing ones.
12 function prefixOf (s, tok) {
13 var index = s.indexOf(tok);
14 return s.substring(0, index);
16 function suffixOf (s, tok) {
17 var index = s.indexOf(tok);
18 return s.substring(index + 1);
21 $(document).ready(function() {
22 $('#hold-request-form').preventDoubleFormSubmit();
24 var copiesRowId = null;
25 var wasSpecific = false;
26 var lastCopiesRowId = null;
27 $(".checkitem").parent().click(function(e){
28 if(e.target.tagName.toLowerCase() == 'td'){
29 $(this).find("input.checkitem").each( function() {
30 $(this).attr('checked', !$(this).attr('checked'));
34 // Hides all 'specific copy' table rows on load.
35 $(".copiesrow").hide();
37 // Insert reasons for forced hold notes
38 $(".forcenotesreason").each(function(){
39 biblioNum = suffixOf($(this).attr("id"), "_");
40 var j=$("#notesmandatory_"+biblioNum).val();
42 $(this).html(ForceHoldNotesReasons[j-1]);
46 $("#place_on_hdr,.place_on_type,.toggle-hold-options").show();
47 $(".hold-options").hide();
48 $(".holddatefrom,.holddateto").prop("readOnly", true);
50 $(".date-format").each(function(){
51 if($(this).hasClass("to")){ var op = "to"; }
52 if($(this).hasClass("from")){ var op = "from"; }
53 var bibNum = $(this).data("biblionumber");
54 $(this).html("<a href=\"#\" class=\"clear-date\" data-op=\"" + op + "\" id=\"clear" + bibNum + "\">" + _("Clear date") + "</a>");
57 $(".clear-date").on("click",function(e){
59 var fieldID = this.id.replace("clear","");
60 var op = $(this).data("op");
61 $("#" + op + fieldID).val("");
64 // Replace non-JS single-selection with multi-selection capability.
65 $(".reserve_mode").val("multi");
66 $(".confirm_nonjs").remove();
67 $(".confirmjs_hold").each(function(){
68 var bib = $(this).attr("title");
69 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
70 html += "value=\"" + bib + "\"/> " + _("Place a hold on") + " </label> ";
73 $(".confirmjs_nohold").each(function(){
74 var bib = $(this).attr("title");
75 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
76 html += "value=\"" + bib + "\"/>" + _("Place a hold on: ") + "</label>";
80 // Make sure a specific item was selected where specified
81 // before moving on to a new item.
82 function changeSelection (newCopiesRowId, isSpecific) {
83 if (copiesRowId && ((copiesRowId != newCopiesRowId) || (wasSpecific != isSpecific))) {
84 var biblioNum = suffixOf(copiesRowId, "_");
86 // If the 'specific copy' radio button was checked
87 if (wasSpecific && (copiesRowId != newCopiesRowId)) {
88 // Find the selected copy
89 var item = $(".checkitem_" + biblioNum + ":checked");
90 if ($(item).size() == 0) {
91 alert(MSG_NO_COPY_SELECTED);
96 copiesRowId = newCopiesRowId;
97 wasSpecific = isSpecific;
101 // When 'specific copy' radio button is clicked
102 $(".selectspecific").click(function() {
104 // Make sure all other specific copy table rows are hidden
105 biblioNum = suffixOf($(this).attr("id"), "_");
106 newCopiesRowId = "#copiesrow_" + biblioNum;
108 if (!changeSelection(newCopiesRowId, true)) {
112 // Show the specific copy table for this radio button.
113 $(newCopiesRowId).show();
117 // When 'first available' radion button is clicked
118 $(".selectany").click(function() {
119 // Make sure all other specific copy table rows are hidden
120 biblioNum = suffixOf($(this).attr("id"), "_");
121 newCopiesRowId = "#copiesrow_" + biblioNum;
123 if (!changeSelection(newCopiesRowId, false)) {
127 // Hide the copies table row
128 $(newCopiesRowId).hide();
131 // When 'Place Hold' button is clicked
132 $(".placehold").click(function(){
133 var biblionumbers = "";
136 if ($(".confirmjs:checked").size() == 0) {
137 alert(MSG_NO_RECORD_SELECTED);
141 // Find the items with the 'Hold' box checked
143 $(".confirmjs:checked").each(function() {
144 var biblioNum = $(this).val();
145 biblionumbers += biblioNum + "/";
146 selections += biblioNum + "/";
148 // If the 'specific copy' radio button is checked
149 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
150 // Find the selected copy
151 var item = $(".checkitem_" + biblioNum + ":checked");
152 if ($(item).size() == 0) {
156 selections += $(item).val();
161 // Add the pickup location
162 var branchSel = $("#branch_" + biblioNum);
163 if (branchSel.size() > 0) {
164 selections += $(branchSel).val();
171 alert(MSG_NO_COPY_SELECTED);
175 $("#selections").val(selections);
176 $("#biblionumbers").val(biblionumbers);
180 $(".toggle-hold-options").on("click",function(e){
182 toggleLink = $(this);
183 var optionsID = this.id.replace("toggle-hold-options-","");
184 $("#hold-options-"+optionsID).toggle(0, function() {
185 toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
193 [% FOREACH bibitemloo IN bibitemloop %]
194 [% IF ( bibitemloo.holdable ) %]
195 // http://jqueryui.com/demos/datepicker/#date-range
196 var dates[% bibitemloo.biblionumber %] = $( "#from[% bibitemloo.biblionumber %], #to[% bibitemloo.biblionumber %]" ).datepicker({
200 onSelect: function( selectedDate ) {
201 var option = this.id == "from[% bibitemloo.biblionumber %]" ? "minDate" : "maxDate",
202 instance = $( this ).data( "datepicker" );
203 date = $.datepicker.parseDate(
204 instance.settings.dateFormat ||
205 $.datepicker._defaults.dateFormat,
206 selectedDate, instance.settings );
207 dates[% bibitemloo.biblionumber %].not( this ).datepicker( "option", option, date );
216 <style type="text/css">td ul { padding : 0; } td li { white-space: nowrap; font-size: 90%; list-style-type:none; padding : .3em 0; }</style>
219 <body id="opac-holds">
220 <div id="doc3" class="yui-t7">
222 [% INCLUDE 'masthead.inc' %]
224 <div id="holds" class="container">
227 <div id="gna" class="dialog alert">
228 <p><strong>Sorry</strong>, you cannot place holds because the library doesn't have up-to-date <a href="/cgi-bin/koha/opac-memberentry.pl">contact information</a> on file.</p>
229 <p>Please contact your librarian, or use the <a href="/cgi-bin/koha/opac-memberentry.pl">online update form</a> to submit current information (<em>Please note:</em> there may be a delay in restoring your account if you submit online)</p>
233 <div id="lost" class="dialog alert">
234 <p><strong>Sorry</strong>, you cannot place holds because your library card has been marked as lost or stolen.</p>
235 <p>If this is an error, please take your card to the circulation desk at your local library and the error will be corrected.</p>
238 [% IF ( debarred ) %]
239 <div id="debarred" class="dialog alert">
240 <p><strong>Sorry</strong>, you cannot place holds because your account has been frozen.</p>
241 <p>Usually the reason for freezing an account is old overdues or damage fees. If <a href="/cgi-bin/koha/opac-user.pl">your account page</a> shows your account to be clear, please consult a librarian.</p>
244 [% IF ( too_much_oweing ) %]
245 <div id="too_much_oweing" class="dialog alert">
246 Sorry, you cannot place holds because you owe [% too_much_oweing %].
249 [% IF ( too_many_reserves ) %]
250 <div id="too_many_reserves" class="dialog alert">Sorry, you cannot place more than [% too_many_reserves %] holds.
253 [% IF ( bad_biblionumber ) %]
254 <div id="bad_biblionumber" class="dialog alert">ERROR: No biblio record found for biblionumber [% bad_biblionumber %].</div>
256 [% IF ( no_items_selected ) %]
257 <div id="no_items_selected" class="dialog alert">
258 You must select at least one item.
261 [% IF ( no_branch_selected ) %]
262 <div id="no_branch_selected" class="dialog alert">
263 You must select a library for pickup.
266 [% IF ( no_biblionumber ) %]
267 <div id="no_biblionumber" class="dialog alert">ERROR: No biblionumber received.</div>
269 [% IF ( bad_data ) %]
270 <div id="bad_data" class="dialog alert">ERROR: Internal error: incomplete hold request.</div>
273 [% IF ( none_available ) %]
274 <div id="none_available" class="dialog alert"><strong>Sorry</strong>, none of these items can be placed on hold.
277 [% END %]<!-- NAME="message" -->
279 [% UNLESS ( message ) %][% UNLESS ( none_available ) %]<h3>Confirm holds for:
280 [% FOREACH USER_INF IN USER_INFO %]
281 [% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %])
284 [% IF (RESERVE_CHARGE) %]
285 <div class="dialog alert" id="reserve_fee">
286 There is a charge of [% RESERVE_CHARGE %] for placing this hold
290 <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
291 <input type="hidden" name="place_reserve" value="1"/>
293 <!-- These values are set dynamically by js -->
294 <input type="hidden" name="biblionumbers" id="biblionumbers"/>
295 <input type="hidden" name="selecteditems" id="selections"/>
298 [% FOREACH bibitemloo IN bibitemloop %]
299 <div class="holdrow">
303 [% IF ( bibitemloo.holdable ) %]
304 <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
305 <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber %]"/>
306 <span class="confirmjs_hold" title="[% bibitemloo.biblionumber %]" style="padding:.3em"></span>
307 <span class="confirm_nonjs">
308 <input type="radio" class="confirmbox checkitem [% bibitemloo.biblionumber %]"
309 name="[% bibitemloo.biblionumber %]" checked="checked"
310 id="single_[% bibitemloo.biblionumber %]"
312 <label class="confirm_label" for="single_[% bibitemloo.biblionumber %]">Place a hold on </label>
317 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% bibitemloo.biblionumber %]">[% bibitemloo.title |html %][% IF ( bibitemloo.subtitle ) %] [% FOREACH subtitl IN bibitemloo.subtitle %][% subtitl.subfield %][% END %][% END %]</a>
318 [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %]</p>
323 [% UNLESS ( bibitemloo.holdable ) %]
324 [% IF ( bibitemloo.already_reserved ) %]
325 <div class="bibmessage">You have already requested this title.</div>
327 [% UNLESS ( bibitemloo.bib_available ) %]
328 <div class="bibmessage">No available items.</div>
330 [% IF ( bibitemloo.already_patron_possession ) %]
331 <div class="bibmessage">This title cannot be requested because it's already in your possession.</div>
333 <div class="bibmessage">This title cannot be requested.</div>
339 [% IF ( bibitemloo.holdable ) %]
340 <fieldset class="rows">
343 [% UNLESS ( item_level_itypes ) %]
345 <span class="label">Item type: </span>
346 [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
347 [% bibitemloo.description %]
350 [% IF showholds || showpriority %]
351 <li class="priority">
352 <span class="label">Holds and priority: </span>
353 [% IF showpriority %] [% bibitemloo.rank %] [% END %]
354 [% IF showholds && showpriority %] out of [% END %]
355 [% IF showholds %] [% bibitemloo.reservecount %] [% END %]
361 [% UNLESS ( singleBranchMode ) %]
362 [% IF ( bibitemloo.holdable ) %]
363 [% IF ( choose_branch ) %]
365 <label for="branch_[% bibitemloo.biblionumber %]">Pick up location:</label>
366 [% UNLESS ( bibitemloo.holdable ) %]
367 <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
368 [% FOREACH branchloo IN bibitemloo.branchloop %]
369 [% IF ( branchloo.selected ) %]
370 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
372 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
377 <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
378 [% FOREACH branchloo IN bibitemloo.branchloop %]
379 [% IF ( branchloo.selected ) %]
380 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
382 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
392 <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber %]" style="display:none;" href="#">Show more options</a>
393 <div id="hold-options-[% bibitemloo.biblionumber %]" class="hold-options">
395 [% IF ( reserve_in_future ) %]
396 <li><label for="from[% bibitemloo.biblionumber %]">Hold starts on date:</label>
397 <input name="reserve_date_[% bibitemloo.biblionumber %]" id="from[% bibitemloo.biblionumber %]" size="10" class="holddatefrom"/>
398 <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
403 [% IF ( bibitemloo.holdable ) %]
405 <label for="to[% bibitemloo.biblionumber %]">Hold not needed after:</label>
406 <input name="expiration_date_[% bibitemloo.biblionumber %]" id="to[% bibitemloo.biblionumber %]" size="10" class="holddateto" />
407 <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
411 [% IF ( OpacHoldNotes && bibitemloo.holdable ) %]
413 <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
414 <label for="holdnotes[% bibitemloo.biblionumber %]">Hold notes:</label>
415 <span id="forcenotesreason_[% bibitemloo.biblionumber %]" class="forcenotesreason"></span>
416 <textarea id="holdnotes[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]">[% bibitemloo.holdnotes %]</textarea>
417 <input type="hidden" id="notesmandatory_[% bibitemloo.biblionumber %]" value="[% bibitemloo.mandatorynotes %]"/>
422 [% IF ( bibitemloo.holdable ) %]
424 [% IF ( OPACItemHolds ) %]
428 [% UNLESS ( bibitemloo.holdable ) %]
429 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
430 id="reqany_[% bibitemloo.biblionumber %]"
436 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
437 id="reqany_[% bibitemloo.biblionumber %]"
444 <label for="reqany_[% bibitemloo.biblionumber %]">Next available copy</label>
445 [% UNLESS ( bibitemloo.holdable ) %]
446 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
447 id="reqspecific_[% bibitemloo.biblionumber %]"
448 class="selectspecific"
453 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
454 id="reqspecific_[% bibitemloo.biblionumber %]"
455 class="selectspecific"
459 <label for="reqspecific_[% bibitemloo.biblionumber %]">A specific copy</label>
465 [% IF ( OPACItemHolds ) %]
466 [% IF ( bibitemloo.holdable ) %]
468 <table class="copiesrow" id="copiesrow_[% bibitemloo.biblionumber %]">
469 <caption>Select a specific copy:</caption>
472 [% IF ( item_level_itypes ) %]
476 [% UNLESS ( singleBranchMode ) %]
477 <th>Home library</th>
478 <th>Last location</th>
481 [% IF ( itemdata_enumchron ) %]
487 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
488 <tr class="[% itemLoo.backgroundcolor %]">
490 [% IF ( itemLoo.available ) %]
491 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]"
492 value="[% itemLoo.itemnumber %]" />
494 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]" />
495 <img src="/opac-tmpl/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
496 [% END %] [% IF ( itemLoo.copynumber ) %][% itemLoo.copynumber %][% END %]
498 [% IF ( item_level_itypes ) %]
500 [% UNLESS ( noItemTypeImages ) %]
501 [% IF ( itemLoo.imageurl ) %]<img src="[% itemLoo.imageurl %]" alt="" />[% END %]
503 [% itemLoo.description %]
506 <td class="barcode">[% itemLoo.barcode %]</td>
507 [% UNLESS ( singleBranchMode ) %]
508 <td class="homebranch">[% itemLoo.homeBranchName %]</td>
509 <td class="holdingbranch">[% itemLoo.holdingBranchName %]</td>
511 <td class="call_no">[% itemLoo.callNumber %]</td>
512 [% IF ( itemdata_enumchron ) %]
513 <td class="vol_info">[% itemLoo.enumchron %]</td>
515 <td class="information">
516 [% IF ( itemLoo.dateDue ) %]
517 <span class="checkedout">Due [% itemLoo.dateDue %]</span>
518 [% ELSIF ( itemLoo.transfertwhen ) %]
519 <span class="intransit">In transit from [% itemLoo.transfertfrom %],
520 to [% itemLoo.transfertto %], since [% itemLoo.transfertwhen %]</span>
522 [% IF ( itemLoo.message ) %]
523 <span class="lost">Unavailable (lost or missing)</span>
525 [% IF ( itemLoo.notforloan ) %]
526 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
528 [% IF ( itemLoo.reservedate ) %]
529 <span class="waiting">[% IF ( itemLoo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %] for patron
530 [% IF ( itemLoo.waitingdate ) %]at[% ELSE %]expected at[% END %] [% itemLoo.ExpectedAtLibrary %]
532 [% IF ( itemLoo.waitingdate ) %][% itemLoo.waitingdate %][% ELSE %][% IF ( itemLoo.reservedate ) %][% itemLoo.reservedate %][% END %][% END %].
535 <span class="notonhold">Not on hold</span>
544 [% END %]<!-- OPACItemHolds -->
546 [% END %]<!-- bib_available -->
551 [% END %] <!-- if message -->
552 </div><!-- bigloop -->
554 [% UNLESS ( message ) %]
555 [% UNLESS ( none_available ) %]
556 <input type="submit" value="Place hold" class="placehold" />
567 <div><!-- The following include seems to have an extra "/div" in it... -->
568 [% INCLUDE 'opac-bottom.inc' %]