X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FPresenter%2FRequirementSpecTextBlock.pm;h=0f8c5612a786ae830e344bd4aa8742366e010daf;hb=dd5cd96c8b0018f73b6b344b6158bf36c9362898;hp=8e2eb81a1f5a06b582a66351211f08fe5cadcd7a;hpb=bf9adfbab97311abf09cbbcf9f3d72f707d8a3af;p=kivitendo-erp.git diff --git a/SL/Presenter/RequirementSpecTextBlock.pm b/SL/Presenter/RequirementSpecTextBlock.pm index 8e2eb81a1..0f8c5612a 100644 --- a/SL/Presenter/RequirementSpecTextBlock.pm +++ b/SL/Presenter/RequirementSpecTextBlock.pm @@ -2,23 +2,26 @@ package SL::Presenter::RequirementSpecTextBlock; use strict; -use parent qw(Exporter); - use Exporter qw(import); -our @EXPORT = qw(requirement_spec_text_block_jstree_data); +our @EXPORT_OK = qw(requirement_spec_text_block_jstree_data); use Carp; use SL::JSON; sub requirement_spec_text_block_jstree_data { - my ($self, $text_block, %params) = @_; + my ($text_block, %params) = @_; + + my $class = 'text-block-context-menu tooltip'; + $class .= ' flagged' if $text_block->is_flagged; return { data => $text_block->title || '', - metadata => { id => $text_block->id, type => 'textblock' }, - attr => { id => "tb-" . $text_block->id, href => $params{href} || '#', class => 'text-block-context-menu' }, + metadata => { id => $text_block->id, type => 'text-block' }, + attr => { id => "tb-" . $text_block->id, href => $params{href} || '#', class => $class, title => $text_block->content_excerpt }, }; } +sub jstree_data { goto &requirement_spec_text_block_jstree_data } + 1;