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