From 781ccb9eaf82bf065d4e14b7f1eec890335be9dc Mon Sep 17 00:00:00 2001 From: Liz Rea Date: Wed, 4 Nov 2015 15:33:40 +1300 Subject: [PATCH] Bug 15120: runreport.pl cronjob doesn't allow custom subjects anymore MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit To test, well do something like misc/cronjobs/runreport.pl --subject="My fancy subject!" --to=you@youraddress.com 1 where 1 is the number of your favourite saved report. Success is your email arrives with the subject "My fancy subject!" Failure is (with --subject defined) you get either the description of the report, or "Koha saved report" as the subject. This is success without --subject defined. Signed-off-by: Frederic Demians Bug repeatable and fixed by this patch. Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 4f8476e09c2de223f73692521b8f8e533ef8400f) Signed-off-by: Frédéric Demians (cherry picked from commit 5288b0d9b579a90e287348c8650d9d92a36f8ca2) Signed-off-by: Liz Rea --- misc/cronjobs/runreport.pl | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/misc/cronjobs/runreport.pl b/misc/cronjobs/runreport.pl index bd4266773c..3ddc1a5856 100755 --- a/misc/cronjobs/runreport.pl +++ b/misc/cronjobs/runreport.pl @@ -163,7 +163,7 @@ my $email = 0; my $format = "text"; my $to = ""; my $from = ""; -my $subject = 'Koha Saved Report'; +my $subject = ""; my $separator = ','; my $quote = '"'; @@ -223,13 +223,16 @@ foreach my $report_id (@ARGV) { my $type = $report->{type}; $verbose and print "SQL: $sql\n\n"; - if (defined($report_name) and $report_name ne "") + if ( $subject eq "" ) { - $subject = $report_name ; - } - else - { - $subject = 'Koha Saved Report'; + if ( defined($report_name) and $report_name ne "") + { + $subject = $report_name ; + } + else + { + $subject = 'Koha Saved Report'; + } } # my $results = execute_query($sql, undef, 0, 99999, $format, $report_id); my ($sth) = execute_query($sql); -- 2.39.5