6 [% USE AuthorisedValues %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Placing a hold › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 [% BLOCK cssinclude %][% END %]
13 [% INCLUDE 'bodytag.inc' bodyid='opac-holds' %]
14 [% INCLUDE 'masthead.inc' %]
17 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
18 <ol class="breadcrumb">
19 <li class="breadcrumb-item">
20 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
22 <li class="breadcrumb-item active">
23 <a href="#" aria-current="page">Placing a hold</a>
26 </nav> <!-- /#breadcrumbs -->
28 <div class="container">
29 <div id="holds" class="maincontent">
30 <h1>Placing a hold</h1>
32 <div id="holdmessages" class="alert">
33 <p>Sorry, you cannot place holds.</p>
37 According to our records, we don't have up-to-date contact information. Please contact the library.
38 <a href="/cgi-bin/koha/opac-memberentry.pl">[% IF ( Koha.Preference('OPACPatronDetails') ) %]Update your contact information[% ELSE %]Go to your contact information[% END %]</a>
39 [% IF ( Koha.Preference('OPACPatronDetails') ) %]<em>(Please note: there may be a delay in restoring your account if you submit online.)</em>[% END %]
45 Your library card has been marked as lost or stolen.<br />
46 <em>If this is an error, please take your library card to the circulation desk at your local library and the error will be corrected.</em>
52 Your account has been frozen.
53 [% IF debarred_comment %]
55 <span id="userdebarred_comment">
57 [% IF debarred_comment.search('OVERDUES_PROCESS') %]
58 Restriction added by overdues process [% debarred_comment.remove('OVERDUES_PROCESS ') | html_line_break %]
60 [% debarred_comment | html_line_break %]
66 [% IF debarred_date && debarred_date != '9999-12-31' %]
68 <span id="userdebarred_date">[% debarred_date | $KohaDates %]</span>
70 <br /><em>Usually the reason for freezing an account is old overdues or damage fees. If shows your account to be clear, please contact the library.</em> <a href="/cgi-bin/koha/opac-account.pl">Go to your account page</a>
74 [% IF ( too_much_oweing ) %]
75 <li id="too_much_oweing">
76 You have unpaid fines. Amount: [% too_much_oweing | $Price %].
80 [% IF ( too_many_reserves ) %]
81 <li id="too_many_reserves">
82 Sorry, you cannot place more than [% too_many_reserves | html %] holds.
86 [% IF ( bad_biblionumber ) %]
87 <li id="bad_biblionumber">
88 ERROR: No record found for record id [% bad_biblionumber | html %].
92 [% IF ( no_items_selected ) %]
93 <li id="no_items_selected">
94 You must select at least one item.
98 [% IF ( no_branch_selected ) %]
99 <li id="no_branch_selected">
100 You must select a library for pickup.
104 [% IF ( no_biblionumber ) %]
105 <li id="no_biblionumber">
106 ERROR: No record id specified.
110 [% IF ( bad_data ) %]
112 ERROR: Internal error: incomplete hold request.
116 [% IF ( expired_patron ) %]
117 <li id="expired_patron">
118 Your library card has expired. Please contact your librarian if you wish to renew your card.
122 [% IF ( no_pickup_locations ) %]
123 <li id="no_pickup_locations">
124 None of the libraries are available for pickup location.
128 </div> <!-- /.message -->
129 [% ELSE # /IF message %]
131 [% IF ( none_available && multi_hold ) %]
132 <div id="none_available" class="alert">
133 Sorry, none of these titles can be placed on hold.
137 [% END # / IF message %]
139 [% UNLESS ( message ) %]
140 [% UNLESS ( none_available ) %]
141 <h2>Confirm holds for:[% INCLUDE 'patron-title.inc' patron = logged_in_user %] ([% logged_in_user.cardnumber | html %])</h2>
142 [% END # / UNLESS none_available %]
144 [% IF (RESERVE_CHARGE) %]
145 <div class="alert" id="reserve_fee">
146 [% IF Koha.Preference('HoldFeeMode') == 'any_time_is_collected' %]
147 You will be charged a hold fee of [% RESERVE_CHARGE | $Price %] when you collect this item
149 You will be charged a hold fee of [% RESERVE_CHARGE | $Price %] for placing this hold
154 [% IF ( new_reserves_allowed ) %]
155 <div id="new_reserves_allowed" class="alert">
156 <strong>Sorry,</strong> you can only place [% new_reserves_allowed | html %] more holds. Please uncheck the checkboxes for the items you wish to not place holds on.
160 <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
161 <legend class="sr-only">Hold requests</legend>
162 <input type="hidden" name="place_reserve" value="1"/>
163 <!-- These values are set dynamically by js -->
164 <input type="hidden" name="biblionumbers" id="biblionumbers"/>
165 <input type="hidden" name="selecteditems" id="selections"/>
168 [% FOREACH bibitemloo IN bibitemloop %]
169 <div class="holdrow">
170 [% IF bibitemloo.forced_hold_level %]
171 <div class="alert alert-info forced_hold_level">
172 [% IF bibitemloo.forced_hold_level == 'item' %]
173 You already have at least one item level hold on this title.
174 All further holds must be item level.
176 You already have at least one record level hold on this title.
177 All further holds must be record level.
182 [% IF ( bibitemloo.holdable ) %]
183 <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
184 <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber | html %]"/>
185 <span class="confirmjs_hold" title="[% bibitemloo.biblionumber | html %]" style="padding:.3em"></span>
186 <span class="confirm_nonjs">
187 <input type="radio" class="confirmbox checkitem [% bibitemloo.biblionumber | html %]" name="[% bibitemloo.biblionumber | html %]" checked="checked" id="single_[% bibitemloo.biblionumber | html %]" value="any" />
188 <label class="confirm_label" for="single_[% bibitemloo.biblionumber | html %]">Place a hold on </label>
190 [% END # / bibitemloo.holdable %]
192 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% bibitemloo.biblionumber | html %]">
193 [% INCLUDE 'biblio-title.inc' biblio=bibitemloo %]
195 [% IF ( bibitemloo.author ) %], by [% bibitemloo.author | html %][% END %]
198 [% UNLESS ( bibitemloo.holdable ) %]
199 [% IF ( bibitemloo.ageRestricted ) %]
200 <div class="alert alert-warning">Sorry, you are too young to reserve this material.</div>
202 [% IF ( bibitemloo.already_reserved ) %]
203 <div class="alert alert-warning">You have already requested this title.</div>
204 [% ELSIF ( bibitemloo.recall ) %]
205 <div class="alert alert-warning">You have already placed a recall on this title.</div>
207 [% IF ( bibitemloo.already_patron_possession ) %]
208 <div class="alert alert-warning">This title cannot be requested because it's already in your possession.</div>
210 [% UNLESS ( bibitemloo.bib_available ) %]
211 <div class="alert">There are no items that can be placed on hold.</div>
213 <div class="alert">This title cannot be requested.</div>
215 [% END # / UNLESS bibitemloo.already_patron_possession %]
216 [% END # / IF bibitemloo.already_reserved %]
217 [% END # / UNLESS bibitemloo.holdable %]
219 [% IF ( bibitemloo.holdable ) %]
220 <fieldset class="rows">
223 [% UNLESS ( item_level_itypes ) %]
225 <span class="label">Item type: </span>
226 [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl | html %]" alt="" />[% END %]
227 [% bibitemloo.translated_description | html %]
231 [% SET OPACShowHoldQueueDetails = Koha.Preference('OPACShowHoldQueueDetails') %]
232 [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'priority' %]
233 <li class="priority">
234 <span class="label">Your priority: </span>
235 [% bibitemloo.rank | html %]
239 [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'holds' %]
240 <li class="holds-count">
241 <span class="label">Number of holds: </span>
242 [% bibitemloo.reservecount | html %]
246 [% UNLESS ( singleBranchMode ) %]
247 [% IF ( bibitemloo.holdable && Koha.Preference('OPACAllowUserToChooseBranch')) %]
249 <label for="branch_[% bibitemloo.biblionumber | html %]">Pick up location:</label>
250 [% UNLESS ( bibitemloo.holdable ) %]
251 <select name="branch" id="branch_[% bibitemloo.biblionumber | html %]" disabled="disabled">
252 [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => bibitemloo.biblionumber, patron => logged_in_user }, selected => branch }) %]
255 [% SET at_least_one_library_not_available_for_pickup = 0 %]
256 <select name="branch" id="branch_[% bibitemloo.biblionumber | html %]">
257 [% FOREACH library IN Branches.pickup_locations({ search_params => { biblio => bibitemloo.biblionumber, patron => logged_in_user }, selected => branch }) %]
258 [% SET pickup_available_at = bibitemloo.not_available_at.grep('^' _ library.branchcode _ '$').size ? 0 : 1 %]
259 [% IF library.selected AND pickup_available_at %]
260 <option value="[% library.branchcode | html %]" selected="selected" >[% library.branchname | html %]</option>
261 [% ELSIF pickup_available_at %]
262 <option value="[% library.branchcode | html %]">[% library.branchname | html %]</option>
264 [% SET at_least_one_library_not_available_for_pickup = 1 %]
265 <option value="[% library.branchcode | html %]" disabled="disabled" title="At least one item is available at this library">[% library.branchname | html %]</option>
269 [% IF at_least_one_library_not_available_for_pickup %]
270 <div class="at_least_one_library_not_available_note">Note: Library policy does not allow hold/pickup of an item available locally. Please come to the library to retrieve these items</div>
272 [% END # / UNLESS bibitemloo.holdable %]
274 [% END # / IF bibitemloo.holdable && Koha.Preference('OPACAllowUserToChooseBranch') %]
275 [% END # / UNLESS singleBranchMode %]
278 <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber | html %]" style="display:none;" href="#">Show more options</a>
280 <div id="hold-options-[% bibitemloo.biblionumber | html %]" class="hold-options">
283 [% IF ( reserve_in_future ) %]
285 <label for="from[% bibitemloo.biblionumber | html %]">Hold starts on date:</label>
286 <input type="text" name="reserve_date_[% bibitemloo.biblionumber | html %]" id="from[% bibitemloo.biblionumber | html %]" data-start_for="to[% bibitemloo.biblionumber | html %]" size="10" class="flatpickr holddatefrom" />
287 <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber | html %]">[% INCLUDE 'date-format.inc' %]</span>
292 <label for="to[% bibitemloo.biblionumber | html %]">Hold not needed after:</label>
293 <input type="text" name="expiration_date_[% bibitemloo.biblionumber | html %]" id="to[% bibitemloo.biblionumber | html %]" size="10" class="flatpickr futuredate" />
294 <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber | html %]">[% INCLUDE 'date-format.inc' %]</span>
297 [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
299 [% FOREACH item IN bibitemloo.itemLoop %]
300 [% itemtypes.push( item.itype ) %]
303 <label for="itemtype">Request specific item type:</label>
304 <select name="itemtype" id="itemtype">
305 <option value="">Any item type</option>
306 [% FOREACH i IN itemtypes.unique.sort %]
307 <option value="[% i | html %]">[% ItemTypes.GetDescription( i ) | html %]</option>
313 [% IF ( OpacHoldNotes ) %]
315 <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber | html %]">
316 <label for="holdnotes_[% bibitemloo.biblionumber | html %]">Hold notes:</label>
317 [% IF bibitemloo.reqholdnotes %]
318 <span id="reqholdnotes_[% bibitemloo.biblionumber | html %]">Please enter additional information about the requested item:</span>
320 <textarea id="holdnotes_[% bibitemloo.biblionumber | html %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber | html %]" >[% bibitemloo.holdnotes | html %]</textarea>
323 [% END # / IF OpacHoldNotes %]
325 [% IF bibitemloo.itemholdable %]
327 <li class="lradio place_on_type" style="display:none;">
328 [% IF NOT bibitemloo.force_hold %]
329 <label class="radio inline" for="reqany_[% bibitemloo.biblionumber | html %]">Next available item</label>
330 <input type="radio" name="reqtype_[% bibitemloo.biblionumber | html %]"
331 id="reqany_[% bibitemloo.biblionumber | html %]"
337 <label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber | html %]">A specific item</label>
338 <input type="radio" name="reqtype_[% bibitemloo.biblionumber | html %]"
339 id="reqspecific_[% bibitemloo.biblionumber | html %]"
340 class="selectspecific"
344 [% END # / IF bibitemloo.itemholdable %]
347 [% IF bibitemloo.itemholdable %]
348 <div id="copiesrow_[% bibitemloo.biblionumber | html %]" class="copiesrow">
349 <table class="table table-bordered table-striped itemstable">
350 <caption>Select a specific item:</caption>
354 [% IF ( item_level_itypes ) %]
358 [% UNLESS ( singleBranchMode ) %]
359 <th>Home library</th>
360 <th>Last location</th>
362 [% IF ( itemdata_ccode ) %]
366 [% IF ( itemdata_enumchron ) %]
375 [% SET unholdable_items = 0 %]
376 [% FOREACH itemLoo IN bibitemloo.itemLoop %]
377 [% IF ( itemLoo.available ) %]
378 [% IF ( itemLoo.onloan ) %]
379 <tr class="holdable onloan">
381 <tr class="holdable">
383 <td class="copynumber" data-order="[% itemLoo.copynumber | html %]">
384 <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber | html %]" name="checkitem_[% bibitemloo.biblionumber | html %]" value="[% itemLoo.itemnumber | html %]" />
386 [% SET unholdable_items = 1 %]
387 [% IF ( itemLoo.onloan ) %]
388 <tr class="unholdable onloan" style="display:none;">
390 <tr class="unholdable" style="display:none;">
392 <td class="copynumber">
393 <input disabled="disabled" type="radio" aria-label="Cannot be put on hold" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber | html %]"
394 style="display:none;" />
395 <i class="fa fa-remove danger" aria-hidden="true" title="Cannot be put on hold"></i>
397 [% IF ( itemLoo.copynumber ) %]
398 [% itemLoo.copynumber | html %]
400 </td> [%# copynumber %]
402 [% IF ( item_level_itypes ) %]
404 [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %]
405 [% IF ( itemLoo.imageurl ) %]
406 <img src="[% itemLoo.imageurl | html %]" alt="" />
409 [% itemLoo.translated_description | html %]
413 <td class="barcode">[% itemLoo.barcode | html %]</td>
414 [% UNLESS ( singleBranchMode ) %]
415 <td class="homebranch">[% Branches.GetName( itemLoo.homeBranchName ) | html %]</td>
416 <td class="holdingbranch">[% Branches.GetName( itemLoo.holdingBranchName ) | html %]</td>
418 [% IF ( itemdata_ccode ) %]
419 <td class="ccode"> [% IF ( itemLoo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemLoo.ccode, opac => 1 ) | html %][% END %]</td>
421 <td class="call_no">[% itemLoo.callNumber | html %]</td>
422 [% IF ( itemdata_enumchron ) %]
423 <td class="vol_info">[% itemLoo.enumchron | html %]</td>
425 <td class="itemnotes">
426 [% itemLoo.itemnotes | html %]
428 <td class="information">
429 [% IF ( itemLoo.dateDue ) %]
430 <span class="checkedout">Due [% itemLoo.dateDue | html %]</span>
431 [% ELSIF ( itemLoo.transfertwhen ) %]
432 <span class="intransit">In transit from [% Branches.GetName( itemLoo.transfertfrom ) | html %] to [% Branches.GetName( itemLoo.transfertto ) | html %] since [% itemLoo.transfertwhen | html %]</span>
435 [% IF ( itemLoo.message ) %]
436 <span class="lost">Unavailable (lost or missing)</span>
439 [% IF ( itemLoo.notforloan ) %]
440 <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue | html %])</span>
443 [% IF ( itemLoo.reservedate ) %]
444 <span class="waiting">
445 [% IF ( itemLoo.waitingdate ) %]
451 [% IF ( itemLoo.waitingdate ) %]
456 [% itemLoo.ExpectedAtLibrary | html %] since
457 [% IF ( itemLoo.waitingdate ) %]
458 [% itemLoo.waitingdate | $KohaDates %]
460 [% IF ( itemLoo.reservedate ) %]
461 [% itemLoo.reservedate | html %]
466 <span class="notonhold">Not on hold</span>
467 [% END # / IF ( itemLoo.reservedate )%]
470 [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
472 </table> <!-- / #copiesrow_[% bibitemloo.biblionumber | html %] -->
473 [% IF unholdable_items %]
474 <button id="show_unholdable" class="btn btn-primary toggle_unholdable unholdable">Show unholdable items</button>
475 <button id="hide_unholdable" class="btn btn-primary toggle_unholdable unholdable" style="display:none;">Hide unholdable items</button>
478 [% END # / IF ( bibitemloo.itemholdable )%]
479 </div> <!-- / #hold-options-[% bibitemloo.biblionumber | html %] -->
481 [% END # / IF ( bibitemloo.holdable ) %]
482 </div> <!-- / .holdrow -->
483 [% END # / FOREACH bibitemloo IN bibitemloop %]
484 </div><!-- #bigloop -->
486 [% UNLESS ( none_available ) %]
487 <input type="submit" value="Confirm hold" class="btn btn-primary placehold" />
491 [% END # / UNLESS message %]
492 </div> <!-- / #holds -->
493 </div> <!-- / .container -->
494 </div> <!-- / .main -->
495 [% INCLUDE 'opac-bottom.inc' %]
496 [% BLOCK jsinclude %]
497 [% INCLUDE 'calendar.inc' %]
498 [% INCLUDE 'datatables.inc' %]
500 var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection.");
501 var MSG_EMPTY_DATE = _("Date should be filled.");
503 $(document).ready(function() {
505 $(".toggle_unholdable").click(function(e){
507 $(this).parent('div').find(".unholdable").toggle();
510 $("#hold-request-form").preventDoubleFormSubmit();
511 var copiesRowId = null;
512 var wasSpecific = false;
513 var lastCopiesRowId = null;
515 $(".toggle-hold-options").show();
516 $(".hold-options").hide();
517 var OPACMandatoryHoldDates = "[% Koha.Preference('OPACMandatoryHoldDates') | html %]";
518 if( OPACMandatoryHoldDates ) {
519 if( OPACMandatoryHoldDates == "start" || OPACMandatoryHoldDates == "both" ) $(".holddatefrom").prop( 'required', true );
520 if( OPACMandatoryHoldDates == "end" || OPACMandatoryHoldDates == "both" ) $(".futuredate").prop( 'required', true );
522 $(".holddatefrom,.futuredate").prop("readOnly", true);
524 $(".checkitem").parent().click(function(e){
525 if(e.target.tagName.toLowerCase() == 'td'){
526 $(this).find("input.checkitem").each( function() {
527 $(this).attr('checked', 'checked');
532 // click on a first td check the confirmjs checkbox
533 $("td.hold").click(function(e){
534 if(e.target.tagName.toLowerCase() == 'td'){
535 $(this).find("input.confirmjs").each( function() {
536 $(this).attr('checked', !$(this).attr('checked'));
542 $(".toggle-hold-options").on("click",function(e){
544 toggleLink = $(this);
545 var optionsID = this.id.replace("toggle-hold-options-","");
546 $("#hold-options-"+optionsID).toggle(0, function() {
547 toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
550 if( $(".holddatefrom").prop('required') || $(".futuredate").prop('required') ) $(".toggle-hold-options").click();
552 // Hides all 'specific copy' table rows on load.
553 $(".copiesrow").hide();
555 [% FOREACH bibitemloo IN bibitemloop %]
556 [% IF bibitemloo.force_hold %]
557 if( $("#to[% bibitemloo.biblionumber | html %]:hidden").length )
558 $("#toggle-hold-options-[% bibitemloo.biblionumber | html %]").click();
559 $("#reqspecific_[% bibitemloo.biblionumber | html %]").click();
560 $("#copiesrow_[% bibitemloo.biblionumber | html %]").show();
562 [% IF bibitemloo.reqholdnotes %]
563 $("#holdnotes_[% bibitemloo.biblionumber | html %]").attr( 'required', true );
567 // Replace non-JS single-selection with multi-selection capability.
568 $(".reserve_mode").val("multi");
569 $(".confirm_nonjs").remove();
570 $(".confirmjs_hold").each(function(){
571 var bib = $(this).attr("title");
572 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
573 html += "value=\"" + bib + "\" id=\"" + bib + "\" /> " + _("Place a hold on") + " </label> ";
576 $(".confirmjs_nohold").each(function(){
577 var bib = $(this).attr("title");
578 var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
579 html += "value=\"" + bib + "\" id=\"" + bib + "\" />" + _("Place a hold on: ") + "</label>";
583 // expand or collapse the copiesrow tr
584 function toggle_copiesrow(biblioNum) {
585 var checkbox = $("input:checkbox[value='"+biblioNum+"']");
586 newCopiesRowId = "#copiesrow_" + biblioNum;
587 var select_specific = $("#reqspecific_"+biblioNum).is(":checked");
588 // If the checkbox is checked AND we want a specific item, we display the items block
589 if ( $(checkbox).is(":checked") && select_specific ) {
590 $(newCopiesRowId).show();
592 $(newCopiesRowId).hide();
596 $("#place_on_hdr").show();
598 $(".place_on_type").show();
599 // onload, selectany is checked
600 $(".selectany").attr("checked", "checked");
603 // On confirmsjs change
604 $(".confirmjs").change(function(){
605 var id = suffixOf($(this).attr("id"), "_");
606 // If I m checked, I enable radio buttons
607 if ( $(this).is(":checked") ) {
608 $("#reqspecific_" + id).attr("disabled", false);
609 $("#reqany_" + id).attr("disabled", false);
611 // Else its are disabled
613 $("#reqspecific_" + id).attr("disabled", "disabled");
614 $("#reqany_" + id).attr("disabled", "disabled");
616 // expand or collaspe the items block
617 toggle_copiesrow(id);
620 // When 'specific copy' or 'first available' radio button is clicked
621 $(".selectspecific, .selectany").click(function() {
622 var id = suffixOf($(this).attr("id"), "_");
623 toggle_copiesrow(id);
626 // Show or hide holds notes
627 $(".shownotes").click(function(){
628 biblioNum = suffixOf($(this).attr("id"), "_");
629 $("#notesrow_"+biblioNum).toggle();
632 // When 'Place Hold' button is clicked
633 $(".placehold").click(function(){
634 var biblionumbers = "";
637 [% IF new_reserves_allowed %]
638 if ($(".confirmjs:checked").size() > [% new_reserves_allowed | html %] ) {
639 alert(MSG_MAX_HOLDS_EXCEEDED);
644 if ($(".confirmjs:checked").size() == 0) {
645 alert( __("No item was selected") );
649 // Find the items with the 'Hold' box checked
651 $(".confirmjs:checked").each(function() {
652 var biblioNum = $(this).val();
653 biblionumbers += biblioNum + "/";
654 selections += biblioNum + "/";
656 // If required hold note is empty, make it visible
657 if( $("#holdnotes_"+biblioNum).attr( 'required' ) && $("#holdnotes_"+biblioNum).val() == '' ) {
658 if( !$("#hold-options-"+biblioNum).is(':visible')) {
659 $("#toggle-hold-options-"+biblioNum).click();
663 if( $(".holddatefrom").prop('required') && $("#from"+ biblioNum).val() == '' ) {
664 alert(MSG_EMPTY_DATE);
666 if( $("#from"+biblioNum+":hidden").length ) $("#toggle-hold-options-"+biblioNum).click();
667 $("#from"+ biblioNum).focus();
669 } else if( $(".futuredate").prop('required') && $("#to"+ biblioNum).val() == '' ) {
670 alert(MSG_EMPTY_DATE);
672 if( $("#to"+biblioNum+":hidden").length ) $("#toggle-hold-options-"+biblioNum).click();
673 $("#to"+ biblioNum).focus();
677 // If the 'specific copy' radio button is checked
678 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
679 // Find the selected copy
680 var item = $(".checkitem_" + biblioNum + ":checked");
681 if ($(item).size() == 0) {
682 alert(MSG_NO_ITEM_SELECTED);
686 selections += $(item).val();
691 // Add the pickup location
692 var branchSel = $("#branch_" + biblioNum);
693 if (branchSel.size() > 0) {
694 selections += $(branchSel).val();
700 if (badBib) { // alert has been raised already
704 $("#selections").val(selections);
705 $("#biblionumbers").val(biblionumbers);
709 $(".itemstable").each(function(){
712 initComplete: function() {
713 this.find("input:radio").first().prop("checked", true );