(bug #2862) improve sql reports

Clear all non-alphanum chars at the end of an sql query.
Use ESCAPE=HTML to escape double quotes in csv export
This commit is contained in:
Nahuel ANGELINETTI 2008-12-12 11:56:19 +01:00 committed by Henri-Damien LAURENT
parent ae02b1438a
commit d647bc8fea
2 changed files with 2 additions and 1 deletions

View File

@ -483,6 +483,7 @@ Given some sql and a name this will saved it so that it can resued
sub save_report {
my ( $sql, $name, $type, $notes ) = @_;
my $dbh = C4::Context->dbh();
$sql =~ s/(\W*)$//;
my $query =
"INSERT INTO saved_sql (borrowernumber,date_created,last_modified,savedsql,report_name,type,notes) VALUES (?,now(),now(),?,?,?,?)";
my $sth = $dbh->prepare($query);

View File

@ -373,7 +373,7 @@ NAME="name" -->"><!-- TMPL_VAR NAME="name"--></label></td><td>
<option value="csv">Comma Separated Text</option>
<option value="tab">Tab Separated Text</option>
</select>
<input type="hidden" name="sql" value="<!-- TMPL_VAR NAME="sql" -->" />
<input type="hidden" name="sql" value="<!-- TMPL_VAR ESCAPE="HTML" NAME="sql" -->" />
<input type="hidden" name="phase" value="Export" />
<input type="submit" name="submit" value="Download" /></fieldset>
</form>