X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/9bbb6912f72c14e23a25ec0a26e8d68b45b224b8..a615812c73cf5b07005b4f56aae5aa1da8357ee9:/SL/Controller/RequirementSpecTextBlock.pm?ds=sidebyside diff --git a/SL/Controller/RequirementSpecTextBlock.pm b/SL/Controller/RequirementSpecTextBlock.pm index 02a27a537..86f09c2dd 100644 --- a/SL/Controller/RequirementSpecTextBlock.pm +++ b/SL/Controller/RequirementSpecTextBlock.pm @@ -26,6 +26,7 @@ use Rose::Object::MakeMethods::Generic 'scalar --get_set_init' => [ qw(predefined_texts js picture) ], ); +__PACKAGE__->run_before('check_auth'); __PACKAGE__->run_before('load_requirement_spec_text_block', only => [qw(ajax_edit ajax_update ajax_delete ajax_flag dragged_and_dropped ajax_copy ajax_add_picture)]); # @@ -85,6 +86,7 @@ sub action_ajax_edit { ->insertAfter($html, '#text-block-' . $self->text_block->id) ->jstree->select_node('#tree', '#tb-' . $self->text_block->id) ->focus('#edit_text_block_' . $self->text_block->id . '_title') + ->reinit_widgets ->render($self); } @@ -397,6 +399,11 @@ sub action_reorder_pictures { # filters # +sub check_auth { + my ($self) = @_; + $::auth->assert('requirement_spec_edit'); +} + sub load_requirement_spec_text_block { my ($self) = @_; $self->text_block(SL::DB::RequirementSpecTextBlock->new(id => $::form->{id})->load || die "No such requirement spec text block"); @@ -456,6 +463,7 @@ sub add_new_text_block_form { $self->js ->action($params{insert_after_id} ? 'insertAfter' : 'appendTo', $html, '#text-block-' . ($params{insert_after_id} || 'list')) + ->reinit_widgets ->focus('#' . $id_base . '_title'); }