From 71aa26b8e6a742243fedc7927a984e833487e276 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 25 Feb 2021 09:56:23 +0000 Subject: [PATCH] Bug 14233: (follow-up) Clarify 'LetterLog' The LetterLog logging wasn't clear as to what it was logging, it actually logs aquisitions related notices being sent.. mostly 'Claims'. This patch updates LetterLog to ClaimsLog to more clearly reflect what it means. (I also discovered that there was a bug in the MODULE these were being logged as.. they were in fact being logged as 'ACQUISITION' and not 'LETTER' in the first place.. and as such not filtering correctly on the viewlog page). --- C4/Letters.pm | 4 ++-- C4/UsageStats.pm | 2 +- installer/data/mysql/atomicupdate/bug_14233.perl | 13 +++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 2 +- .../prog/en/modules/admin/preferences/logs.pref | 2 +- .../intranet-tmpl/prog/en/modules/tools/viewlog.tt | 4 ++-- t/db_dependent/Letters.t | 8 ++++---- t/db_dependent/UsageStats.t | 2 +- 8 files changed, 25 insertions(+), 12 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index 9383b71a3f..3e704db700 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -534,7 +534,7 @@ sub SendAlerts { unless $success; logaction( - "ACQUISITION", + "CLAIMS", $action, undef, "To=" @@ -543,7 +543,7 @@ sub SendAlerts { . $letter->{title} . " Content=" . $letter->{content} - ) if C4::Context->preference("LetterLog"); + ) if C4::Context->preference("ClaimsLog"); } # send an "account details" notice to a newly created user elsif ( $type eq 'members' ) { diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm index 21b461929f..65d3858bc4 100644 --- a/C4/UsageStats.pm +++ b/C4/UsageStats.pm @@ -222,7 +222,7 @@ sub BuildReport { CataloguingLog FinesLog IssueLog - LetterLog + ClaimsLog ReturnLog SubscriptionLog BiblioDefaultView diff --git a/installer/data/mysql/atomicupdate/bug_14233.perl b/installer/data/mysql/atomicupdate/bug_14233.perl index 6e2b6bfc24..9f713d9910 100644 --- a/installer/data/mysql/atomicupdate/bug_14233.perl +++ b/installer/data/mysql/atomicupdate/bug_14233.perl @@ -11,5 +11,18 @@ q{ALTER TABLE letter ADD UNIQUE KEY letter_uniq_1 (`module`,`code`,`branchcode`, ); } + $dbh->do(q{ + UPDATE + action_logs + SET + module = 'CLAIMS' + WHERE + module = 'ACQUISITIONS' + AND ( + action = 'SERIAL CLAIM' + OR action = 'ACQUISITION ORDER' + OR action = 'ACQUISITION CLAIM' + )}); + NewVersion( $DBversion, 14233, "Add id field to letter table" ); } diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index f09947e71b..f3663e6608 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -293,7 +293,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('KohaManualLanguage','en','en|ar|cs|de|es|fr|it|pt_BR|tr|zh_TW','What is the language of the online manual you want to use?','Choice'), ('LabelMARCView','standard','standard|economical','Define how a MARC record will display','Choice'), ('language','en',NULL,'Set the default language in the staff interface.','Languages'), -('LetterLog','1',NULL,'If ON, log all notices sent','YesNo'), +('ClaimsLog','1',NULL,'If ON, log all notices sent','YesNo'), ('LibraryName','','','Define the library name as displayed on the OPAC',''), ('LibraryThingForLibrariesEnabled','0','','Enable or Disable Library Thing for Libraries Features','YesNo'), ('LibraryThingForLibrariesID','','','See:http://librarything.com/forlibraries/','free'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref index 2d717fc165..f87b2be902 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref @@ -1,7 +1,7 @@ Logging: Logging: - - - pref: LetterLog + - pref: ClaimsLog choices: on: Log off: "Don't log" 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 13dc362d85..c36dc7354a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt @@ -84,7 +84,7 @@ [% CASE 'CIRCULATION' %]Circulation[% UNLESS Koha.Preference('IssueLog') %] [% END %] -[% CASE 'LETTER' %]Letter[% UNLESS Koha.Preference('LetterLog') %] [% END %] +[% CASE 'CLAIMS' %]Claims[% UNLESS Koha.Preference('ClaimsLog') %] [% END %] [% CASE 'FINES' %]Fines[% UNLESS Koha.Preference('FinesLog') %] [% END %] @@ -174,7 +174,7 @@ [% ELSE %] [% END %] - [% FOREACH modx IN [ 'AUTH' 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'LETTER' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS', 'SEARCHENGINE', 'NOTICES' ] %] + [% FOREACH modx IN [ 'AUTH' 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'CLAIMS' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS', 'SEARCHENGINE', 'NOTICES' ] %] [% IF modules.grep(modx).size %] [% ELSE %] diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t index 613f5696d3..3aceb76f60 100755 --- a/t/db_dependent/Letters.t +++ b/t/db_dependent/Letters.t @@ -453,8 +453,8 @@ is($err->{'error'}, 'no_email', "Trying to send an alert when there's no e-mail $bookseller = Koha::Acquisition::Booksellers->find( $booksellerid ); $bookseller->contacts->next->email('testemail@mydomain.com')->store; -# Ensure that the preference 'LetterLog' is set to logging -t::lib::Mocks::mock_preference( 'LetterLog', 'on' ); +# Ensure that the preference 'ClaimsLog' is set to logging +t::lib::Mocks::mock_preference( 'ClaimsLog', 'on' ); # SendAlerts needs branchemail or KohaAdminEmailAddress as sender t::lib::Mocks::mock_preference( 'KohaAdminEmailAddress', 'library@domain.com' ); @@ -632,8 +632,8 @@ subtest 'SendAlerts - claimissue' => sub { $bookseller = Koha::Acquisition::Booksellers->find( $booksellerid ); $bookseller->contacts->next->email('testemail@mydomain.com')->store; - # Ensure that the preference 'LetterLog' is set to logging - t::lib::Mocks::mock_preference( 'LetterLog', 'on' ); + # Ensure that the preference 'ClaimsLog' is set to logging + t::lib::Mocks::mock_preference( 'ClaimsLog', 'on' ); # SendAlerts needs branchemail or KohaAdminEmailAddress as sender t::lib::Mocks::mock_userenv({ branchcode => $library->{branchcode} }); diff --git a/t/db_dependent/UsageStats.t b/t/db_dependent/UsageStats.t index ff793c8e94..0bddf6713e 100755 --- a/t/db_dependent/UsageStats.t +++ b/t/db_dependent/UsageStats.t @@ -483,7 +483,7 @@ sub mocking_systempreferences_to_a_set_value { CataloguingLog FinesLog IssueLog - LetterLog + ClaimsLog ReturnLog SubscriptionLog BiblioDefaultView -- 2.20.1