From 24e52ede6791c750acc639e15900c51dc53f9977 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Tue, 4 Oct 2016 12:52:46 +0200 Subject: [PATCH] Bug 17395 - exporting checkouts in CVS generates a file with wrong extension In checkouts table, the is an export form (when some exports syspref are enabled). Export using a CSV profile will create a file with name koha.mrc (same as ISO2709 export). It would be better with koha.csv. Bug 14647 manages the export page, this but will only manage for export from checkouts table where file name is hard-coded. Test plan : - Enable checkouts exports by setting syspref ExportWithCsvProfile with a profile for record export - Go to circ page of a patron with checkouts : /cgi-bin/koha/circ/circulation.pl?borrowernumber=xxx - Show checkouts table - Select some checkboxes in "Export" column - Select "CSV" in export format combo-box - Click on "Export" => Without patch, the generated file is koha.mrc => With patch, the generated file is koha.csv - Check ISO2709 export generates a file named koha.mrc Signed-off-by: Dani Elder Signed-off-by: Jonathan Druart --- tools/export.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/export.pl b/tools/export.pl index 03792c3..b1ce09c 100755 --- a/tools/export.pl +++ b/tools/export.pl @@ -39,7 +39,7 @@ my $record_type = $query->param("record_type"); my $op = $query->param("op") || ''; my $output_format = $query->param("format") || $query->param("output_format") || 'iso2709'; my $backupdir = C4::Context->config('backupdir'); -my $filename = $query->param("filename") || 'koha.mrc'; +my $filename = $query->param("filename") || ( $output_format eq 'csv' ? 'koha.csv' : 'koha.mrc' ); $filename =~ s/(\r|\n)//; my $dbh = C4::Context->dbh; -- 2.1.4