]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DB/RequirementSpecItem.pm
Pflichtenhefte: Auflisten von Abschnitten
[mfinanz.git] / SL / DB / RequirementSpecItem.pm
index 9322c32b76b3fc8f4ba2bc700086eadc625fa550..072b59b09abdb2c15c143df2a38f44e9759abfe2 100644 (file)
@@ -37,4 +37,19 @@ sub sorted_children {
   return [ sort { $a->position <=> $b->position } @{ $self->children } ];
 }
 
+sub get_section {
+  my ($self) = @_;
+
+  $self = $self->parent while $self->parent_id;
+
+  return $self;
+}
+
+sub get_type {
+  my ($self) = @_;
+
+  return 'section' if !$self->parent_id;
+  return $self->parent->parent_id ? 'sub-function-block' : 'function-block';
+}
+
 1;