Lines 229-255
Link Here
|
229 |
</li> |
229 |
</li> |
230 |
[% END # / IF OpacHoldNotes %] |
230 |
[% END # / IF OpacHoldNotes %] |
231 |
|
231 |
|
232 |
[% IF ( OPACItemHolds ) %] |
232 |
[% IF OPACItemHolds == '1' or OPACItemHolds == 'force' %] |
233 |
<!-- ITEM HOLDS --> |
233 |
<!-- ITEM HOLDS --> |
234 |
<li class="lradio"> |
234 |
<li class="lradio place_on_type" style="display:none;"> |
235 |
<label class="radio inline" for="reqany_[% bibitemloo.biblionumber %]">Next available copy</label> |
235 |
<label class="radio inline" for="reqany_[% bibitemloo.biblionumber %]">Next available copy</label> |
236 |
[% UNLESS ( bibitemloo.holdable ) %] |
236 |
[% IF OPACItemHolds == "1" %] |
237 |
<input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqany_[% bibitemloo.biblionumber %]" class="selectany" value="Any" disabled="disabled" /> |
237 |
<input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" |
|
|
238 |
id="reqany_[% bibitemloo.biblionumber %]" |
239 |
class="selectany" |
240 |
value="Any" |
241 |
checked="checked" |
242 |
/> |
238 |
[% ELSE %] |
243 |
[% ELSE %] |
239 |
<input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqany_[% bibitemloo.biblionumber %]" class="selectany" value="Any" checked="checked" /> |
244 |
<input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" |
|
|
245 |
id="reqany_[% bibitemloo.biblionumber %]" |
246 |
class="selectany" |
247 |
value="Any" |
248 |
/> |
240 |
[% END %] |
249 |
[% END %] |
241 |
|
|
|
242 |
<label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber %]">A specific copy</label> |
250 |
<label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber %]">A specific copy</label> |
243 |
[% UNLESS ( bibitemloo.holdable ) %] |
251 |
[% IF OPACItemHolds == "force" %] |
244 |
<input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqspecific_[% bibitemloo.biblionumber %]" class="selectspecific" disabled="disabled" value="Specific" /> |
252 |
<input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" |
|
|
253 |
id="reqspecific_[% bibitemloo.biblionumber %]" |
254 |
class="selectspecific" |
255 |
value="Specific" |
256 |
checked="checked" |
257 |
/> |
245 |
[% ELSE %] |
258 |
[% ELSE %] |
246 |
<input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqspecific_[% bibitemloo.biblionumber %]" class="selectspecific" value="Specific" /> |
259 |
<input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" |
|
|
260 |
id="reqspecific_[% bibitemloo.biblionumber %]" |
261 |
class="selectspecific" |
262 |
value="Specific" |
263 |
/> |
247 |
[% END %] |
264 |
[% END %] |
248 |
</li> |
265 |
</li> |
249 |
[% END # / IF OPACItemHolds %] |
266 |
[% END # / IF OPACItemHolds %] |
250 |
</ul> |
267 |
</ul> |
251 |
|
268 |
|
252 |
[% IF ( OPACItemHolds ) %] |
269 |
[% IF OPACItemHolds == '1' || OPACItemHolds == 'force' %] |
253 |
<table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber %]"> |
270 |
<table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber %]"> |
254 |
<caption>Select a specific copy:</caption> |
271 |
<caption>Select a specific copy:</caption> |
255 |
<tr> |
272 |
<tr> |
Lines 275-281
Link Here
|
275 |
[% IF ( itemLoo.available ) %] |
292 |
[% IF ( itemLoo.available ) %] |
276 |
<input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]" value="[% itemLoo.itemnumber %]" /> |
293 |
<input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]" value="[% itemLoo.itemnumber %]" /> |
277 |
[% ELSE %] |
294 |
[% ELSE %] |
278 |
<input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]" /> |
295 |
<input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]" |
|
|
296 |
style="display:none;" /> |
279 |
<img src="[% interface %]/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" /> |
297 |
<img src="[% interface %]/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" /> |
280 |
[% END %] |
298 |
[% END %] |
281 |
|
299 |
|
Lines 381-386
Link Here
|
381 |
$(this).closest("td").find("input").val(""); |
399 |
$(this).closest("td").find("input").val(""); |
382 |
e.preventDefault(); |
400 |
e.preventDefault(); |
383 |
}); |
401 |
}); |
|
|
402 |
|
403 |
// Select the first item available |
404 |
function select_first_available(id){ |
405 |
var radios = $("input:radio[name='checkitem_" + id + "']"); |
406 |
$(radios).first().attr("checked", "checked"); |
407 |
} |
408 |
|
384 |
$(document).ready(function() { |
409 |
$(document).ready(function() { |
385 |
$("#hold-request-form").preventDoubleFormSubmit(); |
410 |
$("#hold-request-form").preventDoubleFormSubmit(); |
386 |
var copiesRowId = null; |
411 |
var copiesRowId = null; |
Lines 389-398
Link Here
|
389 |
$(".checkitem").parent().click(function(e){ |
414 |
$(".checkitem").parent().click(function(e){ |
390 |
if(e.target.tagName.toLowerCase() == 'td'){ |
415 |
if(e.target.tagName.toLowerCase() == 'td'){ |
391 |
$(this).find("input.checkitem").each( function() { |
416 |
$(this).find("input.checkitem").each( function() { |
392 |
$(this).attr('checked', !$(this).attr('checked')); |
417 |
$(this).attr('checked', 'checked'); |
393 |
}); |
418 |
}); |
394 |
} |
419 |
} |
395 |
}); |
420 |
}); |
|
|
421 |
|
422 |
[% FOREACH bibitemloo IN bibitemloop %] |
423 |
[% IF bibitemloo.holdable %] |
424 |
[% IF OPACItemHolds == 'force' %] |
425 |
$("#copiesrow_[% bibitemloo.biblionumber %]").show(); |
426 |
[% END %] |
427 |
[% END %] |
428 |
[% END %] |
429 |
|
430 |
|
431 |
// click on a first td check the confirmjs checkbox |
432 |
$("td.hold").click(function(e){ |
433 |
if(e.target.tagName.toLowerCase() == 'td'){ |
434 |
$(this).find("input.confirmjs").each( function() { |
435 |
$(this).attr('checked', !$(this).attr('checked')); |
436 |
$(this).change(); |
437 |
}); |
438 |
} |
439 |
}); |
440 |
|
396 |
// Hides all 'specific copy' table rows on load. |
441 |
// Hides all 'specific copy' table rows on load. |
397 |
$(".copiesrow").hide(); |
442 |
$(".copiesrow").hide(); |
398 |
|
443 |
|
Lines 405-413
Link Here
|
405 |
} |
450 |
} |
406 |
}); |
451 |
}); |
407 |
|
452 |
|
408 |
$("#place_on_hdr").show(); |
453 |
$(".toggle-hold-options").show(); |
409 |
$(".place_on_type").show(); |
|
|
410 |
$("#place_on_hdr,.place_on_type,.toggle-hold-options").show(); |
411 |
$(".hold-options").hide(); |
454 |
$(".hold-options").hide(); |
412 |
$(".holddatefrom,.holddateto").prop("readOnly", true); |
455 |
$(".holddatefrom,.holddateto").prop("readOnly", true); |
413 |
|
456 |
|
Lines 431-494
Link Here
|
431 |
$(".confirmjs_hold").each(function(){ |
474 |
$(".confirmjs_hold").each(function(){ |
432 |
var bib = $(this).attr("title"); |
475 |
var bib = $(this).attr("title"); |
433 |
var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\""; |
476 |
var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\""; |
434 |
html += "value=\"" + bib + "\"/> " + _("Place a hold on") + " </label> "; |
477 |
html += "value=\"" + bib + "\" id=\"" + bib + "\" /> " + _("Place a hold on") + " </label> "; |
435 |
$(this).html(html); |
478 |
$(this).html(html); |
436 |
}); |
479 |
}); |
437 |
$(".confirmjs_nohold").each(function(){ |
480 |
$(".confirmjs_nohold").each(function(){ |
438 |
var bib = $(this).attr("title"); |
481 |
var bib = $(this).attr("title"); |
439 |
var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\""; |
482 |
var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\""; |
440 |
html += "value=\"" + bib + "\"/>" + _("Place a hold on: ") + "</label>"; |
483 |
html += "value=\"" + bib + "\" id=\"" + bib + "\" />" + _("Place a hold on: ") + "</label>"; |
441 |
$(this).html(html); |
484 |
$(this).html(html); |
442 |
}); |
485 |
}); |
443 |
|
486 |
|
444 |
// Make sure a specific item was selected where specified |
487 |
// expand or collapse the copiesrow tr |
445 |
// before moving on to a new item. |
488 |
function toggle_copiesrow(biblioNum) { |
446 |
function changeSelection (newCopiesRowId, isSpecific) { |
489 |
var checkbox = $("input:checkbox[value='"+biblioNum+"']"); |
447 |
if (copiesRowId && ((copiesRowId != newCopiesRowId) || (wasSpecific != isSpecific))) { |
490 |
newCopiesRowId = "#copiesrow_" + biblioNum; |
448 |
var biblioNum = suffixOf(copiesRowId, "_"); |
491 |
var select_specific = $("#reqspecific_"+biblioNum).is(":checked"); |
|
|
492 |
// If the checkbox is checked AND we want a specific item, we display the items block |
493 |
if ( $(checkbox).is(":checked") && select_specific ) { |
494 |
$(newCopiesRowId).show(); |
495 |
} else { |
496 |
$(newCopiesRowId).hide(); |
497 |
} |
498 |
}; |
449 |
|
499 |
|
450 |
// If the 'specific copy' radio button was checked |
500 |
$("#place_on_hdr").show(); |
451 |
if (wasSpecific && (copiesRowId != newCopiesRowId)) { |
|
|
452 |
// Find the selected copy |
453 |
var item = $(".checkitem_" + biblioNum + ":checked"); |
454 |
if ($(item).size() == 0) { |
455 |
alert(MSG_NO_COPY_SELECTED); |
456 |
return false; |
457 |
} |
458 |
} |
459 |
} |
460 |
copiesRowId = newCopiesRowId; |
461 |
wasSpecific = isSpecific; |
462 |
return true; |
463 |
} |
464 |
|
501 |
|
465 |
// When 'specific copy' radio button is clicked |
502 |
[% IF OPACItemHolds == '1' %] |
466 |
$(".selectspecific").click(function() { |
503 |
$(".place_on_type").show(); |
|
|
504 |
// onload, selectany is checked |
505 |
$(".selectany").attr("checked", "checked"); |
506 |
[% END %] |
467 |
|
507 |
|
468 |
// Make sure all other specific copy table rows are hidden |
508 |
// If we can choose a specific item, we preselect the first one |
469 |
biblioNum = suffixOf($(this).attr("id"), "_"); |
509 |
[% IF OPACItemHolds =="1" or OPACItemHolds == 'force' %] |
470 |
newCopiesRowId = "#copiesrow_" + biblioNum; |
510 |
$("table.copiesrow").each(function(){ |
|
|
511 |
var id = suffixOf($(this).attr("id"), "_"); |
512 |
select_first_available(id); |
513 |
}); |
514 |
[% END %] |
471 |
|
515 |
|
472 |
if (!changeSelection(newCopiesRowId, true)) { |
516 |
// On confirmsjs change |
473 |
return false; |
517 |
$(".confirmjs").change(function(){ |
|
|
518 |
var id = suffixOf($(this).attr("id"), "_"); |
519 |
// If I m checked, I enable radio buttons |
520 |
if ( $(this).is(":checked") ) { |
521 |
$("#reqspecific_" + id).attr("disabled", false); |
522 |
$("#reqany_" + id).attr("disabled", false); |
523 |
} |
524 |
// Else its are disabled |
525 |
else { |
526 |
$("#reqspecific_" + id).attr("disabled", "disabled"); |
527 |
$("#reqany_" + id).attr("disabled", "disabled"); |
474 |
} |
528 |
} |
|
|
529 |
// expand or collaspe the items block |
530 |
toggle_copiesrow(id); |
531 |
}); |
475 |
|
532 |
|
476 |
// Show the specific copy table for this radio button. |
533 |
// When 'specific copy' or 'first available' radio button is clicked |
477 |
$(newCopiesRowId).show(); |
534 |
$(".selectspecific, .selectany").click(function() { |
|
|
535 |
var id = suffixOf($(this).attr("id"), "_"); |
536 |
toggle_copiesrow(id); |
478 |
}); |
537 |
}); |
479 |
|
538 |
|
480 |
// When 'first available' radion button is clicked |
539 |
// Show or hide holds notes |
481 |
$(".selectany").click(function() { |
540 |
$(".shownotes").click(function(){ |
482 |
// Make sure all other specific copy table rows are hidden |
|
|
483 |
biblioNum = suffixOf($(this).attr("id"), "_"); |
541 |
biblioNum = suffixOf($(this).attr("id"), "_"); |
484 |
newCopiesRowId = "#copiesrow_" + biblioNum; |
542 |
$("#notesrow_"+biblioNum).toggle(); |
485 |
|
|
|
486 |
if (!changeSelection(newCopiesRowId, false)) { |
487 |
return false; |
488 |
} |
489 |
|
490 |
// Hide the copies table row |
491 |
$(newCopiesRowId).hide(); |
492 |
}); |
543 |
}); |
493 |
|
544 |
|
494 |
// When 'Place Hold' button is clicked |
545 |
// When 'Place Hold' button is clicked |
495 |
- |
|
|