MT3346 : overdue_notices

-csv was not working as advertised.
This feature is now working as it is forecast

Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
Henri-Damien LAURENT 2010-05-01 00:19:47 +02:00 committed by Galen Charlton
parent 92b076f0df
commit 6af71eb13a
1 changed files with 24 additions and 29 deletions

View File

@ -566,39 +566,34 @@ END_SQL
}
if (@output_chunks) {
if ($nomail) {
if ( defined $csvfilename ) {
print $csv_fh @output_chunks;
} elsif ( defined $htmlfilename ) {
print $html_fh @output_chunks;
} else {
local $, = "\f"; # pagebreak
print @output_chunks;
}
}
if ( defined $csvfilename ) {
print $csv_fh @output_chunks;
}
elsif ( defined $htmlfilename ) {
print $html_fh @output_chunks;
}
else {
my $attachment = {
filename => defined $csvfilename ? 'attachment.csv' : 'attachment.txt',
type => 'text/plain',
content => join( "\n", @output_chunks )
};
my $letter = {
title => 'Overdue Notices',
content => 'These messages were not sent directly to the patrons.',
};
C4::Letters::EnqueueLetter(
{ letter => $letter,
borrowernumber => undef,
message_transport_type => 'email',
attachments => [$attachment],
to_address => $admin_email_address,
}
);
elsif ($nomail){
local $, = "\f"; # pagebreak
print @output_chunks;
}
my $attachment = {
filename => defined $csvfilename ? 'attachment.csv' : 'attachment.txt',
type => 'text/plain',
content => join( "\n", @output_chunks )
};
my $letter = {
title => 'Overdue Notices',
content => 'These messages were not sent directly to the patrons.',
};
C4::Letters::EnqueueLetter(
{ letter => $letter,
borrowernumber => undef,
message_transport_type => 'email',
attachments => [$attachment],
to_address => $admin_email_address,
}
);
}
}