[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-452-g7c42f6e

Shawn Moore sartak at bestpractical.com
Tue Aug 17 21:30:06 EDT 2010


The branch, 3.9-trunk has been updated
       via  7c42f6ef10618e107ae91539681ed5b44b96e6c7 (commit)
       via  621d8e847cf83e1d43bb672f9f666af36eeec591 (commit)
      from  8f397a39ea874de48ac78d1e1cf659342a070070 (commit)

Summary of changes:
 lib/RT/Queue_Overlay.pm             |   19 +++++++++++++++++++
 share/html/Admin/Queues/People.html |   22 +++++++++++++---------
 2 files changed, 32 insertions(+), 9 deletions(-)

- Log -----------------------------------------------------------------
commit 621d8e847cf83e1d43bb672f9f666af36eeec591
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Aug 17 21:31:51 2010 -0400

    IsManageableRoleGroupType

diff --git a/lib/RT/Queue_Overlay.pm b/lib/RT/Queue_Overlay.pm
index 5d89917..42d64aa 100755
--- a/lib/RT/Queue_Overlay.pm
+++ b/lib/RT/Queue_Overlay.pm
@@ -678,6 +678,25 @@ sub ManageableRoleGroupTypes {
 }
 # }}}
 
+# {{{ IsManageableRoleGroupType
+=head2 IsManageableRoleGroupType
+
+Returns whether the passed-in type is a manageable role group type.
+
+=cut
+
+sub IsManageableRoleGroupType {
+    my $self = shift;
+    my $type = shift;
+
+    for my $valid_type ($self->ManageableRoleGroupTypes) {
+        return 1 if $type eq $valid_type;
+    }
+
+    return 0;
+}
+# }}}
+
 # {{{ _CreateQueueGroups 
 
 =head2 _CreateQueueGroups

commit 7c42f6ef10618e107ae91539681ed5b44b96e6c7
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Aug 17 21:31:54 2010 -0400

    Code cleanup and use the new IsManageableRoleGroupType

diff --git a/share/html/Admin/Queues/People.html b/share/html/Admin/Queues/People.html
index af2da7f..63d5de5 100755
--- a/share/html/Admin/Queues/People.html
+++ b/share/html/Admin/Queues/People.html
@@ -157,17 +157,21 @@ unless ($OnlySearchForPeople or $OnlySearchForGroup) {
 # }}}
 
 # {{{ Add new watchers
-    foreach my  $key (keys %ARGS) {
-        #They're in this order because otherwise $1 gets clobbered :/
-        if ( ($ARGS{$key} =~ /^(AdminCc|Cc)$/) and
-         ($key =~ /^Queue-AddWatcher-Principal-(\d*)$/) ) {
-        $RT::Logger->debug("Adding a watcher $1 to ".$ARGS{$key}."\n");
-        my ($code, $msg) = $QueueObj->AddWatcher(Type => $ARGS{$key},
-                                                 PrincipalId => $1);
+    foreach my $key (keys %ARGS) {
+        my $type = $ARGS{$key};
+
+        next unless $key =~ /^Queue-AddWatcher-Principal-(\d*)$/;
+        my $id = $1;
+
+        next unless RT::Queue->IsManageableRoleGroupType($type);
+
+        $RT::Logger->debug("Adding a watcher $id to $type\n");
+        my ($code, $msg) = $QueueObj->AddWatcher(
+            Type => $type,
+            PrincipalId => $id,
+        );
         push @results, $msg;
-        }
     }
-
 # }}}
 }
  

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


More information about the Rt-commit mailing list