[Rt-commit] r2242 - in rtfm/branches/2.1-TESTING: . html/Callbacks/RTFM/autohandler html/RTFM/Admin/CustomFields html/RTFM/Elements lib/RT/FM lib/RT/Framework

jesse at bestpractical.com jesse at bestpractical.com
Thu Feb 17 02:17:07 EST 2005


Author: jesse
Date: Thu Feb 17 02:17:05 2005
New Revision: 2242

Removed:
   rtfm/branches/2.1-TESTING/html/RTFM/Admin/CustomFields/GroupRights.html
   rtfm/branches/2.1-TESTING/html/RTFM/Admin/CustomFields/UserRights.html
   rtfm/branches/2.1-TESTING/html/RTFM/Elements/SelectCustomFieldType
   rtfm/branches/2.1-TESTING/lib/RT/FM/CustomFieldValue_Overlay.pm
   rtfm/branches/2.1-TESTING/lib/RT/FM/CustomField_Overlay.pm
   rtfm/branches/2.1-TESTING/lib/RT/Framework/
Modified:
   rtfm/branches/2.1-TESTING/   (props changed)
   rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/autohandler/Default
   rtfm/branches/2.1-TESTING/lib/RT/FM/ArticleCollection_Overlay.pm
   rtfm/branches/2.1-TESTING/lib/RT/FM/Article_Overlay.pm
   rtfm/branches/2.1-TESTING/lib/RT/FM/Class_Overlay.pm
Log:
 r4833 at hualien:  jesse | 2005-02-16T19:07:28.197461Z
 more removing things that don't need to be there


Modified: rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/autohandler/Default
==============================================================================
--- rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/autohandler/Default	(original)
+++ rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/autohandler/Default	Thu Feb 17 02:17:05 2005
@@ -20,7 +20,6 @@
 use RT::FM;
 use RT::FM::ArticleCollection;
 use RT::FM::ClassCollection;
-use RT::FM::CustomFieldCollection;
 use RT::FM::TopicCollection;
 use RT::FM::ObjectTopicCollection;
 use Time::ParseDate;

Modified: rtfm/branches/2.1-TESTING/lib/RT/FM/ArticleCollection_Overlay.pm
==============================================================================
--- rtfm/branches/2.1-TESTING/lib/RT/FM/ArticleCollection_Overlay.pm	(original)
+++ rtfm/branches/2.1-TESTING/lib/RT/FM/ArticleCollection_Overlay.pm	Thu Feb 17 02:17:05 2005
@@ -18,10 +18,6 @@
 
 use strict;
 package RT::FM::ArticleCollection;
-
-
-
-
 no warnings qw/redefine/;
 
 =head2 Next

Modified: rtfm/branches/2.1-TESTING/lib/RT/FM/Article_Overlay.pm
==============================================================================
--- rtfm/branches/2.1-TESTING/lib/RT/FM/Article_Overlay.pm	(original)
+++ rtfm/branches/2.1-TESTING/lib/RT/FM/Article_Overlay.pm	Thu Feb 17 02:17:05 2005
@@ -22,7 +22,6 @@
 
 use RT::FM;
 use RT::FM::ArticleCollection;
-use RT::FM::CustomFieldCollection;
 use RT::FM::ObjectTopicCollection;
 use RT::FM::ClassCollection;
 use RT::Links;
@@ -1238,7 +1237,7 @@
     return ( $self->CurrentUser->HasRight(
                             Right        => $right,
                             Object       => $self,
-                            EquivObjects => [ $RT::FM::System, $self->ClassObj ]
+                            EquivObjects => [ $RT::FM::System, $RT::System, $self->ClassObj ]
              ) );
 
 }

Modified: rtfm/branches/2.1-TESTING/lib/RT/FM/Class_Overlay.pm
==============================================================================
--- rtfm/branches/2.1-TESTING/lib/RT/FM/Class_Overlay.pm	(original)
+++ rtfm/branches/2.1-TESTING/lib/RT/FM/Class_Overlay.pm	Thu Feb 17 02:17:05 2005
@@ -16,12 +16,14 @@
 # 
 # END LICENSE BLOCK
 
+package RT::FM::Class;
+
 no warnings qw/redefine/;
 use strict;
 
 
 use RT::FM::System;
-use RT::FM::CustomFieldCollection;
+use RT::CustomFields;
 use RT::ACL;
 
 
@@ -88,6 +90,12 @@
 
 # }}}
 
+# This object takes custom fields
+
+RT::CustomField->_ForObjectType(_LookupTypes() => 'RTFM Articles'); #loc
+
+
+
 # {{{ Create
 
 =item Create PARAMHASH
@@ -187,51 +195,7 @@
 }
 # }}}
 
-# {{{ CustomFields
-
-=head2 CustomFields
-
-Returns a CustomFieldCollection of all custom fields related to this article
-
-=begin testing
-
-my ($id,$msg);
-
-my $class = RT::FM::Class->new($RT::SystemUser);
-($id,$msg) = $class->Create(Name => 'CFTests');
-ok($id, $msg);
-
-ok($class->CustomFields->Count == 0, "The class has no custom fields");
-my $cf1 = RT::FM::CustomField->new($RT::SystemUser);
-($id, $msg) =$cf1->Create(Name => "ListTest1", Type => "SelectMultiple");
-ok ($id, $msg);
-ok($cf1->AddToClass($class->Id));
-ok($class->CustomFields->Count == 1, "The class has 1 custom field - ");
-my $cf2 = RT::FM::CustomField->new($RT::SystemUser);
-($id, $msg) =$cf2->Create(Name => "ListTest2", Type => "SelectMultiple");
-ok ($id, $msg);
-
-# We're not going to do global custom fields
 
-ok ($class->CustomFields->HasEntry($cf1->Id), "The class knows that it has the local cf specifically");
-ok (!$class->CustomFields->HasEntry(9899), "The class knows that it doesn't have some random cf");
-
-=end testing
-
-=cut
-
-
-sub CustomFields {
-    my $self      = shift;
-    
-    my $cfs       = RT::FM::CustomFieldCollection->new( $self->CurrentUser );
-    if ($self->CurrentUserHasRight('SeeClass')) {
-        $cfs->LimitToClass($self->Id);
-
-    }
-
-    return($cfs);                
-}
 # }}}
 
 # {{{ ACCESS CONTROL
@@ -268,9 +232,14 @@
 
     return ($self->CurrentUser->HasRight( Right => $right,
                                           Object => $self, 
-                                          EquivObjects => [$RT::FM::System] ));
+                                          EquivObjects => [$RT::System, $RT::FM::System] ));
 
 }
 
+sub _LookupTypes {
+    "RT::FM::Class-RT::FM::Article";
+}
+
+
 1;
 


More information about the Rt-commit mailing list