CsvImport: dateformat Unterstützung
authorSven Schöling <s.schoeling@googlemail.com>
Fri, 20 Nov 2020 16:34:19 +0000 (17:34 +0100)
committerSven Schöling <s.schoeling@googlemail.com>
Fri, 20 Nov 2020 16:35:08 +0000 (17:35 +0100)
default ist auf dem dateformat des Benutzers

SL/Controller/CsvImport/Base.pm
SL/DB/CsvImportProfile.pm
templates/webpages/csv_import/form.html

index e3c119d..663be5e 100644 (file)
@@ -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 {
index bf11279..b816bed 100644 (file)
@@ -38,6 +38,7 @@ sub set_defaults {
                        escape_char  => '"',
                        charset      => 'CP850',
                        numberformat => $::myconfig{numberformat},
+                       dateformat   => $::myconfig{dateformat},
                        duplicates   => 'no_check',
                       );
 
index aecbf1d..e867f7a 100644 (file)
     </td>
    </tr>
 
+   <tr>
+    <th align="right">[%- LxERP.t8('Date Format') %]:</th>
+    <td colspan="10">
+     [% 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') %]
+    </td>
+   </tr>
+
    <tr>
     <th align="right">[%- LxERP.t8('Charset') %]:</th>
     <td colspan="10">[% L.select_tag('settings.charset', SELF.all_charsets, default = SELF.profile.get('charset'), style = 'width: 300px') %]</td>