From e7088e2389156e0bd0e6741c5c98be2c456a6129 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 25 Mar 2019 17:08:33 +0100 Subject: [PATCH] Pflichtenhefte: Exportoption bzgl. benutzerdefinierter Variablen in Suchmaske gefixt --- SL/Controller/RequirementSpec.pm | 6 ++++-- templates/webpages/requirement_spec/_filter.html | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/SL/Controller/RequirementSpec.pm b/SL/Controller/RequirementSpec.pm index b22e15f65..875f17073 100644 --- a/SL/Controller/RequirementSpec.pm +++ b/SL/Controller/RequirementSpec.pm @@ -374,7 +374,7 @@ sub init_includeable_cvar_configs { sub init_include_cvars { my ($self) = @_; - return $::form->{include_cvars} if $::form->{include_cvars} && (ref($::form->{include_cvars}) eq 'HASH'); + return { map { ($_->name => $::form->{"include_cvars_" . $_->name}) } @{ $self->cvar_configs } } if $::form->{_include_cvars_from_form}; return { map { ($_->name => ($_->includeable && $_->included_by_default)) } @{ $self->cvar_configs } }; } @@ -516,6 +516,8 @@ sub prepare_report { %column_defs = (%column_defs, %cvar_column_defs); } + my @cvar_column_form_names = ('_include_cvars_from_form', map { "include_cvars_" . $_->name } @{ $self->includeable_cvar_configs }); + $report->set_options( std_column_visibility => 1, controller_class => 'RequirementSpec', @@ -528,7 +530,7 @@ sub prepare_report { ); $report->set_columns(%column_defs); $report->set_column_order(@columns); - $report->set_export_options(qw(list filter)); + $report->set_export_options(qw(list filter), @cvar_column_form_names); $report->set_options_from_form; $self->models->set_report_generator_sort_options(report => $report, sortable_columns => \@sortable); } diff --git a/templates/webpages/requirement_spec/_filter.html b/templates/webpages/requirement_spec/_filter.html index 0fd06bd78..2e4209a12 100644 --- a/templates/webpages/requirement_spec/_filter.html +++ b/templates/webpages/requirement_spec/_filter.html @@ -9,6 +9,7 @@
[%- L.hidden_tag("is_template", is_template) %] + [%- L.hidden_tag("_include_cvars_from_form", 1) %]

@@ -56,7 +57,6 @@ [% END %] [% END %] - [% L.hidden_tag("include_cvars.dummy__", 1) %] [% IF SELF.includeable_cvar_configs.size %] @@ -66,7 +66,7 @@ [% FOREACH cvar_cfg = SELF.includeable_cvar_configs %] [%- IF !loop.last && ((loop.count % 3) == 0) %] -- 2.20.1
[% LxERP.t8("Include in Report") %] [% name__ = cvar_cfg.name; - L.checkbox_tag("include_cvars." _ name__, value="1", checked=(SELF.include_cvars.$name__ ? 1 : ''), label=cvar_cfg.description) %] + L.checkbox_tag("include_cvars_" _ name__, value="1", checked=(SELF.include_cvars.$name__ ? 1 : ''), label=cvar_cfg.description) %]