From 15cc71490ce1c9981ed31d691a33b20899971384 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 18 Jan 2017 13:37:36 +0100 Subject: [PATCH] ActionBar: Verwendung beim DATEV-Export --- bin/mozilla/datev.pl | 60 ++++++++++++++++++- locale/de/all | 1 + templates/webpages/datev/export.html | 8 +-- templates/webpages/datev/export3.html | 3 - .../webpages/datev/export_bewegungsdaten.html | 8 +-- .../webpages/datev/export_stammdaten.html | 8 +-- 6 files changed, 63 insertions(+), 25 deletions(-) diff --git a/bin/mozilla/datev.pl b/bin/mozilla/datev.pl index 9b9ac50e6..8604da00d 100644 --- a/bin/mozilla/datev.pl +++ b/bin/mozilla/datev.pl @@ -31,6 +31,7 @@ use Archive::Zip qw(:ERROR_CODES :CONSTANTS); use SL::Common; use SL::DATEV qw(:CONSTANTS); +use SL::Locale::String qw(t8); use strict; @@ -48,6 +49,8 @@ sub export { my $stamm = SL::DATEV->new->get_datev_stamm; + setup_datev_export_action_bar(); + $::form->header; print $::form->parse_html_template('datev/export', $stamm); @@ -70,6 +73,8 @@ sub export_bewegungsdaten { $::lxdebug->enter_sub; $::auth->assert('datev_export'); + setup_datev_export2_action_bar(); + $::form->header; print $::form->parse_html_template('datev/export_bewegungsdaten'); @@ -80,6 +85,8 @@ sub export_stammdaten { $::lxdebug->enter_sub; $::auth->assert('datev_export'); + setup_datev_export2_action_bar(); + $::form->header; print $::form->parse_html_template('datev/export_stammdaten'); @@ -115,8 +122,10 @@ sub export3 { $datev->export; if (!$datev->errors) { + setup_datev_export3_action_bar(download_token => $datev->download_token); + $::form->header; - print $::form->parse_html_template('datev/export3', { datev => $datev }); + print $::form->parse_html_template('datev/export3'); } else { $::form->error("Export schlug fehl.\n" . join "\n", $datev->errors); } @@ -199,3 +208,52 @@ sub _get_dates { return ($fromdate, $todate); } + +sub setup_datev_export_action_bar { + my %params = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Continue'), + submit => [ '#form', { action => 'export2' } ], + accesskey => 'enter', + ], + ); + } +} + +sub setup_datev_export2_action_bar { + my %params = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Export'), + submit => [ '#form', { action => 'export3' } ], + accesskey => 'enter', + ], + action => [ + t8('Back'), + call => [ 'kivi.history_back' ], + ], + ); + } +} + +sub setup_datev_export3_action_bar { + my %params = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + link => [ + t8('Download'), + link => [ 'datev.pl?action=download&download_token=' . $::form->escape($params{download_token}) ], + ], + action => [ + t8('Back'), + call => [ 'kivi.history_back' ], + ], + ); + } +} diff --git a/locale/de/all b/locale/de/all index 7f22f7b2a..c6796fc52 100755 --- a/locale/de/all +++ b/locale/de/all @@ -1015,6 +1015,7 @@ $self->{texts} = { 'Done' => 'Fertig', 'Done.' => 'Fertig.', 'Double partnumbers' => 'Doppelte Artikelnummern', + 'Download' => 'Download', 'Download PDF' => 'PDF herunterladen', 'Download PDF, do not print' => 'Nicht drucken, sondern PDF herunterladen', 'Download SEPA XML export file' => 'SEPA-XML-Exportdatei herunterladen', diff --git a/templates/webpages/datev/export.html b/templates/webpages/datev/export.html index 6381c45bf..588309a32 100644 --- a/templates/webpages/datev/export.html +++ b/templates/webpages/datev/export.html @@ -1,7 +1,7 @@ [%- USE T8 %]

[% 'DATEX - Export Assistent' | $T8 %]

-
+ @@ -54,10 +54,4 @@

- - - -
-
- diff --git a/templates/webpages/datev/export3.html b/templates/webpages/datev/export3.html index 7ea194328..c5fb9d2df 100644 --- a/templates/webpages/datev/export3.html +++ b/templates/webpages/datev/export3.html @@ -8,8 +8,6 @@
[% 'KNE-Export erfolgreich!' | $T8 %]
-
- Download [% IF datev.net_gross_differences.size %] [% INCLUDE 'datev/net_gross_difference.html' @@ -17,4 +15,3 @@ sum_net_gross_differences = datev.sum_net_gross_differences %] [% END %] - diff --git a/templates/webpages/datev/export_bewegungsdaten.html b/templates/webpages/datev/export_bewegungsdaten.html index 2593bb447..5a3b5627d 100644 --- a/templates/webpages/datev/export_bewegungsdaten.html +++ b/templates/webpages/datev/export_bewegungsdaten.html @@ -2,7 +2,7 @@ [%- USE L %]

[% 'DATEX - Export Assistent' | $T8 %]

-
+ @@ -69,10 +69,4 @@ - - - -
- - diff --git a/templates/webpages/datev/export_stammdaten.html b/templates/webpages/datev/export_stammdaten.html index 593060b53..1c7b99821 100644 --- a/templates/webpages/datev/export_stammdaten.html +++ b/templates/webpages/datev/export_stammdaten.html @@ -1,7 +1,7 @@ [%- USE T8 %]

[% 'DATEX - Export Assistent' | $T8 %]

- +
@@ -35,10 +35,4 @@ - - - -
- - -- 2.20.1
[% 'Konten' | $T8 %]