Fix bug 3330 - Report notes modification
authorFrédéric Demians <f.demians@tamil.fr>
Mon, 15 Jun 2009 17:18:51 +0000 (19:18 +0200)
committerGalen Charlton <galen.charlton@liblime.com>
Mon, 15 Jun 2009 17:43:18 +0000 (12:43 -0500)
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
C4/Reports/Guided.pm
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl
reports/guided_reports.pl

index f4f86d1..537867e 100644 (file)
@@ -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();
 }
 
index b7c4e5a..a172fb4 100644 (file)
@@ -465,6 +465,7 @@ Sub report:<select name="subreport">
 <legend>Edit SQL</legend>
 <ol>
 <li><label for="reportname">Report Name:</label><input type="text" id="reportname" name="reportname" value="<!-- TMPL_VAR NAME="reportname" -->" /></li>
+<li><label for="notes">Notes:</label><textarea id="notes" name="notes" cols="50" rows="2"><!-- TMPL_VAR NAME="notes" --></textarea></li>
 <li><textarea id="sql" name="sql" rows="10" cols="60"><!-- TMPL_VAR NAME="sql" --></textarea></li>
 </ol>
 </fieldset>
index e9a31bf..e86c72a 100755 (executable)
@@ -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,
         );