1 [% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "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);
155 <style type="text/css">td ul { padding : 0; } td li { white-space: nowrap; font-size: 90%; list-style-type:none; padding : .3em 0; }</style>
158 <body id="opac-holds">
159 <div id="doc3" class="yui-t7">
160 [% INCLUDE 'masthead.inc' %]
163 <div id="holds" class="container">
166 <div id="gna" class="dialog alert">
167 <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>
168 <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>
172 <div id="lost" class="dialog alert">
173 <p><strong>Sorry</strong>, you cannot place holds because your library card has been marked as lost or stolen.</p>
174 <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>
177 [% IF ( debarred ) %]
178 <div id="debarred" class="dialog alert">
179 <p><strong>Sorry</strong>, you cannot place holds because your account has been frozen.</p>
180 <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>
183 [% IF ( too_much_oweing ) %]
184 <div id="too_much_oweing" class="dialog alert">
185 Sorry, you cannot place holds because you owe [% too_much_oweing %].
188 [% IF ( too_many_reserves ) %]
189 <div id="too_many_reserves" class="dialog alert">Sorry, you cannot place more than [% too_many_reserves %] holds.
192 [% IF ( bad_biblionumber ) %]
193 <div id="bad_biblionumber" class="dialog alert">ERROR: No biblio record found for biblionumber [% bad_biblionumber %].</div>
195 [% IF ( no_items_selected ) %]
196 <div id="no_items_selected" class="dialog alert">
197 You must select at least one item.
200 [% IF ( no_branch_selected ) %]
201 <div id="no_branch_selected" class="dialog alert">
202 You must select a library for pickup.
205 [% IF ( no_biblionumber ) %]
206 <div id="no_biblionumber" class="dialog alert">ERROR: No biblionumber received.</div>
208 [% IF ( bad_data ) %]
209 <div id="bad_data" class="dialog alert">ERROR: Internal error: incomplete hold request.</div>
212 [% IF ( none_available ) %]
213 <div id="none_available" class="dialog alert"><strong>Sorry</strong>, none of these items can be placed on hold.
216 [% END %]<!-- NAME="message" -->
218 [% UNLESS ( message ) %][% UNLESS ( none_available ) %]<h3>Confirm holds for:
219 [% FOREACH USER_INF IN USER_INFO %]
220 [% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %])
224 <form action="/cgi-bin/koha/opac-reserve.pl" method="post">
225 <input type="hidden" name="place_reserve" value="1"/>
227 <!-- These values are set dynamically by js -->
228 <input type="hidden" name="biblionumbers" id="biblionumbers"/>
229 <input type="hidden" name="selecteditems" id="selections"/>
231 <table id="bibitemloop">
232 [% UNLESS ( none_available ) %]<tr>
235 [% UNLESS ( item_level_itypes ) %]
238 [% IF ( showpriority ) %]
241 [% IF ( reserve_in_future ) %]
242 <th>Hold Starts on Date</th>
244 <th>Hold Not Needed After</th>
245 [% IF ( OPACItemHolds ) %]
246 <th id="place_on_hdr" style="display:none">Place On</th>
248 [% UNLESS ( singleBranchMode ) %]
249 [% IF ( choose_branch ) %]
250 <th>Pickup Location</th>
253 </tr>[% ELSE %]<tr><th colspan="5">Title</th></tr>[% END %]
255 [% FOREACH bibitemloo IN bibitemloop %]
257 [% IF ( bibitemloo.holdable ) %]
259 <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
260 <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber %]"/>
261 <span class="confirmjs_hold" title="[% bibitemloo.biblionumber %]"></span>
262 <span class="confirm_nonjs">
263 <input type="radio" class="confirmbox checkitem [% bibitemloo.checkitem_bib %]"
264 name="[% bibitemloo.checkitem_bib %]" checked="checked"
265 id="[% bibitemloo.checkitem_bib %]"
267 <label class="confirm_label" for="[% bibitemloo.checkitem_bib %]">Next available copy</label>
271 [% UNLESS ( none_available ) %]<td> </td>[% END %]
273 [% IF ( bibitemloo.holdable ) %]<td>[% ELSE %]<td colspan="5">[% END %]
274 <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>
275 [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %]
277 [% UNLESS ( bibitemloo.holdable ) %]
279 [% IF ( bibitemloo.already_reserved ) %]
280 <div class="bibmessage">You have already requested this title.</div>
282 [% UNLESS ( bibitemloo.bib_available ) %]
283 <div class="bibmessage">No available items.</div>
285 <div class="bibmessage">This title cannot be requested.</div>
293 [% IF ( bibitemloo.holdable ) %][% UNLESS ( item_level_itypes ) %]
295 [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
296 [% bibitemloo.description %]
299 [% IF ( bibitemloo.holdable ) %]
300 [% IF ( showpriority ) %]
302 [% bibitemloo.rank %] out of [% bibitemloo.reservecount %]
303 </td>[% END %][% END %]
304 [% IF ( reserve_in_future ) %]
305 [% IF ( bibitemloo.holdable ) %]<td>
306 <input name="reserve_date_[% bibitemloo.biblionumber %]" id="reserve_date_[% bibitemloo.biblionumber %]" size="10">
307 <script language="JavaScript" type="text/javascript">
309 $("#reserve_date_[% bibitemloo.biblionumber %]").attr( 'readonly', 'readonly' );
311 var cal_img = document.createElement('img');
312 cal_img.src = "[% themelang %]/lib/calendar/cal.gif";
313 cal_img.alt = "Show Calendar";
314 cal_img.border = "0";
315 cal_img.id = "CalendarReserveDate[% bibitemloo.biblionumber %]";
316 cal_img.style.cursor = "pointer";
317 document.getElementById("reserve_date_[% bibitemloo.biblionumber %]").parentNode.appendChild( cal_img );
319 function validate[% bibitemloo.biblionumber %](date) {
320 var today = new Date();
321 if ( (date > today) ||
322 ( date.getDate() == today.getDate() &&
323 date.getMonth() == today.getMonth() &&
324 date.getFullYear() == today.getFullYear() ) ) {
332 inputField : "reserve_date_[% bibitemloo.biblionumber %]",
333 ifFormat : "[% DHTMLcalendar_dateformat %]",
334 button : "CalendarReserveDate[% bibitemloo.biblionumber %]",
335 disableFunc : validate[% bibitemloo.biblionumber %],
336 dateStatusFunc : validate[% bibitemloo.biblionumber %]
341 <p style="margin:.3em 2em;">
342 <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('reserve_date_[% bibitemloo.biblionumber %]').value='';return false;">Clear Date</a></p>
346 [% IF ( bibitemloo.holdable ) %]<td>
347 <input name="expiration_date_[% bibitemloo.biblionumber %]" id="expiration_date_[% bibitemloo.biblionumber %]" size="10" readonly="readonly" />
348 <img src="[% themelang %]/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="CalendarExpirationDate_[% bibitemloo.biblionumber %]" style="cursor: pointer;" />
349 <script language="JavaScript" type="text/javascript">
351 function validate1(date) {
352 var today = new Date();
353 if ( (date > today) ||
354 ( date.getDate() == today.getDate() &&
355 date.getMonth() == today.getMonth() &&
356 date.getFullYear() == today.getFullYear() ) ) {
364 inputField : "expiration_date_[% bibitemloo.biblionumber %]",
365 ifFormat : "[% DHTMLcalendar_dateformat %]",
366 button : "CalendarExpirationDate_[% bibitemloo.biblionumber %]",
367 disableFunc : validate1,
368 dateStatusFunc : validate1
373 <p style="margin:.3em 2em;">
374 <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('expiration_date_[% bibitemloo.biblionumber %]').value='';return false;">Clear Date</a></p>
377 [% IF ( bibitemloo.holdable ) %]
379 [% IF ( OPACItemHolds ) %]
381 <td class="place_on_type" style="display:none">
384 [% UNLESS ( bibitemloo.holdable ) %]
385 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
386 id="reqany_[% bibitemloo.biblionumber %]"
392 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
393 id="reqany_[% bibitemloo.biblionumber %]"
399 <label for="reqany_[% bibitemloo.biblionumber %]">Next available copy</label>
402 [% UNLESS ( bibitemloo.holdable ) %]
403 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
404 id="reqspecific_[% bibitemloo.biblionumber %]"
405 class="selectspecific"
410 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
411 id="reqspecific_[% bibitemloo.biblionumber %]"
412 class="selectspecific"
416 <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 %]">
446 <td colspan="[% itemtable_colspan %]">
448 <caption>Select a specific copy:</caption>
451 [% IF ( item_level_itypes ) %]
455 [% UNLESS ( singleBranchMode ) %]
456 <th>Home Library</th>
457 <th>Last Location</th>
460 [% IF ( bibitemloo.itemdata_enumchron ) %]
466 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
467 <tr class="[% itemLoo.backgroundcolor %]">
469 [% IF ( itemLoo.available ) %]
470 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]"
471 value="[% itemLoo.itemnumber %]" />
473 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]" />
474 <img src="/opac-tmpl/[% theme %]/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
475 [% END %] [% IF ( itemLoo.copynumber ) %][% itemLoo.copynumber %][% END %]
477 [% IF ( item_level_itypes ) %]
479 [% UNLESS ( noItemTypeImages ) %]
480 [% IF ( itemLoo.imageurl ) %]<img src="[% itemLoo.imageurl %]" alt="" />[% END %]
482 [% itemLoo.description %]
485 <td>[% itemLoo.barcode %]</td>
486 [% UNLESS ( singleBranchMode ) %]
487 <td>[% itemLoo.homeBranchName %]</td>
488 <td>[% itemLoo.holdingBranchName %]</td>
490 <td>[% itemLoo.callNumber %]</td>
491 [% IF ( itemLoo.itemdata_enumchron ) %]<!-- test -->
492 <td>[% itemLoo.enumchron %]</td>
495 [% IF ( itemLoo.date_due ) %]
496 <span class="checkedout">Due [% itemLoo.date_due %]</span>
497 [% ELSIF ( itemLoo.transfertwhen ) %]
498 <span class="intransit">In transit from [% itemLoo.transfertfrom %],
499 to [% itemLoo.transfertto %], since [% itemLoo.transfertwhen %]</span>
501 [% IF ( itemLoo.message ) %]
502 <span class="lost">Unavailable (lost or missing)</span>
504 [% IF ( itemLoo.notforloan ) %]
505 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
507 [% IF ( itemLoo.reservedate ) %]
508 <span class="waiting">[% IF ( itemLoo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %] for patron
509 [% IF ( itemLoo.waitingdate ) %]at[% ELSE %]expected at[% END %] [% itemLoo.ExpectedAtLibrary %]
511 [% IF ( itemLoo.waitingdate ) %][% itemLoo.waitingdate %][% ELSE %][% IF ( itemLoo.reservedate ) %][% itemLoo.reservedate %][% END %][% END %].
514 <span class="notonhold">Not on hold</span>
522 [% END %]<!-- bib_available -->
523 [% END %]<!-- OPACItemHolds -->
525 </table><!-- bibitemloop -->
526 [% END %] <!-- if message -->
527 </div><!-- bigloop -->
529 [% UNLESS ( message ) %]
530 [% UNLESS ( none_available ) %]
531 <input type="submit" value="Place Hold" class="placehold" />
542 <div><!-- The following include seems to have an extra "/div" in it... -->
543 [% INCLUDE 'opac-bottom.inc' %]