From 42a5ef16806c906111528b9acb5ceed703722d7c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20V=C3=A9ron?= Date: Thu, 23 Apr 2015 08:48:15 +0200 Subject: [PATCH] Bug 14024 - add reports to action logs See QA comment #5 - new reports log their Id instead of 0 - format info: | Signed-off-by: Nicole Engard Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- C4/Reports/Guided.pm | 2 +- reports/guided_reports.pl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm index af921417c7..a440ebe86b 100644 --- a/C4/Reports/Guided.pm +++ b/C4/Reports/Guided.pm @@ -642,7 +642,7 @@ sub delete_report { return unless @ids; foreach my $id (@ids) { my $data = get_saved_report($id); - logaction( "REPORTS", "DELETE", $id, "Name: $data->{'report_name'} SQL: $data->{'savedsql'} " ) if C4::Context->preference("ReportsLog"); + logaction( "REPORTS", "DELETE", $id, "$data->{'report_name'} | $data->{'savedsql'} " ) if C4::Context->preference("ReportsLog"); } my $dbh = C4::Context->dbh; my $query = 'DELETE FROM saved_sql WHERE id IN (' . join( ',', ('?') x @ids ) . ')'; diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl index d2b658f496..0fb773f7f3 100755 --- a/reports/guided_reports.pl +++ b/reports/guided_reports.pl @@ -239,7 +239,7 @@ elsif ( $phase eq 'Update SQL'){ 'reportname' => $reportname, 'id' => $id, ); - logaction( "REPORTS", "MODIFY", $id, "$reportname: SQL: $sql" ) if C4::Context->preference("ReportsLog"); + logaction( "REPORTS", "MODIFY", $id, "$reportname | $sql" ) if C4::Context->preference("ReportsLog"); } if ( $usecache ) { $template->param( @@ -597,7 +597,7 @@ elsif ( $phase eq 'Save Report' ) { cache_expiry => $cache_expiry, public => $public, } ); - logaction( "REPORTS", "ADD", 0, "Name: $name: SQL: $sql" ) if C4::Context->preference("ReportsLog"); + logaction( "REPORTS", "ADD", $id, "$name | $sql" ) if C4::Context->preference("ReportsLog"); $template->param( 'save_successful' => 1, 'reportname' => $name, -- 2.39.5