From a4aab76f9d91f7b1c724162573f191c558de54fc Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Thu, 21 Dec 2023 23:05:19 +0000 Subject: [PATCH] Bug 35597: logaction when modifying or deleteing suggestions --- C4/Suggestions.pm | 3 +++ Koha/Suggestion.pm | 3 ++- koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm index 14c6b203c1..773d41c3af 100644 --- a/C4/Suggestions.pm +++ b/C4/Suggestions.pm @@ -27,6 +27,7 @@ use C4::Letters; use C4::Biblio qw( GetMarcFromKohaField ); use Koha::DateUtils qw( dt_from_string ); use Koha::Suggestions; +use C4::Log qw(logaction); use base qw(Exporter); @@ -290,6 +291,7 @@ sub ModSuggestion { ) or warn "can't enqueue letter $letter"; } } + logaction('SUGGESTION', 'MODIFY', $suggestion->{suggestionid}, $suggestion_object ); return 1; # No useful if the exception is raised earlier } @@ -343,6 +345,7 @@ sub DelSuggestion { }; $sth = $dbh->prepare($queryDelete); my $suggestiondeleted = $sth->execute($suggestionid); + logaction('SUGGESTION', 'DELETE', $suggestionid, '' ); return $suggestiondeleted; } } diff --git a/Koha/Suggestion.pm b/Koha/Suggestion.pm index 631c1f662a..d38deb360e 100644 --- a/Koha/Suggestion.pm +++ b/Koha/Suggestion.pm @@ -27,6 +27,7 @@ use Koha::DateUtils qw( dt_from_string ); use Koha::Patrons; use Koha::AuthorisedValues; use Koha::Exceptions::Suggestion; +use C4::Log qw(logaction); use base qw(Koha::Object); @@ -111,7 +112,7 @@ sub store { ) or warn "can't enqueue letter $letter"; } } - + logaction('SUGGESTION', 'CREATE', $result->suggestionid, '' ); return $result; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt index e2a897fd51..f9be835556 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt @@ -101,6 +101,7 @@ [% CASE 'NOTICES' %]Notices[% UNLESS Koha.Preference('NoticesLog') %] [% END %] [% CASE 'NEWS' %]News[% UNLESS Koha.Preference('NewsLog') %] [% END %] [% CASE 'RECALLS' %]Recalls[% UNLESS Koha.Preference('RecallsLog') %] [% END %] +[% CASE 'SUGGESTION' %]Suggestions [% CASE %][% module | html %] [% END %] @@ -217,7 +218,7 @@ [% ELSE %] [% END %] - [% FOREACH modx IN [ 'AUTH' 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'CLAIMS' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS', 'SEARCHENGINE', 'NOTICES', 'NEWS', 'RECALLS' ] %] + [% FOREACH modx IN [ 'AUTH' 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'CLAIMS' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS', 'SEARCHENGINE', 'NOTICES', 'NEWS', 'RECALLS', 'SUGGESTION' ] %] [% IF modules.grep(modx).size %] [% ELSE %] @@ -383,6 +384,8 @@ [% ELSE %] Basket [% loopro.object | html %] [% END %] + [% ELSIF ( loopro.module == "SUGGESTION" ) %] + [% loopro.object | html %] [% ELSE %] [% loopro.object | html %] [% END %] -- 2.30.2