From 69a5907ea17e23532ad5cf2bd41da87d42d86466 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 17 Jul 2013 15:50:57 +0200 Subject: [PATCH] =?utf8?q?Pflichtenhefttextbl=C3=B6cke:=20Nach=20Anlegen?= =?utf8?q?=20weitere=20Anlege-Form=20anzeigen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/RequirementSpecTextBlock.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/SL/Controller/RequirementSpecTextBlock.pm b/SL/Controller/RequirementSpecTextBlock.pm index 964ddbabc..589e52fd2 100644 --- a/SL/Controller/RequirementSpecTextBlock.pm +++ b/SL/Controller/RequirementSpecTextBlock.pm @@ -69,7 +69,7 @@ sub action_ajax_add { $self->js->html('#column-content', $html); } - $self->add_new_text_block_form(output_position => $new_where, insert_after_id => $::form->{id}); + $self->add_new_text_block_form(output_position => $new_where, insert_after_id => $::form->{id}, requirement_spec_id => $::form->{requirement_spec_id}); $self->invalidate_version->render($self); } @@ -117,7 +117,8 @@ sub action_ajax_create { $self->invalidate_version ->replaceWith('#' . $::form->{form_prefix} . '_form', $html) ->jstree->create_node('#tree', $insert_after ? ('#tb-' . $insert_after, 'after') : ('#tb-' . ($attributes->{output_position} == 0 ? 'front' : 'back'), 'last'), $node) - ->jstree->select_node('#tree', '#tb-' . $self->text_block->id) + ->jstree->select_node('#tree', '#tb-' . $self->text_block->id); + $self->add_new_text_block_form(output_position => $self->text_block->output_position, insert_after_id => $self->text_block->id, requirement_spec_id => $self->text_block->requirement_spec_id) ->render($self); } @@ -324,10 +325,11 @@ sub invalidate_version { sub add_new_text_block_form { my ($self, %params) = @_; - croak "Missing parameter output_position" unless defined($params{output_position}) && ($params{output_position} ne ''); + croak "Missing parameter output_position" unless defined($params{output_position}) && ($params{output_position} ne ''); + croak "Missing parameter requirement_spec_id" unless $params{requirement_spec_id}; $self->text_block(SL::DB::RequirementSpecTextBlock->new( - requirement_spec_id => $::form->{requirement_spec_id}, + requirement_spec_id => $params{requirement_spec_id}, output_position => $params{output_position}, )); -- 2.20.1