[Rt-commit] r4362 - in rt/branches/3.7-EXPERIMENTAL: .
ruz at bestpractical.com
ruz at bestpractical.com
Sun Dec 25 04:10:01 EST 2005
Author: ruz
Date: Sun Dec 25 03:20:43 2005
New Revision: 4362
Added:
rt/branches/3.7-EXPERIMENTAL/lib/RT/CustomFieldValues/Groups.pm
Modified:
rt/branches/3.7-EXPERIMENTAL/ (props changed)
Log:
r1584 at cubic-pc: cubic | 2005-12-25 11:23:41 +0300
r1574 at cubic-pc: cubic | 2005-12-25 11:21:41 +0300
* example of the external CF values class,
for testing purposes.
Added: rt/branches/3.7-EXPERIMENTAL/lib/RT/CustomFieldValues/Groups.pm
==============================================================================
--- (empty file)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/CustomFieldValues/Groups.pm Sun Dec 25 03:20:43 2005
@@ -0,0 +1,30 @@
+package RT::CustomFieldValues::Groups;
+
+use strict;
+use warnings;
+
+use base qw(RT::CustomFieldValues::External);
+
+sub SourceDescription {
+ return 'RT user defined groups';
+}
+
+sub ExternalValues {
+ my $self = shift;
+
+ my @res;
+ my $i = 0;
+ my $groups = RT::Groups->new( $self->CurrentUser );
+ $groups->LimitToUserDefinedGroups;
+ $groups->OrderByCols( { FIELD => 'Name' } );
+ while( my $group = $groups->Next ) {
+ push @res, {
+ name => $group->Name,
+ sortorder => $i++,
+ };
+ }
+ return \@res;
+}
+
+
+1;
More information about the Rt-commit
mailing list