1 [% INCLUDE 'doc-head-open.inc' %][% DEFAULT LibraryNameTitle="Koha Online" %] Catalog › Placing hold [% title |html %] for [% FOREACH USER_INF IN USER_INFO %][% USER_INF.firstname %] [% USER_INF.surname %][% END %]
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 var copiesRowId = null;
19 var wasSpecific = false;
20 var lastCopiesRowId = null;
21 $(".checkitem").parent().click(function(e){
22 if(e.target.tagName.toLowerCase() == 'td'){
23 $(this).find("input.checkitem").each( function() {
24 $(this).attr('checked', !$(this).attr('checked'));
28 // Hides all 'specific copy' table rows on load.
29 $(".copiesrow").hide();
31 $("#place_on_hdr").show();
32 $(".place_on_type").show();
34 // Replace non-JS single-selection with multi-selection capability.
35 $(".reserve_mode").val("multi");
36 $(".confirm_nonjs").remove();
37 $(".confirmjs_hold").each(function(){
38 var bib = $(this).attr("title");
39 var html = "<input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
40 html += "value=\"" + bib + "\"/>";
43 $(".confirmjs_nohold").each(function(){
44 var bib = $(this).attr("title");
45 var html = "<input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
46 html += "value=\"" + bib + "\"/>";
50 // Make sure a specific item was selected where specified
51 // before moving on to a new item.
52 function changeSelection (newCopiesRowId, isSpecific) {
53 if (copiesRowId && ((copiesRowId != newCopiesRowId) || (wasSpecific != isSpecific))) {
54 var biblioNum = suffixOf(copiesRowId, "_");
56 // If the 'specific copy' radio button was checked
57 if (wasSpecific && (copiesRowId != newCopiesRowId)) {
58 // Find the selected copy
59 var item = $(".checkitem_" + biblioNum + ":checked");
60 if ($(item).size() == 0) {
61 alert(MSG_NO_COPY_SELECTED);
66 copiesRowId = newCopiesRowId;
67 wasSpecific = isSpecific;
71 // When 'specific copy' radio button is clicked
72 $(".selectspecific").click(function() {
74 // Make sure all other specific copy table rows are hidden
75 biblioNum = suffixOf($(this).attr("id"), "_");
76 newCopiesRowId = "#copiesrow_" + biblioNum;
78 if (!changeSelection(newCopiesRowId, true)) {
81 $(".copiesrow:not(" + newCopiesRowId + ")").hide();
83 // Show the specific copy table for this radio button.
84 $(newCopiesRowId).show();
88 // When 'first available' radion button is clicked
89 $(".selectany").click(function() {
90 // Make sure all other specific copy table rows are hidden
91 biblioNum = suffixOf($(this).attr("id"), "_");
92 newCopiesRowId = "#copiesrow_" + biblioNum;
94 if (!changeSelection(newCopiesRowId, false)) {
98 // Hide the copies table row
99 $(".copiesrow").hide();
102 // When 'Place Hold' button is clicked
103 $(".placehold").click(function(){
104 var biblionumbers = "";
107 if ($(".confirmjs:checked").size() == 0) {
108 alert(MSG_NO_RECORD_SELECTED);
112 // Find the items with the 'Hold' box checked
114 $(".confirmjs:checked").each(function() {
115 var biblioNum = $(this).val();
116 biblionumbers += biblioNum + "/";
117 selections += biblioNum + "/";
119 // If the 'specific copy' radio button is checked
120 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
121 // Find the selected copy
122 var item = $(".checkitem_" + biblioNum + ":checked");
123 if ($(item).size() == 0) {
127 selections += $(item).val();
132 // Add the pickup location
133 var branchSel = $("#branch_" + biblioNum);
134 if (branchSel.size() > 0) {
135 selections += $(branchSel).val();
142 alert(MSG_NO_COPY_SELECTED);
146 $("#selections").val(selections);
147 $("#biblionumbers").val(biblionumbers);
157 <body id="opac-holds">
158 <div id="doc3" class="yui-t7">
159 [% INCLUDE 'masthead.inc' %]
162 <div id="holds" class="container">
165 <div id="gna" class="dialog alert">
166 <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>
167 <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>
171 <div id="lost" class="dialog alert">
172 <p><strong>Sorry</strong>, you cannot place holds because your library card has been marked as lost or stolen.</p>
173 <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>
176 [% IF ( debarred ) %]
177 <div id="debarred" class="dialog alert">
178 <p><strong>Sorry</strong>, you cannot place holds because your account has been frozen.</p>
179 <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>
182 [% IF ( too_much_oweing ) %]
183 <div class="dialog alert">
184 Sorry, you cannot place holds because you owe [% too_much_oweing %].
187 [% IF ( too_many_reserves ) %]
188 <div class="dialog alert">Sorry, you cannot place more than [% too_many_reserves %] holds.
191 [% IF ( bad_biblionumber ) %]
192 <div class="dialog alert">ERROR: No biblio record found for biblionumber [% bad_biblionumber %].</div>
194 [% IF ( no_items_selected ) %]
195 <div class="dialog alert">
196 You must select at least one item.
199 [% IF ( no_branch_selected ) %]
200 <div class="dialog alert">
201 You must select a library for pickup.
204 [% IF ( no_biblionumber ) %]
205 <div class="dialog alert">ERROR: No biblionumber received.</div>
207 [% IF ( bad_data ) %]
208 <div class="dialog alert">ERROR: Internal error: incomplete hold request.</div>
211 [% IF ( none_available ) %]
212 <div class="dialog alert"><strong>Sorry</strong>, none of these items can be placed on hold.
215 [% END %]<!-- NAME="message" -->
217 [% UNLESS ( message ) %][% UNLESS ( none_available ) %]<h3>Confirm holds for:
218 [% FOREACH USER_INF IN USER_INFO %]
219 [% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %])
223 <form action="/cgi-bin/koha/opac-reserve.pl" method="post">
224 <input type="hidden" name="place_reserve" value="1"/>
226 <!-- These values are set dynamically by js -->
227 <input type="hidden" name="biblionumbers" id="biblionumbers"/>
228 <input type="hidden" name="selecteditems" id="selections"/>
230 <table id="bibitemloop">
231 [% UNLESS ( none_available ) %]<tr>
234 [% UNLESS ( item_level_itypes ) %]
237 [% IF ( showpriority ) %]
240 [% IF ( reserve_in_future ) %]
241 <th>Hold Starts on Date</th>
243 <th>Hold Not Needed After</th>
244 [% IF ( OPACItemHolds ) %]
245 <th id="place_on_hdr" style="display:none">Place On</th>
247 [% UNLESS ( singleBranchMode ) %]
248 [% IF ( choose_branch ) %]
249 <th>Pickup Location</th>
252 </tr>[% ELSE %]<tr><th colspan="5">Title</th></tr>[% END %]
254 [% FOREACH bibitemloo IN bibitemloop %]
256 [% IF ( bibitemloo.holdable ) %]
258 <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
259 <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber %]"/>
260 <span class="confirmjs_hold" title="[% bibitemloo.biblionumber %]"></span>
261 <span class="confirm_nonjs">
262 <input type="radio" class="confirmbox checkitem [% bibitemloo.checkitem_bib %]"
263 name="[% bibitemloo.checkitem_bib %]" checked="checked"
264 id="[% bibitemloo.checkitem_bib %]"
266 <label class="confirm_label" for="[% bibitemloo.checkitem_bib %]">Next available copy</label>
270 [% UNLESS ( none_available ) %]<td> </td>[% END %]
272 [% IF ( bibitemloo.holdable ) %]<td>[% ELSE %]<td colspan="5">[% END %]
273 <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>
274 [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %]
276 [% UNLESS ( bibitemloo.holdable ) %]
278 [% IF ( bibitemloo.already_reserved ) %]
279 <div class="bibmessage">You have already requested this title.</div>
281 [% UNLESS ( bibitemloo.bib_available ) %]
282 <div class="bibmessage">No available items.</div>
284 <div class="bibmessage">This title cannot be requested.</div>
292 [% IF ( bibitemloo.holdable ) %][% UNLESS ( item_level_itypes ) %]
294 [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
295 [% bibitemloo.description %]
298 [% IF ( bibitemloo.holdable ) %]
299 [% IF ( showpriority ) %]
301 [% bibitemloo.rank %] out of [% bibitemloo.reservecount %]
302 </td>[% END %][% END %]
303 [% IF ( reserve_in_future ) %]
304 [% IF ( bibitemloo.holdable ) %]<td>
305 <input name="reserve_date_[% bibitemloo.biblionumber %]" id="reserve_date_[% bibitemloo.biblionumber %]" size="10">
306 <script language="JavaScript" type="text/javascript">
308 $("#reserve_date_[% bibitemloo.biblionumber %]").attr( 'readonly', 'readonly' );
310 var cal_img = document.createElement('img');
311 cal_img.src = "[% themelang %]/lib/calendar/cal.gif";
312 cal_img.alt = "Show Calendar";
313 cal_img.border = "0";
314 cal_img.id = "CalendarReserveDate[% bibitemloo.biblionumber %]";
315 cal_img.style.cursor = "pointer";
316 document.getElementById("reserve_date_[% bibitemloo.biblionumber %]").parentNode.appendChild( cal_img );
318 function validate[% bibitemloo.biblionumber %](date) {
319 var today = new Date();
320 if ( (date > today) ||
321 ( date.getDate() == today.getDate() &&
322 date.getMonth() == today.getMonth() &&
323 date.getFullYear() == today.getFullYear() ) ) {
331 inputField : "reserve_date_[% bibitemloo.biblionumber %]",
332 ifFormat : "[% bibitemloo.DHTMLcalendar_dateformat %]",
333 button : "CalendarReserveDate[% bibitemloo.biblionumber %]",
334 disableFunc : validate[% bibitemloo.biblionumber %],
335 dateStatusFunc : validate[% bibitemloo.biblionumber %]
340 <p style="margin:.3em 2em;">
341 <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('reserve_date_[% bibitemloo.biblionumber %]').value='';return false;">Clear Date</a></p>
345 [% IF ( bibitemloo.holdable ) %]<td>
346 <input name="expiration_date_[% bibitemloo.biblionumber %]" id="expiration_date_[% bibitemloo.biblionumber %]" size="10" readonly="readonly" />
347 <img src="[% themelang %]/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="CalendarExpirationDate_[% bibitemloo.biblionumber %]" style="cursor: pointer;" />
348 <script language="JavaScript" type="text/javascript">
350 function validate1(date) {
351 var today = new Date();
352 if ( (date > today) ||
353 ( date.getDate() == today.getDate() &&
354 date.getMonth() == today.getMonth() &&
355 date.getFullYear() == today.getFullYear() ) ) {
363 inputField : "expiration_date_[% bibitemloo.biblionumber %]",
364 ifFormat : "[% bibitemloo.DHTMLcalendar_dateformat %]",
365 button : "CalendarExpirationDate_[% bibitemloo.biblionumber %]",
366 disableFunc : validate1,
367 dateStatusFunc : validate1
372 <p style="margin:.3em 2em;">
373 <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('expiration_date_[% bibitemloo.biblionumber %]').value='';return false;">Clear Date</a></p>
376 [% IF ( bibitemloo.holdable ) %][% IF ( OPACItemHolds ) %]
377 <td class="place_on_type" style="display:none">
381 [% UNLESS ( bibitemloo.holdable ) %]
382 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
383 id="reqany_[% bibitemloo.biblionumber %]"
389 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
390 id="reqany_[% bibitemloo.biblionumber %]"
396 <label for="reqany_[% bibitemloo.biblionumber %]">Next available copy</label>
401 [% UNLESS ( bibitemloo.holdable ) %]
402 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
403 id="reqspecific_[% bibitemloo.biblionumber %]"
404 class="selectspecific"
409 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
410 id="reqspecific_[% bibitemloo.biblionumber %]"
411 class="selectspecific"
415 <label for="reqspecific_[% bibitemloo.biblionumber %]">A specific copy</label>
422 [% UNLESS ( singleBranchMode ) %]
423 [% IF ( bibitemloo.holdable ) %]
424 [% IF ( choose_branch ) %]
426 <select name="branch" id="branch_[% bibitemloo.biblionumber %]"
427 [% UNLESS ( bibitemloo.holdable ) %]disabled="disabled"[% END %] >
428 [% FOREACH branchChoicesLoo IN bibitemloo.branchChoicesLoop %]
429 [% IF ( branchChoicesLoo.selected ) %]
430 <option value="[% branchChoicesLoo.value %]" selected="selected">[% branchChoicesLoo.branchname %]</option>
432 <option value="[% branchChoicesLoo.value %]">[% branchChoicesLoo.branchname %]</option>
442 [% IF ( OPACItemHolds ) %]
443 [% IF ( bibitemloo.holdable ) %]
444 <tr class="copiesrow" id="copiesrow_[% bibitemloo.biblionumber %]">
447 <td colspan="[% bibitemloo.itemtable_colspan %]">
449 <caption>Select a specific copy:</caption>
452 [% IF ( item_level_itypes ) %]
456 [% UNLESS ( bibitemloo.singleBranchMode ) %]
457 <th>Home Library</th>
458 <th>Last Location</th>
461 [% IF ( bibitemloo.itemdata_enumchron ) %]
467 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
468 <tr class="[% itemLoo.backgroundcolor %]">
470 [% IF ( itemLoo.available ) %]
471 <input type="radio" class="checkitem checkitem_[% itemLoo.biblionumber %]" name="checkitem_[% itemLoo.biblionumber %]"
472 value="[% itemLoo.itemnumber %]" />
474 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]" />
475 <img src="/opac-tmpl/[% theme %]/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
476 [% END %] [% IF ( itemLoo.copynumber ) %][% itemLoo.copynumber %][% END %]
478 [% IF ( item_level_itypes ) %]
480 [% UNLESS ( noItemTypeImages ) %]
481 [% IF ( itemLoo.imageurl ) %]<img src="[% itemLoo.imageurl %]" alt="" />[% END %]
483 [% itemLoo.description %]
486 <td>[% itemLoo.barcode %]</td>
487 [% UNLESS ( singleBranchMode ) %]
488 <td>[% itemLoo.homeBranchName %]</td>
489 <td>[% itemLoo.holdingBranchName %]</td>
491 <td>[% itemLoo.callNumber %]</td>
492 [% IF ( itemLoo.itemdata_enumchron ) %]<!-- test -->
493 <td>[% itemLoo.enumchron %]</td>
496 [% IF ( itemLoo.date_due ) %]
497 <span class="checkedout">Due [% itemLoo.date_due %]</span>
498 [% ELSIF ( itemLoo.transfertwhen ) %]
499 <span class="intransit">In transit from [% itemLoo.transfertfrom %],
500 to [% itemLoo.transfertto %], since [% itemLoo.transfertwhen %]</span>
502 [% IF ( itemLoo.message ) %]
503 <span class="lost">Unavailable (lost or missing)</span>
505 [% IF ( itemLoo.notforloan ) %]
506 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
508 [% IF ( itemLoo.reservedate ) %]
509 <span class="waiting">[% IF ( itemLoo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %] for patron
510 [% IF ( itemLoo.waitingdate ) %]at[% ELSE %]expected at[% END %] [% itemLoo.ExpectedAtLibrary %]
512 [% IF ( itemLoo.waitingdate ) %][% itemLoo.waitingdate %][% ELSE %][% IF ( itemLoo.reservedate ) %][% itemLoo.reservedate %][% END %][% END %].
515 <span class="notonhold">Not on hold</span>
523 [% END %]<!-- bib_available -->
524 [% END %]<!-- OPACItemHolds -->
526 </table><!-- bibitemloop -->
527 [% END %] <!-- if message -->
528 </div><!-- bigloop -->
530 [% UNLESS ( message ) %]
531 [% UNLESS ( none_available ) %]
532 <input type="submit" value="Place Hold" class="placehold" />
543 <div><!-- The following include seems to have an extra "/div" in it... -->
544 [% INCLUDE 'opac-bottom.inc' %]