From 57092dfd78ca022cf0b5ca9af0ad30f4e50aa613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9rick?= Date: Fri, 24 Aug 2012 13:43:51 -0400 Subject: [PATCH] Improvements in the overdue_notices.pl script - UTF-8 support in the HTML output - Add the cardnumber and phone columns to the csv output Patch sponsored by the CCSR ( http://www.ccsr.qc.ca ) --- misc/cronjobs/overdue_notices.pl | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 8c0bc12..105bb56 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -350,7 +350,7 @@ if ( defined $csvfilename ) { } else { open $csv_fh, ">", $csvfilename or die "unable to open $csvfilename: $!"; } - if ( $csv->combine(qw(name surname address1 address2 zipcode city country email itemcount itemsinfo)) ) { + if ( $csv->combine(qw(name surname address1 address2 zipcode city country email phone cardnumber itemcount itemsinfo)) ) { print $csv_fh $csv->string, "\n"; } else { $verbose and warn 'combine failed on argument: ' . $csv->error_input; @@ -364,11 +364,12 @@ if ( defined $htmlfilename ) { $html_fh = *STDOUT; } else { my $today = DateTime->now(time_zone => C4::Context->tz ); - open $html_fh, ">",File::Spec->catdir ($htmlfilename,"notices-".$today->ymd().".html"); + open $html_fh, ">:utf8",File::Spec->catdir ($htmlfilename,"notices-".$today->ymd().".html"); } print $html_fh "\n"; print $html_fh "\n"; + print $html_fh "\n"; print $html_fh "