Bug 35597: Move modification logging to Koha::Suggestion
Some actions such as archiving a suggestion were not being logged. By moving the logging to Koha::Suggestion we can ensure more modifcations will be logged. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
3a8faef477
commit
8ee4fef42e
2 changed files with 8 additions and 7 deletions
|
@ -294,9 +294,7 @@ sub ModSuggestion {
|
|||
) or warn "can't enqueue letter $letter";
|
||||
}
|
||||
}
|
||||
if ( C4::Context->preference("SuggestionsLog") ) {
|
||||
logaction( 'SUGGESTION', 'MODIFY', $suggestion->{suggestionid}, $suggestion_object );
|
||||
}
|
||||
|
||||
return 1; # No useful if the exception is raised earlier
|
||||
}
|
||||
|
||||
|
|
|
@ -73,6 +73,12 @@ sub store {
|
|||
my $new_suggestion = !$self->in_storage;
|
||||
|
||||
my $result = $self->SUPER::store();
|
||||
|
||||
if ( C4::Context->preference("SuggestionsLog") ) {
|
||||
my $action = $new_suggestion ? 'CREATE' : 'MODIFY';
|
||||
logaction( 'SUGGESTION', $action, $result->suggestionid, $self );
|
||||
}
|
||||
|
||||
if ( $emailpurchasesuggestions && $self->STATUS eq 'ASKED' ) {
|
||||
|
||||
if (
|
||||
|
@ -114,10 +120,7 @@ sub store {
|
|||
) or warn "can't enqueue letter $letter";
|
||||
}
|
||||
}
|
||||
my $suggestion_object = Koha::Suggestions->find( $result->suggestionid );
|
||||
if ( $new_suggestion && C4::Context->preference("SuggestionsLog") ) {
|
||||
logaction( 'SUGGESTION', 'CREATE', $result->suggestionid, $suggestion_object );
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue