30 |
30 |
(
|
31 |
31 |
scalar => [ qw(requirement_spec_item visible_item visible_section) ],
|
32 |
32 |
'scalar --get_set_init' => [ qw(requirement_spec customers types statuses complexities risks projects project_types project_statuses default_project_type default_project_status copy_source js
|
33 |
|
current_text_block_output_position models time_based_units html_template cvar_configs) ],
|
|
33 |
current_text_block_output_position models time_based_units html_template cvar_configs includeable_cvar_configs include_cvars) ],
|
34 |
34 |
);
|
35 |
35 |
|
36 |
36 |
__PACKAGE__->run_before('setup');
|
... | ... | |
366 |
366 |
$self->current_text_block_output_position($::form->{current_content_type} !~ m/^(?:text-blocks|tb)-(front|back)/ ? -1 : $1 eq 'front' ? 0 : 1);
|
367 |
367 |
}
|
368 |
368 |
|
|
369 |
sub init_includeable_cvar_configs {
|
|
370 |
my ($self) = @_;
|
|
371 |
return [ grep { $_->includeable } @{ $self->cvar_configs } ];
|
|
372 |
}
|
|
373 |
|
|
374 |
sub init_include_cvars {
|
|
375 |
my ($self) = @_;
|
|
376 |
return $::form->{include_cvars} if $::form->{include_cvars} && (ref($::form->{include_cvars}) eq 'HASH');
|
|
377 |
return { map { ($_->name => ($_->includeable && $_->included_by_default)) } @{ $self->cvar_configs } };
|
|
378 |
}
|
|
379 |
|
369 |
380 |
#
|
370 |
381 |
# helpers
|
371 |
382 |
#
|
... | ... | |
474 |
485 |
);
|
475 |
486 |
}
|
476 |
487 |
|
477 |
|
map { $column_defs{$_}->{text} ||= $::locale->text( $self->models->get_sort_spec->{$_}->{title} ) } keys %column_defs;
|
|
488 |
$column_defs{$_}->{text} ||= $::locale->text( $self->models->get_sort_spec->{$_}->{title} ) for keys %column_defs;
|
|
489 |
|
|
490 |
if (!$is_template) {
|
|
491 |
my %cvar_column_defs = map {
|
|
492 |
my $cfg = $_;
|
|
493 |
(('cvar_' . $cfg->name) => {
|
|
494 |
sub => sub { my $var = $_[0]->cvar_by_name($cfg->name); $var ? $var->value_as_text : '' },
|
|
495 |
text => $cfg->description,
|
|
496 |
visible => $self->include_cvars->{ $cfg->name } ? 1 : 0,
|
|
497 |
})
|
|
498 |
} @{ $self->includeable_cvar_configs };
|
|
499 |
|
|
500 |
push @columns, map { 'cvar_' . $_->name } @{ $self->includeable_cvar_configs };
|
|
501 |
%column_defs = (%column_defs, %cvar_column_defs);
|
|
502 |
}
|
478 |
503 |
|
479 |
504 |
$report->set_options(
|
480 |
505 |
std_column_visibility => 1,
|
Pflichtenheft: durchsuchbare CVars als Spalten in Bericht anzeigen können