Datentypen in der Hilfe und Beispieldatei in der richtigen Reihenfolge anzeigen.
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Wed, 23 Oct 2013 11:56:48 +0000 (13:56 +0200)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Mon, 25 Nov 2013 13:03:13 +0000 (14:03 +0100)
SL/Controller/CsvImport.pm
templates/webpages/csv_import/form.html

index 7fa20a7..0ebf141 100644 (file)
@@ -127,12 +127,12 @@ sub action_download_sample {
   my $csv       = Text::CSV_XS->new({ binary => 1, map { ( $_ => $self->profile->get($_) ) } qw(sep_char escape_char quote_char),});
 
   if ($self->worker->is_multiplexed) {
-    foreach my $ri (keys %{ $self->displayable_columns }) {
-      $csv->print($file->fh, [ map { $_->{name}        } @{ $self->displayable_columns->{$ri} } ]);
+    foreach my $p (@{ $self->worker->profile }) {
+      $csv->print($file->fh, [ map { $_->{name}        } @{ $self->displayable_columns->{$p->{row_ident}} } ]);
       $file->fh->print("\r\n");
     }
-    foreach my $ri (keys %{ $self->displayable_columns }) {
-      $csv->print($file->fh, [ map { $_->{description} } @{ $self->displayable_columns->{$ri} } ]);
+    foreach my $p (@{ $self->worker->profile }) {
+      $csv->print($file->fh, [ map { $_->{description} } @{ $self->displayable_columns->{$p->{row_ident}} } ]);
       $file->fh->print("\r\n");
     }
   } else {
index 3b46cf5..5b189ec 100644 (file)
    [%- IF SELF.worker.is_multiplexed %]
      <table>
        <tr class="listheading">
-         [%- FOREACH ri = SELF.displayable_columns.keys %]
-           <th>[%- ri %]</th>
+         [%- FOREACH p = SELF.worker.profile %]
+           <th>[%- p.row_ident %]</th>
          [%- END %]
        </tr>
        <tr class="listrow[% loop.count % 2 %]">
-         [%- FOREACH ri = SELF.displayable_columns.keys %]
+         [%- FOREACH p = SELF.worker.profile %]
+           [% SET ri = p.row_ident %]
          <td>
            <table>
              <tr class="listheading">