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 // Select the first item available
24 function select_first_available(id){
25 var radios = $("input:radio[name='checkitem_" + id + "']");
26 $(radios).first().attr("checked", "checked");
29 $(document).ready(function() {
30 $('#hold-request-form').preventDoubleFormSubmit();
32 var copiesRowId = null;
33 var wasSpecific = false;
34 var lastCopiesRowId = null;
36 $(".toggle-hold-options").show();
37 $(".hold-options").hide();
38 $(".holddatefrom,.holddateto").prop("readOnly", true);
40 $(".checkitem").parent().click(function(e){
41 if(e.target.tagName.toLowerCase() == 'td'){
42 $(this).find("input.checkitem").each( function() {
43 $(this).attr('checked', 'checked');
48 // click on a first td check the confirmjs checkbox
49 $("td.hold").click(function(e){
50 if(e.target.tagName.toLowerCase() == 'td'){
51 $(this).find("input.confirmjs").each( function() {
52 $(this).attr('checked', !$(this).attr('checked'));
58 $(".toggle-hold-options").on("click",function(e){
61 var optionsID = this.id.replace("toggle-hold-options-","");
62 $("#hold-options-"+optionsID).toggle(0, function() {
63 toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
67 // Hides all 'specific copy' table rows on load.
68 $(".copiesrow").hide();
70 // Insert reasons for forced hold notes
71 $(".forcenotesreason").each(function(){
72 biblioNum = suffixOf($(this).attr("id"), "_");
73 var j=$("#notesmandatory_"+biblioNum).val();
75 $(this).html(ForceHoldNotesReasons[j-1]);
79 $(".date-format").each(function(){
80 if($(this).hasClass("to")){ var op = "to"; }
81 if($(this).hasClass("from")){ var op = "from"; }
82 var bibNum = $(this).data("biblionumber");
83 $(this).html("<a href=\"#\" class=\"clear-date\" data-op=\"" + op + "\" id=\"clear" + bibNum + "\">" + _("Clear date") + "</a>");
86 $(".clear-date").on("click",function(e){
88 var fieldID = this.id.replace("clear","");
89 var op = $(this).data("op");
90 $("#" + op + fieldID).val("");
93 // Replace non-JS single-selection with multi-selection capability.
94 $(".reserve_mode").val("multi");
95 $(".confirm_nonjs").remove();
96 $(".confirmjs_hold").each(function(){
97 var bib = $(this).attr("title");
98 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
99 html += "value=\"" + bib + "\" id=\"" + bib + "\" /> " + _("Place a hold on") + " </label> ";
102 $(".confirmjs_nohold").each(function(){
103 var bib = $(this).attr("title");
104 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
105 html += "value=\"" + bib + "\" id=\"" + bib + "\" />" + _("Place a hold on: ") + "</label>";
109 // expand or collapse the copiesrow tr
110 function toggle_copiesrow(biblioNum) {
111 var checkbox = $("input:checkbox[value='"+biblioNum+"']");
112 newCopiesRowId = "#copiesrow_" + biblioNum;
113 var select_specific = $("#reqspecific_"+biblioNum).is(":checked");
115 // If the checkbox is checked AND we want a specific item, we display the items block
116 if ( $(checkbox).is(":checked") && select_specific ) {
117 $(newCopiesRowId).show();
119 $(newCopiesRowId).hide();
123 $("#place_on_hdr").show();
125 [% IF OPACItemHolds == '1' %]
126 $(".place_on_type").show();
127 // onload, selectany is checked
128 $(".selectany").attr("checked", "checked");
131 // If the user is *allowed* to choose a specific item
132 // The first one is preselected
133 [% IF OPACItemHolds =="1" %]
134 $("table.copiesrow").each(function(){
135 var id = suffixOf($(this).attr("id"), "_");
136 select_first_available(id);
140 // On confirmsjs change
141 $(".confirmjs").change(function(){
142 var id = suffixOf($(this).attr("id"), "_");
143 // If I m checked, I enable radio buttons
144 if ( $(this).is(":checked") ) {
145 $("#reqspecific_" + id).attr("disabled", false);
146 $("#reqany_" + id).attr("disabled", false);
148 // Else its are disabled
150 $("#reqspecific_" + id).attr("disabled", "disabled");
151 $("#reqany_" + id).attr("disabled", "disabled");
153 // expand or collaspe the items block
154 toggle_copiesrow(id);
157 // When 'specific copy' or 'first available' radio button is clicked
158 $(".selectspecific, .selectany").click(function() {
159 var id = suffixOf($(this).attr("id"), "_");
160 toggle_copiesrow(id);
163 // Show or hide holds notes
164 $(".shownotes").click(function(){
165 biblioNum = suffixOf($(this).attr("id"), "_");
166 $("#notesrow_"+biblioNum).toggle();
169 // When 'Place Hold' button is clicked
170 $(".placehold").click(function(){
171 var biblionumbers = "";
174 if ($(".confirmjs:checked").size() == 0) {
175 alert(MSG_NO_RECORD_SELECTED);
179 // Find the items with the 'Hold' box checked
181 $(".confirmjs:checked").each(function() {
182 var biblioNum = $(this).val();
183 biblionumbers += biblioNum + "/";
184 selections += biblioNum + "/";
186 // If the 'specific copy' radio button is checked
187 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
188 // Find the selected copy
189 var item = $(".checkitem_" + biblioNum + ":checked");
190 if ($(item).size() == 0) {
194 selections += $(item).val();
199 // Add the pickup location
200 var branchSel = $("#branch_" + biblioNum);
201 if (branchSel.size() > 0) {
202 selections += $(branchSel).val();
209 alert(MSG_NO_ITEM_SELECTED);
213 $("#selections").val(selections);
214 $("#biblionumbers").val(biblionumbers);
219 [% FOREACH bibitemloo IN bibitemloop %]
220 [% IF ( bibitemloo.holdable ) %]
221 // http://jqueryui.com/demos/datepicker/#date-range
222 var dates[% bibitemloo.biblionumber %] = $( "#from[% bibitemloo.biblionumber %], #to[% bibitemloo.biblionumber %]" ).datepicker({
226 onSelect: function( selectedDate ) {
227 var option = this.id == "from[% bibitemloo.biblionumber %]" ? "minDate" : "maxDate",
228 instance = $( this ).data( "datepicker" );
229 date = $.datepicker.parseDate(
230 instance.settings.dateFormat ||
231 $.datepicker._defaults.dateFormat,
232 selectedDate, instance.settings );
233 dates[% bibitemloo.biblionumber %].not( this ).datepicker( "option", option, date );
242 <style type="text/css">td ul { padding : 0; } td li { white-space: nowrap; font-size: 90%; list-style-type:none; padding : .3em 0; }</style>
245 <body id="opac-holds">
246 <div id="doc3" class="yui-t7">
248 [% INCLUDE 'masthead.inc' %]
250 <div id="holds" class="container">
253 <div id="gna" class="dialog alert">
254 <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>
255 <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>
259 <div id="lost" class="dialog alert">
260 <p><strong>Sorry</strong>, you cannot place holds because your library card has been marked as lost or stolen.</p>
261 <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>
264 [% IF ( debarred ) %]
265 <div id="debarred" class="dialog alert">
266 <p><strong>Sorry</strong>, you cannot place holds because your account has been frozen.</p>
267 <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>
270 [% IF ( too_much_oweing ) %]
271 <div id="too_much_oweing" class="dialog alert">
272 Sorry, you cannot place holds because you owe [% too_much_oweing %].
275 [% IF ( too_many_reserves ) %]
276 <div id="too_many_reserves" class="dialog alert">Sorry, you cannot place more than [% too_many_reserves %] holds.
279 [% IF ( bad_biblionumber ) %]
280 <div id="bad_biblionumber" class="dialog alert">ERROR: No biblio record found for biblionumber [% bad_biblionumber %].</div>
282 [% IF ( no_items_selected ) %]
283 <div id="no_items_selected" class="dialog alert">
284 You must select at least one item.
287 [% IF ( no_branch_selected ) %]
288 <div id="no_branch_selected" class="dialog alert">
289 You must select a library for pickup.
292 [% IF ( no_biblionumber ) %]
293 <div id="no_biblionumber" class="dialog alert">ERROR: No biblionumber received.</div>
295 [% IF ( bad_data ) %]
296 <div id="bad_data" class="dialog alert">ERROR: Internal error: incomplete hold request.</div>
298 [% IF ( expired_patron ) %]
299 <div id="expired_patron" class="dialog alert"><p><strong>Sorry</strong>, you cannot place holds because your library card has expired.</p><p>Please contact your librarian if you wish to renew your card.</p></div>
302 [% IF ( none_available ) %]
303 <div id="none_available" class="dialog alert"><strong>Sorry</strong>, none of these items can be placed on hold.
306 [% END %]<!-- NAME="message" -->
308 [% UNLESS ( message ) %][% UNLESS ( none_available ) %]<h3>Confirm holds for:
309 [% FOREACH USER_INF IN USER_INFO %]
310 [% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %])
313 [% IF (RESERVE_CHARGE) %]
314 <div class="dialog alert" id="reserve_fee">
315 There is a charge of [% RESERVE_CHARGE %] for placing this hold
319 <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
320 <input type="hidden" name="place_reserve" value="1"/>
322 <!-- These values are set dynamically by js -->
323 <input type="hidden" name="biblionumbers" id="biblionumbers"/>
324 <input type="hidden" name="selecteditems" id="selections"/>
327 [% FOREACH bibitemloo IN bibitemloop %]
328 <div class="holdrow">
332 [% IF ( bibitemloo.holdable ) %]
333 <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
334 <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber %]"/>
335 <span class="confirmjs_hold" title="[% bibitemloo.biblionumber %]" style="padding:.3em"></span>
336 <span class="confirm_nonjs">
337 <input type="radio" class="confirmbox checkitem [% bibitemloo.biblionumber %]"
338 name="[% bibitemloo.biblionumber %]" checked="checked"
339 id="single_[% bibitemloo.biblionumber %]"
341 <label class="confirm_label" for="single_[% bibitemloo.biblionumber %]">Place a hold on </label>
346 <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>
347 [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %]</p>
352 [% UNLESS ( bibitemloo.holdable ) %]
353 [% IF ( bibitemloo.already_reserved ) %]
354 <div class="bibmessage">You have already requested this title.</div>
356 [% UNLESS ( bibitemloo.bib_available ) %]
357 <div class="bibmessage">No available items.</div>
359 [% IF ( bibitemloo.already_patron_possession ) %]
360 <div class="bibmessage">This title cannot be requested because it's already in your possession.</div>
362 <div class="bibmessage">This title cannot be requested.</div>
368 [% IF ( bibitemloo.holdable ) %]
369 <fieldset class="rows">
372 [% UNLESS ( item_level_itypes ) %]
374 <span class="label">Item type: </span>
375 [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
376 [% bibitemloo.description %]
379 [% IF showholds || showpriority %]
380 <li class="priority">
381 <span class="label">Holds and priority: </span>
382 [% IF showpriority %] [% bibitemloo.rank %] [% END %]
383 [% IF showholds && showpriority %] out of [% END %]
384 [% IF showholds %] [% bibitemloo.reservecount %] [% END %]
390 [% UNLESS ( singleBranchMode ) %]
391 [% IF ( bibitemloo.holdable ) %]
392 [% IF ( choose_branch ) %]
394 <label for="branch_[% bibitemloo.biblionumber %]">Pick up location:</label>
395 [% UNLESS ( bibitemloo.holdable ) %]
396 <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
397 [% FOREACH branchloo IN bibitemloo.branchloop %]
398 [% IF ( branchloo.selected ) %]
399 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
401 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
406 <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
407 [% FOREACH branchloo IN bibitemloo.branchloop %]
408 [% IF ( branchloo.selected ) %]
409 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
411 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
421 <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber %]" style="display:none;" href="#">Show more options</a>
422 <div id="hold-options-[% bibitemloo.biblionumber %]" class="hold-options">
424 [% IF ( reserve_in_future ) %]
425 <li><label for="from[% bibitemloo.biblionumber %]">Hold starts on date:</label>
426 <input name="reserve_date_[% bibitemloo.biblionumber %]" id="from[% bibitemloo.biblionumber %]" size="10" class="holddatefrom"/>
427 <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
432 [% IF ( bibitemloo.holdable ) %]
434 <label for="to[% bibitemloo.biblionumber %]">Hold not needed after:</label>
435 <input name="expiration_date_[% bibitemloo.biblionumber %]" id="to[% bibitemloo.biblionumber %]" size="10" class="holddateto" />
436 <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
440 [% IF ( OpacHoldNotes && bibitemloo.holdable ) %]
442 <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
443 <label for="holdnotes[% bibitemloo.biblionumber %]">Hold notes:</label>
444 <span id="forcenotesreason_[% bibitemloo.biblionumber %]" class="forcenotesreason"></span>
445 <textarea id="holdnotes[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]">[% bibitemloo.holdnotes %]</textarea>
446 <input type="hidden" id="notesmandatory_[% bibitemloo.biblionumber %]" value="[% bibitemloo.mandatorynotes %]"/>
451 [% IF ( bibitemloo.holdable ) %]
453 [% IF OPACItemHolds == '1' or OPACItemHolds == 'force' %]
456 <li class="radio place_on_type" style="display:none;">
457 [% IF OPACItemHolds == "1" %]
458 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
459 id="reqany_[% bibitemloo.biblionumber %]"
465 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
466 id="reqany_[% bibitemloo.biblionumber %]"
471 <label for="reqany_[% bibitemloo.biblionumber %]">Next available item</label>
472 [% IF OPACItemHolds == "force" %]
473 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
474 id="reqspecific_[% bibitemloo.biblionumber %]"
475 class="selectspecific"
480 <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
481 id="reqspecific_[% bibitemloo.biblionumber %]"
482 class="selectspecific"
486 <label for="reqspecific_[% bibitemloo.biblionumber %]">A specific item</label>
489 [% IF OPACItemHolds == 'force' %]
490 <script type="text/javascript">
491 $(document).ready(function() {
492 $("#toggle-hold-options-[% bibitemloo.biblionumber %]").click();
493 $("#copiesrow_[% bibitemloo.biblionumber %]").show();
501 [% IF OPACItemHolds == '1' || OPACItemHolds == 'force' %]
502 [% IF ( bibitemloo.holdable ) %]
504 <table class="copiesrow" id="copiesrow_[% bibitemloo.biblionumber %]">
505 <caption>Select a specific item:</caption>
508 [% IF ( item_level_itypes ) %]
512 [% UNLESS ( singleBranchMode ) %]
513 <th>Home library</th>
514 <th>Last location</th>
517 [% IF ( itemdata_enumchron ) %]
523 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
524 <tr class="[% itemLoo.backgroundcolor %]">
525 <td class="copynumber">
526 [% IF ( itemLoo.available ) %]
527 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]"
528 value="[% itemLoo.itemnumber %]" />
530 <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]"
531 style="display:none;" />
532 <img src="/opac-tmpl/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
533 [% END %] [% IF ( itemLoo.copynumber ) %][% itemLoo.copynumber %][% END %]
535 [% IF ( item_level_itypes ) %]
537 [% UNLESS ( noItemTypeImages ) %]
538 [% IF ( itemLoo.imageurl ) %]<img src="[% itemLoo.imageurl %]" alt="" />[% END %]
540 [% itemLoo.description %]
543 <td class="barcode">[% itemLoo.barcode %]</td>
544 [% UNLESS ( singleBranchMode ) %]
545 <td class="homebranch">[% itemLoo.homeBranchName %]</td>
546 <td class="holdingbranch">[% itemLoo.holdingBranchName %]</td>
548 <td class="call_no">[% itemLoo.callNumber %]</td>
549 [% IF ( itemdata_enumchron ) %]
550 <td class="vol_info">[% itemLoo.enumchron %]</td>
552 <td class="information">
553 [% IF ( itemLoo.dateDue ) %]
554 <span class="checkedout">Due [% itemLoo.dateDue %]</span>
555 [% ELSIF ( itemLoo.transfertwhen ) %]
556 <span class="intransit">In transit from [% itemLoo.transfertfrom %],
557 to [% itemLoo.transfertto %], since [% itemLoo.transfertwhen %]</span>
559 [% IF ( itemLoo.message ) %]
560 <span class="lost">Unavailable (lost or missing)</span>
562 [% IF ( itemLoo.notforloan ) %]
563 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
565 [% IF ( itemLoo.reservedate ) %]
566 <span class="waiting">[% IF ( itemLoo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %] for patron
567 [% IF ( itemLoo.waitingdate ) %]at[% ELSE %]expected at[% END %] [% itemLoo.ExpectedAtLibrary %]
569 [% IF ( itemLoo.waitingdate ) %][% itemLoo.waitingdate | $KohaDates %][% ELSE %][% IF ( itemLoo.reservedate ) %][% itemLoo.reservedate %][% END %][% END %].
572 <span class="notonhold">Not on hold</span>
581 [% END %]<!-- OPACItemHolds -->
583 [% END %]<!-- bib_available -->
587 [% END %] <!-- if message -->
588 </div><!-- bigloop -->
590 [% UNLESS ( message ) %]
591 [% UNLESS ( none_available ) %]
592 <input type="submit" value="Place hold" class="placehold" />
603 <div><!-- The following include seems to have an extra "/div" in it... -->
604 [% INCLUDE 'opac-bottom.inc' %]