From 1ae686100b75daf4590311ba74f8884f32df562e Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 22 Jan 2014 14:38:44 +0100 Subject: [PATCH] Pflichtenhefte: Abschnitte in richtiger Reihenfolge ausgeben --- SL/Controller/RequirementSpec.pm | 2 +- templates/webpages/requirement_spec/show.html | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/SL/Controller/RequirementSpec.pm b/SL/Controller/RequirementSpec.pm index 2f31f97a8..b389ba373 100644 --- a/SL/Controller/RequirementSpec.pm +++ b/SL/Controller/RequirementSpec.pm @@ -181,7 +181,7 @@ sub action_show { my ($self) = @_; my $title = $self->requirement_spec->is_template ? t8('Show requirement spec template') : t8('Show requirement spec'); - my $item = $::form->{requirement_spec_item_id} ? SL::DB::RequirementSpecItem->new(id => $::form->{requirement_spec_item_id})->load : @{ $self->requirement_spec->sections }[0]; + my $item = $::form->{requirement_spec_item_id} ? SL::DB::RequirementSpecItem->new(id => $::form->{requirement_spec_item_id})->load : @{ $self->requirement_spec->sections_sorted }[0]; $self->requirement_spec_item($item); $self->render('requirement_spec/show', title => $title); diff --git a/templates/webpages/requirement_spec/show.html b/templates/webpages/requirement_spec/show.html index 93aad7d79..c41e87d84 100644 --- a/templates/webpages/requirement_spec/show.html +++ b/templates/webpages/requirement_spec/show.html @@ -1,4 +1,5 @@ [%- USE JSON -%][%- USE HTML %][%- USE L %][%- USE LxERP %][%- USE P -%] +[% SET sections = SELF.requirement_spec.sections_sorted || [] %] [%- INCLUDE 'common/flash.html' %] @@ -62,7 +63,7 @@ $(function() { metadata: { type: "sections" }, attr: { id: "sections", class: "section-context-menu" }, children: [ -[% FOREACH section = SELF.requirement_spec.sections %] +[% FOREACH section = sections %] [% P.requirement_spec_item_jstree_data(section).json %][% IF !loop.last %],[% END %] [% END %] ]}, @@ -78,7 +79,7 @@ $(function() { ]; var initially_open = ['tb-front', 'tb-back', 'sections' -[%- FOREACH section = SELF.requirement_spec.sections -%] +[%- FOREACH section = sections -%] , "fb-[% section.id %]" [%- FOREACH function_block = section.children -%] , "fb-[% function_block.id -%]" -- 2.20.1