my $filename;
my $suffix = ($form->{postscript}) ? '.ps' : '.pdf';
if ($filename = $queued{ $form->{formname} }) {
- $form->{queued} =~ s/\Q$form->{formname} $filename\E//;
unlink $::lx_office_conf{paths}->{spool} . "/$filename";
- $filename =~ s/\..*$//g;
- $filename .= $suffix;
- $form->{OUT} = $::lx_office_conf{paths}->{spool} . "/$filename";
- $form->{OUT_MODE} = '>';
+ delete $queued{ $form->{formname} };
+
+ $form->{queued} = join ' ', %queued;
+ $filename =~ s/\..*$//g;
+ $filename .= $suffix;
+ $form->{OUT} = $::lx_office_conf{paths}->{spool} . "/$filename";
+ $form->{OUT_MODE} = '>';
+
} else {
my $temp_fh;
($temp_fh, $filename) = File::Temp::tempfile(
'kivitendo-spoolXXXXXX',
SUFFIX => "$suffix",
- DIR => $::lx_office_conf{paths}->{spool},
+ DIR => $::lx_office_conf{paths}->{spool},
UNLINK => 0,
);
close $temp_fh;