[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-444-g37cde68

Shawn Moore sartak at bestpractical.com
Tue Aug 17 19:38:09 EDT 2010


The branch, 3.9-trunk has been updated
       via  37cde684ac5619730a1687716d119d3e03e03389 (commit)
       via  e02971a6900ed50c82ec8cebccd02b8a843a4a2e (commit)
      from  517b964ded8a3359ea0a95ea644d961fb8f212e2 (commit)

Summary of changes:
 lib/RT/Group_Overlay.pm |    6 +++++-
 lib/RT/Queue_Overlay.pm |   19 ++++++++++++++-----
 2 files changed, 19 insertions(+), 6 deletions(-)

- Log -----------------------------------------------------------------
commit e02971a6900ed50c82ec8cebccd02b8a843a4a2e
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Aug 17 18:38:06 2010 -0400

    Make RoleGroupTypes public API

diff --git a/lib/RT/Queue_Overlay.pm b/lib/RT/Queue_Overlay.pm
index 61b3bc8..0d7dc1b 100755
--- a/lib/RT/Queue_Overlay.pm
+++ b/lib/RT/Queue_Overlay.pm
@@ -650,6 +650,19 @@ sub TicketTransactionCustomFields {
 
 # {{{ Routines dealing with watchers.
 
+# {{{ RoleGroupTypes
+=head2 RoleGroupTypes
+
+Returns a list of the names of the various role group types that this queue
+has.
+
+=cut
+
+sub RoleGroupTypes {
+    return qw(Cc AdminCc Requestor Owner);
+}
+# }}}
+
 # {{{ _CreateQueueGroups 
 
 =head2 _CreateQueueGroups
@@ -664,14 +677,10 @@ It will return true on success and undef on failure.
 
 =cut
 
-sub _RoleGroupTypes {
-    return qw(Cc AdminCc Requestor Owner);
-}
-
 sub _CreateQueueGroups {
     my $self = shift;
 
-    my @types = $self->_RoleGroupTypes;
+    my @types = $self->RoleGroupTypes;
 
     foreach my $type (@types) {
         my $ok = $self->_CreateQueueRoleGroup($type);

commit 37cde684ac5619730a1687716d119d3e03e03389
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Aug 17 18:38:22 2010 -0400

    Refactor _ValidRoleGroupType to just check RT::Queue's listing

diff --git a/lib/RT/Group_Overlay.pm b/lib/RT/Group_Overlay.pm
index 16d5beb..402d340 100755
--- a/lib/RT/Group_Overlay.pm
+++ b/lib/RT/Group_Overlay.pm
@@ -620,7 +620,11 @@ sub _ValidRoleGroupType {
     my $self = shift;
     my $type = shift;
 
-    return $type =~ /^(?:Cc|AdminCc|Requestor|Owner)$/;
+    for my $valid_type (RT::Queue->RoleGroupTypes) {
+        return 1 if $type eq $valid_type;
+    }
+
+    return 0;
 }
 
 sub CreateRoleGroup {

-----------------------------------------------------------------------


More information about the Rt-commit mailing list