[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-829-g07d6bbc

Kevin Falcone falcone at bestpractical.com
Mon Sep 20 14:06:16 EDT 2010


The branch, 3.9-trunk has been updated
       via  07d6bbc464cf828bbe8f49d717a2bd50254a2a76 (commit)
      from  7bd938f511597d4c1080a1a69ce3a48d9864a755 (commit)

Summary of changes:
 lib/RT/SearchBuilder.pm |   90 -----------------------------------------------
 1 files changed, 0 insertions(+), 90 deletions(-)

- Log -----------------------------------------------------------------
commit 07d6bbc464cf828bbe8f49d717a2bd50254a2a76
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Sep 20 14:08:45 2010 -0400

    Remove old dead LimitAttribute code
    
    This doesn't seem to be used anywhere, and should have been
    replaced by the real Attribute code in Record.pm

diff --git a/lib/RT/SearchBuilder.pm b/lib/RT/SearchBuilder.pm
index b47094c..64d1045 100755
--- a/lib/RT/SearchBuilder.pm
+++ b/lib/RT/SearchBuilder.pm
@@ -121,96 +121,6 @@ sub FindAllRows {
     shift->{'find_disabled_rows'} = 1;
 }
 
-=head2 LimitAttribute PARAMHASH
-
-Takes NAME, OPERATOR and VALUE to find records that has the
-matching Attribute.
-
-If EMPTY is set, also select rows with an empty string as
-Attribute's Content.
-
-If NULL is set, also select rows without the named Attribute.
-
-=cut
-
-my %Negate = (
-    '='        => '!=',
-    '!='       => '=',
-    '>'        => '<=',
-    '<'        => '>=',
-    '>='       => '<',
-    '<='       => '>',
-    'LIKE'     => 'NOT LIKE',
-    'NOT LIKE' => 'LIKE',
-    'IS'       => 'IS NOT',
-    'IS NOT'   => 'IS',
-);
-
-sub LimitAttribute {
-    my ($self, %args) = @_;
-    my $clause = 'ALIAS';
-    my $operator = ($args{OPERATOR} || '=');
-    
-    if ($args{NULL} and exists $args{VALUE}) {
-	$clause = 'LEFTJOIN';
-	$operator = $Negate{$operator};
-    }
-    elsif ($args{NEGATE}) {
-	$operator = $Negate{$operator};
-    }
-    
-    my $alias = $self->Join(
-	TYPE   => 'left',
-	ALIAS1 => $args{ALIAS} || 'main',
-	FIELD1 => 'id',
-	TABLE2 => 'Attributes',
-	FIELD2 => 'ObjectId'
-    );
-
-    my $type = ref($self);
-    $type =~ s/(?:s|Collection)$//; # XXX - Hack!
-
-    $self->Limit(
-	$clause	   => $alias,
-	FIELD      => 'ObjectType',
-	OPERATOR   => '=',
-	VALUE      => $type,
-    );
-    $self->Limit(
-	$clause	   => $alias,
-	FIELD      => 'Name',
-	OPERATOR   => '=',
-	VALUE      => $args{NAME},
-    ) if exists $args{NAME};
-
-    return unless exists $args{VALUE};
-
-    $self->Limit(
-	$clause	   => $alias,
-	FIELD      => 'Content',
-	OPERATOR   => $operator,
-	VALUE      => $args{VALUE},
-    );
-
-    # Capture rows with the attribute defined as an empty string.
-    $self->Limit(
-	$clause    => $alias,
-	FIELD      => 'Content',
-	OPERATOR   => '=',
-	VALUE      => '',
-	ENTRYAGGREGATOR => $args{NULL} ? 'AND' : 'OR',
-    ) if $args{EMPTY};
-
-    # Capture rows without the attribute defined
-    $self->Limit(
-	%args,
-	ALIAS      => $alias,
-	FIELD	   => 'id',
-	OPERATOR   => ($args{NEGATE} ? 'IS NOT' : 'IS'),
-	VALUE      => 'NULL',
-    ) if $args{NULL};
-}
-
 =head2 LimitCustomField
 
 Takes a paramhash of key/value pairs with the following keys:

-----------------------------------------------------------------------


More information about the Rt-commit mailing list