[Koha-patches] [PATCH] (bug #5098) csv headers in overdues

Nahuel ANGELINETTI nahuel.angelinetti at biblibre.com
Fri Aug 6 10:21:00 CEST 2010


this add the csv column headers in mail sent to librarian.
---
 misc/cronjobs/overdue_notices.pl |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl
index bbfc678..752d2b1 100755
--- a/misc/cronjobs/overdue_notices.pl
+++ b/misc/cronjobs/overdue_notices.pl
@@ -509,10 +509,14 @@ END_SQL
                 print @output_chunks;
             }
         } else {
+            # Generate the content of the csv with headers
+            my $content = join(";", qw(title name surname address1 address2 zipcode city email itemcount itemsinfo due_date issue_date)) . "\n";
+            $content .= join( "\n", @output_chunks );
+            
             my $attachment = {
                 filename => defined $csvfilename ? 'attachment.csv' : 'attachment.txt',
                 type => 'text/plain',
-                content => join( "\n", @output_chunks )
+                content => $content,
             };
 
             my $letter = {
-- 
1.7.0.4



More information about the Koha-patches mailing list