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

(-)a/Koha/Patron/Debarments.pm (-2 / +14 lines)
Lines 20-25 package Koha::Patron::Debarments; Link Here
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use C4::Context;
22
use C4::Context;
23
use C4::Log qw( logaction );
23
24
24
use Koha::Patron::Restriction::Types;
25
use Koha::Patron::Restriction::Types;
25
use Koha::Patron::Restrictions;
26
use Koha::Patron::Restrictions;
Lines 86-91 sub AddDebarment { Link Here
86
87
87
    UpdateBorrowerDebarmentFlags($borrowernumber);
88
    UpdateBorrowerDebarmentFlags($borrowernumber);
88
89
90
    logaction( "MEMBERS", "CREATE_RESTRICTION", $borrowernumber, $restriction )
91
        if C4::Context->preference("BorrowersLog");
92
89
    return $restriction ? 1 : 0;
93
    return $restriction ? 1 : 0;
90
}
94
}
91
95
Lines 108-113 sub DelDebarment { Link Here
108
112
109
    UpdateBorrowerDebarmentFlags($borrowernumber);
113
    UpdateBorrowerDebarmentFlags($borrowernumber);
110
114
115
    logaction( "MEMBERS", "DELETE_RESTRICTION", $borrowernumber, q{} )
116
        if C4::Context->preference("BorrowersLog");
117
111
    return $r;
118
    return $r;
112
}
119
}
113
120
Lines 149-155 sub ModDebarment { Link Here
149
156
150
    my $r = C4::Context->dbh->do( $sql, {}, ( @values, $borrower_debarment_id ) );
157
    my $r = C4::Context->dbh->do( $sql, {}, ( @values, $borrower_debarment_id ) );
151
158
152
    UpdateBorrowerDebarmentFlags( _GetBorrowernumberByDebarmentId($borrower_debarment_id) );
159
    my $borrowernumber = _GetBorrowernumberByDebarmentId($borrower_debarment_id);
160
    UpdateBorrowerDebarmentFlags($borrowernumber);
161
162
    logaction(
163
        "MEMBERS", "MODIFY_RESTRICTION", $borrowernumber,
164
        Koha::Patron::Restrictions->find($borrower_debarment_id)
165
    ) if C4::Context->preference("BorrowersLog");
153
166
154
    return $r;
167
    return $r;
155
}
168
}
156
- 

Return to bug 25996