X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fam.pl;h=4d1782b1a9222632693b913a941c6d5262c2aaf2;hb=a74d7fafa1ecbaf1f786ed7fdc85dc757ce4955f;hp=fe9199ef0fba6f2b5b879f6cb810a2d99bab7dc7;hpb=8ab8cad9c06edcaa424a13cd6e23d39a02135f07;p=kivitendo-erp.git diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index fe9199ef0..4d1782b1a 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -39,6 +39,7 @@ use SL::User; use SL::USTVA; use SL::Iconv; use SL::TODO; +use SL::Printer; use CGI::Ajax; use CGI; @@ -331,7 +332,7 @@ sub account_header { my %charttype = ( 'A' => $locale->text('Account'), - 'H' => $locale->text('Header'), + 'H' => $locale->text('Heading'), ); foreach my $item ( sort({ $a <=> $b } keys %charttype) ) { @@ -2014,234 +2015,6 @@ sub swap_buchungsgruppen { $main::lxdebug->leave_sub(); } - -sub add_printer { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - - $main::auth->assert('config'); - - $form->{title} = "Add"; - - $form->{callback} = "am.pl?action=add_printer" unless $form->{callback}; - - &printer_header; - &form_footer; - - $main::lxdebug->leave_sub(); -} - -sub edit_printer { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - - $main::auth->assert('config'); - - $form->{title} = "Edit"; - - AM->get_printer(\%myconfig, \%$form); - - &printer_header; - - $form->{orphaned} = 1; - &form_footer; - - $main::lxdebug->leave_sub(); -} - -sub list_printer { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - $main::auth->assert('config'); - - AM->printer(\%myconfig, \%$form); - - $form->{callback} = "am.pl?action=list_printer"; - - my $callback = $form->escape($form->{callback}); - - $form->{title} = $locale->text('Printer'); - - my @column_index = qw(printer_description printer_command template_code); - my %column_header; - $column_header{printer_description} = - qq|| - . $locale->text('Printer Description') - . qq||; - $column_header{printer_command} = - qq|| - . $locale->text('Printer Command') - . qq||; - $column_header{template_code} = - qq|| - . $locale->text('Template Code') - . 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{printer_description} = qq||; - $column_data{printer_command} = qq||; - $column_data{template_code} = - qq||; - - map { print "$column_data{$_}\n" } @column_index; - - print qq| - -|; - } - - print qq| -
$ref->{printer_description}$ref->{printer_command}$ref->{template_code}
-

- -
-
- - - - - - - -
- - - -|; - - $main::lxdebug->leave_sub(); -} - -sub printer_header { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my $locale = $main::locale; - - $main::auth->assert('config'); - - $form->{title} = $locale->text("$form->{title} Printer"); - - # $locale->text('Add Printer') - # $locale->text('Edit Printer') - - $form->{printer_description} =~ s/\"/"/g; - $form->{template_code} =~ s/\"/"/g; - $form->{printer_command} =~ s/\"/"/g; - - - $form->header; - - print qq| - - -
- -{id}> - - - - - - - - - - - - - - - - - - - - - -
$form->{title}
| . $locale->text('Printer') . qq|
| . $locale->text('Printer Command') . qq|
| . $locale->text('Template Code') . qq|

-|; - - $main::lxdebug->leave_sub(); -} - -sub save_printer { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - $main::auth->assert('config'); - - $form->isblank("printer_description", $locale->text('Description missing!')); - $form->isblank("printer_command", $locale->text('Printer Command missing!')); - AM->save_printer(\%myconfig, \%$form); - $form->redirect($locale->text('Printer saved!')); - - $main::lxdebug->leave_sub(); -} - -sub delete_printer { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - $main::auth->assert('config'); - - AM->delete_printer(\%myconfig, \%$form); - $form->redirect($locale->text('Printer deleted!')); - - $main::lxdebug->leave_sub(); -} - sub add_payment { $main::lxdebug->enter_sub(); @@ -2531,6 +2304,8 @@ sub payment_header { "with discount") . qq|
  • | . $locale->text("<%skonto_amount%> -- The deductible amount") +. qq|
  • +
  • | . $locale->text("<%skonto_in_percent%> -- The discount in percent") . qq|
  • | . $locale->text("<%total%> -- Amount payable") . qq|
  • @@ -2720,10 +2495,8 @@ sub config { { 'name' => $locale->text('Queue'), 'value' => 'queue', 'selected' => $selected{queue}, }, ]; - AM->printer(\%myconfig, $form); - $form->{PRINTERS} = []; - foreach my $printer (@{$form->{"ALL"}}) { + foreach my $printer (SL::Printer->all_printers(%::myconfig)) { push @{ $form->{PRINTERS} }, { 'name' => $printer->{printer_description}, 'value' => $printer->{id}, @@ -2743,7 +2516,7 @@ sub config { } $form->{STYLESHEETS} = []; - foreach my $item (qw(lx-office-erp.css Win2000.css)) { + foreach my $item (qw(lx-office-erp.css Win2000.css Mobile.css)) { push @{ $form->{STYLESHEETS} }, { 'name' => $item, 'value' => $item, @@ -3543,7 +3316,7 @@ sub delete_warehouse { $form->header(); print $form->parse_html_template('am/confirm_delete_warehouse'); - exit 0; + ::end_of_request(); } if (AM->delete_warehouse(\%myconfig, $form)) {