[Rt-commit] r2851 - in rt/branches/QUEBEC-EXPERIMENTAL: . lib/RT
jesse at bestpractical.com
jesse at bestpractical.com
Fri May 6 16:45:10 EDT 2005
Author: jesse
Date: Fri May 6 16:45:10 2005
New Revision: 2851
Modified:
rt/branches/QUEBEC-EXPERIMENTAL/ (props changed)
rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/ObjectCustomFields_Overlay.pm
Log:
r15845 at hualien: jesse | 2005-05-06 16:35:42 -0400
r15829 at hualien: jesse | 2005-05-06 16:06:12 -0400
* Make sure that disabled custom fields aren't listed in Queue CF listings.
Modified: rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/ObjectCustomFields_Overlay.pm
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/ObjectCustomFields_Overlay.pm (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/ObjectCustomFields_Overlay.pm Fri May 6 16:45:10 2005
@@ -63,12 +63,14 @@
sub LimitToLookupType {
my $self = shift;
my $lookup = shift;
- my $cfs = $self->NewAlias('CustomFields');
+ unless ($self->{'_cfs_alias'}) {
+ $self->{'_cfs_alias'} = $self->NewAlias('CustomFields');
+ }
$self->Join( ALIAS1 => 'main',
FIELD1 => 'CustomField',
- ALIAS2 => $cfs,
+ ALIAS2 => $self->{'_cfs_alias'},
FIELD2 => 'id' );
- $self->Limit( ALIAS => $cfs,
+ $self->Limit( ALIAS => $self->{'_cfs_alias'},
FIELD => 'LookupType',
OPERATOR => '=',
VALUE => $lookup );
@@ -97,4 +99,15 @@
map { $_->CustomFieldObj } @{$self->ItemsArrayRef};
}
+sub _DoSearch {
+ my $self = shift;
+ if ($self->{'_cfs_alias'}) {
+ $self->Limit( ALIAS => $self->{'_cfs_alias'},
+ FIELD => 'Disabled',
+ OPERATOR => '!=',
+ VALUE => 1);
+ }
+ $self->SUPER::_DoSearch()
+}
+
1;
More information about the Rt-commit
mailing list