Bug 11603: Change the output filenames
authorJonathan Druart <jonathan.druart@biblibre.com>
Thu, 23 Apr 2015 11:25:33 +0000 (13:25 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 1 Jun 2015 17:25:24 +0000 (14:25 -0300)
The output filename is notices_all_<date>.[html|csv|ods] if no
letter_code parameter is given.
If 1 is given: notices_<letter_code>_<date>.[html|csv|ods]
If 1+ are given:
noties_<letter_code1>_..._<letter_codeN>_<date>.[html|csv|ods]

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
misc/cronjobs/gather_print_notices.pl

index 0e8cee3..d573f04 100755 (executable)
@@ -145,10 +145,10 @@ sub print_notices {
     }
 
     while ( my ( $branchcode, $branch_messages ) = each %$messages_by_branch ) {
-        my $letter_code = @letter_codes == 1 ? $letter_codes[0] : 'hold';
+        my $letter_codes = @letter_codes == 0 ? 'all' : join '_', @letter_codes;
         my $filename = $split
-            ? "notices_$letter_code-" . $today->output('iso') . "-$branchcode.$format"
-            : "notices_$letter_code-" . $today->output('iso') . ".$format";
+            ? "notices_$letter_codes-" . $today->output('iso') . "-$branchcode.$format"
+            : "notices_$letter_codes-" . $today->output('iso') . ".$format";
         my $filepath = File::Spec->catdir( $output_directory, $filename );
         if ( $format eq 'html' ) {
             generate_html({