X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FRequirementSpec.pm;h=6afe9973086b910d3669a526c6e2bcd6771c8d48;hb=4ee26bcc22fa980555706ca24323ee9c552c1303;hp=75453fbcdcc90f31929b477ef88fbfcd01885ac5;hpb=e8b07984052b974e46a84a2a4a8a4d3fd10e797a;p=kivitendo-erp.git diff --git a/SL/Controller/RequirementSpec.pm b/SL/Controller/RequirementSpec.pm index 75453fbcd..6afe99730 100644 --- a/SL/Controller/RequirementSpec.pm +++ b/SL/Controller/RequirementSpec.pm @@ -109,23 +109,14 @@ sub action_ajax_show_time_and_cost_estimate { $self->render('requirement_spec/_show_time_and_cost_estimate', { layout => 0 }); } -sub action_ajax_cancel_time_and_cost_estimate { - my ($self) = @_; - - my $html = $self->render('requirement_spec/_show_time_and_cost_estimate', { output => 0 }); - - $self->js - ->replaceWith('#time_cost_estimate', $html) - ->render($self); -} - sub action_ajax_edit_time_and_cost_estimate { my ($self) = @_; my $html = $self->render('requirement_spec/_edit_time_and_cost_estimate', { output => 0 }); $self->js - ->replaceWith('#time_cost_estimate', $html) + ->hide('#time_cost_estimate') + ->after('#time_cost_estimate', $html) ->on('#time_cost_estimate INPUT[type=text]', 'keydown', 'kivi.requirement_spec.time_cost_estimate_input_key_down') ->render($self); } @@ -149,7 +140,8 @@ sub action_ajax_save_time_and_cost_estimate { $self->requirement_spec(SL::DB::RequirementSpec->new(id => $self->requirement_spec->id)->load); my $html = $self->render('requirement_spec/_show_time_and_cost_estimate', { output => 0 }); - $self->js->replaceWith('#time_cost_estimate', $html); + $self->js->replaceWith('#time_cost_estimate', $html) + ->remove('#time_cost_estimate_form_container'); if ($self->visible_section) { $html = $self->render('requirement_spec_item/_section', { output => 0 }, requirement_spec_item => $self->visible_section); @@ -212,7 +204,8 @@ sub action_revert_to { sub action_create_pdf { my ($self, %params) = @_; - my %result = SL::Template::LaTeX->parse_and_create_pdf('requirement_spec.tex', SELF => $self, rspec => $self->requirement_spec); + my $base_name = $self->requirement_spec->type->template_file_name || 'requirement_spec'; + my %result = SL::Template::LaTeX->parse_and_create_pdf("${base_name}.tex", SELF => $self, rspec => $self->requirement_spec); $::form->error(t8('Conversion to PDF failed: #1', $result{error})) if $result{error};