From 319b4d4714b1373bc41e80f4cce3783c1dbb81cb Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 26 Feb 2014 13:35:42 +0100 Subject: [PATCH] Bug 11603: If a letter code is given, filenames should contain it If you choose to generate print notices for a specific letter code, the generated files should be distinct. The use case is: you want to process print notice for letter codes: overdue1, overdue2 and overdue3. The cronjobs will be: perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue1 --csv --ods --html --delimiter=";" perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue2 --csv --ods --html --delimiter=";" perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue3 --csv --ods --html --delimiter=";" without this patch, the 2 first files will be erased. Signed-off-by: Frederic Demians Signed-off-by: Katrin Fischer --- misc/cronjobs/gather_print_notices.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/cronjobs/gather_print_notices.pl b/misc/cronjobs/gather_print_notices.pl index 86b2a6f..9697e3d 100755 --- a/misc/cronjobs/gather_print_notices.pl +++ b/misc/cronjobs/gather_print_notices.pl @@ -134,10 +134,10 @@ sub print_notices { } while ( my ( $branchcode, $branch_messages ) = each %$messages_by_branch ) { + my $letter_code = @letter_codes == 1 ? $letter_codes[0] : 'hold'; my $filename = $split - ? 'holdnotices-' . $today->output('iso') . "-$branchcode.$format" - : 'holdnotices-' . $today->output('iso') . ".$format"; - + ? "notices_$letter_code-" . $today->output('iso') . "-$branchcode.$format" + : "notices_$letter_code-" . $today->output('iso') . ".$format"; my $filepath = File::Spec->catdir( $output_directory, $filename ); if ( $format eq 'html' ) { generate_html({ -- 2.1.0