summaryrefslogtreecommitdiff
path: root/rt/lib/RT/SearchBuilder.pm
diff options
context:
space:
mode:
Diffstat (limited to 'rt/lib/RT/SearchBuilder.pm')
-rw-r--r--rt/lib/RT/SearchBuilder.pm64
1 files changed, 21 insertions, 43 deletions
diff --git a/rt/lib/RT/SearchBuilder.pm b/rt/lib/RT/SearchBuilder.pm
index 3bae0eea6..527952b67 100644
--- a/rt/lib/RT/SearchBuilder.pm
+++ b/rt/lib/RT/SearchBuilder.pm
@@ -65,7 +65,7 @@
package RT::SearchBuilder;
use RT::Base;
-use DBIx::SearchBuilder "1.40";
+use DBIx::SearchBuilder "1.50";
use strict;
use warnings;
@@ -93,9 +93,10 @@ Only find items that haven't been disabled
sub LimitToEnabled {
my $self = shift;
-
- $self->{'handled_disabled_column'} = 1;
- $self->Limit( FIELD => 'Disabled', VALUE => '0' );
+
+ $self->Limit( FIELD => 'Disabled',
+ VALUE => '0',
+ OPERATOR => '=' );
}
=head2 LimitToDeleted
@@ -106,19 +107,12 @@ Only find items that have been deleted.
sub LimitToDeleted {
my $self = shift;
-
- $self->{'handled_disabled_column'} = $self->{'find_disabled_rows'} = 1;
- $self->Limit( FIELD => 'Disabled', VALUE => '1' );
-}
-
-=head2 FindAllRows
-
-Find all matching rows, regardless of whether they are disabled or not
-
-=cut
-
-sub FindAllRows {
- shift->{'find_disabled_rows'} = 1;
+
+ $self->{'find_disabled_rows'} = 1;
+ $self->Limit( FIELD => 'Disabled',
+ OPERATOR => '=',
+ VALUE => '1'
+ );
}
=head2 LimitAttribute PARAMHASH
@@ -268,6 +262,16 @@ sub LimitCustomField {
);
}
+=head2 FindAllRows
+
+Find all matching rows, regardless of whether they are disabled or not
+
+=cut
+
+sub FindAllRows {
+ shift->{'find_disabled_rows'} = 1;
+}
+
=head2 Limit PARAMHASH
This Limit sub calls SUPER::Limit, but defaults "CASESENSITIVE" to 1, thus
@@ -319,32 +323,6 @@ sub ItemsArrayRef {
return $self->ItemsOrderBy($self->SUPER::ItemsArrayRef());
}
-# make sure that Disabled rows never get seen unless
-# we're explicitly trying to see them.
-
-sub _DoSearch {
- my $self = shift;
-
- if ( $self->{'with_disabled_column'}
- && !$self->{'handled_disabled_column'}
- && !$self->{'find_disabled_rows'}
- ) {
- $self->LimitToEnabled;
- }
- return $self->SUPER::_DoSearch(@_);
-}
-sub _DoCount {
- my $self = shift;
-
- if ( $self->{'with_disabled_column'}
- && !$self->{'handled_disabled_column'}
- && !$self->{'find_disabled_rows'}
- ) {
- $self->LimitToEnabled;
- }
- return $self->SUPER::_DoCount(@_);
-}
-
eval "require RT::SearchBuilder_Vendor";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/SearchBuilder_Vendor.pm});
eval "require RT::SearchBuilder_Local";