Pflichtenhefte: Exportoption bzgl. benutzerdefinierter Variablen in Suchmaske gefixt
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 25 Mar 2019 16:08:33 +0000 (17:08 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 25 Mar 2019 16:13:32 +0000 (17:13 +0100)
SL/Controller/RequirementSpec.pm
templates/webpages/requirement_spec/_filter.html

index b22e15f..875f170 100644 (file)
@@ -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);
 }
index 0fd06bd..2e4209a 100644 (file)
@@ -9,6 +9,7 @@
 
  <form method="post" action="controller.pl" id="search_form">
   [%- L.hidden_tag("is_template", is_template) %]
+  [%- L.hidden_tag("_include_cvars_from_form", 1) %]
 
   <p>
    <table>
@@ -56,7 +57,6 @@
      [% END %]
     [% END %]
 
-    [% L.hidden_tag("include_cvars.dummy__", 1) %]
     [% IF SELF.includeable_cvar_configs.size %]
      <tr>
       <th align="right">[% LxERP.t8("Include in Report") %]</th>
@@ -66,7 +66,7 @@
          [% FOREACH cvar_cfg = SELF.includeable_cvar_configs %]
           <td>
            [% 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) %]
           </td>
           [%- IF !loop.last && ((loop.count % 3) == 0) %]
            </tr><tr>