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