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:
parent
da916a368c
commit
288c1a768d
1 changed files with 7 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue