From 590367b79668fbd64763e039de9c1503599e4fca Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Tue, 24 Oct 2017 20:46:13 +0000 Subject: [PATCH] Bug 13952: (follow-up) Fixing export on default biblio framework Signed-off-by: Katrin Fischer Signed-off-by: Michal Denar Signed-off-by: Michal Denar --- admin/import_export_framework.pl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/admin/import_export_framework.pl b/admin/import_export_framework.pl index c0017fa97f..6bfc58ffbb 100755 --- a/admin/import_export_framework.pl +++ b/admin/import_export_framework.pl @@ -40,8 +40,7 @@ unless ($auth_status eq 'ok') { exit 0; } -my $framework_name = $input->param('frameworkcode') || 'default'; -my $frameworkcode = ($framework_name eq 'default') ? q{} : $framework_name; +my $frameworkcode = $input->param('frameworkcode') || 'default'; my $action = $input->param('action') || 'export'; ## Exporting @@ -59,23 +58,23 @@ if ($action eq 'export' && $input->request_method() eq 'GET') { # Correctly set the encoding to output plain text in UTF-8 binmode(STDOUT,':encoding(UTF-8)'); - print $input->header(-type => 'application/vnd.ms-excel', -attachment => 'export_' . $framework_name . '.csv'); + print $input->header(-type => 'application/vnd.ms-excel', -attachment => 'export_' . $frameworkcode . '.csv'); print $strXml; } elsif ($format eq 'excel') { # Excel-xml file - print $input->header(-type => 'application/excel', -attachment => 'export_' . $framework_name . '.xml'); + print $input->header(-type => 'application/excel', -attachment => 'export_' . $frameworkcode . '.xml'); print $strXml; } else { # ODS file my $strODS = ''; createODS($strXml, 'en', \$strODS); - print $input->header(-type => 'application/vnd.oasis.opendocument.spreadsheet', -attachment => 'export_' . $framework_name . '.ods'); + print $input->header(-type => 'application/vnd.oasis.opendocument.spreadsheet', -attachment => 'export_' . $frameworkcode . '.ods'); print $strODS; } ## Importing } elsif ($input->request_method() eq 'POST') { my $ok = -1; - my $fieldname = 'file_import_' . $framework_name; + my $fieldname = 'file_import_' . $frameworkcode; my $filename = $input->param($fieldname); # upload the input file if ($filename && $filename =~ /\.(csv|ods|xml)$/i) { -- 2.11.0