Bugzilla – Attachment 190698 Details for
Bug 27432
Add reports run to action logs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27432: Add reports run to action logs
efd0fdd.patch (text/plain), 2.79 KB, created by
Fridolin Somers
on 2025-12-23 14:23:43 UTC
(
hide
)
Description:
Bug 27432: Add reports run to action logs
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2025-12-23 14:23:43 UTC
Size:
2.79 KB
patch
obsolete
>From efd0fdded929911702bc6eaf8af46a5244d5db4f Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Thu, 14 Jan 2021 15:34:55 +0100 >Subject: [PATCH] Bug 27432: Add reports run to action logs > >Reports run should be logged in action logs. > >This uses the exisiting action "Run" from cronjobs. >Like for other actions, infos contains the report name ("Unknown report" is >no report id provided) and executed SQL query. > >1) Apply patch >2) Enable system preference "ReportsLog" >3) Run a report >4) Go to Tools > Log viewer >5) Select module "Reports" and submit >6) Check you see a log with report name and SQL query >7) Change SQL of report, re-run >8) Go to Tools > Log viewer >9) Select module "Reports" and submit >10) Select the 2 logs "Compare" and click "View comparison" > >Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> >Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com> >--- > C4/Reports/Guided.pm | 4 ++++ > .../intranet-tmpl/prog/en/modules/admin/preferences/logs.pref | 2 +- > 2 files changed, 5 insertions(+), 1 deletion(-) > >diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm >index 577b369495..2672f7bb56 100644 >--- a/C4/Reports/Guided.pm >+++ b/C4/Reports/Guided.pm >@@ -593,6 +593,8 @@ sub execute_query { > my $limit = $params->{limit} || C4::Context->config('report_results_limit') || 999999; > my $sql_params = defined $params->{sql_params} ? $params->{sql_params} : []; > my $report_id = $params->{report_id}; >+ my $report = $report_id ? Koha::Reports->find($report_id) : undef; >+ my $rname = $report ? $report->report_name : 'Unknown name'; > > # check parameters > unless ($sql) { >@@ -656,6 +658,8 @@ sub execute_query { > ->info("Report finished: $report_id") > if $report_id; > >+ logaction( "REPORTS", "Run", $report_id, "$rname | $sql " ) if C4::Context->preference("ReportsLog"); >+ > return ( $sth, { queryerr => $sth->errstr } ) if ( $sth->err ); > > # Check if table.* contained forbidden column names >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 58679b4ab3..ba5e758d30 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 >@@ -89,7 +89,7 @@ Logging: > choices: > 1: Log > 0: "Don't log" >- - when reports are added, deleted or changed. >+ - when reports are added, deleted, changed, or ran. > - > - pref: AuthFailureLog > choices: >-- >2.43.0 >
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 27432
:
115162
|
115184
|
115926
|
115927
|
117355
|
117356
|
117357
|
117358
|
118953
|
118954
|
118955
|
119817
|
119818
|
119819
|
186046
|
186047
|
186048
|
186997
|
186998
|
186999
| 190698