Bug 22632: Add logging of merged patrons

without this patch , when patrons are merged , you can't see the merge in the log viewer.

    To test:
    -Apply the patch
    -Make sure you have "BorrowersLog" on in you System Preference
    -Search patrons
    -Check two ore more patrons
    -Merge selected patrons
    -Merge patrons
    -Go to log viewer
    - Make sure there is the line with the action : "Merge"

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Axel Amghar 2019-04-12 11:17:33 +02:00 committed by Lucas Gass
parent ed1ce54918
commit 0424ebb439
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 12 additions and 0 deletions

View File

@ -792,6 +792,18 @@ sub merge_with {
$patron->move_to_deleted();
$patron->delete();
if ( C4::Context->preference("BorrowersLog") ) {
my $info =
$patron->firstname . " "
. $patron->surname . " ("
. $patron->cardnumber . ")"
. " has been merged into "
. $self->firstname . " "
. $self->surname . " ("
. $self->cardnumber . ")";
logaction( "MEMBERS", "Merge", $self->id, $info );
}
}
}
);