X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fdatev.pl;h=5acf5551719396ef6ab75618fdb10671ff520732;hb=3ddf1e88afb0c817509b80ea4f8466842c349f43;hp=9572e74bd4c2059da5ba9761b196a1ba1b789d0b;hpb=008c2e1529744e195616ac2cbf7736f06a90816e;p=kivitendo-erp.git diff --git a/bin/mozilla/datev.pl b/bin/mozilla/datev.pl index 9572e74bd..5acf55517 100644 --- a/bin/mozilla/datev.pl +++ b/bin/mozilla/datev.pl @@ -18,7 +18,8 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1335, USA. #====================================================================== # # Datev export module @@ -30,6 +31,8 @@ use Archive::Zip qw(:ERROR_CODES :CONSTANTS); use SL::Common; use SL::DATEV qw(:CONSTANTS); +use SL::Locale::String qw(t8); +use SL::DB::Department; use strict; @@ -47,6 +50,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); @@ -69,7 +74,10 @@ sub export_bewegungsdaten { $::lxdebug->enter_sub; $::auth->assert('datev_export'); + setup_datev_export2_action_bar(); + $::form->header; + $::form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all; print $::form->parse_html_template('datev/export_bewegungsdaten'); $::lxdebug->leave_sub; @@ -79,6 +87,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'); @@ -114,8 +124,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); } @@ -198,3 +210,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' ], + ], + ); + } +}