});
[% END %]
$("#guarantor_template").hide();
[% IF guarantor_attributes %]
guarantor_attributes = [% To.json(guarantor_attributes) %];
var TalkingTechItivaPhoneNotification = [% Koha.Preference('TalkingTechItivaPhoneNotification') || 0 | html %];
var PhoneNotification = [% Koha.Preference('PhoneNotification') || 0 | html %];
if ( relationship ) {
fieldset.find('.new_guarantor_relationship').val(relationship);
}
if(typeof guarantor_attributes !== 'undefined') {
$.ajax({
url: '/api/v1/patrons/'+borrowernumber,
method: "GET",
dataType: 'json',
success: function(data){
for (var i = 0; i < parseInt(guarantor_attributes.length, 10); i++) {
var attribute = guarantor_attributes[i];
if ( data[attribute] != null && document.forms.entryform[attribute].value == "" ) {
document.forms.entryform[attribute].value = data[attribute];
return 0;
# Define the fields to be pre-filled in guarantee records
my $prefillguarantorfields=C4::Context->preference("PrefillGuaranteeField");
my @prefill_fields=split(/\,/,$prefillguarantorfields);
$template->param( guarantor_attributes => \@prefill_fields );
if ($op eq 'add'){
if ($guarantor_id) {
-