X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/73be6af449d872825d1fbdffe536b9061ca649c8..2f833a265b6b21799b80724c59456a876ec36ed3:/bin/mozilla/am.pl diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 2dacb6f98..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 { @@ -846,228 +820,37 @@ 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'); - - AM->language(\%myconfig, \%$form); - - $form->{callback} = "am.pl?action=list_language"; - - my $callback = $form->escape($form->{callback}); - - $form->{title} = $locale->text('Languages'); - - 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; + $::lxdebug->enter_sub; + $::auth->assert('config'); - print qq| - -|; + AM->language(\%::myconfig, $::form); + $::form->{callback} = "am.pl?action=list_language"; + $::form->{title} = $::locale->text('Languages'); - $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} = - ""; + $::form->header; - map { print "$column_data{$_}\n" } @column_index; + print $::form->parse_html_template('am/language_list'); - 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 { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my $locale = $main::locale; - - $main::auth->assert('config'); - - $form->{title} = $locale->text("$form->{title} Language"); + $::lxdebug->enter_sub; + $::auth->assert('config'); # $locale->text('Add Language') # $locale->text('Edit Language') + $::form->{title} = $::locale->text("$::form->{title} Language"); - $form->{description} =~ s/\"/"/g; - $form->{template_code} =~ s/\"/"/g; - $form->{article_code} =~ s/\"/"/g; - - - $form->header; - - my $numberformat = - qq||; - foreach my $item (('1,000.00', '1000.00', '1.000,00', '1000,00')) { - $numberformat .= - ($item eq $form->{output_numberformat}) - ? ""; - } - - my $dateformat = - qq||; - foreach my $item (qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)) { - $dateformat .= - ($item eq $form->{output_dateformat}) - ? ""; - } - - print qq| - - -
- -{id}> - + $::form->header; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$form->{title}
| . $locale->text('Language') . qq|
| . $locale->text('Template Code') . qq|
| . $locale->text('Article Code') . qq|
| . $locale->text('Number Format') . qq|
| . $locale->text('Date Format') . qq|
| . $locale->text('Long Dates') . qq|{output_longdates} ? " checked" : "") . - qq|>| . $locale->text("Yes") . - qq|{output_longdates} ? "" : " checked") . - qq|>| . $locale->text("No") . - qq|

-|; + print $::form->parse_html_template('am/language_header', { + numberformats => [ '1,000.00', '1000.00', '1.000,00', '1000,00' ], + dateformats => [ qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd) ], + }); - $main::lxdebug->leave_sub(); + $::lxdebug->leave_sub; } sub save_language { @@ -1378,7 +1161,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|