3 [% INCLUDE 'doc-head-open.inc' %]
4 [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Placing a hold
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% INCLUDE 'calendar.inc' %]
7 <script type="text/javascript">
9 var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection.");
10 var ForceHoldNotesReasons=new Array(
11 _("This title consists of multiple volumes/parts. Please indicate which part you need. Clicking on specific item information may be helpful."),
12 "*** Add a new reason above this line ***" ); // NOTE: Do not renumber reasons; this will affect use of existing ones.
14 function prefixOf (s, tok) {
15 var index = s.indexOf(tok);
16 return s.substring(0, index);
18 function suffixOf (s, tok) {
19 var index = s.indexOf(tok);
20 return s.substring(index + 1);
23 $(document).ready(function() {
24 $('#hold-request-form').preventDoubleFormSubmit();
26 var copiesRowId = null;
27 var wasSpecific = false;
28 var lastCopiesRowId = null;
29 $(".checkitem").parent().click(function(e){
30 if(e.target.tagName.toLowerCase() == 'td'){
31 $(this).find("input.checkitem").each( function() {
32 $(this).attr('checked', !$(this).attr('checked'));
36 // Hides all 'specific copy' table rows on load.
37 $(".copiesrow").hide();
39 // Insert reasons for forced hold notes
40 $(".forcenotesreason").each(function(){
41 biblioNum = suffixOf($(this).attr("id"), "_");
42 var j=$("#notesmandatory_"+biblioNum).val();
44 $(this).html(ForceHoldNotesReasons[j-1]);
48 $("#place_on_hdr,.place_on_type,.toggle-hold-options").show();
49 $(".hold-options").hide();
50 $(".holddatefrom,.holddateto").prop("readOnly", true);
52 $(".date-format").each(function(){
53 if($(this).hasClass("to")){ var op = "to"; }
54 if($(this).hasClass("from")){ var op = "from"; }
55 var bibNum = $(this).data("biblionumber");
56 $(this).html("<a href=\"#\" class=\"clear-date\" data-op=\"" + op + "\" id=\"clear" + bibNum + "\">" + _("Clear date") + "</a>");
59 $(".clear-date").on("click",function(e){
61 var fieldID = this.id.replace("clear","");
62 var op = $(this).data("op");
63 $("#" + op + fieldID).val("");
66 // Replace non-JS single-selection with multi-selection capability.
67 $(".reserve_mode").val("multi");
68 $(".confirm_nonjs").remove();
69 $(".confirmjs_hold").each(function(){
70 var bib = $(this).attr("title");
71 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
72 html += "value=\"" + bib + "\"/> " + _("Place a hold on") + " </label> ";
75 $(".confirmjs_nohold").each(function(){
76 var bib = $(this).attr("title");
77 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
78 html += "value=\"" + bib + "\"/>" + _("Place a hold on: ") + "</label>";
82 // Make sure a specific item was selected where specified
83 // before moving on to a new item.
84 function changeSelection (newCopiesRowId, isSpecific) {
85 if (copiesRowId && ((copiesRowId != newCopiesRowId) || (wasSpecific != isSpecific))) {
86 var biblioNum = suffixOf(copiesRowId, "_");
88 // If the 'specific copy' radio button was checked
89 if (wasSpecific && (copiesRowId != newCopiesRowId)) {
90 // Find the selected copy
91 var item = $(".checkitem_" + biblioNum + ":checked");
92 if ($(item).size() == 0) {
93 alert(MSG_NO_ITEM_SELECTED);
98 copiesRowId = newCopiesRowId;
99 wasSpecific = isSpecific;
103 // When 'specific copy' radio button is clicked
104 $(".selectspecific").click(function() {
106 // Make sure all other specific copy table rows are hidden
107 biblioNum = suffixOf($(this).attr("id"), "_");
108 newCopiesRowId = "#copiesrow_" + biblioNum;
110 if (!changeSelection(newCopiesRowId, true)) {
114 // Show the specific copy table for this radio button.
115 $(newCopiesRowId).show();
119 // When 'first available' radion button is clicked
120 $(".selectany").click(function() {
121 // Make sure all other specific copy table rows are hidden
122 biblioNum = suffixOf($(this).attr("id"), "_");
123 newCopiesRowId = "#copiesrow_" + biblioNum;
125 if (!changeSelection(newCopiesRowId, false)) {
129 // Hide the copies table row
130 $(newCopiesRowId).hide();
133 // When 'Place Hold' button is clicked
134 $(".placehold").click(function(){
135 var biblionumbers = "";
138 if ($(".confirmjs:checked").size() == 0) {
139 alert(MSG_NO_RECORD_SELECTED);
143 // Find the items with the 'Hold' box checked
145 $(".confirmjs:checked").each(function() {
146 var biblioNum = $(this).val();
147 biblionumbers += biblioNum + "/";
148 selections += biblioNum + "/";
150 // If the 'specific copy' radio button is checked
151 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
152 // Find the selected copy
153 var item = $(".checkitem_" + biblioNum + ":checked");
154 if ($(item).size() == 0) {
158 selections += $(item).val();
163 // Add the pickup location
164 var branchSel = $("#branch_" + biblioNum);
165 if (branchSel.size() > 0) {
166 selections += $(branchSel).val();
173 alert(MSG_NO_ITEM_SELECTED);
177 $("#selections").val(selections);
178 $("#biblionumbers").val(biblionumbers);
182 $(".toggle-hold-options").on("click",function(e){
184 toggleLink = $(this);
185 var optionsID = this.id.replace("toggle-hold-options-","");
186 $("#hold-options-"+optionsID).toggle(0, function() {
187 toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
195 [% FOREACH bibitemloo IN bibitemloop %]
196 [% IF ( bibitemloo.holdable ) %]
197 // http://jqueryui.com/demos/datepicker/#date-range
198 var dates[% bibitemloo.biblionumber %] = $( "#from[% bibitemloo.biblionumber %], #to[% bibitemloo.biblionumber %]" ).datepicker({
202 onSelect: function( selectedDate ) {
203 var option = this.id == "from[% bibitemloo.biblionumber %]" ? "minDate" : "maxDate",
204 instance = $( this ).data( "datepicker" );
205 date = $.datepicker.parseDate(
206 instance.settings.dateFormat ||
207 $.datepicker._defaults.dateFormat,
208 selectedDate, instance.settings );
209 dates[% bibitemloo.biblionumber %].not( this ).datepicker( "option", option, date );
218 <style type="text/css">td ul { padding : 0; } td li { white-space: nowrap; font-size: 90%; list-style-type:none; padding : .3em 0; }</style>
221 <body id="opac-holds">
222 <div id="doc3" class="yui-t7">
224 [% INCLUDE 'masthead.inc' %]
226 <div id="holds" class="container">
229 <div id="gna" class="dialog alert">
230 <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>
231 <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>
235 <div id="lost" class="dialog alert">
236 <p><strong>Sorry</strong>, you cannot place holds because your library card has been marked as lost or stolen.</p>
237 <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>
240 [% IF ( debarred ) %]
241 <div id="debarred" class="dialog alert">
242 <p><strong>Sorry</strong>, you cannot place holds because your account has been frozen.</p>
243 <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>
246 [% IF ( too_much_oweing ) %]
247 <div id="too_much_oweing" class="dialog alert">
248 Sorry, you cannot place holds because you owe [% too_much_oweing %].
251 [% IF ( too_many_reserves ) %]
252 <div id="too_many_reserves" class="dialog alert">Sorry, you cannot place more than [% too_many_reserves %] holds.
255 [% IF ( bad_biblionumber ) %]
256 <div id="bad_biblionumber" class="dialog alert">ERROR: No biblio record found for biblionumber [% bad_biblionumber %].</div>
258 [% IF ( no_items_selected ) %]
259 <div id="no_items_selected" class="dialog alert">
260 You must select at least one item.
263 [% IF ( no_branch_selected ) %]
264 <div id="no_branch_selected" class="dialog alert">
265 You must select a library for pickup.
268 [% IF ( no_biblionumber ) %]
269 <div id="no_biblionumber" class="dialog alert">ERROR: No biblionumber received.</div>
271 [% IF ( bad_data ) %]
272 <div id="bad_data" class="dialog alert">ERROR: Internal error: incomplete hold request.</div>
275 [% IF ( none_available ) %]
276 <div id="none_available" class="dialog alert"><strong>Sorry</strong>, none of these items can be placed on hold.
279 [% END %]<!-- NAME="message" -->
281 [% UNLESS ( message ) %][% UNLESS ( none_available ) %]<h3>Confirm holds for:
282 [% FOREACH USER_INF IN USER_INFO %]
283 [% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %])
286 [% IF (RESERVE_CHARGE) %]
287 <div class="dialog alert" id="reserve_fee">
288 There is a charge of [% RESERVE_CHARGE %] for placing this hold
292 <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
293 <input type="hidden" name="place_reserve" value="1"/>
295 <!-- These values are set dynamically by js -->
296 <input type="hidden" name="biblionumbers" id="biblionumbers"/>
297 <input type="hidden" name="selecteditems" id="selections"/>
300 [% FOREACH bibitemloo IN bibitemloop %]
301 <div class="holdrow">
305 [% IF ( bibitemloo.holdable ) %]
306 <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
307 <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber %]"/>
308 <span class="confirmjs_hold" title="[% bibitemloo.biblionumber %]" style="padding:.3em"></span>
309 <span class="confirm_nonjs">
310 <input type="radio" class="confirmbox checkitem [% bibitemloo.biblionumber %]"
311 name="[% bibitemloo.biblionumber %]" checked="checked"
312 id="single_[% bibitemloo.biblionumber %]"
314 <label class="confirm_label" for="single_[% bibitemloo.biblionumber %]">Place a hold on </label>
319 <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>
320 [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %]</p>
325 [% UNLESS ( bibitemloo.holdable ) %]
326 [% IF ( bibitemloo.already_reserved ) %]
327 <div class="bibmessage">You have already requested this title.</div>
329 [% UNLESS ( bibitemloo.bib_available ) %]
330 <div class="bibmessage">No available items.</div>
332 [% IF ( bibitemloo.already_patron_possession ) %]
333 <div class="bibmessage">This title cannot be requested because it's already in your possession.</div>
335 <div class="bibmessage">This title cannot be requested.</div>
341 [% IF ( bibitemloo.holdable ) %]
342 <fieldset class="rows">
345 [% UNLESS ( item_level_itypes ) %]
347 <span class="label">Item type: </span>
348 [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
349 [% bibitemloo.description %]
352 [% IF showholds || showpriority %]
353 <li class="priority">
354 <span class="label">Holds and priority: </span>
355 [% IF showpriority %] [% bibitemloo.rank %] [% END %]
356 [% IF showholds && showpriority %] out of [% END %]
357 [% IF showholds %] [% bibitemloo.reservecount %] [% END %]
363 [% UNLESS ( singleBranchMode ) %]
364 [% IF ( bibitemloo.holdable ) %]
365 [% IF ( choose_branch ) %]
367 <label for="branch_[% bibitemloo.biblionumber %]">Pick up location:</label>
368 [% UNLESS ( bibitemloo.holdable ) %]
369 <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
370 [% FOREACH branchloo IN bibitemloo.branchloop %]
371 [% IF ( branchloo.selected ) %]
372 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
374 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
379 <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
380 [% FOREACH branchloo IN bibitemloo.branchloop %]
381 [% IF ( branchloo.selected ) %]
382 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
384 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
394 <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber %]" style="display:none;" href="#">Show more options</a>
395 <div id="hold-options-[% bibitemloo.biblionumber %]" class="hold-options">
397 [% IF ( reserve_in_future ) %]
398 <li><label for="from[% bibitemloo.biblionumber %]">Hold starts on date:</label>
399 <input name="reserve_date_[% bibitemloo.biblionumber %]" id="from[% bibitemloo.biblionumber %]" size="10" class="holddatefrom"/>
400 <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
405 [% IF ( bibitemloo.holdable ) %]
407 <label for="to[% bibitemloo.biblionumber %]">Hold not needed after:</label>
408 <input name="expiration_date_[% bibitemloo.biblionumber %]" id="to[% bibitemloo.biblionumber %]" size="10" class="holddateto" />
409 <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
413 [% IF ( OpacHoldNotes && bibitemloo.holdable ) %]
415 <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
416 <label for="holdnotes[% bibitemloo.biblionumber %]">Hold notes:</label>
417 <span id="forcenotesreason_[% bibitemloo.biblionumber %]" class="forcenotesreason"></span>
418 <textarea id="holdnotes[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]">[% bibitemloo.holdnotes %]</textarea>
419 <input type="hidden" id="notesmandatory_[% bibitemloo.biblionumber %]" value="[% bibitemloo.mandatorynotes %]"/>
424 [% IF ( bibitemloo.holdable ) %]
426 [% IF ( OPACItemHolds ) %]
430 [% UNLESS ( bibitemloo.holdable ) %]
431 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
432 id="reqany_[% bibitemloo.biblionumber %]"
438 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
439 id="reqany_[% bibitemloo.biblionumber %]"
446 <label for="reqany_[% bibitemloo.biblionumber %]">Next available item</label>
447 [% UNLESS ( bibitemloo.holdable ) %]
448 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
449 id="reqspecific_[% bibitemloo.biblionumber %]"
450 class="selectspecific"
455 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
456 id="reqspecific_[% bibitemloo.biblionumber %]"
457 class="selectspecific"
461 <label for="reqspecific_[% bibitemloo.biblionumber %]">A specific item</label>
467 [% IF ( OPACItemHolds ) %]
468 [% IF ( bibitemloo.holdable ) %]
470 <table class="copiesrow" id="copiesrow_[% bibitemloo.biblionumber %]">
471 <caption>Select a specific item:</caption>
474 [% IF ( item_level_itypes ) %]
478 [% UNLESS ( singleBranchMode ) %]
479 <th>Home library</th>
480 <th>Last location</th>
483 [% IF ( itemdata_enumchron ) %]
489 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
490 <tr class="[% itemLoo.backgroundcolor %]">
491 <td class="copynumber">
492 [% IF ( itemLoo.available ) %]
493 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]"
494 value="[% itemLoo.itemnumber %]" />
496 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]" />
497 <img src="/opac-tmpl/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
498 [% END %] [% IF ( itemLoo.copynumber ) %][% itemLoo.copynumber %][% END %]
500 [% IF ( item_level_itypes ) %]
502 [% UNLESS ( noItemTypeImages ) %]
503 [% IF ( itemLoo.imageurl ) %]<img src="[% itemLoo.imageurl %]" alt="" />[% END %]
505 [% itemLoo.description %]
508 <td class="barcode">[% itemLoo.barcode %]</td>
509 [% UNLESS ( singleBranchMode ) %]
510 <td class="homebranch">[% itemLoo.homeBranchName %]</td>
511 <td class="holdingbranch">[% itemLoo.holdingBranchName %]</td>
513 <td class="call_no">[% itemLoo.callNumber %]</td>
514 [% IF ( itemdata_enumchron ) %]
515 <td class="vol_info">[% itemLoo.enumchron %]</td>
517 <td class="information">
518 [% IF ( itemLoo.dateDue ) %]
519 <span class="checkedout">Due [% itemLoo.dateDue %]</span>
520 [% ELSIF ( itemLoo.transfertwhen ) %]
521 <span class="intransit">In transit from [% itemLoo.transfertfrom %],
522 to [% itemLoo.transfertto %], since [% itemLoo.transfertwhen %]</span>
524 [% IF ( itemLoo.message ) %]
525 <span class="lost">Unavailable (lost or missing)</span>
527 [% IF ( itemLoo.notforloan ) %]
528 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
530 [% IF ( itemLoo.reservedate ) %]
531 <span class="waiting">[% IF ( itemLoo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %] for patron
532 [% IF ( itemLoo.waitingdate ) %]at[% ELSE %]expected at[% END %] [% itemLoo.ExpectedAtLibrary %]
534 [% IF ( itemLoo.waitingdate ) %][% itemLoo.waitingdate | $KohaDates %][% ELSE %][% IF ( itemLoo.reservedate ) %][% itemLoo.reservedate %][% END %][% END %].
537 <span class="notonhold">Not on hold</span>
546 [% END %]<!-- OPACItemHolds -->
548 [% END %]<!-- bib_available -->
553 [% END %] <!-- if message -->
554 </div><!-- bigloop -->
556 [% UNLESS ( message ) %]
557 [% UNLESS ( none_available ) %]
558 <input type="submit" value="Place hold" class="placehold" />
569 <div><!-- The following include seems to have an extra "/div" in it... -->
570 [% INCLUDE 'opac-bottom.inc' %]