From 355c76f816a3f6da6eae641152c81e4c9a02cfbc Mon Sep 17 00:00:00 2001 From: Andrew Fuerste Henry Date: Tue, 5 Aug 2025 13:38:18 +0000 Subject: [PATCH] Bug 35467: Rename NewsLog system preference to AdditionalContent To test: 1 - confirm whether or not NewsLog is enabled on your system 2 - apply patch, updatedatabase, restart_all 3 - search system preferences, confirm you now have AdditionalContentLog rather than NewsLog and that the new description is accurate 4 - confitm AdditionalContentLog shows the value you previously had for NewsLog 5 - go to Tools > Log Viewer 6 - confirm the checkbox here is labeled "Additional Content", that it correctly reflects the syspref value, and that it links to the syspref 7 - with AdditionalContentLog enabled, created/edit/delete news, HTML customizations, and pages. confirm they log 8 - with AdditionalContentLog disabled, created/edit/delete news, HTML customizations, and pages. confirm they don't log Signed-off-by: Owen Leonard Signed-off-by: Pedro Amorim --- installer/data/mysql/mandatory/sysprefs.sql | 2 +- koha-tmpl/intranet-tmpl/prog/en/includes/action-logs.inc | 2 +- .../prog/en/modules/admin/preferences/logs.pref | 4 ++-- tools/additional-contents.pl | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 76954d20229..67cd533dafb 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -13,6 +13,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: their own only, any within their branch, or all','Choice'), ('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'), ('ActionLogsTraceDepth', '0', '', 'Sets the maximum depth of the action logs stack trace', 'Integer'), +('AdditionalContentLog','0',NULL,'If ON, log OPAC news changes','YesNo'), ('AdditionalContentsEditor','tinymce','tinymce|codemirror','Choose tool for editing News.', 'Choice'), ('AdditionalFieldsInZ3950ResultAuthSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of an authority Z39.50 search', 'Free'), ('AdditionalFieldsInZ3950ResultSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of a search Z3950', 'Free'), @@ -432,7 +433,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('minPasswordLength','8',NULL,'Specify the minimum length of a patron/staff password','free'), ('NewItemsDefaultLocation','','','If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )',''), ('NewsAuthorDisplay','none','none|opac|staff|both','Display the author name for news items.','Choice'), -('NewsLog','0',NULL,'If ON, log OPAC news changes','YesNo'), ('noissuescharge','5','','Define maximum amount withstanding before checkouts are blocked','Integer'), ('NoIssuesChargeGuarantees','','','Define maximum amount withstanding before checkouts are blocked','Integer'), ('NoIssuesChargeGuarantorsWithGuarantees','','','Define maximum amount withstanding before checkouts are blocked including guarantors and their other guarantees','Integer'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/action-logs.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/action-logs.inc index 1ab3e72af80..09455971a24 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/action-logs.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/action-logs.inc @@ -35,7 +35,7 @@ [% CASE 'NOTICES' %] Notices[% UNLESS Koha.Preference('NoticesLog') %][% END %] [% CASE 'NEWS' %] - News[% UNLESS Koha.Preference('NewsLog') %][% END %] + Additional content[% UNLESS Koha.Preference('AdditionalContentLog') %][% END %] [% CASE 'RECALLS' %] Recalls[% UNLESS Koha.Preference('RecallsLog') %][% END %] [% CASE 'SUGGESTION' %] 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 c2598d19a45..5de47dbdf38 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 @@ -109,11 +109,11 @@ Logging: 0: "Don't log" - " changes to notice templates." - - - pref: NewsLog + - pref: AdditionalContentLog choices: 1: Log 0: "Don't log" - - " changes to news entries and other contents managed in the news tool." + - " changes to HTML customizations, news entires, pages, and other content managed in the additional content tools." - - pref: RecallsLog choices: diff --git a/tools/additional-contents.pl b/tools/additional-contents.pl index 89dacf9589c..db10d2de2e6 100755 --- a/tools/additional-contents.pl +++ b/tools/additional-contents.pl @@ -143,7 +143,7 @@ if ( $op eq 'add_form' ) { my $existing_content = $existing_contents->find($id); if ($existing_content) { if ( $existing_content->title ne $title || $existing_content->content ne $content ) { - if ( C4::Context->preference("NewsLog") ) { + if ( C4::Context->preference("AdditionalContentLog") ) { logaction( 'NEWS', 'MODIFY', undef, sprintf( "%s|%s|%s|%s", $code, $title, $lang, $content ) @@ -152,14 +152,14 @@ if ( $op eq 'add_form' ) { } else { $translated_content->{updated_on} = $existing_content->updated_on; } - } elsif ( C4::Context->preference("NewsLog") ) { + } elsif ( C4::Context->preference("AdditionalContentLog") ) { logaction( 'NEWS', 'ADD', undef, sprintf( "%s|%s|%s|%s", $code, $title, $lang, $content ) ); } push @translated_contents, $translated_content; } - if ( C4::Context->preference("NewsLog") ) { + if ( C4::Context->preference("AdditionalContentLog") ) { my @existing_ids = $existing_contents->get_column('id'); my @deleted_ids = array_minus( @existing_ids, @seen_ids ); for my $id (@deleted_ids) { @@ -197,7 +197,7 @@ if ( $op eq 'add_form' ) { sub { my $contents = Koha::AdditionalContents->search( { id => \@ids } ); - if ( C4::Context->preference("NewsLog") ) { + if ( C4::Context->preference("AdditionalContentLog") ) { while ( my $c = $contents->next ) { my $translated_contents = $c->translated_contents; while ( my $translated_content = $translated_contents->next ) { -- 2.39.5