Report in der richtigen Reihenfolge speichern und anzeigen.
authorSven Schöling <s.schoeling@linet-services.de>
Wed, 14 Nov 2012 15:10:38 +0000 (16:10 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Fri, 11 Jan 2013 12:54:57 +0000 (13:54 +0100)
SL/Controller/CsvImport.pm
templates/webpages/csv_import/report.html

index 830d5ff..cb54de9 100644 (file)
@@ -282,15 +282,19 @@ sub save_report {
   my $sth = $dbh->prepare($query);
   my $sth2 = $dbh->prepare($query2);
 
+#  $::lxdebug->dump(0,  "self", $self->info_headers);
+#  $::lxdebug->dump(0,  "self", $self->headers);
+#  $::lxdebug->dump(0,  "self", $self->raw_data_headers);
+
   # save headers
   my @headers = (
-    @{ $self->info_headers->{headers} || [] },
-    @{ $self->headers->{headers} || [] },
-    @{ $self->raw_data_headers->{headers} || [] },
+    grep({ $self->info_headers->{used}->{$_}     } @{ $self->info_headers->{headers} }),
+    grep({ $self->headers->{used}->{$_}          } @{ $self->headers->{headers} }),
+    grep({ $self->raw_data_headers->{used}->{$_} } @{ $self->raw_data_headers->{headers} }),
   );
-  my @info_methods = keys %{ $self->info_headers->{methods} || {} };
-  my @methods      = @{ $self->headers->{methods} || [] };
-  my @raw_methods  = keys %{ $self->raw_data_headers->{used} || {} };
+  my @info_methods = grep { $self->info_headers->{used}->{$_}     } @{ $self->info_headers->{headers} };
+  my @methods      = grep { $self->headers->{used}->{$_}          } @{ $self->headers->{methods} };
+  my @raw_methods  = grep { $self->raw_data_headers->{used}->{$_} } @{ $self->raw_data_headers->{headers} };
 
   $sth->execute($report->id, $_, 0, $headers[$_]) for 0 .. $#headers;
 
index e6c34b0..353e873 100644 (file)
@@ -15,7 +15,7 @@
   </tr>
  [%- ELSE %]
   [% csv_import_report_errors = SELF.report.folded_status.${loop.index}.errors %]
-  <tr class="[% IF csv_import_report_errors.size %]redrow[% ELSE %]listrow[% END %][% loop.count % 2 %]">
+  <tr class="[% IF csv_import_report_errors.size %]redrow[% ELSE %]listrow[% END %][% 1 - loop.count % 2 %]">
   [%- FOREACH value = row %]
    <td>[%- value | html  %]</td>
   [%- END %]