X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FPresenter%2FRecord.pm;h=368a05d7caed4bcc832c91fb638ee211e5cb345d;hb=915e14b7f4a22384a3cd6ca744401474525dd301;hp=4f9a5183074cecb826088d8b8289b14c8d2c7202;hpb=bfd8b7a229bf1bec0a6ed2c2e8a76d6cab30704a;p=kivitendo-erp.git diff --git a/SL/Presenter/Record.pm b/SL/Presenter/Record.pm index 4f9a51830..368a05d7c 100644 --- a/SL/Presenter/Record.pm +++ b/SL/Presenter/Record.pm @@ -27,6 +27,7 @@ sub grouped_record_list { my %groups = _sort_grouped_lists(_group_records($list)); my $output = ''; + $output .= _requirement_spec_list( $self, $groups{requirement_specs}, %params) if $groups{requirement_specs}; $output .= _sales_quotation_list( $self, $groups{sales_quotations}, %params) if $groups{sales_quotations}; $output .= _sales_order_list( $self, $groups{sales_orders}, %params) if $groups{sales_orders}; $output .= _sales_delivery_order_list( $self, $groups{sales_delivery_orders}, %params) if $groups{sales_delivery_orders}; @@ -74,7 +75,12 @@ sub record_list { if ($with_columns{record_link_direction}) { push @columns, { title => $::locale->text('Link direction'), - data => sub { $_[0]->{_record_link_direction} eq 'from' ? $::locale->text('Row was source for current record') : $::locale->text('Row was created from current record') }, + data => sub { + $_[0]->{_record_link_depth} > 1 + ? $::locale->text('Row was linked to another record') + : $_[0]->{_record_link_direction} eq 'from' + ? $::locale->text('Row was source for current record') + : $::locale->text('Row was created from current record') }, }; } @@ -142,6 +148,7 @@ sub _group_records { my ($list) = @_; my %matchers = ( + requirement_specs => sub { (ref($_[0]) eq 'SL::DB::RequirementSpec') }, sales_quotations => sub { (ref($_[0]) eq 'SL::DB::Order') && $_[0]->is_type('sales_quotation') }, sales_orders => sub { (ref($_[0]) eq 'SL::DB::Order') && $_[0]->is_type('sales_order') }, sales_delivery_orders => sub { (ref($_[0]) eq 'SL::DB::DeliveryOrder') && $_[0]->is_sales }, @@ -182,6 +189,24 @@ sub _sort_grouped_lists { return %groups; } +sub _requirement_spec_list { + my ($self, $list, %params) = @_; + + return $self->record_list( + $list, + title => $::locale->text('Requirement specs'), + type => 'requirement_spec', + columns => [ + [ $::locale->text('Requirement spec number'), sub { $self->requirement_spec($_[0], display => 'table-cell') } ], + [ $::locale->text('Customer'), 'customer' ], + [ $::locale->text('Title'), 'title' ], + [ $::locale->text('Project'), 'project', ], + [ $::locale->text('Status'), sub { $_[0]->status->description } ], + ], + %params, + ); +} + sub _sales_quotation_list { my ($self, $list, %params) = @_;