]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1397747 - Move _get_all_group_names to Bugzilla::Config::Common::_get_all_group_n...
authorDylan William Hardison <dylan@hardison.net>
Thu, 7 Sep 2017 15:04:07 +0000 (11:04 -0400)
committerGitHub <noreply@github.com>
Thu, 7 Sep 2017 15:04:07 +0000 (11:04 -0400)
Bugzilla/Config/Common.pm
Bugzilla/Config/GroupSecurity.pm
extensions/AntiSpam/lib/Config.pm
extensions/BMO/Extension.pm
extensions/EditComments/Extension.pm
extensions/RestrictComments/lib/Config.pm

index cbb030a9cb3418b2924761de23d3d199f3abd550..8b1a9da911c34acba3401e63bcc4e90fe33e1477 100644 (file)
@@ -30,6 +30,7 @@ use base qw(Exporter);
     check_bug_status check_smtp_auth check_theschwartz_available
     check_maxattachmentsize check_email
     check_comment_taggers_group
+    get_all_group_names
 );
 
 # Checking functions for the various values
@@ -345,6 +346,13 @@ sub check_comment_taggers_group {
     return check_group($group_name);
 }
 
+sub get_all_group_names {
+    return [
+        '',
+        map { $_->name } Bugzilla::Group->get_all,
+    ];
+}
+
 # OK, here are the parameter definitions themselves.
 #
 # Each definition is a hash with keys:
index c9d6421d32083dad9cce2d6898f669108711548e..68c852fe60988a9d33f0c8d2b7ccc806059b5a5f 100644 (file)
@@ -29,7 +29,7 @@ sub get_param_list {
         {
             name    => 'chartgroup',
             type    => 's',
-            choices => \&_get_all_group_names,
+            choices => \&get_all_group_names,
             default => 'editbugs',
             checker => \&check_group
         },
@@ -37,7 +37,7 @@ sub get_param_list {
         {
             name    => 'insidergroup',
             type    => 's',
-            choices => \&_get_all_group_names,
+            choices => \&get_all_group_names,
             default => '',
             checker => \&check_group
         },
@@ -45,7 +45,7 @@ sub get_param_list {
         {
             name    => 'timetrackinggroup',
             type    => 's',
-            choices => \&_get_all_group_names,
+            choices => \&get_all_group_names,
             default => 'editbugs',
             checker => \&check_group
         },
@@ -53,7 +53,7 @@ sub get_param_list {
         {
             name    => 'querysharegroup',
             type    => 's',
-            choices => \&_get_all_group_names,
+            choices => \&get_all_group_names,
             default => 'editbugs',
             checker => \&check_group
         },
@@ -61,7 +61,7 @@ sub get_param_list {
         {
             name    => 'comment_taggers_group',
             type    => 's',
-            choices => \&_get_all_group_names,
+            choices => \&get_all_group_names,
             default => 'editbugs',
             checker => \&check_comment_taggers_group
         },
@@ -69,7 +69,7 @@ sub get_param_list {
         {
             name    => 'debug_group',
             type    => 's',
-            choices => \&_get_all_group_names,
+            choices => \&get_all_group_names,
             default => 'admin',
             checker => \&check_group
         },
@@ -89,10 +89,6 @@ sub get_param_list {
     return @param_list;
 }
 
-sub _get_all_group_names {
-    my @group_names = map { $_->name } Bugzilla::Group->get_all;
-    unshift( @group_names, '' );
-    return \@group_names;
-}
+
 
 1;
index b6d1234d920d00e0d96625742a6332b605825f1f..e35a7f00124a80f12853f4d7020724cf8f58a2d0 100644 (file)
@@ -23,7 +23,7 @@ sub get_param_list {
         {
             name => 'antispam_spammer_exclude_group',
             type => 's',
-            choices => \&_get_all_group_names,
+            choices => \&get_all_group_names,
             default => 'canconfirm',
             checker => \&check_group
         },
@@ -79,10 +79,4 @@ sub get_param_list {
     return @param_list;
 }
 
-sub _get_all_group_names {
-    my @group_names = map {$_->name} Bugzilla::Group->get_all;
-    unshift(@group_names, '');
-    return \@group_names;
-}
-
 1;
index cb1996cbc33ef0741712635ccacc7f126ae5c40f..db672f82ac640b2be13fac16c7e27d97210722f1 100644 (file)
@@ -31,7 +31,7 @@ use base qw(Bugzilla::Extension);
 
 use Bugzilla::Bug;
 use Bugzilla::BugMail;
-use Bugzilla::Config::Common qw(check_group);
+use Bugzilla::Config::Common qw(check_group get_all_group_names);
 use Bugzilla::Constants;
 use Bugzilla::Error;
 use Bugzilla::Field;
@@ -2579,7 +2579,7 @@ sub config_modify_panels {
     push @{ $args->{panels}->{groupsecurity}->{params} }, {
         name    => 'delete_comments_group',
         type    => 's',
-        choices => \&Bugzilla::Config::GroupSecurity::_get_all_group_names,
+        choices => \&get_all_group_names,
         default => 'admin',
         checker => \&check_group
     };
index 1dc22a85eaa292207aeb9308f61c3024b19098e0..ab19ab6e7b3a4ac80c32d8067ab11e51b99ebfd2 100644 (file)
@@ -249,7 +249,7 @@ sub config_modify_panels {
     push @{ $args->{panels}->{groupsecurity}->{params} }, {
         name    => 'edit_comments_group',
         type    => 's',
-        choices => \&Bugzilla::Config::GroupSecurity::_get_all_group_names,
+        choices => \&get_all_group_names,
         default => 'admin',
         checker => \&check_group
     };
index 55cf11187886b99b5eab7d1753b1101c7065b13c..e5dbc518ca8054365d67d4e3c8ba9e14c3be7f5d 100644 (file)
@@ -23,14 +23,14 @@ sub get_param_list {
         {
             name => 'restrict_comments_group',
             type => 's',
-            choices => \&_get_all_group_names,
+            choices => \&get_all_group_names,
             default => '',
             checker => \&check_group
         },
         {
             name => 'restrict_comments_enable_group',
             type => 's',
-            choices => \&_get_all_group_names,
+            choices => \&get_all_group_names,
             default => '',
             checker => \&check_group
         },
@@ -39,10 +39,4 @@ sub get_param_list {
     return @param_list;
 }
 
-sub _get_all_group_names {
-    my @group_names = map {$_->name} Bugzilla::Group->get_all;
-    unshift(@group_names, '');
-    return \@group_names;
-}
-
 1;