@@ -, +, @@ --- installer/data/mysql/atomicupdate/bug_14233.perl | 5 +++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/logs.pref | 6 ++++++ tools/letter.pl | 10 +++++++--- 4 files changed, 19 insertions(+), 3 deletions(-) --- a/installer/data/mysql/atomicupdate/bug_14233.perl +++ a/installer/data/mysql/atomicupdate/bug_14233.perl @@ -24,5 +24,10 @@ q{ALTER TABLE letter ADD UNIQUE KEY letter_uniq_1 (`module`,`code`,`branchcode`, OR action = 'ACQUISITION CLAIM' )}); + $dbh->do(q{ + INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) + VALUES ('NoticesLog','',NULL,'If enabled, log changes to notice templates','YesNo') + }); + NewVersion( $DBversion, 14233, "Add id field to letter table" ); } --- a/installer/data/mysql/mandatory/sysprefs.sql +++ a/installer/data/mysql/mandatory/sysprefs.sql @@ -351,6 +351,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('NotHighlightedWords','and|or|not',NULL,'List of words to NOT highlight when OpacHitHighlight is enabled','free'), ('NoticeBcc','','','Email address to bcc outgoing notices sent by email','free'), ('NoticeCSS','',NULL,'Notices CSS url.','free'), +('NoticesLog','',NULL,'If enabled, log changes to notice templates','YesNo'), ('NotifyBorrowerDeparture','30',NULL,'Define number of days before expiry where circulation is warned about patron account expiry','Integer'), ('NovelistSelectEnabled','0',NULL,'Enable Novelist Select content. Requires Novelist Profile and Password','YesNo'), ('NovelistSelectPassword','',NULL,'Novelist select user Password','free'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref @@ -90,6 +90,12 @@ Logging: 1: Log 0: "Don't log" - " successful authentications." + - + - pref: NoticesLog + choices: + on: Log + off: "Don't log" + - " changes to notice templates." Debugging: - --- a/tools/letter.pl +++ a/tools/letter.pl @@ -318,7 +318,8 @@ sub add_validate { elsif ( $letter and $letter->{message_transport_type} eq $mtt and $letter->{lang} eq $lang ) { logaction( 'NOTICES', 'MODIFY', $letter->{id}, $content, 'Intranet' ) - unless ( $content eq $letter->{content} ); + if ( C4::Context->preference("NoticesLog") + && $content ne $letter->{content} ); $dbh->do( q{ UPDATE letter @@ -343,7 +344,9 @@ sub add_validate { lang => $lang } )->store; - logaction('NOTICES', 'CREATE', $letter->id, $letter->content, 'Intranet'); + logaction( 'NOTICES', 'CREATE', $letter->id, $letter->content, + 'Intranet' ) + if C4::Context->preference("NoticesLog"); } } # set up default display @@ -375,7 +378,8 @@ sub delete_confirmed { ); while ( my $letter = $letters->next ) { logaction( 'NOTICES', 'DELETE', $letter->id, $letter->content, - 'Intranet' ); + 'Intranet' ) + if C4::Context->preference("NoticesLog"); $letter->delete; } --