Revision d9a85058
Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt
SL/Controller/Reclamation.pm | ||
---|---|---|
2147 | 2147 |
} |
2148 | 2148 |
$column_defs{$_}->{text} ||= t8( $self->models->get_sort_spec->{$_}->{title} || $_ ) for keys %column_defs; |
2149 | 2149 |
|
2150 |
my @columns_to_show = grep { $::form->{active_in_report}->{"$_"} } keys %column_defs; |
|
2151 |
unless (scalar(@columns_to_show)){ @columns_to_show = @default_columns; } |
|
2152 |
|
|
2153 |
my %active_in_report = map { $_ => 1 } @columns_to_show; |
|
2154 |
$self->models->add_additional_url_params(map { "active_in_report." . $_ => 1 } @columns_to_show); #for reorder |
|
2155 |
my %columns_in_report = map {$_ => $column_defs{$_}} @columns_to_show; |
|
2150 |
unless ($::form->{active_in_report}) { |
|
2151 |
$::form->{active_in_report}->{$_} = 1 foreach @default_columns; |
|
2152 |
} |
|
2153 |
$self->models->add_additional_url_params( |
|
2154 |
active_in_report => $::form->{active_in_report}); |
|
2155 |
map { $column_defs{$_}->{visible} = $::form->{active_in_report}->{"$_"} } |
|
2156 |
keys %column_defs; |
|
2156 | 2157 |
|
2157 | 2158 |
## add cvars TODO(Tamino): Add own cvars |
2158 | 2159 |
#my %cvar_column_defs = map { |
... | ... | |
2170 | 2171 |
#my @cvar_column_form_names = ('_include_cvars_from_form', map { "include_cvars_" . $_->name } @{ $self->includeable_cvar_configs }); |
2171 | 2172 |
|
2172 | 2173 |
# make all sortable |
2173 |
my @sortable = keys %columns_in_report;
|
|
2174 |
my @sortable = keys %column_defs;
|
|
2174 | 2175 |
|
2175 | 2176 |
my $filter_html = SL::Presenter::ReclamationFilter::filter( |
2176 |
$::form->{filter}, $self->type, active_in_report => \%active_in_report
|
|
2177 |
$::form->{filter}, $self->type, active_in_report => $::form->{active_in_report}
|
|
2177 | 2178 |
); |
2178 | 2179 |
|
2179 | 2180 |
$report->set_options( |
... | ... | |
2194 | 2195 |
allow_pdf_export => 1, |
2195 | 2196 |
allow_csv_export => 1, |
2196 | 2197 |
); |
2197 |
$report->set_columns(%columns_in_report);
|
|
2198 |
$report->set_columns(%column_defs);
|
|
2198 | 2199 |
$report->set_column_order(@columns_order); |
2199 | 2200 |
#$report->set_export_options(qw(list filter), @cvar_column_form_names); TODO(Tamino): for cvars |
2200 |
$report->set_export_options(qw(list filter)); |
|
2201 |
$report->set_export_options(qw(list filter active_in_report));
|
|
2201 | 2202 |
$report->set_options_from_form; |
2202 | 2203 |
$self->models->set_report_generator_sort_options(report => $report, sortable_columns => \@sortable); |
2203 | 2204 |
} |
Auch abrufbar als: Unified diff
Reklamationsbericht: FIX: Nur aktive im Export anzeigen