96 |
96 |
my $new_type = $self->item->item_type;
|
97 |
97 |
my $new_visible_section = SL::DB::RequirementSpecItem->new(id => $self->visible_item->id)->load->section;
|
98 |
98 |
|
99 |
|
return $self->render($self->js) if !$old_visible_section || ($new_type eq 'section');
|
|
99 |
return $self->invalidate_version->render($self) if !$old_visible_section || ($new_type eq 'section');
|
100 |
100 |
|
101 |
101 |
# From here on $old_visible_section is definitely set.
|
102 |
102 |
|
... | ... | |
108 |
108 |
|
109 |
109 |
if ($old_visible_section->id != $new_visible_section->id) {
|
110 |
110 |
# The currently visible item has been dragged to a different section.
|
|
111 |
$self->invalidate_version;
|
111 |
112 |
return $self->render_list($new_section, $self->item)
|
112 |
113 |
->render($self);
|
113 |
114 |
}
|
... | ... | |
131 |
132 |
|
132 |
133 |
# $::lxdebug->dump(0, "js", $self->js->to_array);
|
133 |
134 |
|
134 |
|
$self->render($self->js);
|
|
135 |
$self->invalidate_version->render($self);
|
135 |
136 |
}
|
136 |
137 |
|
137 |
138 |
sub action_ajax_add_section {
|
... | ... | |
181 |
182 |
|
182 |
183 |
if ($type eq 'section') {
|
183 |
184 |
my $node = $self->presenter->requirement_spec_item_jstree_data($self->item);
|
|
185 |
$self->invalidate_version;
|
184 |
186 |
return $self->render_list($self->item)
|
185 |
187 |
->jstree->create_node('#tree', $insert_after ? ('#fb-' . $insert_after, 'after') : ('#sections', 'last'), $node)
|
186 |
188 |
->jstree->select_node('#tree', '#fb-' . $self->item->id)
|
... | ... | |
199 |
201 |
|
200 |
202 |
$self->replace_bottom($self->item->parent) if $type eq 'sub-function-block';
|
201 |
203 |
|
202 |
|
$self->js->render($self);
|
|
204 |
$self->invalidate_version->render($self);
|
203 |
205 |
}
|
204 |
206 |
|
205 |
207 |
sub action_ajax_edit {
|
... | ... | |
271 |
273 |
|
272 |
274 |
my $html = $self->render('requirement_spec_item/_section_header', { output => 0 }, requirement_spec_item => $self->item);
|
273 |
275 |
|
274 |
|
return $self->js
|
|
276 |
return $self->invalidate_version
|
275 |
277 |
->remove('#edit_section_form')
|
276 |
278 |
->html('#section-header-' . $self->item->id, $html)
|
277 |
279 |
->show('#section-header-' . $self->item->id)
|
... | ... | |
295 |
297 |
$self->replace_bottom($self->item, id_prefix => $id_prefix);
|
296 |
298 |
$self->replace_bottom($self->item->parent) if $type eq 'sub-function-block';
|
297 |
299 |
|
298 |
|
$self->js->render($self);
|
|
300 |
$self->invalidate_version->render($self);
|
299 |
301 |
}
|
300 |
302 |
|
301 |
303 |
sub action_ajax_delete {
|
... | ... | |
338 |
340 |
}
|
339 |
341 |
}
|
340 |
342 |
|
341 |
|
$self->js->jstree->delete_node('#tree', '#fb-' . $self->item->id)
|
342 |
|
->render($self);
|
|
343 |
$self->invalidate_version
|
|
344 |
->jstree->delete_node('#tree', '#fb-' . $self->item->id)
|
|
345 |
->render($self);
|
343 |
346 |
}
|
344 |
347 |
|
345 |
348 |
sub action_ajax_flag {
|
... | ... | |
457 |
460 |
# Update the current view if required.
|
458 |
461 |
$self->insert_new_item_in_section_view($self->js) if $self->is_item_visible;
|
459 |
462 |
|
460 |
|
$self->js->render($self);
|
|
463 |
$self->invalidate_version->render($self);
|
461 |
464 |
}
|
462 |
465 |
|
463 |
466 |
#
|
... | ... | |
469 |
472 |
$::auth->assert('sales_quotation_edit');
|
470 |
473 |
}
|
471 |
474 |
|
472 |
|
sub load_requirement_spec {
|
473 |
|
my ($self) = @_;
|
474 |
|
$self->requirement_spec(SL::DB::RequirementSpec->new(id => $::form->{requirement_spec_id})->load || die "No such requirement spec");
|
475 |
|
}
|
476 |
|
|
477 |
475 |
sub load_requirement_spec_item {
|
478 |
476 |
my ($self) = @_;
|
479 |
|
$self->item(SL::DB::RequirementSpecItem->new(id => $::form->{id})->load || die "No such requirement spec item");
|
|
477 |
$self->item(SL::DB::RequirementSpecItem->new(id => $::form->{id})->load);
|
480 |
478 |
}
|
481 |
479 |
|
482 |
480 |
#
|
... | ... | |
616 |
614 |
return $self->visible_section && ($self->visible_section->id == $item->section->id);
|
617 |
615 |
}
|
618 |
616 |
|
|
617 |
sub invalidate_version {
|
|
618 |
my ($self) = @_;
|
|
619 |
|
|
620 |
my $html = $self->render('requirement_spec/_version', { output => 0 },
|
|
621 |
requirement_spec => SL::DB::RequirementSpec->new(id => $::form->{requirement_spec_id} || $self->item->requirement_spec_id)->load);
|
|
622 |
return $self->js->html('#requirement_spec_version', $html);
|
|
623 |
}
|
|
624 |
|
619 |
625 |
1;
|
Pflichtenhefversion nach Änderung an Items invalidieren