|
Lines 151-156
Link Here
|
| 151 |
[% FOREACH bibitemloo IN bibitemloop %] |
151 |
[% FOREACH bibitemloo IN bibitemloop %] |
| 152 |
<div class="holdrow"> |
152 |
<div class="holdrow"> |
| 153 |
<input id="remaining_holds_[% bibitemloo.biblionumber | html %]" type="hidden" value="[% bibitemloo.remaining_holds_for_record | html %]"/> |
153 |
<input id="remaining_holds_[% bibitemloo.biblionumber | html %]" type="hidden" value="[% bibitemloo.remaining_holds_for_record | html %]"/> |
|
|
154 |
<input id="remaining_holds_allowed_today[% bibitemloo.biblionumber | html %]" type="hidden" value="[% bibitemloo.remaining_holds_allowed_today | html %]"/> |
| 154 |
<p> |
155 |
<p> |
| 155 |
[% IF ( bibitemloo.holdable ) %] |
156 |
[% IF ( bibitemloo.holdable ) %] |
| 156 |
<span title="[% bibitemloo.biblionumber | html %]" style="padding:.3em"> |
157 |
<span title="[% bibitemloo.biblionumber | html %]" style="padding:.3em"> |
|
Lines 298-305
Link Here
|
| 298 |
</li> |
299 |
</li> |
| 299 |
[% END # / IF OpacHoldNotes %] |
300 |
[% END # / IF OpacHoldNotes %] |
| 300 |
|
301 |
|
|
|
302 |
[% IF bibitemloo.itemholdable %] |
| 301 |
<!-- ITEM HOLDS --> |
303 |
<!-- ITEM HOLDS --> |
| 302 |
<li class="lradio place_on_type" style="display:none;"> |
304 |
<li class="lradio place_on_type" style="display:none;"> |
|
|
305 |
[% IF NOT bibitemloo.force_hold %] |
| 303 |
<label class="radio inline" for="reqany_[% bibitemloo.biblionumber | html %]">Next available item</label> |
306 |
<label class="radio inline" for="reqany_[% bibitemloo.biblionumber | html %]">Next available item</label> |
| 304 |
<input type="radio" name="reqtype_[% bibitemloo.biblionumber | html %]" |
307 |
<input type="radio" name="reqtype_[% bibitemloo.biblionumber | html %]" |
| 305 |
id="reqany_[% bibitemloo.biblionumber | html %]" |
308 |
id="reqany_[% bibitemloo.biblionumber | html %]" |
|
Lines 307-312
Link Here
|
| 307 |
value="Any" |
310 |
value="Any" |
| 308 |
checked="checked" |
311 |
checked="checked" |
| 309 |
/> |
312 |
/> |
|
|
313 |
[% END %] |
| 310 |
<label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber | html %]">A specific item</label> |
314 |
<label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber | html %]">A specific item</label> |
| 311 |
<input type="radio" name="reqtype_[% bibitemloo.biblionumber | html %]" |
315 |
<input type="radio" name="reqtype_[% bibitemloo.biblionumber | html %]" |
| 312 |
id="reqspecific_[% bibitemloo.biblionumber | html %]" |
316 |
id="reqspecific_[% bibitemloo.biblionumber | html %]" |
|
Lines 314-319
Link Here
|
| 314 |
value="Specific" |
318 |
value="Specific" |
| 315 |
/> |
319 |
/> |
| 316 |
</li> |
320 |
</li> |
|
|
321 |
[% END # / IF bibitemloo.itemholdable %] |
| 317 |
</ul> |
322 |
</ul> |
| 318 |
|
323 |
|
| 319 |
[% IF bibitemloo.remaining_holds_for_record > 1 %] |
324 |
[% IF bibitemloo.remaining_holds_for_record > 1 %] |
|
Lines 321-327
Link Here
|
| 321 |
<div id="holds_to_place_[% bibitemloo.biblionumber | html %]" class="hold-options holds-to-place"> |
326 |
<div id="holds_to_place_[% bibitemloo.biblionumber | html %]" class="hold-options holds-to-place"> |
| 322 |
<label>Holds to place (count)</label> |
327 |
<label>Holds to place (count)</label> |
| 323 |
<select name="holds_to_place_count_[% bibitemloo.biblionumber | html %]"> |
328 |
<select name="holds_to_place_count_[% bibitemloo.biblionumber | html %]"> |
| 324 |
[% WHILE count <= bibitemloo.remaining_holds_for_record %] |
329 |
[% WHILE count <= bibitemloo.lowest_value %] |
| 325 |
<option value="[% count | html %]">[% count | html %]</option> |
330 |
<option value="[% count | html %]">[% count | html %]</option> |
| 326 |
[% SET count = count + 1 %] |
331 |
[% SET count = count + 1 %] |
| 327 |
[% END %] |
332 |
[% END %] |
|
Lines 458-464
Link Here
|
| 458 |
<script> |
463 |
<script> |
| 459 |
// <![CDATA[ |
464 |
// <![CDATA[ |
| 460 |
var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection."); |
465 |
var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection."); |
| 461 |
var MSG_MAX_HOLDS_EXCEEDED = _("Maximum number of reserve exceded."); |
466 |
var MSG_MAX_HOLDS_EXCEEDED = _("Maximum number of holds for this record reached."); |
|
|
467 |
var MSG_EXCEEDED_HOLDS_PER_DAY = _("Maximum number of holds allowed today reached."); |
| 468 |
var MSG_EXCEEDED_MAXRESERVES_SYSPREF = _("Maximum number of holds allowed at once reached"); |
| 462 |
|
469 |
|
| 463 |
// Clear the contents of an input field |
470 |
// Clear the contents of an input field |
| 464 |
$(".clearfield").on("click",function(e){ |
471 |
$(".clearfield").on("click",function(e){ |
|
Lines 494-505
Link Here
|
| 494 |
var bibNum = suffixOf($(this).attr("name"), "_"); |
501 |
var bibNum = suffixOf($(this).attr("name"), "_"); |
| 495 |
var nbCheked = $("input[name='checkitem_"+bibNum+"']:checked").length; |
502 |
var nbCheked = $("input[name='checkitem_"+bibNum+"']:checked").length; |
| 496 |
var remaining = $("input[id='remaining_holds_"+bibNum+"']").val(); |
503 |
var remaining = $("input[id='remaining_holds_"+bibNum+"']").val(); |
|
|
504 |
var remaining_holds_today = $("input[id='remaining_holds_allowed_today"+bibNum+"']").val(); |
| 505 |
var maxreserves = "[% maxreserves | html %]"; |
| 497 |
if (nbCheked >= remaining) { |
506 |
if (nbCheked >= remaining) { |
|
|
507 |
alert(MSG_MAX_HOLDS_EXCEEDED); |
| 508 |
$("input[name='checkitem_"+bibNum+"']:not(:checked)").attr('disabled', 'disabled'); |
| 509 |
} |
| 510 |
else if (nbCheked >= remaining_holds_today) { |
| 511 |
alert(MSG_EXCEEDED_HOLDS_PER_DAY); |
| 512 |
$("input[name='checkitem_"+bibNum+"']:not(:checked)").attr('disabled', 'disabled'); |
| 513 |
} |
| 514 |
else if (nbCheked >= maxreserves) { |
| 515 |
alert(MSG_EXCEEDED_MAXRESERVES_SYSPREF); |
| 498 |
$("input[name='checkitem_"+bibNum+"']:not(:checked)").attr('disabled', 'disabled'); |
516 |
$("input[name='checkitem_"+bibNum+"']:not(:checked)").attr('disabled', 'disabled'); |
| 499 |
} |
517 |
} |
| 500 |
else { |
518 |
else { |
| 501 |
$('.checkitem_'+bibNum).attr('disabled', false); |
519 |
$('.checkitem_'+bibNum).attr('disabled', false); |
| 502 |
} |
520 |
} |
|
|
521 |
|
| 503 |
}); |
522 |
}); |
| 504 |
|
523 |
|
| 505 |
$(".toggle-hold-options").on("click",function(e){ |
524 |
$(".toggle-hold-options").on("click",function(e){ |
|
Lines 526-533
Link Here
|
| 526 |
$("#toggle-hold-options-[% bibitemloo.biblionumber | html %]").click(); |
545 |
$("#toggle-hold-options-[% bibitemloo.biblionumber | html %]").click(); |
| 527 |
$("#reqany_[% bibitemloo.biblionumber | html %]").attr('checked', true); |
546 |
$("#reqany_[% bibitemloo.biblionumber | html %]").attr('checked', true); |
| 528 |
[% END %] |
547 |
[% END %] |
| 529 |
$("#reqany_[% bibitemloo.biblionumber | html %]").attr('disabled', 'disabled'); |
|
|
| 530 |
$("#reqspecific_[% bibitemloo.biblionumber | html %]").attr('disabled', 'disabled'); |
| 531 |
[% END %] |
548 |
[% END %] |
| 532 |
[% IF bibitemloo.reqholdnotes %] |
549 |
[% IF bibitemloo.reqholdnotes %] |
| 533 |
$("#holdnotes_[% bibitemloo.biblionumber | html %]").attr( 'required', true ); |
550 |
$("#holdnotes_[% bibitemloo.biblionumber | html %]").attr( 'required', true ); |
|
Lines 558-563
Link Here
|
| 558 |
if ( $(checkbox).is(":checked") && select_specific ) { |
575 |
if ( $(checkbox).is(":checked") && select_specific ) { |
| 559 |
$(newCopiesRowId).show(); |
576 |
$(newCopiesRowId).show(); |
| 560 |
$(holdsToPlaceCountId).hide(); |
577 |
$(holdsToPlaceCountId).hide(); |
|
|
578 |
|
| 579 |
//Check if maximum holds is reached and if it has then disable un-checked item checkboxes and display message |
| 580 |
var nbCheked = 1; |
| 581 |
var remaining = $("input[id='remaining_holds_"+biblioNum+"']").val(); |
| 582 |
var remaining_holds_today = $("input[id='remaining_holds_allowed_today"+biblioNum+"']").val(); |
| 583 |
var maxreserves = "[% maxreserves | html %]"; |
| 584 |
if (nbCheked == remaining) { |
| 585 |
if (remaining != '1') { |
| 586 |
alert(MSG_MAX_HOLDS_EXCEEDED); |
| 587 |
} |
| 588 |
$("input[name='checkitem_"+biblioNum+"']:not(:checked)").attr('disabled', 'disabled'); |
| 589 |
} |
| 590 |
else if (nbCheked == remaining_holds_today) { |
| 591 |
if (remaining_holds_today != '1') { |
| 592 |
alert(MSG_EXCEEDED_HOLDS_PER_DAY); |
| 593 |
} |
| 594 |
$("input[name='checkitem_"+biblioNum+"']:not(:checked)").attr('disabled', 'disabled'); |
| 595 |
} |
| 596 |
else if (nbCheked == maxreserves) { |
| 597 |
if (maxreserves != '1') { |
| 598 |
alert(MSG_EXCEEDED_MAXRESERVES_SYSPREF); |
| 599 |
} |
| 600 |
$("input[name='checkitem_"+biblioNum+"']:not(:checked)").attr('disabled', 'disabled'); |
| 601 |
} |
| 602 |
|
| 561 |
} else { |
603 |
} else { |
| 562 |
$(newCopiesRowId).hide(); |
604 |
$(newCopiesRowId).hide(); |
| 563 |
$(holdsToPlaceCountId).show(); |
605 |
$(holdsToPlaceCountId).show(); |