From 9cd9a517be354123f25dcf4d725f500805dcf33d Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 31 Jan 2017 11:20:35 +0100 Subject: [PATCH] =?utf8?q?ActionBar:=20Verwendung=20bei=20=C2=BBKonto=20er?= =?utf8?q?fassen/bearbeiten=C2=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bin/mozilla/am.pl | 36 +++++++++++++++++++++++- locale/de/all | 1 + templates/webpages/am/edit_accounts.html | 4 ++- 3 files changed, 39 insertions(+), 2 deletions(-) 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) %] +
-- 2.20.1