From 6410ae9fc53e8501b21038c41005e39831020f5f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 20 Nov 2020 17:34:19 +0100 Subject: [PATCH] =?utf8?q?CsvImport:=20dateformat=20Unterst=C3=BCtzung?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit default ist auf dem dateformat des Benutzers --- SL/Controller/CsvImport/Base.pm | 6 ++---- SL/DB/CsvImportProfile.pm | 1 + templates/webpages/csv_import/form.html | 7 +++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/SL/Controller/CsvImport/Base.pm b/SL/Controller/CsvImport/Base.pm index e3c119de2..663be5eb8 100644 --- a/SL/Controller/CsvImport/Base.pm +++ b/SL/Controller/CsvImport/Base.pm @@ -45,8 +45,8 @@ sub run { $self->controller->track_progress(progress => 10); - my $old_numberformat = $::myconfig{numberformat}; - $::myconfig{numberformat} = $self->controller->profile->get('numberformat'); + local $::myconfig{numberformat} = $self->controller->profile->get('numberformat'); + local $::myconfig{dateformat} = $self->controller->profile->get('dateformat'); $self->csv->parse; @@ -83,8 +83,6 @@ sub run { $self->fix_field_lengths; $self->controller->track_progress(progress => 100); - - $::myconfig{numberformat} = $old_numberformat; } sub add_columns { diff --git a/SL/DB/CsvImportProfile.pm b/SL/DB/CsvImportProfile.pm index bf11279d1..b816bedb8 100644 --- a/SL/DB/CsvImportProfile.pm +++ b/SL/DB/CsvImportProfile.pm @@ -38,6 +38,7 @@ sub set_defaults { escape_char => '"', charset => 'CP850', numberformat => $::myconfig{numberformat}, + dateformat => $::myconfig{dateformat}, duplicates => 'no_check', ); diff --git a/templates/webpages/csv_import/form.html b/templates/webpages/csv_import/form.html index aecbf1ddb..e867f7a51 100644 --- a/templates/webpages/csv_import/form.html +++ b/templates/webpages/csv_import/form.html @@ -180,6 +180,13 @@ + + [%- LxERP.t8('Date Format') %]: + + [% L.select_tag('settings.dateformat', ['dd.mm.yyyy', 'yyyy-mm-dd', 'dd/mm/yyyy', 'mm/dd/yyyy' ], default = SELF.profile.get('dateformat'), style = 'width: 300px') %] + + + [%- LxERP.t8('Charset') %]: [% L.select_tag('settings.charset', SELF.all_charsets, default = SELF.profile.get('charset'), style = 'width: 300px') %] -- 2.20.1