[open-ils-commits] r9429 - branches/rel_1_2/Open-ILS/src/reporter
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Apr 22 15:09:14 EDT 2008
Author: erickson
Date: 2008-04-22 14:30:06 -0400 (Tue, 22 Apr 2008)
New Revision: 9429
Modified:
branches/rel_1_2/Open-ILS/src/reporter/clark-kent.pl
Log:
added support for taking pivot info from the report def
Modified: branches/rel_1_2/Open-ILS/src/reporter/clark-kent.pl
===================================================================
--- branches/rel_1_2/Open-ILS/src/reporter/clark-kent.pl 2008-04-22 18:01:05 UTC (rev 9428)
+++ branches/rel_1_2/Open-ILS/src/reporter/clark-kent.pl 2008-04-22 18:30:06 UTC (rev 9429)
@@ -13,7 +13,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;
@@ -132,9 +132,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;
}
@@ -160,6 +164,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