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:
parent
92b076f0df
commit
6af71eb13a
|
|
@ -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,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue