X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/ecce066d5d1ab4eaf97e65d0fb0c42fd824f04fe..c19b1e03fb03f195d86a5b78f8ce2338f745f599:/SL/Controller/Helper/RequirementSpec.pm diff --git a/SL/Controller/Helper/RequirementSpec.pm b/SL/Controller/Helper/RequirementSpec.pm new file mode 100644 index 000000000..b24c4aa80 --- /dev/null +++ b/SL/Controller/Helper/RequirementSpec.pm @@ -0,0 +1,25 @@ +package SL::Controller::Helper::RequirementSpec; + +use strict; + +use Exporter qw(import); +our @EXPORT = qw(init_visible_section); + +use SL::DB::Manager::RequirementSpecItem; + +sub init_visible_section { + my ($self) = @_; + + my $content_id = $::form->{current_content_id}; + my $content_type = $::form->{current_content_type}; + + return undef unless $content_id; + return undef unless $content_type =~ m/section|function-block/; + + $self->visible_item(SL::DB::Manager::RequirementSpecItem->find_by(id => $content_id)); + return undef unless $self->visible_item; + + return $self->visible_section($self->visible_item->section); +} + +1;