From: Sven Schöling Date: Fri, 20 Jan 2012 19:46:32 +0000 (+0100) Subject: am/form_footer auf template umgeschrieben X-Git-Tag: release-2.7.0beta1~25 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=2f833a265b6b21799b80724c59456a876ec36ed3;p=kivitendo-erp.git am/form_footer auf template umgeschrieben --- diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index f28fa5221..e24e7c2eb 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -366,44 +366,18 @@ sub account_header { } sub form_footer { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my $locale = $main::locale; - - $main::auth->assert('config'); - - print qq| - - - -
|; - if ((!$form->{id}) || ($form->{id} && $form->{orphaned}) || (($form->{type} eq "account") && (!$form->{new_chart_valid}))) { - print qq| - -|; -} - - if ($form->{id} && $form->{orphaned}) { - print qq||; - } - - if ($form->{id} && $form->{type} eq "account") { - print qq| - |; - } - - print qq| - + $::lxdebug->enter_sub; + $::auth->assert('config'); - - -|; + print $::form->parse_html_template('am/form_footer', { + show_save => !$::form->{id} + || ($::form->{id} && $::form->{orphaned}) + || ($::form->{type} eq "account" && !$::form->{new_chart_valid}), + show_delete => $::form->{id} && $::form->{orphaned}, + show_save_as_new => $::form->{id} && $::form->{type} eq "account", + }); - $main::lxdebug->leave_sub(); + $::lxdebug->leave_sub; } sub save_account { diff --git a/templates/webpages/am/form_footer.html b/templates/webpages/am/form_footer.html new file mode 100644 index 000000000..99bfdf3a7 --- /dev/null +++ b/templates/webpages/am/form_footer.html @@ -0,0 +1,15 @@ +[%- USE T8 %] +[%- USE L %] +[%- USE HTML %] +[%- USE LxERP %] +[% L.hidden_tag('callback', callback) %] + +
+[%- IF show_save %][% L.submit_tag('action', LxERP.t8('Save')) %][% END %] +[%- IF show_delete %][% L.submit_tag('action', LxERP.t8('Delete')) %][% END %] +[%- IF show_save_as_new %][% L.submit_tag('action', LxERP.t8('Save as new')) %][% END %] + + + + +