From: Moritz Bunkus Date: Tue, 31 Jan 2017 10:20:35 +0000 (+0100) Subject: ActionBar: Verwendung bei »Konto erfassen/bearbeiten« X-Git-Tag: release-3.5.4~1271 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=9cd9a517be354123f25dcf4d725f500805dcf33d;p=kivitendo-erp.git ActionBar: Verwendung bei »Konto erfassen/bearbeiten« --- diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index ec27fbbd4..a62fa15f6 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -109,7 +109,6 @@ sub edit_account { } &account_header; - &form_footer; $main::lxdebug->leave_sub(); } @@ -372,6 +371,8 @@ sub account_header { my $ChartTypeIsAccount = ($form->{charttype} eq "A") ? "1":""; my $AccountIsPosted = ($form->{orphaned} ) ? "":"1"; + setup_am_edit_account_action_bar(); + $form->header(); my $parameters_ref = { @@ -1394,3 +1395,36 @@ sub setup_am_config_action_bar { ); } } + +sub setup_am_edit_account_action_bar { + my %params = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + combobox => [ + action => [ + t8('Save'), + submit => [ '#form', { action => "save_account" } ], + disabled => $::form->{id} && !$::form->{orphaned} ? t8('The object is in use and cannot be changed.') + : undef, + accesskey => 'enter', + ], + + action => [ + t8('Save as new'), + submit => [ '#form', { action => "save_as_new_account" } ], + disabled => !$::form->{id} ? t8('The object has not been saved yet.') : undef, + ], + ], + + action => [ + t8('Delete'), + submit => [ '#form', { action => "delete_account" } ], + disabled => !$::form->{id} ? t8('The object has not been saved yet.') + : $::form->{id} && !$::form->{orphaned} ? t8('The object is in use and cannot be deleted.') + : undef, + confirm => t8('Do you really want to delete this object?'), + ], + ); + } +} diff --git a/locale/de/all b/locale/de/all index 2d30717ce..db1a23021 100755 --- a/locale/de/all +++ b/locale/de/all @@ -3029,6 +3029,7 @@ $self->{texts} = { 'The object has been deleted.' => 'Das Objekt wurde gelöscht..', 'The object has been saved.' => 'Das Objekt wurde gespeichert.', 'The object has not been saved yet.' => 'Das Objekt wurde noch nicht gespeichert.', + 'The object is in use and cannot be changed.' => 'Das Objekt ist in Benutzung und kann nicht geändert werden.', 'The object is in use and cannot be deleted.' => 'Das Objekt ist in Benutzung und kann nicht gelöscht werden.', 'The option field is empty.' => 'Das Optionsfeld ist leer.', 'The order has been deleted' => 'Der Auftrag wurde gelöscht.', diff --git a/templates/webpages/am/edit_accounts.html b/templates/webpages/am/edit_accounts.html index c83e94e1a..e07484b63 100644 --- a/templates/webpages/am/edit_accounts.html +++ b/templates/webpages/am/edit_accounts.html @@ -16,7 +16,7 @@ $(function() { }); -
+ @@ -308,3 +308,5 @@ $(function() { } [% END %] +[% L.hidden_tag('callback', callback) %] +