From b4fc493375b77b6e27414fe3f7773f8b1add00fd Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 22 Apr 2013 11:52:31 +0200 Subject: [PATCH] =?utf8?q?Pflichtenheftversion=20nach=20=C3=84nderung=20Ba?= =?utf8?q?sisdaten=20invalidieren?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/RequirementSpec.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/SL/Controller/RequirementSpec.pm b/SL/Controller/RequirementSpec.pm index c119ea3b0..cac70a980 100644 --- a/SL/Controller/RequirementSpec.pm +++ b/SL/Controller/RequirementSpec.pm @@ -274,7 +274,7 @@ sub create_or_update { if ($::request->is_ajax) { my $html = $self->render('requirement_spec/_header', { output => 0 }); - return $self->js + return $self->invalidate_version ->replaceWith('#requirement-spec-header', $html) ->flash('info', t8('The requirement spec has been saved.')) ->render($self); @@ -348,4 +348,15 @@ sub prepare_report { $self->disable_pagination if $report->{options}{output_format} =~ /^(pdf|csv)$/i; } +sub invalidate_version { + my ($self) = @_; + + my $rspec = SL::DB::RequirementSpec->new(id => $self->requirement_spec->id)->load; + $rspec->invalidate_version; + + my $html = $self->render('requirement_spec/_version', { output => 0 }, requirement_spec => $rspec); + return $self->js->html('#requirement_spec_version', $html); +} + + 1; -- 2.20.1