[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Nicer output for e-mailed documents



Hi Chris,


When mailing documents from the mail interfaces, they get their (ugly)
internal names assigned.

However, it's much nicer if the documents are named using their unique
numbers. The patch below achieves that for invoices and most of the
other mail items.


Index: bin/io.pl
===================================================================
--- bin/io.pl   (revision 3157)
+++ bin/io.pl   (working copy)
@@ -1804,6 +1804,7 @@
         format => uc $form->{format},
         method => $form->{media},
         output_options => \%output_options,
+       output_file => $form->{formname} . "-" . $form->{"${inv}number"},
         );
     try {
         $template->render($form);


This patch has 1 weak spot though: while it should be fine in general,
if two agents are editing and mailing the same form simultaneously,
that could cause an error due to the fact that the process id is no
longer used in the temporary file name.

Do you have a better solution?


Bye,

Erik.