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 1247-1254 Link Here
1247
                }
1247
                }
1248
            [% END %]
1248
            [% END %]
1249
1249
1250
            [% IF guarantor %]
1250
            [% IF new_guarantors %]
1251
                select_user( '[% guarantor.borrowernumber | html %]', [% To.json( guarantor.unblessed ) | $raw %] );
1251
                [% FOREACH g IN new_guarantors %]
1252
                    select_user( '[% g.patron.borrowernumber | html %]', [% To.json( g.patron.unblessed ) | $raw %], '[% g.relationship | html %]' );
1253
                [% END %]
1252
            [% END %]
1254
            [% END %]
1253
1255
1254
            $("#cn_max").hide();
1256
            $("#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
170
171
    if ( is_guarantor ) {
171
    if ( is_guarantor ) {
Lines 205-210 function select_user(borrowernumber, borrower) { Link Here
205
205
206
        $('#guarantor_relationships').append( fieldset );
206
        $('#guarantor_relationships').append( fieldset );
207
        fieldset.show();
207
        fieldset.show();
208
209
        if ( relationship ) {
210
            fieldset.find('.new_guarantor_relationship').val(relationship);
211
        }
208
    }
212
    }
209
213
210
    return 0;
214
    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