[Rt-commit] r15592 - in rt/branches/3.999-DANGEROUS: lib/RT/Model
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Thu Aug 28 05:36:39 EDT 2008
Author: sunnavy
Date: Thu Aug 28 05:36:36 2008
New Revision: 15592
Modified:
rt/branches/3.999-DANGEROUS/ (props changed)
rt/branches/3.999-DANGEROUS/lib/RT/Model/TicketCollection.pm
Log:
r16242 at sunnavys-mb: sunnavy | 2008-08-28 15:20:07 +0800
a missing merge in lib/RT/Model/TicketCollection.pm
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/TicketCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/TicketCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/TicketCollection.pm Thu Aug 28 05:36:36 2008
@@ -100,7 +100,7 @@
Type => [ 'ENUM', ],
Creator => [ 'ENUM' => 'User', ],
LastUpdatedBy => [ 'ENUM' => 'User', ],
- Owner => [ 'WATCHERFIELD' => 'owner', ],
+ Owner => [ 'WATCHERFIELD' => 'Owner', ],
EffectiveId => [ 'INT', ],
Id => [ 'INT', ],
InitialPriority => [ 'INT', ],
@@ -1437,10 +1437,48 @@
my @res = ();
my $order = 0;
foreach my $row (@args) {
- if ( $row->{alias} || ( $row->{column} || '' ) !~ /\./ ) {
+ if ( $row->{alias} ) {
push @res, $row;
next;
}
+ if ( $row->{column} !~ /\./ ) {
+ my $meta = $self->columns->{ $row->{column} };
+ unless ($meta) {
+ push @res, $row;
+ next;
+ }
+
+ if ( $meta->[0] eq 'ENUM' && ( $meta->[1] || '' ) eq 'Queue' ) {
+ my $alias = $self->join(
+ type => 'left',
+ alias1 => 'main',
+ column1 => $row->{'column'},
+ table2 => 'Queues',
+ column2 => 'id',
+ );
+ push @res, { %$row, alias => $alias, column => "name" };
+ }
+ elsif (
+ ( $meta->[0] eq 'ENUM' && ( $meta->[1] || '' ) eq 'User' )
+ || ( $meta->[0] eq 'WATCHERFIELD'
+ && ( $meta->[1] || '' ) eq 'Owner' )
+ )
+ {
+ my $alias = $self->join(
+ type => 'left',
+ alias1 => 'main',
+ column1 => $row->{'column'},
+ table2 => 'Users',
+ column2 => 'id',
+ );
+ push @res, { %$row, alias => $alias, column => "name" };
+ }
+ else {
+ push @res, $row;
+ }
+ next;
+ }
+
my ( $field, $subkey ) = split /\./, $row->{column}, 2;
my $meta = $self->columns->{$field};
if ( defined $meta->[0] && $meta->[0] eq 'WATCHERFIELD' ) {
More information about the Rt-commit
mailing list