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 392-397 sub ModMember { Link Here
392
393
393
    my $patron = Koha::Patrons->find( $new_borrower->{borrowernumber} );
394
    my $patron = Koha::Patrons->find( $new_borrower->{borrowernumber} );
394
395
396
    my $borrowers_log = C4::Context->preference("BorrowersLog");
397
    if ( $borrowers_log && $patron->cardnumber ne $new_borrower->{cardnumber} )
398
    {
399
        logaction(
400
            "MEMBERS",
401
            "MODIFY",
402
            $data{'borrowernumber'},
403
            to_json(
404
                {
405
                    cardnumber_replaced => {
406
                        previous_cardnumber => $patron->cardnumber,
407
                        new_cardnumber      => $new_borrower->{cardnumber},
408
                    }
409
                },
410
                { utf8 => 1, pretty => 1 }
411
            )
412
        );
413
    }
414
395
    delete $new_borrower->{userid} if exists $new_borrower->{userid} and not $new_borrower->{userid};
415
    delete $new_borrower->{userid} if exists $new_borrower->{userid} and not $new_borrower->{userid};
396
416
397
    my $execute_success = $patron->store if $patron->set($new_borrower);
417
    my $execute_success = $patron->store if $patron->set($new_borrower);
Lines 423-429 sub ModMember { Link Here
423
            Koha::NorwegianPatronDB::NLSync({ 'borrowernumber' => $data{'borrowernumber'} });
443
            Koha::NorwegianPatronDB::NLSync({ 'borrowernumber' => $data{'borrowernumber'} });
424
        }
444
        }
425
445
426
        logaction("MEMBERS", "MODIFY", $data{'borrowernumber'}, "UPDATE (executed w/ arg: $data{'borrowernumber'})") if C4::Context->preference("BorrowersLog");
446
        logaction("MEMBERS", "MODIFY", $data{'borrowernumber'}, "UPDATE (executed w/ arg: $data{'borrowernumber'})") if $borrowers_log;
427
    }
447
    }
428
    return $execute_success;
448
    return $execute_success;
429
}
449
}
430
- 

Return to bug 18626