View | Details | Raw Unified | Return to bug 26597
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (+3 lines)
Lines 1930-1935 legend:hover { Link Here
1930
            });
1930
            });
1931
        [% END %]
1931
        [% END %]
1932
        $("#guarantor_template").hide();
1932
        $("#guarantor_template").hide();
1933
        [% IF guarantor_attributes %]
1934
            guarantor_attributes = [% To.json(guarantor_attributes) %];
1935
        [% END %]
1933
1936
1934
    </script>
1937
    </script>
1935
    [% Asset.js("js/members.js") | $raw %]
1938
    [% Asset.js("js/members.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/members.js (+16 lines)
Lines 121-126 function select_user(borrowernumber, borrower, relationship) { Link Here
121
        if ( relationship ) {
121
        if ( relationship ) {
122
            fieldset.find('.new_guarantor_relationship').val(relationship);
122
            fieldset.find('.new_guarantor_relationship').val(relationship);
123
        }
123
        }
124
125
        if(typeof guarantor_attributes !== 'undefined') {
126
            $.ajax({
127
                url: '/api/v1/patrons/'+borrowernumber,
128
                method: "GET",
129
                dataType: 'json',
130
                success: function(data){
131
                    for (var i = 0; i < parseInt(guarantor_attributes.length, 10); i++) {
132
                        var attribute = guarantor_attributes[i];
133
                        if ( data[attribute] != null && document.forms.entryform[attribute].value == "" ) {
134
                            document.forms.entryform[attribute].value = data[attribute];
135
                        }
136
                    }
137
                }
138
            });
139
        }
124
    }
140
    }
125
141
126
    return 0;
142
    return 0;
(-)a/members/memberentry.pl (-1 / +1 lines)
Lines 613-618 if (C4::Context->preference("IndependentBranches")) { Link Here
613
# Define the fields to be pre-filled in guarantee records
613
# Define the fields to be pre-filled in guarantee records
614
my $prefillguarantorfields=C4::Context->preference("PrefillGuaranteeField");
614
my $prefillguarantorfields=C4::Context->preference("PrefillGuaranteeField");
615
my @prefill_fields=split(/\,/,$prefillguarantorfields);
615
my @prefill_fields=split(/\,/,$prefillguarantorfields);
616
$template->param( guarantor_attributes => \@prefill_fields );
616
617
617
if ($op eq 'add'){
618
if ($op eq 'add'){
618
    if ($guarantor_id) {
619
    if ($guarantor_id) {
619
- 

Return to bug 26597