From 2f833a265b6b21799b80724c59456a876ec36ed3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 20 Jan 2012 20:46:32 +0100 Subject: [PATCH] am/form_footer auf template umgeschrieben --- bin/mozilla/am.pl | 46 ++++++-------------------- templates/webpages/am/form_footer.html | 15 +++++++++ 2 files changed, 25 insertions(+), 36 deletions(-) create mode 100644 templates/webpages/am/form_footer.html 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 %] + + + + + -- 2.20.1