[open-ils-commits] r10469 - in trunk/Open-ILS:
src/perlmods/OpenILS/Reporter web/reports/xul
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Aug 28 08:32:11 EDT 2008
Author: miker
Date: 2008-08-28 08:32:10 -0400 (Thu, 28 Aug 2008)
New Revision: 10469
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Reporter/SQLBuilder.pm
trunk/Open-ILS/web/reports/xul/template-config.js
Log:
moving "builder" to the right place ... now all objects have proper access; removing overly restrictive left join avoidance code -- we may have to go further than this, too
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Reporter/SQLBuilder.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Reporter/SQLBuilder.pm 2008-08-27 20:37:05 UTC (rev 10468)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Reporter/SQLBuilder.pm 2008-08-28 12:32:10 UTC (rev 10469)
@@ -153,7 +153,7 @@
my $self = shift;
my $f = shift;
- $self->{_from} = OpenILS::Reporter::SQLBuilder::Relation->parse( $f, $self );
+ $self->{_from} = OpenILS::Reporter::SQLBuilder::Relation->parse( $f, $self->builder );
return $self;
}
@@ -167,7 +167,7 @@
return $self unless (@cols && defined($cols[0]));
@cols = @{ $cols[0] } if (@cols == 1 && ref($cols[0]) eq 'ARRAY');
- push @{ $self->{_where} }, map { OpenILS::Reporter::SQLBuilder::Column::Where->new( $_, $self->{_from}->builder->{_rels} )->set_builder( $self->builder ) } @cols;
+ push @{ $self->{_where} }, map { OpenILS::Reporter::SQLBuilder::Column::Where->new( $_ )->set_builder( $self->builder ) } @cols;
return $self;
}
@@ -455,8 +455,6 @@
$self->{_aggregate} = $col_data->{aggregate};
- $self->{_rels} = shift;
-
if (ref($self->{_column})) {
my $trans = $self->{_column}->{transform} || 'Bare';
my $pkg = "OpenILS::Reporter::SQLBuilder::Column::Transform::$trans";
@@ -477,7 +475,7 @@
sub find_relation {
my $self = shift;
- return $self->{_rels}->{$self->{_relation}};
+ return $self->builder->{_rels}->{$self->{_relation}};
}
sub name {
@@ -1104,6 +1102,19 @@
bless $self => "OpenILS::Reporter::SQLBuilder::Join::$self->{_join_type}";
+ if ( $self->{_join_type} eq 'inner' or !$self->{_join_type}) {
+ $self->{_join_type} eq 'i';
+ } else {
+ if ($self->{_join_type} eq 'left') {
+ $self->{_right_rel}->{_nullable} = 'l';
+ } elsif ($self->{_join_type} eq 'right') {
+ $self->{_left_rel}->{_nullable} = 'r';
+ } else {
+ $self->{_right_rel}->{_nullable} = 'f';
+ $self->{_left_rel}->{_nullable} = 'f';
+ }
+ }
+
return $self;
}
@@ -1129,10 +1140,6 @@
my $dir = shift;
#return $self->{_sql} if ($self->{_sql});
- my $_nullable_rel = $dir && $dir eq 'r' ? '_left_rel' : '_right_rel';
- $self->{_right_rel}->{_nullable} = 'l';
- $self->{$_nullable_rel}->{_nullable} = $dir;
-
my $j = $dir && $dir eq 'r' ? 'FULL OUTER' : 'LEFT OUTER';
my $sql = "\n\t$j ". $self->SUPER::toSQL('l');
Modified: trunk/Open-ILS/web/reports/xul/template-config.js
===================================================================
--- trunk/Open-ILS/web/reports/xul/template-config.js 2008-08-27 20:37:05 UTC (rev 10468)
+++ trunk/Open-ILS/web/reports/xul/template-config.js 2008-08-28 12:32:10 UTC (rev 10469)
@@ -849,9 +849,9 @@
current_link.getAttribute('reltype') != 'has_a' ||
prev_type == 'left' ||
rel.reltype != 'has_a'
- ) && (
- getKeys(rel.fields.filter_tab).length == 0 &&
- getKeys(rel.fields.aggfitler_tab).length == 0
+// ) && (
+// getKeys(rel.fields.filter_tab).length == 0 &&
+// getKeys(rel.fields.aggfitler_tab).length == 0
)
) current_obj.type = 'left';
More information about the open-ils-commits
mailing list