Bugzilla – Attachment 122864 Details for
Bug 28717
NewsLog doesn't work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28717: Add logging logic to koha-news.pl
Bug-28717-Add-logging-logic-to-koha-newspl.patch (text/plain), 1.97 KB, created by
Lucas Gass (lukeg)
on 2021-07-16 00:12:54 UTC
(
hide
)
Description:
Bug 28717: Add logging logic to koha-news.pl
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2021-07-16 00:12:54 UTC
Size:
1.97 KB
patch
obsolete
>From 6ef172dd0f9290e4944bc374aaf6959d97a17f03 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 16 Jul 2021 00:09:27 +0000 >Subject: [PATCH] Bug 28717: Add logging logic to koha-news.pl > >To test: >1. have some news items >2. make sure NewsLog is turned on >3. Add, modify, and delete some news >4. Check the action logs, nothing is logged >5. Apply patch >6. do step 3 again >7. now changes should be logged >--- > tools/koha-news.pl | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > >diff --git a/tools/koha-news.pl b/tools/koha-news.pl >index 65f560a5dd..6500fa2a7f 100755 >--- a/tools/koha-news.pl >+++ b/tools/koha-news.pl >@@ -32,6 +32,7 @@ use C4::Languages qw(getTranslatedLanguages); > use Date::Calc qw/Date_to_Days Today/; > use Koha::DateUtils; > use Koha::News; >+use C4::Log qw(logaction); > > my $cgi = CGI->new; > >@@ -117,6 +118,10 @@ elsif ( $op eq 'add' ) { > branchcode => $branchcode, > borrowernumber => $borrowernumber, > })->store; >+ #log news creation >+ if (C4::Context->preference("NewsLog")) { >+ logaction('OPACNEWS', 'ADD' , undef, $lang . ' | ' . $content); >+ } > print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl"); > } > else { >@@ -135,12 +140,20 @@ elsif ( $op eq 'edit' ) { > number => $number, > branchcode => $branchcode, > })->store; >+ #log modification >+ if (C4::Context->preference("NewsLog")) { >+ logaction('OPACNEWS', 'MODIFY' , undef, $lang . ' | ' . $content); >+ } > } > print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl"); > } > elsif ( $op eq 'del' ) { > my @ids = $cgi->multi_param('ids'); > Koha::News->search({ idnew => @ids })->delete; >+ #log new OPAC news deletion >+ if (C4::Context->preference("NewsLog")) { >+ logaction('OPACNEWS', 'DELETE', undef, $lang . ' | ' . $content ); >+ } > print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl"); > } > >-- >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 28717
:
122864
|
122921
|
122927
|
122941
|
122943
|
122944
|
122955
|
123964
|
125471
|
125543
|
125637
|
125659