[Rt-commit] r1989 - in rt/branches/3.3-TESTING: . lib/RT

jesse at bestpractical.com jesse at bestpractical.com
Thu Dec 16 14:46:57 EST 2004


Author: jesse
Date: Mon Dec 13 23:48:14 2004
New Revision: 1989

Modified:
   rt/branches/3.3-TESTING/   (props changed)
   rt/branches/3.3-TESTING/lib/RT/CustomFields_Overlay.pm
   rt/branches/3.3-TESTING/lib/RT/Transaction_Overlay.pm
Log:
 r2419 at hualien:  jesse | 2004-12-14T04:42:37.099863Z
 More fixes for working with Transaction Custom Fields


Modified: rt/branches/3.3-TESTING/lib/RT/CustomFields_Overlay.pm
==============================================================================
--- rt/branches/3.3-TESTING/lib/RT/CustomFields_Overlay.pm	(original)
+++ rt/branches/3.3-TESTING/lib/RT/CustomFields_Overlay.pm	Mon Dec 13 23:48:14 2004
@@ -147,16 +147,6 @@
 }
 # }}}
 
-sub LimitToObjectType {
-    my $self = shift;
-    my $type = shift;
-
-    return if $self->{_sql_limit_objectype}{$type}++;
-    $self->Limit (ALIAS => $self->_OCFAlias,
-		    ENTRYAGGREGATOR => 'OR',
-		    FIELD => 'ObjectType',
-		    VALUE => $type);
-}
 
 # {{{ sub _DoSearch 
 

Modified: rt/branches/3.3-TESTING/lib/RT/Transaction_Overlay.pm
==============================================================================
--- rt/branches/3.3-TESTING/lib/RT/Transaction_Overlay.pm	(original)
+++ rt/branches/3.3-TESTING/lib/RT/Transaction_Overlay.pm	Mon Dec 13 23:48:14 2004
@@ -960,16 +960,12 @@
 
     if ( UNIVERSAL::can( $self->Object, 'QueueObj' ) ) {
 
-        unless ( $field =~ /^\d+$/ ) {
-            my $cf = RT::CustomField->new( $self->CurrentUser );
-            $cf->LoadByName(
-                Name  => $field,
-                Queue => $self->Object->QueueObj->Id
-            );
-            unless ( $cf->id ) {
-                $cf->LoadByName( Name => $field, Queue => '0' );
-            }
-            $field = $cf->id;
+        unless ( $field =~ /^\d+$/o ) {
+            my $CFs = RT::CustomFields->new( $self->CurrentUser );
+             $CFs->Limit( FIELD => 'Name', VALUE => $field);
+            $CFs->LimitToLookupType($self->_LookupTypes);
+            $CFs->LimitToGlobalOrObjectId($self->Object->QueueObj->id);
+            $field = $CFs->First->id if $CFs->First;
         }
     }
     return $self->SUPER::CustomFieldValues($field);


More information about the Rt-commit mailing list