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

(-)a/C4/Members.pm (-2 / +21 lines)
Lines 26-31 use C4::Context; Link Here
26
use String::Random qw( random_string );
26
use String::Random qw( random_string );
27
use Scalar::Util qw( looks_like_number );
27
use Scalar::Util qw( looks_like_number );
28
use Date::Calc qw/Today check_date Date_to_Days/;
28
use Date::Calc qw/Today check_date Date_to_Days/;
29
use JSON qw(to_json);
29
use C4::Log; # logaction
30
use C4::Log; # logaction
30
use C4::Overdues;
31
use C4::Overdues;
31
use C4::Reserves;
32
use C4::Reserves;
Lines 330-335 sub ModMember { Link Here
330
331
331
    my $patron = Koha::Patrons->find( $new_borrower->{borrowernumber} );
332
    my $patron = Koha::Patrons->find( $new_borrower->{borrowernumber} );
332
333
334
    my $borrowers_log = C4::Context->preference("BorrowersLog");
335
    if ( $borrowers_log && $patron->cardnumber ne $new_borrower->{cardnumber} )
336
    {
337
        logaction(
338
            "MEMBERS",
339
            "MODIFY",
340
            $data{'borrowernumber'},
341
            to_json(
342
                {
343
                    cardnumber_replaced => {
344
                        previous_cardnumber => $patron->cardnumber,
345
                        new_cardnumber      => $new_borrower->{cardnumber},
346
                    }
347
                },
348
                { utf8 => 1, pretty => 1 }
349
            )
350
        );
351
    }
352
333
    delete $new_borrower->{userid} if exists $new_borrower->{userid} and not $new_borrower->{userid};
353
    delete $new_borrower->{userid} if exists $new_borrower->{userid} and not $new_borrower->{userid};
334
354
335
    my $execute_success = $patron->store if $patron->set($new_borrower);
355
    my $execute_success = $patron->store if $patron->set($new_borrower);
Lines 361-367 sub ModMember { Link Here
361
            Koha::NorwegianPatronDB::NLSync({ 'borrowernumber' => $data{'borrowernumber'} });
381
            Koha::NorwegianPatronDB::NLSync({ 'borrowernumber' => $data{'borrowernumber'} });
362
        }
382
        }
363
383
364
        logaction("MEMBERS", "MODIFY", $data{'borrowernumber'}, "UPDATE (executed w/ arg: $data{'borrowernumber'})") if C4::Context->preference("BorrowersLog");
384
        logaction("MEMBERS", "MODIFY", $data{'borrowernumber'}, "UPDATE (executed w/ arg: $data{'borrowernumber'})") if $borrowers_log;
365
    }
385
    }
366
    return $execute_success;
386
    return $execute_success;
367
}
387
}
368
- 

Return to bug 18626