Bug 7139 : Log addition and deletion of circulation messages

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Changed the two action names into caps no-spaces.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
Chris Cormack 2011-11-02 14:43:45 +13:00 committed by Paul Poulain
parent da916a368c
commit 288c1a768d

View file

@ -2126,7 +2126,7 @@ sub AddMessage {
my $query = "INSERT INTO messages ( borrowernumber, branchcode, message_type, message ) VALUES ( ?, ?, ?, ? )";
my $sth = $dbh->prepare($query);
$sth->execute( $borrowernumber, $branchcode, $message_type, $message );
logaction("MEMBERS", "ADDCIRCMESSAGE", $borrowernumber, $message) if C4::Context->preference("BorrowersLog");
return 1;
}
@ -2216,11 +2216,15 @@ sub DeleteMessage {
my ( $message_id ) = @_;
my $dbh = C4::Context->dbh;
my $query = "DELETE FROM messages WHERE message_id = ?";
my $query = "SELECT * FROM messages WHERE message_id = ?";
my $sth = $dbh->prepare($query);
$sth->execute( $message_id );
my $message = $sth->fetchrow_hashref();
$query = "DELETE FROM messages WHERE message_id = ?";
$sth = $dbh->prepare($query);
$sth->execute( $message_id );
logaction("MEMBERS", "DELCIRCMESSAGE", $message->{'borrowernumber'}, $message->{'message'}) if C4::Context->preference("BorrowersLog");
}
END { } # module clean-up code here (global destructor)