From b216babdf8ca0fad63014c39a743a6839d568a25 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Mon, 15 Jun 2009 19:18:51 +0200 Subject: [PATCH] Fix bug 3330 - Report notes modification Signed-off-by: Galen Charlton --- C4/Reports/Guided.pm | 5 +++-- .../prog/en/modules/reports/guided_reports_start.tmpl | 1 + reports/guided_reports.pl | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm index f4f86d1d6f..537867e59d 100644 --- a/C4/Reports/Guided.pm +++ b/C4/Reports/Guided.pm @@ -451,11 +451,12 @@ sub update_sql { my $id = shift || croak "No Id given"; my $sql = shift; my $reportname = shift; + my $notes = shift; my $dbh = C4::Context->dbh(); $sql =~ s/(\s*\;\s*)$//; # removes trailing whitespace and /;/ - my $query = "UPDATE saved_sql SET savedsql = ?, last_modified = now(), report_name = ? WHERE id = ? "; + my $query = "UPDATE saved_sql SET savedsql = ?, last_modified = now(), report_name = ?, notes = ? WHERE id = ? "; my $sth = $dbh->prepare($query); - $sth->execute( $sql, $reportname, $id ); + $sth->execute( $sql, $reportname, $notes, $id ); $sth->finish(); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl index b7c4e5a3c1..a172fb494a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl @@ -465,6 +465,7 @@ Sub report:" /> +
  • diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl index e9a31bf3ea..e86c72ae2a 100755 --- a/reports/guided_reports.pl +++ b/reports/guided_reports.pl @@ -96,7 +96,8 @@ elsif ( $phase eq 'Edit SQL'){ $template->param( 'sql' => $sql, 'reportname' => $reportname, - 'id' => $id, + 'notes' => $notes, + 'id' => $id, 'editsql' => 1, ); } @@ -105,6 +106,7 @@ elsif ( $phase eq 'Update SQL'){ my $id = $input->param('id'); my $sql = $input->param('sql'); my $reportname = $input->param('reportname'); + my $notes = $input->param('notes'); my @errors; if ($sql =~ /;?\W?(UPDATE|DELETE|DROP|INSERT|SHOW|CREATE)\W/i) { push @errors, {sqlerr => $1}; @@ -119,7 +121,7 @@ elsif ( $phase eq 'Update SQL'){ ); } else { - update_sql( $id, $sql, $reportname ); + update_sql( $id, $sql, $reportname, $notes ); $template->param( 'save_successful' => 1, ); -- 2.39.5