From 31b247eeafbde0d9c043768489bf1228bd997d60 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 26 Jan 2017 17:17:01 +0100 Subject: [PATCH] ActionBar: Verwendung beim CSV-Import --- SL/Controller/CsvImport.pm | 23 +++++++++++++++++++++++ locale/de/all | 4 ++-- templates/webpages/csv_import/form.html | 5 +---- templates/webpages/csv_import/report.html | 9 ++++++++- 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/SL/Controller/CsvImport.pm b/SL/Controller/CsvImport.pm index 014514d1f..43d6fbf7a 100644 --- a/SL/Controller/CsvImport.pm +++ b/SL/Controller/CsvImport.pm @@ -333,6 +333,8 @@ sub render_inputs { $self->setup_help; + $self->setup_render_inputs_action_bar; + $self->render('csv_import/form', title => $title); } @@ -726,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; diff --git a/locale/de/all b/locale/de/all index 280e2b905..e3496a3a2 100755 --- a/locale/de/all +++ b/locale/de/all @@ -2179,7 +2179,7 @@ $self->{texts} = { 'Prepare bank collection via SEPA XML' => 'Einzug via SEPA XML vorbereiten', 'Prepare bank transfer via SEPA XML' => 'Überweisung via SEPA XML vorbereiten', 'Prepayment' => 'Vorauszahlung', - 'Preview' => 'Druckvorschau', + 'Preview' => 'Vorschau', 'Preview Mode' => 'Vorschaumodus', 'Previous transdate text' => 'wurde gespeichert am', 'Previous transnumber text' => 'Letzte Buchung mit der Buchungsnummer', @@ -2843,7 +2843,6 @@ $self->{texts} = { 'Template suggestions' => 'Vorschläge für Vorlagen', 'Templates' => 'Vorlagen', 'Terms missing in row ' => '+Tage fehlen in Zeile ', - 'Test and preview' => 'Test und Vorschau', 'Test database connectivity' => 'Datenbankverbindung testen', 'Text block actions' => 'Textblockaktionen', 'Text block picture actions' => 'Aktionen für Textblockbilder', @@ -3111,6 +3110,7 @@ $self->{texts} = { 'The tax zone is in use and cannot be deleted.' => 'Die Steuerzone wird benutzt und kann nicht gelöscht werden', 'The taxzone has been created.' => 'Die Steuerzone wurde erstellt.', 'The taxzone has been saved.' => 'Die Steuerzone wurde gespeichert.', + 'The test import has not been executed yet.' => 'Der Testimport wurde noch nicht durchgeführt.', 'The third reason is that wrong (taxkey) settings for the credit / debit CSV-import were used.' => 'Der dritte Grund ist, dass fehlerhafte Einstellungen (Steuerschlüssel) beim Kreditoren / Debitoren CSV-Import benutzt worden sind.', 'The third way is to download the module from the above mentioned URL and to install the module manually following the installations instructions contained in the source archive.' => 'Die dritte Variante besteht darin, das Paket von der oben genannten URL herunterzuladen und es manuell zu installieren. Beachten Sie dabei die im Paket enthaltenen Installationsanweisungen.', 'The three columns "make_X", "model_X" and "lastcost_X" with the same number "X" are used to import vendor part numbers and vendor prices.' => 'Die drei Spalten "make_X", "model_X" und "lastcost_X" mit derselben Nummer "X" werden zum Import von Lieferantenartikelnummern und -preisen genutzt.', diff --git a/templates/webpages/csv_import/form.html b/templates/webpages/csv_import/form.html index 2fff25263..b838fcdea 100644 --- a/templates/webpages/csv_import/form.html +++ b/templates/webpages/csv_import/form.html @@ -6,7 +6,7 @@ [%- INCLUDE 'common/flash.html' %] -
+ [% L.hidden_tag('form_sent', '1') %] [% L.hidden_tag('action', 'CsvImport/dispatch') %] [% L.hidden_tag('profile.type', SELF.profile.type) %] @@ -329,10 +329,7 @@
[%- END %][%# UNLESS SELF.worker.is_multiplexed %] - [% L.submit_tag('action_test', LxERP.t8('Test and preview')) %] [%- END %][%# IF SELF.profile.get('dont_edit_profile') %] - [% L.submit_tag('action_import', LxERP.t8('Import'), style='display:none') %] -
diff --git a/templates/webpages/csv_import/report.html b/templates/webpages/csv_import/report.html index f2ea4212c..77e69601e 100644 --- a/templates/webpages/csv_import/report.html +++ b/templates/webpages/csv_import/report.html @@ -55,5 +55,12 @@ [%- PROCESS 'common/paginate.html' pages=SELF.pages, base_url = SELF.base_url %] -- 2.20.1