X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fio.pl;h=a1a9c4da0f00600500cb6e249524b98e79a4c9d7;hb=2d6988532a665bd7e42bb88a38a8b52cbb352646;hp=ca6d96bccac5ebb74e4b7ac13b88941aa964db59;hpb=8750748a82df4c51b682be923dbb301d1a036212;p=kivitendo-erp.git diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index ca6d96bcc..a1a9c4da0 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1270,52 +1270,15 @@ sub edit_e_mail { $form->{oldmedia} = $form->{media}; $form->{media} = "email"; - my %formname_translations = ( - "bin_list" => $locale->text('Bin List'), - "credit_note" => $locale->text('Credit Note'), - "invoice" => $locale->text('Invoice'), - "packing_list" => $locale->text('Packing List'), - "pick_list" => $locale->text('Pick List'), - "proforma" => $locale->text('Proforma Invoice'), - "purchase_order" => $locale->text('Purchase Order'), - "request_quotation" => $locale->text('RFQ'), - "sales_order" => $locale->text('Confirmation'), - "sales_quotation" => $locale->text('Quotation'), - "storno_invoice" => $locale->text('Storno Invoice'), - "storno_packing_list" => $locale->text('Storno Packing List'), - ); - - my $attachment_filename = $formname_translations{$form->{"formname"}}; - my $prefix; - - if (grep({ $form->{"type"} eq $_ } qw(invoice credit_note))) { - $prefix = "inv"; - } elsif ($form->{"type"} =~ /_quotation$/) { - $prefix = "quo"; - } else { - $prefix = "ord"; - } - - if ($attachment_filename && $form->{"${prefix}number"}) { - $attachment_filename .= "_" . $form->{"${prefix}number"} . - ($form->{"format"} =~ /pdf/i ? ".pdf" : - $form->{"format"} =~ /postscript/i ? ".ps" : - $form->{"format"} =~ /opendocument/i ? ".odt" : - $form->{"format"} =~ /html/i ? ".html" : ""); - $attachment_filename =~ s/ /_/g; - my %umlaute = ( "ä" => "ae", "ö" => "oe", "ü" => "ue", - "Ä" => "Ae", "Ö" => "Oe", "Ü" => "Ue", "ß" => "ss"); - map { $attachment_filename =~ s/$_/$umlaute{$_}/g } keys %umlaute; - } else { - $attachment_filename = ""; - } + my $attachment_filename = $form->generate_attachment_filename(); $form->{"fokus"} = $form->{"email"} ? "Form.subject" : "Form.email"; $form->header; - my (@nh, %nh, @hiddenkeys); - @nh = qw(action email cc bcc subject message formname sendmode format header override); $nh{@nh} = (1)x@nh; - @hidden_keys = grep { !$nh{$_} } grep { !ref $form->{$_} } keys %$form; + my (@dont_hide_key_list, %dont_hide_key, @hidden_keys); + @dont_hide_key_list = qw(action email cc bcc subject message formname sendmode format header override); + @dont_hide_key{@dont_hide_key_list} = (1) x @dont_hide_key_list; + @hidden_keys = grep { !$dont_hide_key{$_} } grep { !ref $form->{$_} } keys %$form; print $form->parse_html_template('generic/edit_email', { title => $title, @@ -1710,6 +1673,8 @@ sub print_form { $form->{templates} = "$myconfig{templates}"; + delete $form->{printer_command}; + $form->{language} = $form->get_template_language(\%myconfig); $form->{printer_code} = $form->get_printer_code(\%myconfig); @@ -1774,6 +1739,8 @@ sub print_form { $form->{"IN"} =~ s/html$/odt/; } + delete $form->{OUT}; + if ($form->{media} eq 'printer') { $form->{OUT} = "| $form->{printer_command} &>/dev/null"; $form->{printed} .= " $form->{formname}"; @@ -1785,15 +1752,13 @@ sub print_form { $form->{subject} = qq|$form->{label} $form->{"${inv}number"}| unless $form->{subject}; - $form->{OUT} = "$sendmail"; - $form->{emailed} .= " $form->{formname}"; $form->{emailed} =~ s/^ //; } $emailed = $form->{emailed}; if ($form->{media} eq 'queue') { - %queued = split / /, $form->{queued}; + %queued = map { s|.*/|| } split / /, $form->{queued}; if ($filename = $queued{ $form->{formname} }) { $form->{queued} =~ s/$form->{formname} $filename//;