[open-ils-commits] r9430 - trunk/Open-ILS/src/reporter
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Apr 22 15:11:19 EDT 2008
Author: erickson
Date: 2008-04-22 14:32:12 -0400 (Tue, 22 Apr 2008)
New Revision: 9430
Modified:
trunk/Open-ILS/src/reporter/clark-kent.pl
Log:
added support for taking pivot info from the report def
Modified: trunk/Open-ILS/src/reporter/clark-kent.pl
===================================================================
--- trunk/Open-ILS/src/reporter/clark-kent.pl 2008-04-22 18:30:06 UTC (rev 9429)
+++ trunk/Open-ILS/src/reporter/clark-kent.pl 2008-04-22 18:32:12 UTC (rev 9430)
@@ -14,7 +14,7 @@
use OpenSRF::EX qw/:try/;
use OpenSRF::Utils qw/:daemon/;
use OpenSRF::Utils::JSON;
-#use OpenSRF::Utils::Logger qw/:level/;
+use OpenSRF::Utils::Logger qw/$logger/;
use OpenSRF::System;
use OpenSRF::AppSession;
use OpenSRF::Utils::SettingsClient;
@@ -133,9 +133,13 @@
$r->{report} = $s3;
my $b = OpenILS::Reporter::SQLBuilder->new;
- $b->register_params( OpenSRF::Utils::JSON->JSON2perl( $r->{report}->{data} ) );
+ my $report_data = OpenSRF::Utils::JSON->JSON2perl( $r->{report}->{data} );
+ $b->register_params( $report_data );
$r->{resultset} = $b->parse_report( OpenSRF::Utils::JSON->JSON2perl( $r->{report}->{template}->{data} ) );
+ $r->{resultset}->set_pivot_data($report_data->{__pivot_data}) if $report_data->{__pivot_data};
+ $r->{resultset}->set_pivot_label($report_data->{__pivot_label}) if $report_data->{__pivot_label};
+ $r->{resultset}->set_pivot_default($report_data->{__pivot_default}) if $report_data->{__pivot_default};
$r->{resultset}->relative_time($r->{run_time});
push @reports, $r;
}
@@ -161,6 +165,7 @@
WHERE id = ?;
SQL
+ $logger->debug('Report SQL: ' . $r->{resultset}->toSQL);
$sth = $dbh->prepare($r->{resultset}->toSQL);
$sth->execute;
More information about the open-ils-commits
mailing list