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 1971-1976 legend:hover { Link Here
1971
        [% IF guarantor_attributes %]
1971
        [% IF guarantor_attributes %]
1972
            guarantor_attributes = [% To.json(guarantor_attributes) %];
1972
            guarantor_attributes = [% To.json(guarantor_attributes) %];
1973
        [% END %]
1973
        [% END %]
1974
        [% IF to_api_mapping %]
1975
            to_api_mapping = [% To.json(to_api_mapping) %];
1976
        [% END %]
1974
1977
1975
        var TalkingTechItivaPhoneNotification = [% Koha.Preference('TalkingTechItivaPhoneNotification') || 0 | html %];
1978
        var TalkingTechItivaPhoneNotification = [% Koha.Preference('TalkingTechItivaPhoneNotification') || 0 | html %];
1976
        var PhoneNotification = [% Koha.Preference('PhoneNotification') || 0 | html %];
1979
        var PhoneNotification = [% Koha.Preference('PhoneNotification') || 0 | html %];
(-)a/koha-tmpl/intranet-tmpl/prog/js/members.js (-5 / +6 lines)
Lines 122-137 function select_user(borrowernumber, borrower, relationship) { Link Here
122
            fieldset.find('.new_guarantor_relationship').val(relationship);
122
            fieldset.find('.new_guarantor_relationship').val(relationship);
123
        }
123
        }
124
124
125
        if(typeof guarantor_attributes !== 'undefined') {
125
        if(typeof guarantor_attributes !== 'undefined' && to_api_mapping) {
126
            $.ajax({
126
            $.ajax({
127
                url: '/api/v1/patrons/'+borrowernumber,
127
                url: '/api/v1/patrons/'+borrowernumber,
128
                method: "GET",
128
                method: "GET",
129
                dataType: 'json',
129
                dataType: 'json',
130
                success: function(data){
130
                success: function(data){
131
                    for (var i = 0; i < parseInt(guarantor_attributes.length, 10); i++) {
131
                    for (let i = 0; i < parseInt(guarantor_attributes.length, 10); i++) {
132
                        var attribute = guarantor_attributes[i];
132
                        let attribute = guarantor_attributes[i];
133
                        if ( data[attribute] != null && document.forms.entryform[attribute].value == "" ) {
133
                        let key_data = to_api_mapping[attribute] || attribute;
134
                            document.forms.entryform[attribute].value = data[attribute];
134
                        if(data[key_data] != null && attribute in document.forms.entryform && document.forms.entryform[attribute].value == ""){
135
                            document.forms.entryform[attribute].value = data[key_data];
135
                        }
136
                        }
136
                    }
137
                    }
137
                }
138
                }
(-)a/members/memberentry.pl (-2 / +4 lines)
Lines 625-631 if (C4::Context->preference("IndependentBranches")) { Link Here
625
# Define the fields to be pre-filled in guarantee records
625
# Define the fields to be pre-filled in guarantee records
626
my $prefillguarantorfields=C4::Context->preference("PrefillGuaranteeField");
626
my $prefillguarantorfields=C4::Context->preference("PrefillGuaranteeField");
627
my @prefill_fields=split(/\,/,$prefillguarantorfields);
627
my @prefill_fields=split(/\,/,$prefillguarantorfields);
628
$template->param( guarantor_attributes => \@prefill_fields );
628
$template->param(
629
    guarantor_attributes => \@prefill_fields,
630
    to_api_mapping => Koha::Patron->new->to_api_mapping
631
 );
629
632
630
if ($op eq 'add'){
633
if ($op eq 'add'){
631
    if ($guarantor_id) {
634
    if ($guarantor_id) {
632
- 

Return to bug 26597