Bugzilla – Attachment 116651 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: Add logging to notice creation/update actions
Bug-14233-Add-logging-to-notice-creationupdate-act.patch (text/plain), 2.06 KB, created by
Martin Renvoize (ashimema)
on 2021-02-10 12:10:08 UTC
(
hide
)
Description:
Bug 14233: Add logging to notice creation/update actions
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-02-10 12:10:08 UTC
Size:
2.06 KB
patch
obsolete
>From 141f09206d1941231d810ecdcc2b04be2e84b3b1 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 10 Feb 2021 12:09:19 +0000 >Subject: [PATCH] Bug 14233: Add logging to notice creation/update actions > >--- > tools/letter.pl | 20 +++++++++++++++----- > 1 file changed, 15 insertions(+), 5 deletions(-) > >diff --git a/tools/letter.pl b/tools/letter.pl >index 0e7d23536d..c53f50c099 100755 >--- a/tools/letter.pl >+++ b/tools/letter.pl >@@ -46,6 +46,7 @@ use C4::Auth; > use C4::Context; > use C4::Output; > use C4::Letters; >+use C4::Log; > > use Koha::Patron::Attribute::Types; > >@@ -315,6 +316,7 @@ sub add_validate { > next; > } > elsif ( $letter and $letter->{message_transport_type} eq $mtt and $letter->{lang} eq $lang ) { >+ logaction('NOTICES', 'REPLACE', $letter->{id}, $letter->{content}, 'Intranet'); > $dbh->do( > q{ > UPDATE letter >@@ -326,11 +328,19 @@ sub add_validate { > $branchcode, $oldmodule, $code, $mtt, $lang > ); > } else { >- $dbh->do( >- q{INSERT INTO letter (branchcode,module,code,name,is_html,title,content,message_transport_type, lang) VALUES (?,?,?,?,?,?,?,?,?)}, >- undef, >- $branchcode || '', $module, $code, $name, $is_html || 0, $title, $content, $mtt, $lang >- ); >+ my $letter = Koha::Notice::Templates->new( >+ { >+ branchcode => $branchcode, >+ module => $module, >+ name => $name, >+ is_html => $is_html, >+ title => $title, >+ content => $content, >+ message_transport_type => $mtt, >+ lang => $lang >+ } >+ )->store; >+ logaction('NOTICES', 'CREATE', $letter->id, $letter->content, 'Intranet'); > } > } > # set up default display >-- >2.20.1
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