my ($self) = @_;
eval {
- my $linked_records = $self->object->linked_records(direction => 'both', recursive => 1);
+ my $linked_records = $self->object->linked_records(direction => 'both', recursive => 1, save_path => 1);
push @{ $linked_records }, $self->object->sepa_export_items if $self->object->can('sepa_export_items');
my $output = SL::Presenter->get->grouped_record_list(
$linked_records,
if ($params{save_path}) {
my %links_by_id = map { $_->{id} => $_ } @$links;
for (@objects) {
- $_->{_record_link_path} = $links_by_id{$_->{_record_link}->id}->{path};
- $_->{_record_link_depth} = $links_by_id{$_->{_record_link}->id}->{depth};
+ my $link = $links_by_id{$_->{_record_link}->id};
+ my $intermediate_links = SL::DB::Manager::RecordLink->get_all(query => [ id => $link->{path} ]);
+ $_->{_record_link_path} = $link->{path};
+ $_->{_record_link_obj_path} = [ map { $get_objects->($_) } @$intermediate_links ];
+ $_->{_record_link_depth} = $link->{depth};
}
}
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') },
};
}
'Row #1: amount has to be different from zero.' => 'Zeile #1: Der Wert darf nicht 0 sein.',
'Row number' => 'Zeilennummer',
'Row was created from current record' => 'Zeile wurde aus aktuellem Beleg erstellt',
+ 'Row was linked to another record' => 'Zeile wurde über einen anderen Beleg verlinkt',
'Row was source for current record' => 'Zeile war Quelle für aktuellen Beleg',
'Run at' => 'Ausgeführt um',
'SAVED' => 'Gespeichert',