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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-2 / +4 lines)
Lines 1245-1252 Link Here
1245
                }
1245
                }
1246
            [% END %]
1246
            [% END %]
1247
1247
1248
            [% IF guarantor %]
1248
            [% IF new_guarantors %]
1249
                select_user( '[% guarantor.borrowernumber | html %]', [% To.json( guarantor.unblessed ) | $raw %] );
1249
                [% FOREACH g IN new_guarantors %]
1250
                    select_user( '[% g.patron.borrowernumber | html %]', [% To.json( g.patron.unblessed ) | $raw %], '[% g.relationship | html %]' );
1251
                [% END %]
1250
            [% END %]
1252
            [% END %]
1251
1253
1252
            $("#cn_max").hide();
1254
            $("#cn_max").hide();
(-)a/koha-tmpl/intranet-tmpl/prog/js/members.js (-1 / +5 lines)
Lines 165-171 function update_category_code(category_code) { Link Here
165
    $(mytables).find(" li[data-category_code='']").show();
165
    $(mytables).find(" li[data-category_code='']").show();
166
}
166
}
167
167
168
function select_user(borrowernumber, borrower) {
168
function select_user(borrowernumber, borrower, relationship) {
169
    let is_guarantor = $(`.guarantor-details[data-borrowernumber=${borrower.borrowernumber}]`).length;
169
    let is_guarantor = $(`.guarantor-details[data-borrowernumber=${borrower.borrowernumber}]`).length;
170
    console.log("LEN: "  + is_guarantor );
170
    console.log("LEN: "  + is_guarantor );
171
171
Lines 207-212 function select_user(borrowernumber, borrower) { Link Here
207
207
208
        $('#guarantor_relationships').append( fieldset );
208
        $('#guarantor_relationships').append( fieldset );
209
        fieldset.show();
209
        fieldset.show();
210
211
        if ( relationship ) {
212
            fieldset.find('.new_guarantor_relationship').val(relationship);
213
        }
210
    }
214
    }
211
215
212
    return 0;
216
    return 0;
(-)a/members/memberentry.pl (-1 / +13 lines)
Lines 261-266 if ( ( $op eq 'insert' ) and !$nodouble ) { Link Here
261
    if ( $patrons->count > 0) {
261
    if ( $patrons->count > 0) {
262
        $nodouble = 0;
262
        $nodouble = 0;
263
        $check_member = $patrons->next->borrowernumber;
263
        $check_member = $patrons->next->borrowernumber;
264
265
266
        my @new_guarantors;
267
        my @new_guarantor_id           = $input->multi_param('new_guarantor_id');
268
        my @new_guarantor_relationship = $input->multi_param('new_guarantor_relationship');
269
        foreach my $gid ( @new_guarantor_id ) {
270
            my $patron = Koha::Patrons->find( $gid );
271
            my $relationship = shift( @new_guarantor_relationship );
272
            next unless $patron;
273
            my $g = { patron => $patron, relationship => $relationship };
274
            push( @new_guarantors, $g );
275
        }
276
        $template->param( new_guarantors => \@new_guarantors );
264
    }
277
    }
265
}
278
}
266
279
267
- 

Return to bug 24113