projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
marei: headline/colspec keys for SimpleTabular
[kivitendo-erp.git]
/
SL
/
Presenter
/
RequirementSpecItem.pm
diff --git
a/SL/Presenter/RequirementSpecItem.pm
b/SL/Presenter/RequirementSpecItem.pm
index
c620325
..
58be195
100644
(file)
--- a/
SL/Presenter/RequirementSpecItem.pm
+++ b/
SL/Presenter/RequirementSpecItem.pm
@@
-2,39
+2,45
@@
package SL::Presenter::RequirementSpecItem;
use strict;
use strict;
-use
parent qw(Exporter
);
+use
SL::Presenter::Text qw(truncate
);
use Exporter qw(import);
use Exporter qw(import);
-our @EXPORT = qw(requirement_spec_item_tree_node_title requirement_spec_item_jstree_data requirement_spec_item_dependency_list);
+our @EXPORT
_OK
= qw(requirement_spec_item_tree_node_title requirement_spec_item_jstree_data requirement_spec_item_dependency_list);
use Carp;
sub requirement_spec_item_tree_node_title {
use Carp;
sub requirement_spec_item_tree_node_title {
- my ($
self, $
item) = @_;
+ my ($item) = @_;
- return join(' ', map { $_ || '' } ($item->fb_number,
$self->truncate($item->parent_id ? $item->description
: $item->title, at => 30)));
+ return join(' ', map { $_ || '' } ($item->fb_number,
truncate($item->parent_id ? $item->description_as_stripped_html
: $item->title, at => 30)));
}
}
+sub tree_node_title { goto &requirement_spec_item_tree_node_title }
+
sub requirement_spec_item_jstree_data {
sub requirement_spec_item_jstree_data {
- my ($
self, $
item, %params) = @_;
+ my ($item, %params) = @_;
- my @children = map {
$self->
requirement_spec_item_jstree_data($_, %params) } @{ $item->children_sorted };
+ my @children = map { requirement_spec_item_jstree_data($_, %params) } @{ $item->children_sorted };
my $type = !$item->parent_id ? 'section' : 'function-block';
my $type = !$item->parent_id ? 'section' : 'function-block';
- my $class = $type . '-context-menu';
+ my $class = $type . '-context-menu
tooltip
';
$class .= ' flagged' if $item->is_flagged;
return {
$class .= ' flagged' if $item->is_flagged;
return {
- data =>
$self->
requirement_spec_item_tree_node_title($item),
+ data => requirement_spec_item_tree_node_title($item),
metadata => { id => $item->id, type => $type },
metadata => { id => $item->id, type => $type },
- attr => { id => "fb-" . $item->id, href => $params{href} || '#', class => $class },
+ attr => { id => "fb-" . $item->id, href => $params{href} || '#', class => $class
, title => $item->content_excerpt
},
children => \@children,
};
}
children => \@children,
};
}
+sub jstree_data { goto &requirement_spec_item_jstree_data }
+
sub requirement_spec_item_dependency_list {
sub requirement_spec_item_dependency_list {
- my ($
self, $
item) = @_;
+ my ($item) = @_;
$::locale->language_join([ map { $_->fb_number } @{ $item->dependencies } ]);
}
$::locale->language_join([ map { $_->fb_number } @{ $item->dependencies } ]);
}
+sub dependency_list { goto &requirement_spec_item_dependency_list }
+
1;
1;