[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-448-ge8167c3

Shawn Moore sartak at bestpractical.com
Tue Aug 17 20:54:18 EDT 2010


The branch, 3.9-trunk has been updated
       via  e8167c3082c405a5221fa0ae3ce54c446111981a (commit)
       via  7ca1b8858627281d1901d45e4728cb9f3c8793e3 (commit)
      from  be6649f00b1cd29e63e313e8bce2e578c4a469b8 (commit)

Summary of changes:
 lib/RT/Group_Overlay.pm               |    2 +-
 lib/RT/Queue_Overlay.pm               |   25 ++++++++++++++++++++-----
 share/html/Elements/SelectWatcherType |    2 +-
 3 files changed, 22 insertions(+), 7 deletions(-)

- Log -----------------------------------------------------------------
commit 7ca1b8858627281d1901d45e4728cb9f3c8793e3
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Aug 17 20:48:12 2010 -0400

    Include any additional role groups in SelectWatcherType

diff --git a/share/html/Elements/SelectWatcherType b/share/html/Elements/SelectWatcherType
index b78d830..ba669a1 100755
--- a/share/html/Elements/SelectWatcherType
+++ b/share/html/Elements/SelectWatcherType
@@ -57,7 +57,7 @@
 <%INIT>
 my @types;
 if ($Scope =~ 'queue') {
-   @types = qw(Cc AdminCc);
+   @types = grep { $_ ne 'Owner' && $_ ne 'Requestor' } RT::Queue->RoleGroupTypes;
 }
 else { 
    @types = qw(Requestor Cc AdminCc);

commit e8167c3082c405a5221fa0ae3ce54c446111981a
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Aug 17 20:56:07 2010 -0400

    Split up RoleGroupTypes into All~ and Manageable~
    
        This way we don't have to pepper grep { $_ ne 'Owner' && $_ ne
        'Requestor' } around the code

diff --git a/lib/RT/Group_Overlay.pm b/lib/RT/Group_Overlay.pm
index 402d340..03e347d 100755
--- a/lib/RT/Group_Overlay.pm
+++ b/lib/RT/Group_Overlay.pm
@@ -620,7 +620,7 @@ sub _ValidRoleGroupType {
     my $self = shift;
     my $type = shift;
 
-    for my $valid_type (RT::Queue->RoleGroupTypes) {
+    for my $valid_type (RT::Queue->AllRoleGroupTypes) {
         return 1 if $type eq $valid_type;
     }
 
diff --git a/lib/RT/Queue_Overlay.pm b/lib/RT/Queue_Overlay.pm
index 0d7dc1b..5d89917 100755
--- a/lib/RT/Queue_Overlay.pm
+++ b/lib/RT/Queue_Overlay.pm
@@ -650,16 +650,31 @@ sub TicketTransactionCustomFields {
 
 # {{{ Routines dealing with watchers.
 
-# {{{ RoleGroupTypes
-=head2 RoleGroupTypes
+# {{{ AllRoleGroupTypes
+=head2 AllRoleGroupTypes
 
 Returns a list of the names of the various role group types that this queue
-has.
+has, including Requestor and Owner. If you don't want them, see
+L</ManageableRoleGroupTypes>.
 
 =cut
 
-sub RoleGroupTypes {
-    return qw(Cc AdminCc Requestor Owner);
+sub AllRoleGroupTypes {
+    my $self = shift;
+    return ($self->RoleGroupTypes, qw(Requestor Owner));
+}
+# }}}
+
+# {{{ ManageableRoleGroupTypes
+=head2 ManageableRoleGroupTypes
+
+Returns a list of the names of the various role group types that this queue
+has, excluding Requestor and Owner. If you want them, see L</AllRoleGroupTypes>.
+
+=cut
+
+sub ManageableRoleGroupTypes {
+    return qw(Cc AdminCc);
 }
 # }}}
 
diff --git a/share/html/Elements/SelectWatcherType b/share/html/Elements/SelectWatcherType
index ba669a1..c5b0615 100755
--- a/share/html/Elements/SelectWatcherType
+++ b/share/html/Elements/SelectWatcherType
@@ -57,7 +57,7 @@
 <%INIT>
 my @types;
 if ($Scope =~ 'queue') {
-   @types = grep { $_ ne 'Owner' && $_ ne 'Requestor' } RT::Queue->RoleGroupTypes;
+   @types = RT::Queue->ManageableRoleGroupTypes;
 }
 else { 
    @types = qw(Requestor Cc AdminCc);

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


More information about the Rt-commit mailing list