Revision 0a2fb69e
Von Moritz Bunkus vor fast 10 Jahren hinzugefügt
SL/Controller/RequirementSpec.pm | ||
---|---|---|
373 | 373 |
my $self = shift; |
374 | 374 |
my $is_new = !$self->requirement_spec->id; |
375 | 375 |
my $params = delete($::form->{requirement_spec}) || { }; |
376 |
my $cvars = delete($::form->{cvars}) || { }; |
|
376 | 377 |
|
377 | 378 |
$self->requirement_spec->assign_attributes(%{ $params }); |
378 | 379 |
|
380 |
foreach my $var (@{ $self->requirement_spec->cvars_by_config }) { |
|
381 |
my $value = $cvars->{ $var->config->name }; |
|
382 |
$value = $::form->parse_amount(\%::myconfig, $value) if $var->config->type eq 'number'; |
|
383 |
|
|
384 |
$var->value($value); |
|
385 |
} |
|
386 |
|
|
379 | 387 |
my $title = $is_new && $self->requirement_spec->is_template ? t8('Create a new requirement spec template') |
380 | 388 |
: $is_new ? t8('Create a new requirement spec') |
381 | 389 |
: $self->requirement_spec->is_template ? t8('Edit requirement spec template') |
... | ... | |
396 | 404 |
if ($self->copy_source) { |
397 | 405 |
$self->requirement_spec($self->copy_source->create_copy(%{ $params })); |
398 | 406 |
} else { |
399 |
$self->requirement_spec->save; |
|
407 |
$self->requirement_spec->save(cascade => 1);
|
|
400 | 408 |
} |
401 | 409 |
})) { |
402 | 410 |
$::lxdebug->message(LXDebug::WARN(), "Error: " . $db->error); |
Auch abrufbar als: Unified diff
Pflichtenhefte: benutzerdefinierte Variablen anzeigen und bearbeiten