1 [% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog › Placing a hold
2 [% INCLUDE 'doc-head-close.inc' %]
3 <script type="text/javascript">
5 var MSG_NO_COPY_SELECTED = _("Expecting a specific copy selection.");
7 function prefixOf (s, tok) {
8 var index = s.indexOf(tok);
9 return s.substring(0, index);
11 function suffixOf (s, tok) {
12 var index = s.indexOf(tok);
13 return s.substring(index + 1);
16 $(document).ready(function() {
17 $('#hold-request-form').preventDoubleFormSubmit();
19 var copiesRowId = null;
20 var wasSpecific = false;
21 var lastCopiesRowId = null;
22 $(".checkitem").parent().click(function(e){
23 if(e.target.tagName.toLowerCase() == 'td'){
24 $(this).find("input.checkitem").each( function() {
25 $(this).attr('checked', !$(this).attr('checked'));
29 // Hides all 'specific copy' table rows on load.
30 $(".copiesrow").hide();
32 $("#place_on_hdr").show();
33 $(".place_on_type").show();
35 // Replace non-JS single-selection with multi-selection capability.
36 $(".reserve_mode").val("multi");
37 $(".confirm_nonjs").remove();
38 $(".confirmjs_hold").each(function(){
39 var bib = $(this).attr("title");
40 var html = "<input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
41 html += "value=\"" + bib + "\"/>";
44 $(".confirmjs_nohold").each(function(){
45 var bib = $(this).attr("title");
46 var html = "<input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
47 html += "value=\"" + bib + "\"/>";
51 // Make sure a specific item was selected where specified
52 // before moving on to a new item.
53 function changeSelection (newCopiesRowId, isSpecific) {
54 if (copiesRowId && ((copiesRowId != newCopiesRowId) || (wasSpecific != isSpecific))) {
55 var biblioNum = suffixOf(copiesRowId, "_");
57 // If the 'specific copy' radio button was checked
58 if (wasSpecific && (copiesRowId != newCopiesRowId)) {
59 // Find the selected copy
60 var item = $(".checkitem_" + biblioNum + ":checked");
61 if ($(item).size() == 0) {
62 alert(MSG_NO_COPY_SELECTED);
67 copiesRowId = newCopiesRowId;
68 wasSpecific = isSpecific;
72 // When 'specific copy' radio button is clicked
73 $(".selectspecific").click(function() {
75 // Make sure all other specific copy table rows are hidden
76 biblioNum = suffixOf($(this).attr("id"), "_");
77 newCopiesRowId = "#copiesrow_" + biblioNum;
79 if (!changeSelection(newCopiesRowId, true)) {
82 $(".copiesrow:not(" + newCopiesRowId + ")").hide();
84 // Show the specific copy table for this radio button.
85 $(newCopiesRowId).show();
89 // When 'first available' radion button is clicked
90 $(".selectany").click(function() {
91 // Make sure all other specific copy table rows are hidden
92 biblioNum = suffixOf($(this).attr("id"), "_");
93 newCopiesRowId = "#copiesrow_" + biblioNum;
95 if (!changeSelection(newCopiesRowId, false)) {
99 // Hide the copies table row
100 $(".copiesrow").hide();
103 // When 'Place Hold' button is clicked
104 $(".placehold").click(function(){
105 var biblionumbers = "";
108 if ($(".confirmjs:checked").size() == 0) {
109 alert(MSG_NO_RECORD_SELECTED);
113 // Find the items with the 'Hold' box checked
115 $(".confirmjs:checked").each(function() {
116 var biblioNum = $(this).val();
117 biblionumbers += biblioNum + "/";
118 selections += biblioNum + "/";
120 // If the 'specific copy' radio button is checked
121 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
122 // Find the selected copy
123 var item = $(".checkitem_" + biblioNum + ":checked");
124 if ($(item).size() == 0) {
128 selections += $(item).val();
133 // Add the pickup location
134 var branchSel = $("#branch_" + biblioNum);
135 if (branchSel.size() > 0) {
136 selections += $(branchSel).val();
143 alert(MSG_NO_COPY_SELECTED);
147 $("#selections").val(selections);
148 $("#biblionumbers").val(biblionumbers);
156 <style type="text/css">td ul { padding : 0; } td li { white-space: nowrap; font-size: 90%; list-style-type:none; padding : .3em 0; }</style>
159 <body id="opac-holds">
160 <div id="doc3" class="yui-t7">
161 [% INCLUDE 'masthead.inc' %]
164 <div id="holds" class="container">
167 <div id="gna" class="dialog alert">
168 <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>
169 <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>
173 <div id="lost" class="dialog alert">
174 <p><strong>Sorry</strong>, you cannot place holds because your library card has been marked as lost or stolen.</p>
175 <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>
178 [% IF ( debarred ) %]
179 <div id="debarred" class="dialog alert">
180 <p><strong>Sorry</strong>, you cannot place holds because your account has been frozen.</p>
181 <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>
184 [% IF ( too_much_oweing ) %]
185 <div id="too_much_oweing" class="dialog alert">
186 Sorry, you cannot place holds because you owe [% too_much_oweing %].
189 [% IF ( too_many_reserves ) %]
190 <div id="too_many_reserves" class="dialog alert">Sorry, you cannot place more than [% too_many_reserves %] holds.
193 [% IF ( bad_biblionumber ) %]
194 <div id="bad_biblionumber" class="dialog alert">ERROR: No biblio record found for biblionumber [% bad_biblionumber %].</div>
196 [% IF ( no_items_selected ) %]
197 <div id="no_items_selected" class="dialog alert">
198 You must select at least one item.
201 [% IF ( no_branch_selected ) %]
202 <div id="no_branch_selected" class="dialog alert">
203 You must select a library for pickup.
206 [% IF ( no_biblionumber ) %]
207 <div id="no_biblionumber" class="dialog alert">ERROR: No biblionumber received.</div>
209 [% IF ( bad_data ) %]
210 <div id="bad_data" class="dialog alert">ERROR: Internal error: incomplete hold request.</div>
213 [% IF ( none_available ) %]
214 <div id="none_available" class="dialog alert"><strong>Sorry</strong>, none of these items can be placed on hold.
217 [% END %]<!-- NAME="message" -->
219 [% UNLESS ( message ) %][% UNLESS ( none_available ) %]<h3>Confirm holds for:
220 [% FOREACH USER_INF IN USER_INFO %]
221 [% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %])
224 [% IF (RESERVE_CHARGE) %]
225 <div class="dialog alert" id="reserve_fee">
226 There is a charge of [% RESERVE_CHARGE %] for placing this hold
230 <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
231 <input type="hidden" name="place_reserve" value="1"/>
233 <!-- These values are set dynamically by js -->
234 <input type="hidden" name="biblionumbers" id="biblionumbers"/>
235 <input type="hidden" name="selecteditems" id="selections"/>
237 <table id="bibitemloop">
238 [% UNLESS ( none_available ) %]<tr>
241 [% UNLESS ( item_level_itypes ) %]
244 [% IF showholds && showpriority %]
245 <th>Holds and priority</th>
246 [% ELSIF showholds %]
248 [% ELSIF showpriority %]
251 [% IF ( reserve_in_future ) %]
252 <th>Hold starts on date</th>
254 <th>Hold not needed after</th>
255 [% IF ( OPACItemHolds ) %]
256 <th id="place_on_hdr" style="display:none">Place on</th>
258 [% UNLESS ( singleBranchMode ) %]
259 [% IF ( choose_branch ) %]
260 <th>Pickup location</th>
263 </tr>[% ELSE %]<tr><th colspan="5">Title</th></tr>[% END %]
265 [% FOREACH bibitemloo IN bibitemloop %]
267 [% IF ( bibitemloo.holdable ) %]
269 <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
270 <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber %]"/>
271 <span class="confirmjs_hold" title="[% bibitemloo.biblionumber %]"></span>
272 <span class="confirm_nonjs">
273 <input type="radio" class="confirmbox checkitem [% bibitemloo.checkitem_bib %]"
274 name="[% bibitemloo.checkitem_bib %]" checked="checked"
275 id="[% bibitemloo.checkitem_bib %]"
277 <label class="confirm_label" for="[% bibitemloo.checkitem_bib %]">Next available copy</label>
281 [% UNLESS ( none_available ) %]<td class="hold"> </td>[% END %]
283 [% IF ( bibitemloo.holdable ) %]<td class="title">[% ELSE %]<td class="title" colspan="5">[% END %]
284 <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>
285 [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %]
287 [% UNLESS ( bibitemloo.holdable ) %]
289 [% IF ( bibitemloo.already_reserved ) %]
290 <div class="bibmessage">You have already requested this title.</div>
292 [% UNLESS ( bibitemloo.bib_available ) %]
293 <div class="bibmessage">No available items.</div>
295 <div class="bibmessage">This title cannot be requested.</div>
303 [% IF ( bibitemloo.holdable ) %]
305 [% UNLESS ( item_level_itypes ) %]
307 [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
308 [% bibitemloo.description %]
311 [% IF showholds || showpriority %]
312 <td class="priority">
313 [% IF showpriority %] [% bibitemloo.rank %] [% END %]
314 [% IF showholds && showpriority %] out of [% END %]
315 [% IF showholds %] [% bibitemloo.reservecount %] [% END %]
318 [% IF ( reserve_in_future ) %]
319 <td class="reserve_date">
320 <input name="reserve_date_[% bibitemloo.biblionumber %]" id="from" size="10" class="datepickerfrom"/>
321 <script language="JavaScript" type="text/javascript">
323 $("#reserve_date_[% bibitemloo.biblionumber %]").attr( 'readonly', 'readonly' );
326 <p style="margin:.3em 2em;">
327 <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('reserve_date_[% bibitemloo.biblionumber %]').value='';return false;">Clear date</a></p>
331 [% IF ( bibitemloo.holdable ) %]<td class="expiration_date">
332 <input name="expiration_date_[% bibitemloo.biblionumber %]" id="to" size="10" readonly="readonly" class="datepickerto" />
333 <p style="margin:.3em 2em;">
334 <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('expiration_date_[% bibitemloo.biblionumber %]').value='';return false;">Clear date</a></p>
337 [% IF ( bibitemloo.holdable ) %]
339 [% IF ( OPACItemHolds ) %]
341 <td class="place_on_type" style="display:none">
344 [% UNLESS ( bibitemloo.holdable ) %]
345 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
346 id="reqany_[% bibitemloo.biblionumber %]"
352 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
353 id="reqany_[% bibitemloo.biblionumber %]"
359 <label for="reqany_[% bibitemloo.biblionumber %]">Next available copy</label>
362 [% UNLESS ( bibitemloo.holdable ) %]
363 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
364 id="reqspecific_[% bibitemloo.biblionumber %]"
365 class="selectspecific"
370 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
371 id="reqspecific_[% bibitemloo.biblionumber %]"
372 class="selectspecific"
376 <label for="reqspecific_[% bibitemloo.biblionumber %]">A specific copy</label>
382 [% UNLESS ( singleBranchMode ) %]
383 [% IF ( bibitemloo.holdable ) %]
384 [% IF ( choose_branch ) %]
386 [% UNLESS ( bibitemloo.holdable ) %]
387 <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
388 [% FOREACH branchChoicesLoo IN bibitemloo.branchChoicesLoop %]
389 [% IF ( branchChoicesLoo.selected ) %]
390 <option value="[% branchChoicesLoo.value %]" selected="selected">[% branchChoicesLoo.branchname %]</option>
392 <option value="[% branchChoicesLoo.value %]">[% branchChoicesLoo.branchname %]</option>
397 <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
398 [% FOREACH branchChoicesLoo IN bibitemloo.branchChoicesLoop %]
399 [% IF ( branchChoicesLoo.selected ) %]
400 <option value="[% branchChoicesLoo.value %]" selected="selected">[% branchChoicesLoo.branchname %]</option>
402 <option value="[% branchChoicesLoo.value %]">[% branchChoicesLoo.branchname %]</option>
413 [% IF ( OPACItemHolds ) %]
414 [% IF ( bibitemloo.holdable ) %]
415 <tr class="copiesrow" id="copiesrow_[% bibitemloo.biblionumber %]">
417 <td colspan="[% itemtable_colspan %]">
419 <caption>Select a specific copy:</caption>
422 [% IF ( item_level_itypes ) %]
426 [% UNLESS ( singleBranchMode ) %]
427 <th>Home library</th>
428 <th>Last location</th>
431 [% IF ( bibitemloo.itemdata_enumchron ) %]
437 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
438 <tr class="[% itemLoo.backgroundcolor %]">
440 [% IF ( itemLoo.available ) %]
441 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]"
442 value="[% itemLoo.itemnumber %]" />
444 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]" />
445 <img src="/opac-tmpl/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
446 [% END %] [% IF ( itemLoo.copynumber ) %][% itemLoo.copynumber %][% END %]
448 [% IF ( item_level_itypes ) %]
450 [% UNLESS ( noItemTypeImages ) %]
451 [% IF ( itemLoo.imageurl ) %]<img src="[% itemLoo.imageurl %]" alt="" />[% END %]
453 [% itemLoo.description %]
456 <td class="barcode">[% itemLoo.barcode %]</td>
457 [% UNLESS ( singleBranchMode ) %]
458 <td class="homebranch">[% itemLoo.homeBranchName %]</td>
459 <td class="holdingbranch">[% itemLoo.holdingBranchName %]</td>
461 <td class="call_no">[% itemLoo.callNumber %]</td>
462 [% IF ( itemLoo.itemdata_enumchron ) %]<!-- test -->
463 <td class="vol_info">[% itemLoo.enumchron %]</td>
465 <td class="information">
466 [% IF ( itemLoo.dateDue ) %]
467 <span class="checkedout">Due [% itemLoo.dateDue %]</span>
468 [% ELSIF ( itemLoo.transfertwhen ) %]
469 <span class="intransit">In transit from [% itemLoo.transfertfrom %],
470 to [% itemLoo.transfertto %], since [% itemLoo.transfertwhen %]</span>
472 [% IF ( itemLoo.message ) %]
473 <span class="lost">Unavailable (lost or missing)</span>
475 [% IF ( itemLoo.notforloan ) %]
476 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
478 [% IF ( itemLoo.reservedate ) %]
479 <span class="waiting">[% IF ( itemLoo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %] for patron
480 [% IF ( itemLoo.waitingdate ) %]at[% ELSE %]expected at[% END %] [% itemLoo.ExpectedAtLibrary %]
482 [% IF ( itemLoo.waitingdate ) %][% itemLoo.waitingdate %][% ELSE %][% IF ( itemLoo.reservedate ) %][% itemLoo.reservedate %][% END %][% END %].
485 <span class="notonhold">Not on hold</span>
493 [% END %]<!-- bib_available -->
494 [% END %]<!-- OPACItemHolds -->
496 </table><!-- bibitemloop -->
497 [% END %] <!-- if message -->
498 </div><!-- bigloop -->
500 [% UNLESS ( message ) %]
501 [% UNLESS ( none_available ) %]
502 <input type="submit" value="Place Hold" class="placehold" />
513 <div><!-- The following include seems to have an extra "/div" in it... -->
514 [% INCLUDE 'opac-bottom.inc' %]