Commit d8dc06a6 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 478972: Remove the 'useentrygroupdefault' parameter - Patch by Fré©ric…

Bug 478972: Remove the 'useentrygroupdefault' parameter - Patch by Fré©ric Buclin <LpSolit@gmail.com> r/a=mkanat
parent a86ee3a1
...@@ -151,10 +151,6 @@ sub update_params { ...@@ -151,10 +151,6 @@ sub update_params {
{ {
$param->{'makeproductgroups'} = $param->{'usebuggroups'}; $param->{'makeproductgroups'} = $param->{'usebuggroups'};
} }
if (exists $param->{'usebuggroupsentry'}
&& !exists $param->{'useentrygroupdefault'}) {
$param->{'useentrygroupdefault'} = $param->{'usebuggroupsentry'};
}
# Modularise auth code # Modularise auth code
if (exists $param->{'useLDAP'} && !exists $param->{'loginmethod'}) { if (exists $param->{'useLDAP'} && !exists $param->{'loginmethod'}) {
......
...@@ -49,12 +49,6 @@ sub get_param_list { ...@@ -49,12 +49,6 @@ sub get_param_list {
}, },
{ {
name => 'useentrygroupdefault',
type => 'b',
default => 0
},
{
name => 'chartgroup', name => 'chartgroup',
type => 's', type => 's',
choices => \&_get_all_group_names, choices => \&_get_all_group_names,
......
...@@ -1010,10 +1010,12 @@ use constant ABSTRACT_SCHEMA => { ...@@ -1010,10 +1010,12 @@ use constant ABSTRACT_SCHEMA => {
REFERENCES => {TABLE => 'products', REFERENCES => {TABLE => 'products',
COLUMN => 'id', COLUMN => 'id',
DELETE => 'CASCADE'}}, DELETE => 'CASCADE'}},
entry => {TYPE => 'BOOLEAN', NOTNULL => 1}, entry => {TYPE => 'BOOLEAN', NOTNULL => 1,
DEFAULT => 'FALSE'},
membercontrol => {TYPE => 'BOOLEAN', NOTNULL => 1}, membercontrol => {TYPE => 'BOOLEAN', NOTNULL => 1},
othercontrol => {TYPE => 'BOOLEAN', NOTNULL => 1}, othercontrol => {TYPE => 'BOOLEAN', NOTNULL => 1},
canedit => {TYPE => 'BOOLEAN', NOTNULL => 1}, canedit => {TYPE => 'BOOLEAN', NOTNULL => 1,
DEFAULT => 'FALSE'},
editcomponents => {TYPE => 'BOOLEAN', NOTNULL => 1, editcomponents => {TYPE => 'BOOLEAN', NOTNULL => 1,
DEFAULT => 'FALSE'}, DEFAULT => 'FALSE'},
editbugs => {TYPE => 'BOOLEAN', NOTNULL => 1, editbugs => {TYPE => 'BOOLEAN', NOTNULL => 1,
......
...@@ -557,7 +557,13 @@ sub update_table_definitions { ...@@ -557,7 +557,13 @@ sub update_table_definitions {
# 2009-03-02 arbingersys@gmail.com - Bug 423613 # 2009-03-02 arbingersys@gmail.com - Bug 423613
$dbh->bz_add_index('profiles', 'profiles_extern_id_idx', $dbh->bz_add_index('profiles', 'profiles_extern_id_idx',
{TYPE => 'UNIQUE', FIELDS => [qw(extern_id)]}); {TYPE => 'UNIQUE', FIELDS => [qw(extern_id)]});
# 2009-03-31 LpSolit@gmail.com - Bug 478972
$dbh->bz_alter_column('group_control_map', 'entry',
{TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'FALSE'});
$dbh->bz_alter_column('group_control_map', 'canedit',
{TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'FALSE'});
################################################################ ################################################################
# New --TABLE-- changes should go *** A B O V E *** this point # # New --TABLE-- changes should go *** A B O V E *** this point #
################################################################ ################################################################
...@@ -1840,7 +1846,6 @@ sub _setup_usebuggroups_backward_compatibility { ...@@ -1840,7 +1846,6 @@ sub _setup_usebuggroups_backward_compatibility {
# #
# If group_control_map is empty, backward-compatibility # If group_control_map is empty, backward-compatibility
# usebuggroups-equivalent records should be created. # usebuggroups-equivalent records should be created.
my $entry = Bugzilla->params->{'useentrygroupdefault'};
my ($maps_exist) = $dbh->selectrow_array( my ($maps_exist) = $dbh->selectrow_array(
"SELECT DISTINCT 1 FROM group_control_map"); "SELECT DISTINCT 1 FROM group_control_map");
if (!$maps_exist) { if (!$maps_exist) {
...@@ -1857,11 +1862,9 @@ sub _setup_usebuggroups_backward_compatibility { ...@@ -1857,11 +1862,9 @@ sub _setup_usebuggroups_backward_compatibility {
if ($groupname eq $productname) { if ($groupname eq $productname) {
# Product and group have same name. # Product and group have same name.
$dbh->do("INSERT INTO group_control_map " . $dbh->do("INSERT INTO group_control_map " .
"(group_id, product_id, entry, membercontrol, " . "(group_id, product_id, membercontrol, othercontrol) " .
"othercontrol, canedit) " . "VALUES (?, ?, ?, ?)", undef,
"VALUES ($groupid, $productid, $entry, " . ($groupid, $productid, CONTROLMAPDEFAULT, CONTROLMAPNA));
CONTROLMAPDEFAULT . ", " .
CONTROLMAPNA . ", 0)");
} else { } else {
# See if this group is a product group at all. # See if this group is a product group at all.
my $sth2 = $dbh->prepare("SELECT id FROM products my $sth2 = $dbh->prepare("SELECT id FROM products
...@@ -1872,11 +1875,9 @@ sub _setup_usebuggroups_backward_compatibility { ...@@ -1872,11 +1875,9 @@ sub _setup_usebuggroups_backward_compatibility {
# If there is no product with the same name as this # If there is no product with the same name as this
# group, then it is permitted for all products. # group, then it is permitted for all products.
$dbh->do("INSERT INTO group_control_map " . $dbh->do("INSERT INTO group_control_map " .
"(group_id, product_id, entry, membercontrol, " . "(group_id, product_id, membercontrol, othercontrol) " .
"othercontrol, canedit) " . "VALUES (?, ?, ?, ?)", undef,
"VALUES ($groupid, $productid, 0, " . ($groupid, $productid, CONTROLMAPSHOWN, CONTROLMAPNA));
CONTROLMAPSHOWN . ", " .
CONTROLMAPNA . ", 0)");
} }
} }
} }
......
...@@ -565,10 +565,9 @@ sub _create_bug_group { ...@@ -565,10 +565,9 @@ sub _create_bug_group {
# Associate the new group and new product. # Associate the new group and new product.
$dbh->do('INSERT INTO group_control_map $dbh->do('INSERT INTO group_control_map
(group_id, product_id, entry, membercontrol, othercontrol, canedit) (group_id, product_id, membercontrol, othercontrol)
VALUES (?, ?, ?, ?, ?, ?)', VALUES (?, ?, ?, ?)',
undef, ($group->id, $self->id, Bugzilla->params->{'useentrygroupdefault'}, undef, ($group->id, $self->id, CONTROLMAPDEFAULT, CONTROLMAPNA));
CONTROLMAPDEFAULT, CONTROLMAPNA, 0));
} }
sub _create_series { sub _create_series {
......
...@@ -658,13 +658,9 @@ sub get_selectable_products { ...@@ -658,13 +658,9 @@ sub get_selectable_products {
my $query = "SELECT id " . my $query = "SELECT id " .
" FROM products " . " FROM products " .
"LEFT JOIN group_control_map " . "LEFT JOIN group_control_map " .
" ON group_control_map.product_id = products.id "; "ON group_control_map.product_id = products.id " .
if (Bugzilla->params->{'useentrygroupdefault'}) { " AND group_control_map.membercontrol = " . CONTROLMAPMANDATORY .
$query .= " AND group_control_map.entry != 0 "; " AND group_id NOT IN(" . $self->groups_as_string . ") " .
} else {
$query .= " AND group_control_map.membercontrol = " . CONTROLMAPMANDATORY;
}
$query .= " AND group_id NOT IN(" . $self->groups_as_string . ") " .
" WHERE group_id IS NULL " . " WHERE group_id IS NULL " .
"ORDER BY name"; "ORDER BY name";
......
...@@ -481,25 +481,6 @@ ...@@ -481,25 +481,6 @@
<varlistentry> <varlistentry>
<term> <term>
useentrygroupdefault
</term>
<listitem>
<para>
Bugzilla products can have a group associated with them, so that
certain users can only see bugs in certain products. When this
parameter is set to <quote>on</quote>, this
causes the initial group controls on newly created products
to place all newly-created bugs in the group
having the same name as the product immediately.
After a product is initially created, the group controls
can be further adjusted without interference by
this mechanism.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
usevisibilitygroups usevisibilitygroups
</term> </term>
<listitem> <listitem>
......
...@@ -214,9 +214,8 @@ if ($action eq 'new') { ...@@ -214,9 +214,8 @@ if ($action eq 'new') {
# Permit all existing products to use the new group if makeproductgroups. # Permit all existing products to use the new group if makeproductgroups.
if ($cgi->param('insertnew')) { if ($cgi->param('insertnew')) {
$dbh->do('INSERT INTO group_control_map $dbh->do('INSERT INTO group_control_map
(group_id, product_id, entry, membercontrol, (group_id, product_id, membercontrol, othercontrol)
othercontrol, canedit) SELECT ?, products.id, ?, ? FROM products',
SELECT ?, products.id, 0, ?, ?, 0 FROM products',
undef, ($group->id, CONTROLMAPSHOWN, CONTROLMAPNA)); undef, ($group->id, CONTROLMAPSHOWN, CONTROLMAPNA));
} }
delete_token($token); delete_token($token);
......
...@@ -140,14 +140,10 @@ if ($cgi->param('createmissinggroupcontrolmapentries')) { ...@@ -140,14 +140,10 @@ if ($cgi->param('createmissinggroupcontrolmapentries')) {
my $na = CONTROLMAPNA; my $na = CONTROLMAPNA;
my $shown = CONTROLMAPSHOWN; my $shown = CONTROLMAPSHOWN;
my $insertsth = $dbh->prepare( my $insertsth = $dbh->prepare(
qq{INSERT INTO group_control_map ( qq{INSERT INTO group_control_map
group_id, product_id, entry, (group_id, product_id, membercontrol, othercontrol)
membercontrol, othercontrol, canedit VALUES (?, ?, $shown, $na)});
)
VALUES (
?, ?, 0,
$shown, $na, 0
)});
my $updatesth = $dbh->prepare(qq{UPDATE group_control_map my $updatesth = $dbh->prepare(qq{UPDATE group_control_map
SET membercontrol = $shown SET membercontrol = $shown
WHERE group_id = ? WHERE group_id = ?
......
...@@ -27,12 +27,6 @@ ...@@ -27,12 +27,6 @@
makeproductgroups => "If this is on, $terms.Bugzilla will associate $terms.abug group " _ makeproductgroups => "If this is on, $terms.Bugzilla will associate $terms.abug group " _
"with each product in the database, and use it for querying ${terms.bugs}.", "with each product in the database, and use it for querying ${terms.bugs}.",
useentrygroupdefault => "If this is on, $terms.Bugzilla will use product $terms.bug groups " _
"by default to restrict who can enter ${terms.bugs}. If this is on, " _
"users can see any product to which they have entry access in search menus. " _
"If this is off, users can see any product to which they have not " _
"been excluded by a mandatory restriction.",
chartgroup => "The name of the group of users who can use the 'New Charts' " _ chartgroup => "The name of the group of users who can use the 'New Charts' " _
"feature. Administrators should ensure that the public categories " _ "feature. Administrators should ensure that the public categories " _
"and series definitions do not divulge confidential information " _ "and series definitions do not divulge confidential information " _
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment