1 [% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha Online" %] Catalog › Placing a hold
2 [% INCLUDE 'doc-head-close.inc' %]
3 [% INCLUDE 'calendar.inc' %]
4 <script type="text/javascript">
6 var MSG_NO_COPY_SELECTED = _("Expecting a specific copy selection.");
8 function prefixOf (s, tok) {
9 var index = s.indexOf(tok);
10 return s.substring(0, index);
12 function suffixOf (s, tok) {
13 var index = s.indexOf(tok);
14 return s.substring(index + 1);
17 $(document).ready(function() {
18 $('#hold-request-form').preventDoubleFormSubmit();
20 var copiesRowId = null;
21 var wasSpecific = false;
22 var lastCopiesRowId = null;
23 $(".checkitem").parent().click(function(e){
24 if(e.target.tagName.toLowerCase() == 'td'){
25 $(this).find("input.checkitem").each( function() {
26 $(this).attr('checked', !$(this).attr('checked'));
30 // Hides all 'specific copy' table rows on load.
31 $(".copiesrow").hide();
33 $("#place_on_hdr").show();
34 $(".place_on_type").show();
36 // Replace non-JS single-selection with multi-selection capability.
37 $(".reserve_mode").val("multi");
38 $(".confirm_nonjs").remove();
39 $(".confirmjs_hold").each(function(){
40 var bib = $(this).attr("title");
41 var html = "<input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
42 html += "value=\"" + bib + "\"/>";
45 $(".confirmjs_nohold").each(function(){
46 var bib = $(this).attr("title");
47 var html = "<input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
48 html += "value=\"" + bib + "\"/>";
52 // Make sure a specific item was selected where specified
53 // before moving on to a new item.
54 function changeSelection (newCopiesRowId, isSpecific) {
55 if (copiesRowId && ((copiesRowId != newCopiesRowId) || (wasSpecific != isSpecific))) {
56 var biblioNum = suffixOf(copiesRowId, "_");
58 // If the 'specific copy' radio button was checked
59 if (wasSpecific && (copiesRowId != newCopiesRowId)) {
60 // Find the selected copy
61 var item = $(".checkitem_" + biblioNum + ":checked");
62 if ($(item).size() == 0) {
63 alert(MSG_NO_COPY_SELECTED);
68 copiesRowId = newCopiesRowId;
69 wasSpecific = isSpecific;
73 // When 'specific copy' radio button is clicked
74 $(".selectspecific").click(function() {
76 // Make sure all other specific copy table rows are hidden
77 biblioNum = suffixOf($(this).attr("id"), "_");
78 newCopiesRowId = "#copiesrow_" + biblioNum;
80 if (!changeSelection(newCopiesRowId, true)) {
83 $(".copiesrow:not(" + newCopiesRowId + ")").hide();
85 // Show the specific copy table for this radio button.
86 $(newCopiesRowId).show();
90 // When 'first available' radion button is clicked
91 $(".selectany").click(function() {
92 // Make sure all other specific copy table rows are hidden
93 biblioNum = suffixOf($(this).attr("id"), "_");
94 newCopiesRowId = "#copiesrow_" + biblioNum;
96 if (!changeSelection(newCopiesRowId, false)) {
100 // Hide the copies table row
101 $(".copiesrow").hide();
104 // When 'Place Hold' button is clicked
105 $(".placehold").click(function(){
106 var biblionumbers = "";
109 if ($(".confirmjs:checked").size() == 0) {
110 alert(MSG_NO_RECORD_SELECTED);
114 // Find the items with the 'Hold' box checked
116 $(".confirmjs:checked").each(function() {
117 var biblioNum = $(this).val();
118 biblionumbers += biblioNum + "/";
119 selections += biblioNum + "/";
121 // If the 'specific copy' radio button is checked
122 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
123 // Find the selected copy
124 var item = $(".checkitem_" + biblioNum + ":checked");
125 if ($(item).size() == 0) {
129 selections += $(item).val();
134 // Add the pickup location
135 var branchSel = $("#branch_" + biblioNum);
136 if (branchSel.size() > 0) {
137 selections += $(branchSel).val();
144 alert(MSG_NO_COPY_SELECTED);
148 $("#selections").val(selections);
149 $("#biblionumbers").val(biblionumbers);
157 <style type="text/css">td ul { padding : 0; } td li { white-space: nowrap; font-size: 90%; list-style-type:none; padding : .3em 0; }</style>
160 <body id="opac-holds">
161 <div id="doc3" class="yui-t7">
162 [% INCLUDE 'masthead.inc' %]
165 <div id="holds" class="container">
168 <div id="gna" class="dialog alert">
169 <p><strong>Sorry</strong>, you cannot place holds because the library doesn't have up-to-date <a href="/cgi-bin/koha/opac-userupdate.pl">contact information</a> on file.</p>
170 <p>Please contact your librarian, or use the <a href="/cgi-bin/koha/opac-userupdate.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>
174 <div id="lost" class="dialog alert">
175 <p><strong>Sorry</strong>, you cannot place holds because your library card has been marked as lost or stolen.</p>
176 <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>
179 [% IF ( debarred ) %]
180 <div id="debarred" class="dialog alert">
181 <p><strong>Sorry</strong>, you cannot place holds because your account has been frozen.</p>
182 <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>
185 [% IF ( too_much_oweing ) %]
186 <div id="too_much_oweing" class="dialog alert">
187 Sorry, you cannot place holds because you owe [% too_much_oweing %].
190 [% IF ( too_many_reserves ) %]
191 <div id="too_many_reserves" class="dialog alert">Sorry, you cannot place more than [% too_many_reserves %] holds.
194 [% IF ( bad_biblionumber ) %]
195 <div id="bad_biblionumber" class="dialog alert">ERROR: No biblio record found for biblionumber [% bad_biblionumber %].</div>
197 [% IF ( no_items_selected ) %]
198 <div id="no_items_selected" class="dialog alert">
199 You must select at least one item.
202 [% IF ( no_branch_selected ) %]
203 <div id="no_branch_selected" class="dialog alert">
204 You must select a library for pickup.
207 [% IF ( no_biblionumber ) %]
208 <div id="no_biblionumber" class="dialog alert">ERROR: No biblionumber received.</div>
210 [% IF ( bad_data ) %]
211 <div id="bad_data" class="dialog alert">ERROR: Internal error: incomplete hold request.</div>
214 [% IF ( none_available ) %]
215 <div id="none_available" class="dialog alert"><strong>Sorry</strong>, none of these items can be placed on hold.
218 [% END %]<!-- NAME="message" -->
220 [% UNLESS ( message ) %][% UNLESS ( none_available ) %]<h3>Confirm holds for:
221 [% FOREACH USER_INF IN USER_INFO %]
222 [% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %])
225 [% IF (RESERVE_CHARGE) %]
226 <div class="dialog alert" id="reserve_fee">
227 There is a charge of [% RESERVE_CHARGE %] for placing this hold
231 <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
232 <input type="hidden" name="place_reserve" value="1"/>
234 <!-- These values are set dynamically by js -->
235 <input type="hidden" name="biblionumbers" id="biblionumbers"/>
236 <input type="hidden" name="selecteditems" id="selections"/>
238 <table id="bibitemloop">
239 [% UNLESS ( none_available ) %]<tr>
242 [% UNLESS ( item_level_itypes ) %]
245 [% IF ( showpriority ) %]
248 [% IF ( reserve_in_future ) %]
249 <th>Hold Starts on Date</th>
251 <th>Hold Not Needed After</th>
252 [% IF ( OPACItemHolds ) %]
253 <th id="place_on_hdr" style="display:none">Place On</th>
255 [% UNLESS ( singleBranchMode ) %]
256 [% IF ( choose_branch ) %]
257 <th>Pickup Location</th>
260 </tr>[% ELSE %]<tr><th colspan="5">Title</th></tr>[% END %]
262 [% FOREACH bibitemloo IN bibitemloop %]
264 [% IF ( bibitemloo.holdable ) %]
266 <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
267 <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber %]"/>
268 <span class="confirmjs_hold" title="[% bibitemloo.biblionumber %]"></span>
269 <span class="confirm_nonjs">
270 <input type="radio" class="confirmbox checkitem [% bibitemloo.checkitem_bib %]"
271 name="[% bibitemloo.checkitem_bib %]" checked="checked"
272 id="[% bibitemloo.checkitem_bib %]"
274 <label class="confirm_label" for="[% bibitemloo.checkitem_bib %]">Next available copy</label>
278 [% UNLESS ( none_available ) %]<td> </td>[% END %]
280 [% IF ( bibitemloo.holdable ) %]<td>[% ELSE %]<td colspan="5">[% END %]
281 <a 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>
282 [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %]
284 [% UNLESS ( bibitemloo.holdable ) %]
286 [% IF ( bibitemloo.already_reserved ) %]
287 <div class="bibmessage">You have already requested this title.</div>
289 [% UNLESS ( bibitemloo.bib_available ) %]
290 <div class="bibmessage">No available items.</div>
292 <div class="bibmessage">This title cannot be requested.</div>
300 [% IF ( bibitemloo.holdable ) %][% UNLESS ( item_level_itypes ) %]
302 [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
303 [% bibitemloo.description %]
306 [% IF ( bibitemloo.holdable ) %]
307 [% IF ( showpriority ) %]
309 [% bibitemloo.rank %] out of [% bibitemloo.reservecount %]
310 </td>[% END %][% END %]
311 [% IF ( reserve_in_future ) %]
312 [% IF ( bibitemloo.holdable ) %]<td>
313 <input name="reserve_date_[% bibitemloo.biblionumber %]" id="reserve_date_[% bibitemloo.biblionumber %]" size="10">
314 <script language="JavaScript" type="text/javascript">
316 $("#reserve_date_[% bibitemloo.biblionumber %]").attr( 'readonly', 'readonly' );
318 var cal_img = document.createElement('img');
319 cal_img.src = "[% themelang %]/lib/calendar/cal.gif";
320 cal_img.alt = "Show Calendar";
321 cal_img.border = "0";
322 cal_img.id = "CalendarReserveDate[% bibitemloo.biblionumber %]";
323 cal_img.style.cursor = "pointer";
324 document.getElementById("reserve_date_[% bibitemloo.biblionumber %]").parentNode.appendChild( cal_img );
326 function validate[% bibitemloo.biblionumber %](date) {
327 var today = new Date();
328 if ( (date > today) ||
329 ( date.getDate() == today.getDate() &&
330 date.getMonth() == today.getMonth() &&
331 date.getFullYear() == today.getFullYear() ) ) {
339 inputField : "reserve_date_[% bibitemloo.biblionumber %]",
340 ifFormat : "[% DHTMLcalendar_dateformat %]",
341 button : "CalendarReserveDate[% bibitemloo.biblionumber %]",
342 disableFunc : validate[% bibitemloo.biblionumber %],
343 dateStatusFunc : validate[% bibitemloo.biblionumber %],
344 firstDay : [% CalendarFirstDayOfWeek %]
349 <p style="margin:.3em 2em;">
350 <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('reserve_date_[% bibitemloo.biblionumber %]').value='';return false;">Clear Date</a></p>
354 [% IF ( bibitemloo.holdable ) %]<td>
355 <input name="expiration_date_[% bibitemloo.biblionumber %]" id="expiration_date_[% bibitemloo.biblionumber %]" size="10" readonly="readonly" />
356 <img src="[% themelang %]/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="CalendarExpirationDate_[% bibitemloo.biblionumber %]" style="cursor: pointer;" />
357 <script language="JavaScript" type="text/javascript">
359 function validate1(date) {
360 var today = new Date();
361 if ( (date > today) ||
362 ( date.getDate() == today.getDate() &&
363 date.getMonth() == today.getMonth() &&
364 date.getFullYear() == today.getFullYear() ) ) {
372 inputField : "expiration_date_[% bibitemloo.biblionumber %]",
373 ifFormat : "[% DHTMLcalendar_dateformat %]",
374 button : "CalendarExpirationDate_[% bibitemloo.biblionumber %]",
375 disableFunc : validate1,
376 dateStatusFunc : validate1,
377 firstDay : [% CalendarFirstDayOfWeek %]
382 <p style="margin:.3em 2em;">
383 <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('expiration_date_[% bibitemloo.biblionumber %]').value='';return false;">Clear Date</a></p>
386 [% IF ( bibitemloo.holdable ) %]
388 [% IF ( OPACItemHolds ) %]
390 <td class="place_on_type" style="display:none">
393 [% UNLESS ( bibitemloo.holdable ) %]
394 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
395 id="reqany_[% bibitemloo.biblionumber %]"
401 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
402 id="reqany_[% bibitemloo.biblionumber %]"
408 <label for="reqany_[% bibitemloo.biblionumber %]">Next available copy</label>
411 [% UNLESS ( bibitemloo.holdable ) %]
412 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
413 id="reqspecific_[% bibitemloo.biblionumber %]"
414 class="selectspecific"
419 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
420 id="reqspecific_[% bibitemloo.biblionumber %]"
421 class="selectspecific"
425 <label for="reqspecific_[% bibitemloo.biblionumber %]">A specific copy</label>
431 [% UNLESS ( singleBranchMode ) %]
432 [% IF ( bibitemloo.holdable ) %]
433 [% IF ( choose_branch ) %]
435 [% UNLESS ( bibitemloo.holdable ) %]
436 <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
437 [% FOREACH branchChoicesLoo IN bibitemloo.branchChoicesLoop %]
438 [% IF ( branchChoicesLoo.selected ) %]
439 <option value="[% branchChoicesLoo.value %]" selected="selected">[% branchChoicesLoo.branchname %]</option>
441 <option value="[% branchChoicesLoo.value %]">[% branchChoicesLoo.branchname %]</option>
446 <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
447 [% FOREACH branchChoicesLoo IN bibitemloo.branchChoicesLoop %]
448 [% IF ( branchChoicesLoo.selected ) %]
449 <option value="[% branchChoicesLoo.value %]" selected="selected">[% branchChoicesLoo.branchname %]</option>
451 <option value="[% branchChoicesLoo.value %]">[% branchChoicesLoo.branchname %]</option>
462 [% IF ( OPACItemHolds ) %]
463 [% IF ( bibitemloo.holdable ) %]
464 <tr class="copiesrow" id="copiesrow_[% bibitemloo.biblionumber %]">
466 <td colspan="[% itemtable_colspan %]">
468 <caption>Select a specific copy:</caption>
471 [% IF ( item_level_itypes ) %]
475 [% UNLESS ( singleBranchMode ) %]
476 <th>Home Library</th>
477 <th>Last Location</th>
480 [% IF ( bibitemloo.itemdata_enumchron ) %]
486 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
487 <tr class="[% itemLoo.backgroundcolor %]">
489 [% IF ( itemLoo.available ) %]
490 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]"
491 value="[% itemLoo.itemnumber %]" />
493 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]" />
494 <img src="/opac-tmpl/[% theme %]/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
495 [% END %] [% IF ( itemLoo.copynumber ) %][% itemLoo.copynumber %][% END %]
497 [% IF ( item_level_itypes ) %]
499 [% UNLESS ( noItemTypeImages ) %]
500 [% IF ( itemLoo.imageurl ) %]<img src="[% itemLoo.imageurl %]" alt="" />[% END %]
502 [% itemLoo.description %]
505 <td>[% itemLoo.barcode %]</td>
506 [% UNLESS ( singleBranchMode ) %]
507 <td>[% itemLoo.homeBranchName %]</td>
508 <td>[% itemLoo.holdingBranchName %]</td>
510 <td>[% itemLoo.callNumber %]</td>
511 [% IF ( itemLoo.itemdata_enumchron ) %]<!-- test -->
512 <td>[% itemLoo.enumchron %]</td>
515 [% IF ( itemLoo.dateDue ) %]
516 <span class="checkedout">Due [% itemLoo.dateDue %]</span>
517 [% ELSIF ( itemLoo.transfertwhen ) %]
518 <span class="intransit">In transit from [% itemLoo.transfertfrom %],
519 to [% itemLoo.transfertto %], since [% itemLoo.transfertwhen %]</span>
521 [% IF ( itemLoo.message ) %]
522 <span class="lost">Unavailable (lost or missing)</span>
524 [% IF ( itemLoo.notforloan ) %]
525 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
527 [% IF ( itemLoo.reservedate ) %]
528 <span class="waiting">[% IF ( itemLoo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %] for patron
529 [% IF ( itemLoo.waitingdate ) %]at[% ELSE %]expected at[% END %] [% itemLoo.ExpectedAtLibrary %]
531 [% IF ( itemLoo.waitingdate ) %][% itemLoo.waitingdate %][% ELSE %][% IF ( itemLoo.reservedate ) %][% itemLoo.reservedate %][% END %][% END %].
534 <span class="notonhold">Not on hold</span>
542 [% END %]<!-- bib_available -->
543 [% END %]<!-- OPACItemHolds -->
545 </table><!-- bibitemloop -->
546 [% END %] <!-- if message -->
547 </div><!-- bigloop -->
549 [% UNLESS ( message ) %]
550 [% UNLESS ( none_available ) %]
551 <input type="submit" value="Place Hold" class="placehold" />
562 <div><!-- The following include seems to have an extra "/div" in it... -->
563 [% INCLUDE 'opac-bottom.inc' %]