projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Finanzcontrollingbericht: Spalte Ā»VorgangsbezeichnungĀ« anzeigen
[kivitendo-erp.git]
/
SL
/
DB
/
RequirementSpec.pm
diff --git
a/SL/DB/RequirementSpec.pm
b/SL/DB/RequirementSpec.pm
index
2354440
..
cd603aa
100644
(file)
--- a/
SL/DB/RequirementSpec.pm
+++ b/
SL/DB/RequirementSpec.pm
@@
-171,9
+171,9
@@
sub _copy_from {
my %paste_template_result;
# Clone text blocks and pictures.
my %paste_template_result;
# Clone text blocks and pictures.
- my $clone_
picture
= sub {
- my ($
picture
) = @_;
- my $cloned = Rose::DB::Object::Helpers::clone_and_reset($
picture
);
+ my $clone_
and_reset_position
= sub {
+ my ($
src_obj
) = @_;
+ my $cloned = Rose::DB::Object::Helpers::clone_and_reset($
src_obj
);
$cloned->position(undef);
return $cloned;
};
$cloned->position(undef);
return $cloned;
};
@@
-182,7
+182,7
@@
sub _copy_from {
my ($text_block) = @_;
my $cloned = Rose::DB::Object::Helpers::clone_and_reset($text_block);
$cloned->position(undef);
my ($text_block) = @_;
my $cloned = Rose::DB::Object::Helpers::clone_and_reset($text_block);
$cloned->position(undef);
- $cloned->pictures([ map { $clone_
picture
->($_) } @{ $text_block->pictures_sorted } ]);
+ $cloned->pictures([ map { $clone_
and_reset_position
->($_) } @{ $text_block->pictures_sorted } ]);
return $cloned;
};
return $cloned;
};
@@
-194,6
+194,11
@@
sub _copy_from {
$self->add_text_blocks($paste_template_result{text_blocks});
}
$self->add_text_blocks($paste_template_result{text_blocks});
}
+ # Clone additional parts.
+ $paste_template_result{parts} = [ map { $clone_and_reset_position->($_) } @{ $source->parts } ];
+ my $accessor = $params->{paste_template} ? "add_parts" : "parts";
+ $self->$accessor($paste_template_result{parts});
+
# Save new object -- we need its ID for the items.
$self->save;
# Save new object -- we need its ID for the items.
$self->save;