BUGFIX : encoding problem & security problem
[koha_fer] / tools / runreport.pl
index 45d278c..d2d85a2 100755 (executable)
@@ -2,6 +2,7 @@
 
 # fix this line
 use C4::Reports;
+use C4::Context;
 
 use Mail::Sendmail;
 
@@ -9,19 +10,19 @@ use Mail::Sendmail;
 my ($report,$format,$email) = @ARGV;
 
 my ($sql,$type) = get_saved_report($report);
-my $results = execute_query($sql,$type,$format); 
+my $results = execute_query($sql,$type,$format,$report); 
 my $message;
 if ($format eq 'text'){
        $message="<table>$results</table>";     
 }
 if ($format eq 'url'){
-       $message="something";
+       $message="$results";
 }
 
 if ($email){
        my $to      = $email;
        # should be koha admin email
-    my $from    = 'crc@liblime.com';
+    my $from    = C4::Context->preference('KohaAdminEmailAddress');
     my $subject = 'Automated job run';
     my %mail    = (
                        To      => $to,