Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 806db9c0

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID 806db9c06c2a9ec6148d9d852fb9208dd68d31b7
  • Vorgänger 69a5907e
  • Nachfolger 5723fbf9

Pflichtenheftabschnitte: Nach Anlegen Form fürs Anlegen eines Funktionsblocks anzeigen

Unterschiede anzeigen:

SL/Controller/RequirementSpecItem.pm
192 192
  if ($type eq 'section') {
193 193
    my $node = $self->presenter->requirement_spec_item_jstree_data($self->item);
194 194
    $self->invalidate_version;
195
    return $self->render_list($self->item)
195
    $self->render_list($self->item)
196
      ->hide('#section-list-empty')
196 197
      ->jstree->create_node('#tree', $insert_after ? ('#fb-' . $insert_after, 'after') : ('#sections', 'last'), $node)
197
      ->jstree->select_node('#tree', '#fb-' . $self->item->id)
198
      ->jstree->select_node('#tree', '#fb-' . $self->item->id);
199
    return $self->add_new_item_form_after_create
198 200
      ->render($self);
199 201
  }
200 202

  
......
210 212

  
211 213
  $self->replace_bottom($self->item->parent) if $type eq 'sub-function-block';
212 214

  
213
  $self->add_new_item_form_after_create if $type =~ m/function-block/;
215
  $self->add_new_item_form_after_create;
214 216

  
215 217
  $self->invalidate_version->render($self);
216 218
}
......
601 603
sub add_new_item_form_after_create {
602 604
  my ($self, %params) = @_;
603 605

  
604
  my $created_item = $self->item;
605
  $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));
606
  my $created_item    = $self->item;
607
  my $is_section      = $created_item->item_type eq 'section';
608

  
609
  $self->item(SL::DB::RequirementSpecItem->new(
610
    requirement_spec_id => $created_item->requirement_spec_id,
611
    parent_id           => $is_section ? $created_item->id : $created_item->parent_id,
612
    item_type           => $is_section ? 'function-block'  : $created_item->item_type,
613
  ));
606 614

  
607 615
  $self->add_new_item_form(
608
    insert_position   => 'insertAfter',
609 616
    insert_reference  => $created_item->id,
610
    display_reference => '#' . $created_item->item_type . '-' . $created_item->id,
617
    insert_position   => $is_section ? 'appendTo'      : 'insertAfter',
618
    display_reference => $is_section ? '#section-list' : '#' . $created_item->item_type . '-' . $created_item->id,
611 619
  );
612 620
}
613 621

  

Auch abrufbar als: Unified diff