|
Lines 567-594
Link Here
|
| 567 |
}); |
567 |
}); |
| 568 |
return false; |
568 |
return false; |
| 569 |
}); |
569 |
}); |
| 570 |
} |
|
|
| 571 |
|
570 |
|
| 572 |
$('select[name="patron_attributes"]').change(function () { |
571 |
$('select[name="patron_attributes"]').change(function() { |
| 573 |
updateAttrValues(this); |
572 |
updateAttrValues(this); |
| 574 |
}); |
573 |
} ); |
| 575 |
|
574 |
|
| 576 |
$('select[name="patron_attributes"]').change(); |
575 |
$('select[name="patron_attributes"]').change(); |
| 577 |
|
576 |
|
| 578 |
$(".clear-date").on("click", function (e) { |
577 |
$(".clear-date").on("click",function(e){ |
| 579 |
e.preventDefault(); |
578 |
e.preventDefault(); |
| 580 |
var fieldID = this.id.replace("clear-date-", ""); |
579 |
var fieldID = this.id.replace("clear-date-",""); |
| 581 |
$("#" + fieldID).val(""); |
580 |
$("#" + fieldID).val(""); |
| 582 |
}); |
581 |
}); |
| 583 |
$("#cataloguing_additem_newitem").on("click", ".add_attributes", function (e) { |
582 |
$("#cataloguing_additem_newitem").on("click",".add_attributes",function(e){ |
| 584 |
e.preventDefault(); |
583 |
e.preventDefault(); |
| 585 |
add_attributes(); |
584 |
add_attributes(); |
| 586 |
}); |
585 |
}); |
| 587 |
$("#cataloguing_additem_newitem").on("click", ".del_attributes", function (e) { |
586 |
$("#cataloguing_additem_newitem").on("click",".del_attributes",function(e){ |
| 588 |
e.preventDefault(); |
587 |
e.preventDefault(); |
| 589 |
del_attributes(this); |
588 |
del_attributes(this); |
| 590 |
}); |
589 |
}); |
| 591 |
$("#patron_batchmod_form").on("submit", function () { |
590 |
|
|
|
591 |
$('form[name="f"]').on("submit", function(){ |
| 592 |
// Add the checkboxes to the DOM before we submit the form |
| 593 |
var form = this; |
| 594 |
var checkboxes = $(patron_table).find('input:checkbox:checked').serializeArray(); |
| 595 |
$.each(checkboxes, function(){ |
| 596 |
let borrowernumber = this.value; |
| 597 |
if(!$(form).find('input[name="borrowernumber"][value="'+borrowernumber+'"]').length){ |
| 598 |
$(form).append( |
| 599 |
$('<input>') |
| 600 |
.attr('type', 'hidden') |
| 601 |
.attr('name', 'borrowernumber') |
| 602 |
.val(borrowernumber) |
| 603 |
); |
| 604 |
} |
| 605 |
}); |
| 606 |
}); |
| 607 |
} |
| 608 |
|
| 609 |
$("#patron_batchmod_form").on("submit", function(){ |
| 592 |
/* Reset form fields on inactive tabs */ |
610 |
/* Reset form fields on inactive tabs */ |
| 593 |
var tab = $(this).find("ul.nav-tabs li a.active").attr("href"); |
611 |
var tab = $(this).find("ul.nav-tabs li a.active").attr("href"); |
| 594 |
if (tab == "#usecardnumber_panel") { |
612 |
if (tab == "#usecardnumber_panel") { |
|
Lines 600-617
Link Here
|
| 600 |
$("#borrowernumberuploadfile, #cardnumberuploadfile, #borrowernumberlist, #cardnumberlist").val(""); |
618 |
$("#borrowernumberuploadfile, #cardnumberuploadfile, #borrowernumberlist, #cardnumberlist").val(""); |
| 601 |
} |
619 |
} |
| 602 |
}); |
620 |
}); |
| 603 |
|
|
|
| 604 |
$('form[name="f"]').on("submit", function () { |
| 605 |
// Add the checkboxes to the DOM before we submit the form |
| 606 |
var form = this; |
| 607 |
var checkboxes = $(patron_table).find("input:checkbox:checked").serializeArray(); |
| 608 |
$.each(checkboxes, function () { |
| 609 |
let borrowernumber = this.value; |
| 610 |
if (!$(form).find('input[name="borrowernumber"][value="' + borrowernumber + '"]').length) { |
| 611 |
$(form).append($("<input>").attr("type", "hidden").attr("name", "borrowernumber").val(borrowernumber)); |
| 612 |
} |
| 613 |
}); |
| 614 |
}); |
| 615 |
}); |
621 |
}); |
| 616 |
|
622 |
|
| 617 |
function updateAttrValues(select_attr) { |
623 |
function updateAttrValues(select_attr) { |
| 618 |
- |
|
|