From 966d6da16267d6a4d6d8ff43be36ecf8cd167d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Thu, 23 Apr 2015 08:48:15 +0200 Subject: [PATCH] [Folluw-up] Bug 14024 - add reports to action logs See QA comment #5 - new reports log their Id instead of 0 - format info: | --- 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 9791f87..d9fe081 100644 --- a/C4/Reports/Guided.pm +++ b/C4/Reports/Guided.pm @@ -635,7 +635,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 b74866f..bd5ec9b 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, -- 1.7.10.4