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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-1 / +1 lines)
Lines 1779-1785 Link Here
1779
1779
1780
            [% IF new_guarantors %]
1780
            [% IF new_guarantors %]
1781
                [% FOREACH g IN new_guarantors %]
1781
                [% FOREACH g IN new_guarantors %]
1782
                    select_user( '[% g.patron.borrowernumber | html %]', [% To.json( g.patron.unblessed ) | $raw %], '[% g.relationship | html %]' );
1782
                    select_user( '[% g.patron.borrowernumber | html %]', [% To.json( g.patron.unblessed ) | $raw %], '[% g.relationship | html %]', [% nok | $raw %] );
1783
                [% END %]
1783
                [% END %]
1784
            [% END %]
1784
            [% END %]
1785
1785
(-)a/koha-tmpl/intranet-tmpl/prog/js/members.js (-3 / +2 lines)
Lines 90-101 function update_category_code(category_code) { Link Here
90
    hint.html(hint_string);
90
    hint.html(hint_string);
91
}
91
}
92
92
93
function select_user(borrowernumber, borrower, relationship) {
93
function select_user(borrowernumber, borrower, relationship, nok) {
94
    let is_guarantor = $(
94
    let is_guarantor = $(
95
        `.guarantor-details[data-borrowernumber=${borrowernumber}]`
95
        `.guarantor-details[data-borrowernumber=${borrowernumber}]`
96
    ).length;
96
    ).length;
97
97
98
    if (is_guarantor) {
98
    if (is_guarantor && !nok) {
99
        alert("Patron is already a guarantor for this patron");
99
        alert("Patron is already a guarantor for this patron");
100
    } else {
100
    } else {
101
        $("#guarantor_id").val(borrowernumber);
101
        $("#guarantor_id").val(borrowernumber);
102
- 

Return to bug 40116