Bugzilla – Attachment 11829 Details for
Bug 8687
Improvements in overdue_notices.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8687: Improvements in the overdue_notices.pl script
Bug-8687-Improvements-in-the-overduenoticespl-scri.patch (text/plain), 4.24 KB, created by
Chris Cormack
on 2012-08-24 23:17:41 UTC
(
hide
)
Description:
Bug 8687: Improvements in the overdue_notices.pl script
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2012-08-24 23:17:41 UTC
Size:
4.24 KB
patch
obsolete
>From db26bb641ca219c57d98263d0bfb39e4caa94bde Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9rick?= <frederick.capovilla@libeo.com> >Date: Fri, 24 Aug 2012 13:43:51 -0400 >Subject: [PATCH] Bug 8687: 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 ) > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > misc/cronjobs/overdue_notices.pl | 15 +++++++++------ > 1 file 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 "<html>\n"; > print $html_fh "<head>\n"; >+ print $html_fh "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n"; > print $html_fh "<style type='text/css'>\n"; > print $html_fh "pre {page-break-after: always;}\n"; > print $html_fh "pre {white-space: pre-wrap;}\n"; >@@ -439,7 +440,7 @@ END_SQL > # <date> <itemcount> <firstname> <lastname> <address1> <address2> <address3> <city> <postcode> > > my $borrower_sql = <<'END_SQL'; >-SELECT distinct(issues.borrowernumber), firstname, surname, address, address2, city, zipcode, country, email >+SELECT distinct(issues.borrowernumber), firstname, surname, address, address2, city, zipcode, country, email, phone, cardnumber > FROM issues,borrowers,categories > WHERE issues.borrowernumber=borrowers.borrowernumber > AND borrowers.categorycode=categories.categorycode >@@ -468,8 +469,8 @@ END_SQL > $verbose and warn $borrower_sql . "\n $branchcode | " . $overdue_rules->{'categorycode'} . "\n ($mindays, $maxdays)\nreturns " . $sth->rows . " rows"; > > while ( my ( $borrowernumber, $firstname, $lastname, >- $address1, $address2, $city, $postcode, $country, $email >- ) = $sth->fetchrow ) >+ $address1, $address2, $city, $postcode, $country, $email, >+ $phone, $cardnumber) = $sth->fetchrow ) > { > $verbose and warn "borrower $firstname, $lastname ($borrowernumber) has items triggering level $i."; > >@@ -546,6 +547,8 @@ END_SQL > postcode => $postcode, > email => $email, > itemcount => $itemcount, >+ phone => $phone, >+ cardnumber => $cardnumber, > titles => $titles, > outputformat => defined $csvfilename ? 'csv' : defined $htmlfilename ? 'html' : '', > } >@@ -735,7 +738,7 @@ sub prepare_letter_for_printing { > if ( exists $params->{'outputformat'} && $params->{'outputformat'} eq 'csv' ) { > if ($csv->combine( > $params->{'firstname'}, $params->{'lastname'}, $params->{'address1'}, $params->{'address2'}, $params->{'postcode'}, >- $params->{'city'}, $params->{'email'}, $params->{'itemcount'}, $params->{'titles'} >+ $params->{'city'}, $params->{'email'}, $params->{'phone'}, $params->{'cardnumber'}, $params->{'itemcount'}, $params->{'titles'} > ) > ) { > return $csv->string, "\n"; >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8687
:
11826
|
11829
|
12404
|
12711
|
12712
|
12713
|
17601
|
17941
|
23150
|
23229
|
30403
|
30451
|
30530
|
30538
|
30873
|
30874
|
30875