Bug 15120: runreport.pl cronjob doesn't allow custom subjects anymore

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 <f.demians@tamil.fr>
  Bug repeatable and fixed by this patch.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Liz Rea 2015-11-04 15:33:40 +13:00 committed by Tomas Cohen Arazi
parent b11eb03a4c
commit 4f8476e09c

View file

@ -164,7 +164,7 @@ my $email = 0;
my $format = "text"; my $format = "text";
my $to = ""; my $to = "";
my $from = ""; my $from = "";
my $subject = 'Koha Saved Report'; my $subject = "";
my $separator = ','; my $separator = ',';
my $quote = '"'; my $quote = '"';
@ -226,7 +226,9 @@ foreach my $report_id (@ARGV) {
my $type = $report->{type}; my $type = $report->{type};
$verbose and print "SQL: $sql\n\n"; $verbose and print "SQL: $sql\n\n";
if (defined($report_name) and $report_name ne "") if ( $subject eq "" )
{
if ( defined($report_name) and $report_name ne "")
{ {
$subject = $report_name ; $subject = $report_name ;
} }
@ -234,6 +236,7 @@ foreach my $report_id (@ARGV) {
{ {
$subject = 'Koha Saved Report'; $subject = 'Koha Saved Report';
} }
}
# my $results = execute_query($sql, undef, 0, 99999, $format, $report_id); # my $results = execute_query($sql, undef, 0, 99999, $format, $report_id);
my ($sth) = execute_query($sql); my ($sth) = execute_query($sql);
# execute_query(sql, , 0, 20, , ) # execute_query(sql, , 0, 20, , )