Revision 70ada37e
Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt
SL/Controller/Reclamation.pm | ||
---|---|---|
2136 | 2136 |
} |
2137 | 2137 |
$column_defs{$_}->{text} ||= t8( $self->models->get_sort_spec->{$_}->{title} || $_ ) for keys %column_defs; |
2138 | 2138 |
|
2139 |
my @columns_to_show = grep { $::form->{active_in_report}->{"$_"} } keys %column_defs; |
|
2140 |
unless (scalar(@columns_to_show)){ @columns_to_show = @default_columns; } |
|
2141 |
|
|
2142 |
my %active_in_report = map { $_ => 1 } @columns_to_show; |
|
2143 |
$self->models->add_additional_url_params(map { "active_in_report." . $_ => 1 } @columns_to_show); #for reorder |
|
2144 |
my %columns_in_report = map {$_ => $column_defs{$_}} @columns_to_show; |
|
2139 |
unless ($::form->{active_in_report}) { |
|
2140 |
$::form->{active_in_report}->{$_} = 1 foreach @default_columns; |
|
2141 |
} |
|
2142 |
$self->models->add_additional_url_params( |
|
2143 |
active_in_report => $::form->{active_in_report}); |
|
2144 |
map { $column_defs{$_}->{visible} = $::form->{active_in_report}->{"$_"} } |
|
2145 |
keys %column_defs; |
|
2145 | 2146 |
|
2146 | 2147 |
## add cvars TODO(Tamino): Add own cvars |
2147 | 2148 |
#my %cvar_column_defs = map { |
... | ... | |
2159 | 2160 |
#my @cvar_column_form_names = ('_include_cvars_from_form', map { "include_cvars_" . $_->name } @{ $self->includeable_cvar_configs }); |
2160 | 2161 |
|
2161 | 2162 |
# make all sortable |
2162 |
my @sortable = keys %columns_in_report;
|
|
2163 |
my @sortable = keys %column_defs;
|
|
2163 | 2164 |
|
2164 | 2165 |
my $filter_html = SL::Presenter::ReclamationFilter::filter( |
2165 |
$::form->{filter}, $self->type, active_in_report => \%active_in_report
|
|
2166 |
$::form->{filter}, $self->type, active_in_report => $::form->{active_in_report}
|
|
2166 | 2167 |
); |
2167 | 2168 |
|
2168 | 2169 |
$report->set_options( |
... | ... | |
2183 | 2184 |
allow_pdf_export => 1, |
2184 | 2185 |
allow_csv_export => 1, |
2185 | 2186 |
); |
2186 |
$report->set_columns(%columns_in_report);
|
|
2187 |
$report->set_columns(%column_defs);
|
|
2187 | 2188 |
$report->set_column_order(@columns_order); |
2188 | 2189 |
#$report->set_export_options(qw(list filter), @cvar_column_form_names); TODO(Tamino): for cvars |
2189 |
$report->set_export_options(qw(list filter)); |
|
2190 |
$report->set_export_options(qw(list filter active_in_report));
|
|
2190 | 2191 |
$report->set_options_from_form; |
2191 | 2192 |
$self->models->set_report_generator_sort_options(report => $report, sortable_columns => \@sortable); |
2192 | 2193 |
} |
Auch abrufbar als: Unified diff
Reklamationsbericht: FIX: Nur aktive im Export anzeigen