X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FRequirementSpec.pm;h=1cc17712f7011b6041b7c8769ccb4e48a2ed35b9;hb=a28a585e4cc989f4428d47352ef5f118035c237f;hp=cd603aa6f1c4ef3f05d03eb65e3dc14b8be6d5f3;hpb=31ead75c81bed1ebb1ac65475205e24cded34af5;p=kivitendo-erp.git diff --git a/SL/DB/RequirementSpec.pm b/SL/DB/RequirementSpec.pm index cd603aa6f..1cc17712f 100644 --- a/SL/DB/RequirementSpec.pm +++ b/SL/DB/RequirementSpec.pm @@ -8,6 +8,11 @@ use Rose::DB::Object::Helpers; use SL::DB::MetaSetup::RequirementSpec; use SL::DB::Manager::RequirementSpec; +use SL::DB::Helper::AttrDuration; +use SL::DB::Helper::CustomVariables ( + module => 'RequirementSpecs', + cvars_alias => 1, +); use SL::DB::Helper::LinkedRecords; use SL::Locale::String; use SL::Util qw(_hashify); @@ -52,6 +57,8 @@ __PACKAGE__->meta->add_relationship( __PACKAGE__->meta->initialize; +__PACKAGE__->attr_duration(qw(time_estimation)); + __PACKAGE__->before_save('_before_save_initialize_not_null_columns'); sub validate { @@ -168,6 +175,11 @@ sub _copy_from { %attributes); } + # Copy custom variables. + foreach my $var (@{ $source->cvars_by_config }) { + $self->cvar_by_name($var->config->name)->value($var->value); + } + my %paste_template_result; # Clone text blocks and pictures. @@ -200,7 +212,7 @@ sub _copy_from { $self->$accessor($paste_template_result{parts}); # Save new object -- we need its ID for the items. - $self->save; + $self->save(cascade => 1); my %id_to_clone;