Revision 564d8509
Von Sven Schöling vor mehr als 17 Jahren hinzugefügt
bin/mozilla/io.pl | ||
---|---|---|
1270 | 1270 |
$form->{oldmedia} = $form->{media}; |
1271 | 1271 |
$form->{media} = "email"; |
1272 | 1272 |
|
1273 |
my %formname_translations = ( |
|
1274 |
"bin_list" => $locale->text('Bin List'), |
|
1275 |
"credit_note" => $locale->text('Credit Note'), |
|
1276 |
"invoice" => $locale->text('Invoice'), |
|
1277 |
"packing_list" => $locale->text('Packing List'), |
|
1278 |
"pick_list" => $locale->text('Pick List'), |
|
1279 |
"proforma" => $locale->text('Proforma Invoice'), |
|
1280 |
"purchase_order" => $locale->text('Purchase Order'), |
|
1281 |
"request_quotation" => $locale->text('RFQ'), |
|
1282 |
"sales_order" => $locale->text('Confirmation'), |
|
1283 |
"sales_quotation" => $locale->text('Quotation'), |
|
1284 |
"storno_invoice" => $locale->text('Storno Invoice'), |
|
1285 |
"storno_packing_list" => $locale->text('Storno Packing List'), |
|
1286 |
); |
|
1287 |
|
|
1288 |
my $attachment_filename = $formname_translations{$form->{"formname"}}; |
|
1289 |
my $prefix; |
|
1290 |
|
|
1291 |
if (grep({ $form->{"type"} eq $_ } qw(invoice credit_note))) { |
|
1292 |
$prefix = "inv"; |
|
1293 |
} elsif ($form->{"type"} =~ /_quotation$/) { |
|
1294 |
$prefix = "quo"; |
|
1295 |
} else { |
|
1296 |
$prefix = "ord"; |
|
1297 |
} |
|
1298 |
|
|
1299 |
if ($attachment_filename && $form->{"${prefix}number"}) { |
|
1300 |
$attachment_filename .= "_" . $form->{"${prefix}number"} . |
|
1301 |
($form->{"format"} =~ /pdf/i ? ".pdf" : |
|
1302 |
$form->{"format"} =~ /postscript/i ? ".ps" : |
|
1303 |
$form->{"format"} =~ /opendocument/i ? ".odt" : |
|
1304 |
$form->{"format"} =~ /html/i ? ".html" : ""); |
|
1305 |
$attachment_filename =~ s/ /_/g; |
|
1306 |
my %umlaute = ( "?" => "ae", "?" => "oe", "?" => "ue", |
|
1307 |
"?" => "Ae", "?" => "Oe", "?" => "Ue", "?" => "ss"); |
|
1308 |
map { $attachment_filename =~ s/$_/$umlaute{$_}/g } keys %umlaute; |
|
1309 |
} else { |
|
1310 |
$attachment_filename = ""; |
|
1311 |
} |
|
1273 |
my $attachment_filename = $form->generate_attachment_filename(); |
|
1312 | 1274 |
|
1313 | 1275 |
$form->{"fokus"} = $form->{"email"} ? "Form.subject" : "Form.email"; |
1314 | 1276 |
$form->header; |
Auch abrufbar als: Unified diff
Attachment Filenmaes werden nun von einer SL/Form.pm Objektfunktion generiert