(bug #3011) csv export doesn't fill all the fields
authorNahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>
Fri, 6 Mar 2009 11:24:29 +0000 (12:24 +0100)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Tue, 26 May 2009 19:15:23 +0000 (21:15 +0200)
This patch just fix the script which export to csv the overdue, and field the missing fields

misc/cronjobs/overdue_notices.pl

index 7ae67a0..23ce459 100755 (executable)
@@ -393,6 +393,7 @@ END_SQL
                 while ( my $item_info = $sth2->fetchrow_hashref() ) {
                     my @item_info = map { $_ =~ /^date|date$/ ? format_date( $item_info->{$_} ) : $item_info->{$_} || '' } @item_content_fields;
                     $titles .= join("\t", @item_info) . "\n";
+                    $itemcount++;
                 }
                 $sth2->finish;
     
@@ -584,7 +585,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->{'items.content'}
+                $params->{'city'},      $params->{'email'},    $params->{'itemcount'}, $params->{'titles'}
             )
           ) {
             return $csv->string, "\n";