Refactoring; Kosmetik: Ausrichtung
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 7 Nov 2012 14:45:46 +0000 (15:45 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 7 Nov 2012 14:46:04 +0000 (15:46 +0100)
bin/mozilla/io.pl

index 467092e..698758e 100644 (file)
@@ -1541,18 +1541,21 @@ sub print_form {
     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;