View | Details | Raw Unified | Return to bug 11188
Collapse All | Expand All

(-)a/misc/cronjobs/gather_print_notices.pl (-7 / +9 lines)
Lines 59-67 usage(0) if ($help); Link Here
59
59
60
my $output_directory = $ARGV[0];
60
my $output_directory = $ARGV[0];
61
61
62
if ( !$output_directory || !-d $output_directory ) {
62
if ( !$output_directory || !-d $output_directory || !-w $output_directory ) {
63
    print STDERR
63
    print STDERR
64
"Error: You must specify a valid directory to dump the print notices in.\n";
64
"Error: You must specify a valid and writeable directory to dump the print notices in.\n";
65
    usage(1);
65
    usage(1);
66
}
66
}
67
67
Lines 87-95 if ($split) { Link Here
87
87
88
    foreach my $branchcode ( keys %messages_by_branch ) {
88
    foreach my $branchcode ( keys %messages_by_branch ) {
89
        my @messages = @{ $messages_by_branch{$branchcode} };
89
        my @messages = @{ $messages_by_branch{$branchcode} };
90
        open $OUTPUT, '>',
90
        my $output_file = File::Spec->catdir( $output_directory,
91
          File::Spec->catdir( $output_directory,
92
            "holdnotices-" . $today->output('iso') . "-$branchcode.html" );
91
            "holdnotices-" . $today->output('iso') . "-$branchcode.html" );
92
        open $OUTPUT, '>', $output_file
93
            or die "Could not open $output_file: $!";
93
94
94
        my $template =
95
        my $template =
95
          C4::Templates::gettemplate( 'batch/print-notices.tmpl', 'intranet',
96
          C4::Templates::gettemplate( 'batch/print-notices.tmpl', 'intranet',
Lines 112-120 if ($split) { Link Here
112
    }
113
    }
113
}
114
}
114
else {
115
else {
115
    open $OUTPUT, '>',
116
    my $output_file = File::Spec->catdir( $output_directory,
116
      File::Spec->catdir( $output_directory,
117
        "holdnotices-" . $today->output('iso') . ".html" );
117
        "holdnotices-" . $today->output('iso') . ".html" );
118
    open $OUTPUT, '>', $output_file
119
        or die "Could not open $output_file: $!";
120
118
121
119
    my $template =
122
    my $template =
120
      C4::Templates::gettemplate( 'batch/print-notices.tmpl', 'intranet',
123
      C4::Templates::gettemplate( 'batch/print-notices.tmpl', 'intranet',
121
- 

Return to bug 11188