[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-453-g1208e4b
Shawn Moore
sartak at bestpractical.com
Tue Aug 17 21:32:00 EDT 2010
The branch, 3.9-trunk has been updated
via 1208e4b98046af698a74235cadb48339b103e23e (commit)
from 7c42f6ef10618e107ae91539681ed5b44b96e6c7 (commit)
Summary of changes:
lib/RT/Group_Overlay.pm | 13 +------------
lib/RT/Queue_Overlay.pm | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 12 deletions(-)
- Log -----------------------------------------------------------------
commit 1208e4b98046af698a74235cadb48339b103e23e
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Tue Aug 17 21:33:54 2010 -0400
IsRoleGroupType and use it as the validator
diff --git a/lib/RT/Group_Overlay.pm b/lib/RT/Group_Overlay.pm
index 03e347d..1334e92 100755
--- a/lib/RT/Group_Overlay.pm
+++ b/lib/RT/Group_Overlay.pm
@@ -616,17 +616,6 @@ Returns a tuple of (Id, Message). If id is 0, the create failed
=cut
-sub _ValidRoleGroupType {
- my $self = shift;
- my $type = shift;
-
- for my $valid_type (RT::Queue->AllRoleGroupTypes) {
- return 1 if $type eq $valid_type;
- }
-
- return 0;
-}
-
sub CreateRoleGroup {
my $self = shift;
my %args = ( Instance => undef,
@@ -634,7 +623,7 @@ sub CreateRoleGroup {
Domain => undef,
@_ );
- unless ($self->_ValidRoleGroupType($args{Type})) {
+ unless (RT::Queue->IsRoleGroupType($args{Type})) {
return ( 0, $self->loc("Invalid Group Type") );
}
diff --git a/lib/RT/Queue_Overlay.pm b/lib/RT/Queue_Overlay.pm
index 42d64aa..0558fb9 100755
--- a/lib/RT/Queue_Overlay.pm
+++ b/lib/RT/Queue_Overlay.pm
@@ -665,6 +665,24 @@ sub AllRoleGroupTypes {
}
# }}}
+# {{{ IsRoleGroupType
+=head2 IsRoleGroupType
+
+Returns whether the passed-in type is a role group type.
+
+=cut
+
+sub IsRoleGroupType {
+ my $self = shift;
+ my $type = shift;
+
+ for my $valid_type ($self->AllRoleGroupTypes) {
+ return 1 if $type eq $valid_type;
+ }
+
+ return 0;
+}
+# }}}
# {{{ ManageableRoleGroupTypes
=head2 ManageableRoleGroupTypes
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list