From: Moritz Bunkus Date: Tue, 31 Jan 2017 14:39:10 +0000 (+0100) Subject: ActionBar: Verwendung bei »Steuern« X-Git-Tag: release-3.5.4~1268 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c7fff13f52ed343b751c7ceec575ba584b88e4bd;p=kivitendo-erp.git ActionBar: Verwendung bei »Steuern« --- diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index a62fa15f6..30c78703f 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -1110,10 +1110,10 @@ sub add_tax { $form->{expense} = 1; $form->{costs} = 1; + setup_am_edit_tax_action_bar(); $form->header(); my $parameters_ref = { -# ChartTypeIsAccount => $ChartTypeIsAccount, LANGUAGES => SL::DB::Manager::Language->get_all_sorted, }; @@ -1147,6 +1147,7 @@ sub edit_tax { $form->{rate} = $form->format_amount(\%myconfig, $form->{rate}, 2); + setup_am_edit_tax_action_bar(); $form->header(); my $parameters_ref = { @@ -1177,13 +1178,11 @@ sub list_tax { $form->{title} = $locale->text('Tax-O-Matic'); + setup_am_list_tax_action_bar(); $form->header(); - my $parameters_ref = { - }; - # Ausgabe des Templates - print($form->parse_html_template('am/list_tax', $parameters_ref)); + print($form->parse_html_template('am/list_tax')); $main::lxdebug->leave_sub(); } @@ -1428,3 +1427,39 @@ sub setup_am_edit_account_action_bar { ); } } + +sub setup_am_list_tax_action_bar { + my %params = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + link => [ + t8('Add'), + link => 'am.pl?action=add_tax', + ], + ); + } +} + +sub setup_am_edit_tax_action_bar { + my %params = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Save'), + submit => [ '#form', { action => "save_tax" } ], + accesskey => 'enter', + ], + + action => [ + t8('Delete'), + submit => [ '#form', { action => "delete_tax" } ], + disabled => !$::form->{id} ? t8('The object has not been saved yet.') + : !$::form->{orphaned} || $::form->{tax_already_used} ? t8('The object is in use and cannot be deleted.') + : undef, + confirm => t8('Do you really want to delete this object?'), + ], + ); + } +} diff --git a/templates/webpages/am/edit_tax.html b/templates/webpages/am/edit_tax.html index 46c45d84a..616ac2d8f 100644 --- a/templates/webpages/am/edit_tax.html +++ b/templates/webpages/am/edit_tax.html @@ -4,7 +4,7 @@ [%- USE LxERP %]

[% 'Tax-O-Matic' | $T8 %] [% title %]

-
+ @@ -129,12 +129,4 @@ [% END %] - - - - [% IF orphaned AND NOT tax_already_used %] - - [% END %] -
- diff --git a/templates/webpages/am/list_tax.html b/templates/webpages/am/list_tax.html index 836cca355..4b8ed2d47 100644 --- a/templates/webpages/am/list_tax.html +++ b/templates/webpages/am/list_tax.html @@ -25,7 +25,3 @@ [% END %] - -

- [%- 'Add' | $T8 %] -