From: Moritz Bunkus Date: Wed, 17 Jul 2013 10:22:42 +0000 (+0200) Subject: Pflichtenhefte: nach Anlegen eines Funktionsblocks gleich nächste Anlege-Form anzeigen X-Git-Tag: release-3.2.0beta~467^2~113 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e967690da6cc483427d0e930eec1442ed589443e;p=kivitendo-erp.git Pflichtenhefte: nach Anlegen eines Funktionsblocks gleich nächste Anlege-Form anzeigen --- 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) = @_;