3 [% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog › Placing a hold
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% INCLUDE 'calendar.inc' %]
6 <script type="text/javascript">
8 var MSG_NO_COPY_SELECTED = _("Expecting a specific copy selection.");
9 var ForceHoldNotesReasons=new Array(
10 _("This title consists of multiple volumes/parts. Please indicate which part you need. Clicking on specific copy information may be helpful."),
11 "*** Add a new reason above this line ***" ); // NOTE: Do not renumber reasons; this will affect use of existing ones.
13 function prefixOf (s, tok) {
14 var index = s.indexOf(tok);
15 return s.substring(0, index);
17 function suffixOf (s, tok) {
18 var index = s.indexOf(tok);
19 return s.substring(index + 1);
22 $(document).ready(function() {
23 $('#hold-request-form').preventDoubleFormSubmit();
25 var copiesRowId = null;
26 var wasSpecific = false;
27 var lastCopiesRowId = null;
28 $(".checkitem").parent().click(function(e){
29 if(e.target.tagName.toLowerCase() == 'td'){
30 $(this).find("input.checkitem").each( function() {
31 $(this).attr('checked', !$(this).attr('checked'));
35 // Hides all 'specific copy' table rows on load.
36 $(".copiesrow").hide();
38 // Insert reasons for forced hold notes
39 $(".forcenotesreason").each(function(){
40 biblioNum = suffixOf($(this).attr("id"), "_");
41 var j=$("#notesmandatory_"+biblioNum).val();
43 $(this).html(ForceHoldNotesReasons[j-1]);
47 $("#place_on_hdr,.place_on_type,.toggle-hold-options").show();
48 $(".hold-options").hide();
49 $(".holddatefrom,.holddateto").prop("readOnly", true);
51 $(".date-format").each(function(){
52 if($(this).hasClass("to")){ var op = "to"; }
53 if($(this).hasClass("from")){ var op = "from"; }
54 var bibNum = $(this).data("biblionumber");
55 $(this).html("<a href=\"#\" class=\"clear-date\" data-op=\"" + op + "\" id=\"clear" + bibNum + "\">" + _("Clear date") + "</a>");
58 $(".clear-date").on("click",function(e){
60 var fieldID = this.id.replace("clear","");
61 var op = $(this).data("op");
62 $("#" + op + fieldID).val("");
65 // Replace non-JS single-selection with multi-selection capability.
66 $(".reserve_mode").val("multi");
67 $(".confirm_nonjs").remove();
68 $(".confirmjs_hold").each(function(){
69 var bib = $(this).attr("title");
70 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
71 html += "value=\"" + bib + "\"/> " + _("Place a hold on") + " </label> ";
74 $(".confirmjs_nohold").each(function(){
75 var bib = $(this).attr("title");
76 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
77 html += "value=\"" + bib + "\"/>" + _("Place a hold on: ") + "</label>";
81 // Make sure a specific item was selected where specified
82 // before moving on to a new item.
83 function changeSelection (newCopiesRowId, isSpecific) {
84 if (copiesRowId && ((copiesRowId != newCopiesRowId) || (wasSpecific != isSpecific))) {
85 var biblioNum = suffixOf(copiesRowId, "_");
87 // If the 'specific copy' radio button was checked
88 if (wasSpecific && (copiesRowId != newCopiesRowId)) {
89 // Find the selected copy
90 var item = $(".checkitem_" + biblioNum + ":checked");
91 if ($(item).size() == 0) {
92 alert(MSG_NO_COPY_SELECTED);
97 copiesRowId = newCopiesRowId;
98 wasSpecific = isSpecific;
102 // When 'specific copy' radio button is clicked
103 $(".selectspecific").click(function() {
105 // Make sure all other specific copy table rows are hidden
106 biblioNum = suffixOf($(this).attr("id"), "_");
107 newCopiesRowId = "#copiesrow_" + biblioNum;
109 if (!changeSelection(newCopiesRowId, true)) {
113 // Show the specific copy table for this radio button.
114 $(newCopiesRowId).show();
118 // When 'first available' radion button is clicked
119 $(".selectany").click(function() {
120 // Make sure all other specific copy table rows are hidden
121 biblioNum = suffixOf($(this).attr("id"), "_");
122 newCopiesRowId = "#copiesrow_" + biblioNum;
124 if (!changeSelection(newCopiesRowId, false)) {
128 // Hide the copies table row
129 $(newCopiesRowId).hide();
132 // When 'Place Hold' button is clicked
133 $(".placehold").click(function(){
134 var biblionumbers = "";
137 if ($(".confirmjs:checked").size() == 0) {
138 alert(MSG_NO_RECORD_SELECTED);
142 // Find the items with the 'Hold' box checked
144 $(".confirmjs:checked").each(function() {
145 var biblioNum = $(this).val();
146 biblionumbers += biblioNum + "/";
147 selections += biblioNum + "/";
149 // If the 'specific copy' radio button is checked
150 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
151 // Find the selected copy
152 var item = $(".checkitem_" + biblioNum + ":checked");
153 if ($(item).size() == 0) {
157 selections += $(item).val();
162 // Add the pickup location
163 var branchSel = $("#branch_" + biblioNum);
164 if (branchSel.size() > 0) {
165 selections += $(branchSel).val();
172 alert(MSG_NO_COPY_SELECTED);
176 $("#selections").val(selections);
177 $("#biblionumbers").val(biblionumbers);
181 $(".toggle-hold-options").on("click",function(e){
183 toggleLink = $(this);
184 var optionsID = this.id.replace("toggle-hold-options-","");
185 $("#hold-options-"+optionsID).toggle(0, function() {
186 toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
194 [% FOREACH bibitemloo IN bibitemloop %]
195 [% IF ( bibitemloo.holdable ) %]
196 // http://jqueryui.com/demos/datepicker/#date-range
197 var dates[% bibitemloo.biblionumber %] = $( "#from[% bibitemloo.biblionumber %], #to[% bibitemloo.biblionumber %]" ).datepicker({
201 onSelect: function( selectedDate ) {
202 var option = this.id == "from[% bibitemloo.biblionumber %]" ? "minDate" : "maxDate",
203 instance = $( this ).data( "datepicker" );
204 date = $.datepicker.parseDate(
205 instance.settings.dateFormat ||
206 $.datepicker._defaults.dateFormat,
207 selectedDate, instance.settings );
208 dates[% bibitemloo.biblionumber %].not( this ).datepicker( "option", option, date );
217 <style type="text/css">td ul { padding : 0; } td li { white-space: nowrap; font-size: 90%; list-style-type:none; padding : .3em 0; }</style>
220 <body id="opac-holds">
221 <div id="doc3" class="yui-t7">
223 [% INCLUDE 'masthead.inc' %]
225 <div id="holds" class="container">
228 <div id="gna" class="dialog alert">
229 <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>
230 <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>
234 <div id="lost" class="dialog alert">
235 <p><strong>Sorry</strong>, you cannot place holds because your library card has been marked as lost or stolen.</p>
236 <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>
239 [% IF ( debarred ) %]
240 <div id="debarred" class="dialog alert">
241 <p><strong>Sorry</strong>, you cannot place holds because your account has been frozen.</p>
242 <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>
245 [% IF ( too_much_oweing ) %]
246 <div id="too_much_oweing" class="dialog alert">
247 Sorry, you cannot place holds because you owe [% too_much_oweing %].
250 [% IF ( too_many_reserves ) %]
251 <div id="too_many_reserves" class="dialog alert">Sorry, you cannot place more than [% too_many_reserves %] holds.
254 [% IF ( bad_biblionumber ) %]
255 <div id="bad_biblionumber" class="dialog alert">ERROR: No biblio record found for biblionumber [% bad_biblionumber %].</div>
257 [% IF ( no_items_selected ) %]
258 <div id="no_items_selected" class="dialog alert">
259 You must select at least one item.
262 [% IF ( no_branch_selected ) %]
263 <div id="no_branch_selected" class="dialog alert">
264 You must select a library for pickup.
267 [% IF ( no_biblionumber ) %]
268 <div id="no_biblionumber" class="dialog alert">ERROR: No biblionumber received.</div>
270 [% IF ( bad_data ) %]
271 <div id="bad_data" class="dialog alert">ERROR: Internal error: incomplete hold request.</div>
274 [% IF ( none_available ) %]
275 <div id="none_available" class="dialog alert"><strong>Sorry</strong>, none of these items can be placed on hold.
278 [% END %]<!-- NAME="message" -->
280 [% UNLESS ( message ) %][% UNLESS ( none_available ) %]<h3>Confirm holds for:
281 [% FOREACH USER_INF IN USER_INFO %]
282 [% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %])
285 [% IF (RESERVE_CHARGE) %]
286 <div class="dialog alert" id="reserve_fee">
287 There is a charge of [% RESERVE_CHARGE %] for placing this hold
291 <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
292 <input type="hidden" name="place_reserve" value="1"/>
294 <!-- These values are set dynamically by js -->
295 <input type="hidden" name="biblionumbers" id="biblionumbers"/>
296 <input type="hidden" name="selecteditems" id="selections"/>
299 [% FOREACH bibitemloo IN bibitemloop %]
300 <div class="holdrow">
304 [% IF ( bibitemloo.holdable ) %]
305 <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
306 <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber %]"/>
307 <span class="confirmjs_hold" title="[% bibitemloo.biblionumber %]" style="padding:.3em"></span>
308 <span class="confirm_nonjs">
309 <input type="radio" class="confirmbox checkitem [% bibitemloo.biblionumber %]"
310 name="[% bibitemloo.biblionumber %]" checked="checked"
311 id="single_[% bibitemloo.biblionumber %]"
313 <label class="confirm_label" for="single_[% bibitemloo.biblionumber %]">Place a hold on </label>
318 <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>
319 [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %]</p>
324 [% UNLESS ( bibitemloo.holdable ) %]
325 [% IF ( bibitemloo.already_reserved ) %]
326 <div class="bibmessage">You have already requested this title.</div>
328 [% UNLESS ( bibitemloo.bib_available ) %]
329 <div class="bibmessage">No available items.</div>
331 [% IF ( bibitemloo.already_patron_possession ) %]
332 <div class="bibmessage">This title cannot be requested because it's already in your possession.</div>
334 <div class="bibmessage">This title cannot be requested.</div>
340 [% IF ( bibitemloo.holdable ) %]
341 <fieldset class="rows">
344 [% UNLESS ( item_level_itypes ) %]
346 <span class="label">Item type: </span>
347 [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
348 [% bibitemloo.description %]
351 [% IF showholds || showpriority %]
352 <li class="priority">
353 <span class="label">Holds and priority: </span>
354 [% IF showpriority %] [% bibitemloo.rank %] [% END %]
355 [% IF showholds && showpriority %] out of [% END %]
356 [% IF showholds %] [% bibitemloo.reservecount %] [% END %]
362 [% UNLESS ( singleBranchMode ) %]
363 [% IF ( bibitemloo.holdable ) %]
364 [% IF ( choose_branch ) %]
366 <label for="branch_[% bibitemloo.biblionumber %]">Pick up location:</label>
367 [% UNLESS ( bibitemloo.holdable ) %]
368 <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
369 [% FOREACH branchloo IN bibitemloo.branchloop %]
370 [% IF ( branchloo.selected ) %]
371 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
373 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
378 <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
379 [% FOREACH branchloo IN bibitemloo.branchloop %]
380 [% IF ( branchloo.selected ) %]
381 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
383 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
393 <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber %]" style="display:none;" href="#">Show more options</a>
394 <div id="hold-options-[% bibitemloo.biblionumber %]" class="hold-options">
396 [% IF ( reserve_in_future ) %]
397 <li><label for="from[% bibitemloo.biblionumber %]">Hold starts on date:</label>
398 <input name="reserve_date_[% bibitemloo.biblionumber %]" id="from[% bibitemloo.biblionumber %]" size="10" class="holddatefrom"/>
399 <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
404 [% IF ( bibitemloo.holdable ) %]
406 <label for="to[% bibitemloo.biblionumber %]">Hold not needed after:</label>
407 <input name="expiration_date_[% bibitemloo.biblionumber %]" id="to[% bibitemloo.biblionumber %]" size="10" class="holddateto" />
408 <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
412 [% IF ( OpacHoldNotes && bibitemloo.holdable ) %]
414 <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
415 <label for="holdnotes[% bibitemloo.biblionumber %]">Hold notes:</label>
416 <span id="forcenotesreason_[% bibitemloo.biblionumber %]" class="forcenotesreason"></span>
417 <textarea id="holdnotes[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]">[% bibitemloo.holdnotes %]</textarea>
418 <input type="hidden" id="notesmandatory_[% bibitemloo.biblionumber %]" value="[% bibitemloo.mandatorynotes %]"/>
423 [% IF ( bibitemloo.holdable ) %]
425 [% IF ( OPACItemHolds ) %]
429 [% UNLESS ( bibitemloo.holdable ) %]
430 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
431 id="reqany_[% bibitemloo.biblionumber %]"
437 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
438 id="reqany_[% bibitemloo.biblionumber %]"
445 <label for="reqany_[% bibitemloo.biblionumber %]">Next available copy</label>
446 [% UNLESS ( bibitemloo.holdable ) %]
447 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
448 id="reqspecific_[% bibitemloo.biblionumber %]"
449 class="selectspecific"
454 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
455 id="reqspecific_[% bibitemloo.biblionumber %]"
456 class="selectspecific"
460 <label for="reqspecific_[% bibitemloo.biblionumber %]">A specific copy</label>
466 [% IF ( OPACItemHolds ) %]
467 [% IF ( bibitemloo.holdable ) %]
469 <table class="copiesrow" id="copiesrow_[% bibitemloo.biblionumber %]">
470 <caption>Select a specific copy:</caption>
473 [% IF ( item_level_itypes ) %]
477 [% UNLESS ( singleBranchMode ) %]
478 <th>Home library</th>
479 <th>Last location</th>
482 [% IF ( itemdata_enumchron ) %]
488 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
489 <tr class="[% itemLoo.backgroundcolor %]">
491 [% IF ( itemLoo.available ) %]
492 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]"
493 value="[% itemLoo.itemnumber %]" />
495 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]" />
496 <img src="/opac-tmpl/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
497 [% END %] [% IF ( itemLoo.copynumber ) %][% itemLoo.copynumber %][% END %]
499 [% IF ( item_level_itypes ) %]
501 [% UNLESS ( noItemTypeImages ) %]
502 [% IF ( itemLoo.imageurl ) %]<img src="[% itemLoo.imageurl %]" alt="" />[% END %]
504 [% itemLoo.description %]
507 <td class="barcode">[% itemLoo.barcode %]</td>
508 [% UNLESS ( singleBranchMode ) %]
509 <td class="homebranch">[% itemLoo.homeBranchName %]</td>
510 <td class="holdingbranch">[% itemLoo.holdingBranchName %]</td>
512 <td class="call_no">[% itemLoo.callNumber %]</td>
513 [% IF ( itemdata_enumchron ) %]
514 <td class="vol_info">[% itemLoo.enumchron %]</td>
516 <td class="information">
517 [% IF ( itemLoo.dateDue ) %]
518 <span class="checkedout">Due [% itemLoo.dateDue %]</span>
519 [% ELSIF ( itemLoo.transfertwhen ) %]
520 <span class="intransit">In transit from [% itemLoo.transfertfrom %],
521 to [% itemLoo.transfertto %], since [% itemLoo.transfertwhen %]</span>
523 [% IF ( itemLoo.message ) %]
524 <span class="lost">Unavailable (lost or missing)</span>
526 [% IF ( itemLoo.notforloan ) %]
527 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
529 [% IF ( itemLoo.reservedate ) %]
530 <span class="waiting">[% IF ( itemLoo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %] for patron
531 [% IF ( itemLoo.waitingdate ) %]at[% ELSE %]expected at[% END %] [% itemLoo.ExpectedAtLibrary %]
533 [% IF ( itemLoo.waitingdate ) %][% itemLoo.waitingdate | $KohaDates %][% ELSE %][% IF ( itemLoo.reservedate ) %][% itemLoo.reservedate %][% END %][% END %].
536 <span class="notonhold">Not on hold</span>
545 [% END %]<!-- OPACItemHolds -->
547 [% END %]<!-- bib_available -->
552 [% END %] <!-- if message -->
553 </div><!-- bigloop -->
555 [% UNLESS ( message ) %]
556 [% UNLESS ( none_available ) %]
557 <input type="submit" value="Place hold" class="placehold" />
568 <div><!-- The following include seems to have an extra "/div" in it... -->
569 [% INCLUDE 'opac-bottom.inc' %]