1 package SL::Presenter::RequirementSpecItem;
5 use parent qw(Exporter);
7 use Exporter qw(import);
8 our @EXPORT = qw(requirement_spec_item_jstree_data requirement_spec_item_dependency_list);
12 sub requirement_spec_item_jstree_data {
13 my ($self, $item, %params) = @_;
15 my @children = map { $self->requirement_spec_item_jstree_data($_, %params) } @{ $item->sorted_children };
16 my $type = !$item->parent_id ? 'section' : 'functionblock';
19 data => join(' ', map { $_ || '' } ($item->fb_number, $item->title)),
20 metadata => { id => $item->id, type => $type },
21 attr => { id => "fb-" . $item->id, href => $params{href} || '#' },
22 children => \@children,
26 sub requirement_spec_item_dependency_list {
27 my ($self, $item) = @_;
29 $::locale->language_join([ map { $_->fb_number } @{ $item->dependencies } ]);