summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-06-21 10:05:59 +0200
committerlpsolit%gmail.com <>2006-06-21 10:05:59 +0200
commitb74f46a8039ebb62472a48a50139f696e6b6d0c7 (patch)
tree403ced09ba7375be943ec1f9def591e183c840e5
parentc41117346f48774e5c6731303702b5ce98db517b (diff)
downloadbugzilla-b74f46a8039ebb62472a48a50139f696e6b6d0c7.tar.gz
bugzilla-b74f46a8039ebb62472a48a50139f696e6b6d0c7.tar.xz
Bug 324783: The chartgroup, insidergroup and timetrackinggroup groups in editparams.cgi should be listed in a dropdown menu - Patch by Frédéric Buclin <LpSolit@gmail.com> r=Colin r=mkanat a=myk
-rw-r--r--Bugzilla/Config/Common.pm12
-rw-r--r--Bugzilla/Config/GroupSecurity.pm26
-rw-r--r--Bugzilla/Group.pm3
3 files changed, 30 insertions, 11 deletions
diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm
index 3e6e22a57..416a87849 100644
--- a/Bugzilla/Config/Common.pm
+++ b/Bugzilla/Config/Common.pm
@@ -38,10 +38,11 @@ use Socket;
use Bugzilla::Util;
use Bugzilla::Constants;
use Bugzilla::Field;
+use Bugzilla::Group;
use base qw(Exporter);
@Bugzilla::Config::Common::EXPORT =
- qw(check_multi check_numeric check_regexp check_url
+ qw(check_multi check_numeric check_regexp check_url check_group
check_sslbase check_priority check_severity check_platform
check_opsys check_shadowdb check_urlbase check_webdotbase
check_netmask check_user_verify_class check_image_converter
@@ -151,6 +152,15 @@ sub check_opsys {
return "";
}
+sub check_group {
+ my $group_name = shift;
+ my $group = new Bugzilla::Group({'name' => $group_name});
+ unless (defined $group) {
+ return "Must be an existing group name";
+ }
+ return "";
+}
+
sub check_shadowdb {
my ($value) = (@_);
$value = trim($value);
diff --git a/Bugzilla/Config/GroupSecurity.pm b/Bugzilla/Config/GroupSecurity.pm
index f1f1ac2a6..4e9e5f51c 100644
--- a/Bugzilla/Config/GroupSecurity.pm
+++ b/Bugzilla/Config/GroupSecurity.pm
@@ -34,11 +34,15 @@ package Bugzilla::Config::GroupSecurity;
use strict;
use Bugzilla::Config::Common;
+use Bugzilla::Group;
$Bugzilla::Config::GroupSecurity::sortkey = "07";
sub get_param_list {
my $class = shift;
+
+ my @group_names = map {$_->name} Bugzilla::Group::get_all_groups();
+
my @param_list = (
{
name => 'makeproductgroups',
@@ -54,22 +58,28 @@ sub get_param_list {
{
name => 'chartgroup',
- type => 't',
- default => 'editbugs'
+ type => 's',
+ choices => \@group_names,
+ default => 'editbugs',
+ checker => \&check_group
},
-
+
{
name => 'insidergroup',
- type => 't',
- default => ''
+ type => 's',
+ choices => \@group_names,
+ default => '',
+ checker => \&check_group
},
{
name => 'timetrackinggroup',
- type => 't',
- default => 'editbugs'
+ type => 's',
+ choices => \@group_names,
+ default => 'editbugs',
+ checker => \&check_group
},
-
+
{
name => 'usevisibilitygroups',
type => 'b',
diff --git a/Bugzilla/Group.pm b/Bugzilla/Group.pm
index 31b031381..45caf65cc 100644
--- a/Bugzilla/Group.pm
+++ b/Bugzilla/Group.pm
@@ -25,7 +25,6 @@ use strict;
package Bugzilla::Group;
-use Bugzilla::Config;
use Bugzilla::Util;
use Bugzilla::Error;
@@ -113,7 +112,7 @@ sub ValidateGroupName {
my $dbh = Bugzilla->dbh;
my $query = "SELECT id FROM groups " .
"WHERE name = ?";
- if (Param('usevisibilitygroups')) {
+ if (Bugzilla->params->{'usevisibilitygroups'}) {
my @visible = (-1);
foreach my $user (@users) {
$user && push @visible, @{$user->visible_groups_direct};