projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pflichtenheftitems: RETURN in Zeitschätzungs-Input via AJAX submitten gefixt
[kivitendo-erp.git]
/
SL
/
Controller
/
RequirementSpecItem.pm
diff --git
a/SL/Controller/RequirementSpecItem.pm
b/SL/Controller/RequirementSpecItem.pm
index
6b833f7
..
0f7d66f
100644
(file)
--- a/
SL/Controller/RequirementSpecItem.pm
+++ b/
SL/Controller/RequirementSpecItem.pm
@@
-84,11
+84,11
@@
sub action_dragged_and_dropped {
my $old_visible_section = $self->visible_section ? $self->visible_section : undef;
my $old_parent_id = $self->item->parent_id;
my $old_type = $self->item->item_type;
my $old_visible_section = $self->visible_section ? $self->visible_section : undef;
my $old_parent_id = $self->item->parent_id;
my $old_type = $self->item->item_type;
- my $new_type = $position =~ m/before|after/ ? $dropped_item->item_type : $dropped_item->child_type;
+ my $new_type =
!$dropped_item ? 'section' :
$position =~ m/before|after/ ? $dropped_item->item_type : $dropped_item->child_type;
$self->item->db->do_transaction(sub {
$self->item->remove_from_list;
$self->item->db->do_transaction(sub {
$self->item->remove_from_list;
- $self->item->parent_id($position =~ m/before|after/ ? $dropped_item->parent_id : $dropped_item->id);
+ $self->item->parent_id($position =~ m/before|after/ ? $dropped_item->parent_id : $dropped_item->id)
if $dropped_item
;
$self->item->item_type($new_type);
$self->item->add_to_list(position => $position, reference => $::form->{dropped_id} || undef);
});
$self->item->item_type($new_type);
$self->item->add_to_list(position => $position, reference => $::form->{dropped_id} || undef);
});
@@
-226,7
+226,8
@@
sub action_ajax_edit {
# Show section/item to edit if it is not visible.
my $html = $self->render('requirement_spec_item/_section', { output => 0 }, requirement_spec_item => $self->item->section);
# Show section/item to edit if it is not visible.
my $html = $self->render('requirement_spec_item/_section', { output => 0 }, requirement_spec_item => $self->item->section);
- $self->js->html('#column-content', $html);
+ $self->set_function_blocks_tab_menu_class(class => 'section-context-menu')
+ ->html('#column-content', $html);
}
if ($self->item->item_type =~ m/section/) {
}
if ($self->item->item_type =~ m/section/) {
@@
-257,6
+258,7
@@
sub action_ajax_edit {
->hide($content_top_id)
->remove("#${id_base}_form")
->insertAfter($html, $content_top_id)
->hide($content_top_id)
->remove("#${id_base}_form")
->insertAfter($html, $content_top_id)
+ ->run('kivi.requirement_spec.init_function_block_keypress_events', "${id_base}_form")
->jstree->select_node('#tree', '#fb-' . $self->item->id)
->focus("#${id_base}_description")
->val('#current_content_type', $self->item->item_type)
->jstree->select_node('#tree', '#fb-' . $self->item->id)
->focus("#${id_base}_description")
->val('#current_content_type', $self->item->item_type)
@@
-329,7
+331,7
@@
sub action_ajax_delete {
} else {
my $html = $self->render('requirement_spec_item/_no_section', { output => 0 });
} else {
my $html = $self->render('requirement_spec_item/_no_section', { output => 0 });
- $self->
js
+ $self->
set_function_blocks_tab_menu_class(class => 'section-context-menu')
->html('#column-content', $html)
->val('#current_content_type', '')
->val('#current_content_id', '')
->html('#column-content', $html)
->val('#current_content_type', '')
->val('#current_content_id', '')
@@
-466,8
+468,9
@@
sub action_ajax_paste {
# Pasting the very first section?
if (!@{ $self->sections }) {
my $html = $self->render('requirement_spec_item/_section', { output => 0 }, requirement_spec_item => $self->item);
# Pasting the very first section?
if (!@{ $self->sections }) {
my $html = $self->render('requirement_spec_item/_section', { output => 0 }, requirement_spec_item => $self->item);
- $self->js->html('#column-content', $html)
- ->jstree->select_node('#tree', '#fb-' . $self->item->id)
+ $self->set_function_blocks_tab_menu_class(class => 'section-context-menu')
+ ->html('#column-content', $html)
+ ->jstree->select_node('#tree', '#fb-' . $self->item->id)
}
# Update the current view if required.
}
# Update the current view if required.
@@
-532,7
+535,8
@@
sub render_list {
my ($self, $item, $item_to_select) = @_;
my $html = $self->render('requirement_spec_item/_section', { output => 0 }, requirement_spec_item => $item);
my ($self, $item, $item_to_select) = @_;
my $html = $self->render('requirement_spec_item/_section', { output => 0 }, requirement_spec_item => $item);
- $self->js->html('#column-content', $html);
+ $self->set_function_blocks_tab_menu_class(class => 'section-context-menu')
+ ->html('#column-content', $html);
$self->select_node($item_to_select || $item);
}
$self->select_node($item_to_select || $item);
}
@@
-569,7
+573,7
@@
sub ensure_section_is_shown {
my $new_section = $self->item->section;
my $html = $self->render('requirement_spec_item/_section', { output => 0 }, requirement_spec_item => $new_section);
my $new_section = $self->item->section;
my $html = $self->render('requirement_spec_item/_section', { output => 0 }, requirement_spec_item => $new_section);
- return $self->
js
+ return $self->
set_function_blocks_tab_menu_class(class => 'section-context-menu')
->html('#column-content', $html)
->val('#current_content_type', 'section')
->val('#current_content_id', $new_section->id)
->html('#column-content', $html)
->val('#current_content_type', 'section')
->val('#current_content_id', $new_section->id)
@@
-597,6
+601,7
@@
sub add_new_item_form {
return $self->js
->action($params{insert_position}, $html, $params{display_reference})
return $self->js
->action($params{insert_position}, $html, $params{display_reference})
+ ->run('kivi.requirement_spec.init_function_block_keypress_events', "${id_base}_form")
->focus("#${id_base}_description");
}
->focus("#${id_base}_description");
}