X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FCsvImport.pm;h=43d6fbf7ad95d4737b44f692184714344b933a79;hb=f1adac26732c78610767856db26d76d889e04f71;hp=0da6e7005ae57e492b6f19d8243a0c92137a65c7;hpb=e2332bfd203a5d9925034dfdd90a15b3c9c66044;p=kivitendo-erp.git diff --git a/SL/Controller/CsvImport.pm b/SL/Controller/CsvImport.pm index 0da6e7005..43d6fbf7a 100644 --- a/SL/Controller/CsvImport.pm +++ b/SL/Controller/CsvImport.pm @@ -163,7 +163,6 @@ sub action_report { } my $num_rows = $self->{report}->numrows; - my $num_cols = SL::DB::Manager::CsvImportReportRow->get_all_count(query => [ csv_import_report_id => $report_id, row => 0 ]); # manual paginating, yuck my $page = $::form->{page} || 1; @@ -334,6 +333,8 @@ sub render_inputs { $self->setup_help; + $self->setup_render_inputs_action_bar; + $self->render('csv_import/form', title => $title); } @@ -727,4 +728,25 @@ sub init_mappings { [ grep { $_->{from} } @{ $::form->{mappings} || [] } ] } +sub setup_render_inputs_action_bar { + my ($self, %params) = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Preview'), + submit => [ '#form', { action => 'CsvImport/test' } ], + accesskey => 'enter', + not_if => ($self->profile && $self->profile->get('dont_edit_profile')), + ], + action => [ + t8('Import'), + submit => [ '#form', { action => 'CsvImport/import' } ], + disabled => t8('The test import has not been executed yet.'), + id => 'action_import', + ], + ); + } +} + 1;