From e967690da6cc483427d0e930eec1442ed589443e Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 17 Jul 2013 12:22:42 +0200 Subject: [PATCH] =?utf8?q?Pflichtenhefte:=20nach=20Anlegen=20eines=20Funkt?= =?utf8?q?ionsblocks=20gleich=20n=C3=A4chste=20Anlege-Form=20anzeigen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/RequirementSpecItem.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/SL/Controller/RequirementSpecItem.pm b/SL/Controller/RequirementSpecItem.pm index 73c8555ff..33ff06710 100644 --- a/SL/Controller/RequirementSpecItem.pm +++ b/SL/Controller/RequirementSpecItem.pm @@ -205,6 +205,8 @@ sub action_ajax_create { $self->replace_bottom($self->item->parent) if $type eq 'sub-function-block'; + $self->add_new_item_form_after_create if $type =~ m/function-block/; + $self->invalidate_version->render($self); } @@ -591,6 +593,19 @@ sub add_new_item_form { ->focus("#${id_base}_description"); } +sub add_new_item_form_after_create { + my ($self, %params) = @_; + + my $created_item = $self->item; + $self->item(SL::DB::RequirementSpecItem->new(requirement_spec_id => $created_item->requirement_spec_id, parent_id => $created_item->parent_id, item_type => $created_item->item_type)); + + $self->add_new_item_form( + insert_position => 'insertAfter', + insert_reference => $created_item->id, + display_reference => '#' . $created_item->item_type . '-' . $created_item->id, + ); +} + sub add_function_block { my ($self, $new_type) = @_; -- 2.20.1