projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pflichtenhefte: Kontextmenüs für Items/Textblöcke auf größerer Fläche anzeigen
[kivitendo-erp.git]
/
SL
/
DB
/
RequirementSpec.pm
diff --git
a/SL/DB/RequirementSpec.pm
b/SL/DB/RequirementSpec.pm
index
abeac1c
..
0ad61aa
100644
(file)
--- a/
SL/DB/RequirementSpec.pm
+++ b/
SL/DB/RequirementSpec.pm
@@
-27,6
+27,11
@@
__PACKAGE__->meta->add_relationship(
class => 'SL::DB::RequirementSpec',
column_map => { id => 'working_copy_id' },
},
class => 'SL::DB::RequirementSpec',
column_map => { id => 'working_copy_id' },
},
+ orders => {
+ type => 'one to many',
+ class => 'SL::DB::RequirementSpecOrder',
+ column_map => { id => 'requirement_spec_id' },
+ },
);
__PACKAGE__->meta->initialize;
);
__PACKAGE__->meta->initialize;
@@
-71,6
+76,13
@@
sub sections_sorted {
sub sections { §ions_sorted; }
sub sections { §ions_sorted; }
+sub orders_sorted {
+ my ($self, %params) = _hashify(1, @_);
+ my $by = $params{by} || 'itime';
+
+ return [ sort { $a->$by cmp $b->$by } @{ $self->orders } ];
+}
+
sub displayable_name {
my ($self) = @_;
sub displayable_name {
my ($self) = @_;
@@
-119,7
+131,7
@@
sub _copy_from {
# Copy attributes.
if (!$params->{paste_template}) {
# Copy attributes.
if (!$params->{paste_template}) {
- $self->assign_attributes(map({ ($_ => $source->$_) } qw(type_id status_id customer_id project_id title hourly_rate
net_sum
previous_section_number previous_fb_number is_template)),
+ $self->assign_attributes(map({ ($_ => $source->$_) } qw(type_id status_id customer_id project_id title hourly_rate
time_estimation
previous_section_number previous_fb_number is_template)),
%attributes);
}
%attributes);
}
@@
-153,6
+165,7
@@
sub _copy_from {
my $cloned = Rose::DB::Object::Helpers::clone_and_reset($item);
$cloned->requirement_spec_id($self->id);
$cloned->position(undef);
my $cloned = Rose::DB::Object::Helpers::clone_and_reset($item);
$cloned->requirement_spec_id($self->id);
$cloned->position(undef);
+ $cloned->fb_number(undef) if $params->{paste_template};
$cloned->children(map { $clone_item->($_) } @{ $item->children });
$id_to_clone{ $item->id } = $cloned;
$cloned->children(map { $clone_item->($_) } @{ $item->children });
$id_to_clone{ $item->id } = $cloned;
@@
-361,7
+374,7
@@
saved. Creating the copy happens within a transaction.
=item C<create_version %attributes>
=item C<create_version %attributes>
-Prerequisites: C<$self> must be a working copy (see
L</working_copy>
),
+Prerequisites: C<$self> must be a working copy (see
the overview
),
not a versioned copy.
This function creates a new version for C<$self>. This involves
not a versioned copy.
This function creates a new version for C<$self>. This involves
@@
-408,7
+421,7
@@
copy and the last version created for it.
=item C<invalidate_version>
=item C<invalidate_version>
-Prerequisites: C<$self> must be a working copy (see
L</working_copy>
),
+Prerequisites: C<$self> must be a working copy (see
the overview
),
not a versioned copy.
Sets the C<version_id> field to C<undef> and saves C<$self>.
not a versioned copy.
Sets the C<version_id> field to C<undef> and saves C<$self>.