From e16e1f36dec1679b1defb5efc5acd7290cc9de85 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 20 Jan 2012 20:13:30 +0100 Subject: [PATCH] am/list_language in template ausgelagert --- bin/mozilla/am.pl | 132 ++--------------------- templates/webpages/am/language_list.html | 52 +++++++++ 2 files changed, 60 insertions(+), 124 deletions(-) create mode 100644 templates/webpages/am/language_list.html diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 2dacb6f98..d11219660 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -846,135 +846,19 @@ sub edit_language { } sub list_language { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - $main::auth->assert('config'); + $::lxdebug->enter_sub; + $::auth->assert('config'); AM->language(\%myconfig, \%$form); - $form->{callback} = "am.pl?action=list_language"; + $::form->{callback} = "am.pl?action=list_language"; + $::form->{title} = $::locale->text('Languages'); - my $callback = $form->escape($form->{callback}); + $::form->header; - $form->{title} = $locale->text('Languages'); + print $::form->parse_html_template('am/language_list'); - my @column_index = qw(description template_code article_code output_numberformat output_dateformat output_longdates); - my %column_header; - $column_header{description} = - qq|| - . $locale->text('Description') - . qq||; - $column_header{template_code} = - qq|| - . $locale->text('Template Code') - . qq||; - $column_header{article_code} = - qq|| - . $locale->text('Article Code') - . qq||; - $column_header{output_numberformat} = - qq|| - . $locale->text('Number Format') - . qq||; - $column_header{output_dateformat} = - qq|| - . $locale->text('Date Format') - . qq||; - $column_header{output_longdates} = - qq|| - . $locale->text('Long Dates') - . qq||; - - $form->header; - - print qq| - - - - - - - - - - - - - -
$form->{title}
- - -|; - - map { print "$column_header{$_}\n" } @column_index; - - print qq| - -|; - - my ($i, %column_data); - foreach my $ref (@{ $form->{ALL} }) { - - $i++; - $i %= 2; - - print qq| - -|; - - - $column_data{description} = - qq||; - $column_data{template_code} = qq||; - $column_data{article_code} = - qq||; - $column_data{output_numberformat} = - ""; - $column_data{output_dateformat} = - ""; - $column_data{output_longdates} = - ""; - - map { print "$column_data{$_}\n" } @column_index; - - print qq| - -|; - } - - print qq| -
$ref->{description}$ref->{template_code}$ref->{article_code}" . - ($ref->{output_numberformat} ? $ref->{output_numberformat} : - $locale->text("use program settings")) . - "" . - ($ref->{output_dateformat} ? $ref->{output_dateformat} : - $locale->text("use program settings")) . - "" . - ($ref->{output_longdates} ? $locale->text("Yes") : $locale->text("No")) . - "
-

- -
-
- - - - - - - -
- - - -|; - - $main::lxdebug->leave_sub(); + $::lxdebug->leave_sub; } sub language_header { @@ -1378,7 +1262,7 @@ sub buchungsgruppe_header { } my $linkaccounts; - if ( $::instance_conf->get_inventory_system eq 'perpetual' ) { # was !$::lx_office_conf{system}->{eur}) { + if ( $::instance_conf->get_inventory_system eq 'perpetual' ) { # was !$::lx_office_conf{system}->{eur}) { } $linkaccounts = qq| | . $locale->text('Inventory') . qq| diff --git a/templates/webpages/am/language_list.html b/templates/webpages/am/language_list.html new file mode 100644 index 000000000..a49d18ef5 --- /dev/null +++ b/templates/webpages/am/language_list.html @@ -0,0 +1,52 @@ +[%- USE HTML %] +[%- USE L %] +[%- USE LxERP %] +[%- USE T8 %] + + +

[% title | html %]

+ + + + + + + + + + + +
+ + + + + + + + + +[%- FOREACH row = ALL %] + + + + + + + +[%- END %] + +
[% 'Description' | $T8 %][% 'Template Code' | $T8 %][% 'Article Code' | $T8 %][% 'Number Format' | $T8 %][% 'Date Format' | $T8 %][% 'Long Dates' | $T8 %]
[% row.description %][% row.template_code | html %][% row.article_code | html %][% row.output_numberformat ? row.output_numberformat : LxERP.t8('use program settings') | html %][% row.output_dateformat ? row.output_dateformat : LxERP.t8('use program settings') | html %][% row.output_longdates ? LxERP.t8('Yes') : LxERP.t8('No') %]
+

+ +
+
+ + + + + +
+ + + -- 2.20.1