Bugzilla – Attachment 118164 Details for
Bug 14233
Add logging support to notices and slips management
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14233: (follow-up) Add NoticesLog preference
Bug-14233-follow-up-Add-NoticesLog-preference.patch (text/plain), 4.46 KB, created by
Kyle M Hall (khall)
on 2021-03-11 17:17:22 UTC
(
hide
)
Description:
Bug 14233: (follow-up) Add NoticesLog preference
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2021-03-11 17:17:22 UTC
Size:
4.46 KB
patch
obsolete
>From eb645681e2e3ec65de1a2362e179c6803c21e7e3 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 25 Feb 2021 10:10:22 +0000 >Subject: [PATCH] Bug 14233: (follow-up) Add NoticesLog preference > >This patch adds a preference to enable/disable the notice template >logging. > >Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > 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(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_14233.perl b/installer/data/mysql/atomicupdate/bug_14233.perl >index 8a6caf0b25..ba78b924e3 100644 >--- a/installer/data/mysql/atomicupdate/bug_14233.perl >+++ b/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" ); > } >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index d93a90ea3f..bc4d9ba21a 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/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'), >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 33a56d5317..4f4945e1af 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 >@@ -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: > - >diff --git a/tools/letter.pl b/tools/letter.pl >index 64fe2ff76e..faf80e7d39 100755 >--- a/tools/letter.pl >+++ b/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; > } > >-- >2.24.1 (Apple Git-126)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14233
:
116649
|
116650
|
116651
|
116660
|
116661
|
116662
|
116668
|
116671
|
116672
|
116673
|
116674
|
116713
|
116760
|
116761
|
117251
|
117252
|
117253
|
117254
|
117255
|
117256
|
117257
|
117258
|
117259
|
117294
|
117295
|
117296
|
117297
|
117298
|
117299
|
117300
|
117301
|
117302
|
117303
|
117304
|
117311
|
117312
|
117313
|
117314
|
117315
|
117316
|
117317
|
117318
|
117319
|
117320
|
117321
|
117345
|
118132
|
118133
|
118134
|
118135
|
118136
|
118137
|
118138
|
118139
|
118140
|
118141
|
118142
|
118143
|
118155
|
118156
|
118157
|
118158
|
118159
|
118160
|
118161
|
118162
|
118163
|
118164
|
118165
|
118166
|
118167
|
118323
|
119291
|
119292
|
119293
|
119294
|
119312
|
119313
|
119314
|
119315
|
119359
|
119360
|
119361
|
119362
|
119510