Commit 32213409 authored by jocuri%softhome.net's avatar jocuri%softhome.net

Patch for bug 255512: For bz_secure, distinguish between mandatory and…

Patch for bug 255512: For bz_secure, distinguish between mandatory and non-mandatory groups and create distinct CSS classes to enable customizations by the admin; patch by Marc Schumann <wurblzap@gmail.com>; r=kiko, r=joel, a=justdave.
parent 081484eb
...@@ -812,7 +812,7 @@ while (my @row = FetchSQLData()) { ...@@ -812,7 +812,7 @@ while (my @row = FetchSQLData()) {
$bugproducts->{$bug->{'product'}} = 1 if $bug->{'product'}; $bugproducts->{$bug->{'product'}} = 1 if $bug->{'product'};
$bugstatuses->{$bug->{'bug_status'}} = 1 if $bug->{'bug_status'}; $bugstatuses->{$bug->{'bug_status'}} = 1 if $bug->{'bug_status'};
$bug->{isingroups} = 0; $bug->{'secure_mode'} = undef;
# Add the record to the list. # Add the record to the list.
push(@bugs, $bug); push(@bugs, $bug);
...@@ -821,20 +821,29 @@ while (my @row = FetchSQLData()) { ...@@ -821,20 +821,29 @@ while (my @row = FetchSQLData()) {
push(@bugidlist, $bug->{'bug_id'}); push(@bugidlist, $bug->{'bug_id'});
} }
# Check for bug privacy and set $bug->{isingroups} = 1 if private # Check for bug privacy and set $bug->{'secure_mode'} to 'implied' or 'manual'
# to 1 or more groups # based on whether the privacy is simply product implied (by mandatory groups)
my %privatebugs; # or because of human choice
my %min_membercontrol;
if (@bugidlist) { if (@bugidlist) {
SendSQL("SELECT DISTINCT bugs.bug_id FROM bugs, bug_group_map " . SendSQL("SELECT DISTINCT bugs.bug_id, MIN(group_control_map.membercontrol) " .
"FROM bugs, bug_group_map " .
"LEFT JOIN group_control_map " .
"ON group_control_map.product_id=bugs.product_id " .
"AND group_control_map.group_id=bug_group_map.group_id " .
"WHERE bugs.bug_id = bug_group_map.bug_id " . "WHERE bugs.bug_id = bug_group_map.bug_id " .
"AND bugs.bug_id IN (" . join(',',@bugidlist) . ")"); "AND bugs.bug_id IN (" . join(',',@bugidlist) . ") " .
"GROUP BY bugs.bug_id");
while (MoreSQLData()) { while (MoreSQLData()) {
my ($bug_id) = FetchSQLData(); my ($bug_id, $min_membercontrol) = FetchSQLData();
$privatebugs{$bug_id} = 1; $min_membercontrol{$bug_id} = $min_membercontrol;
} }
foreach my $bug (@bugs) { foreach my $bug (@bugs) {
if ($privatebugs{$bug->{'bug_id'}}) { if ($min_membercontrol{$bug->{'bug_id'}} == CONTROLMAPSHOWN
$bug->{isingroups} = 1; || $min_membercontrol{$bug->{'bug_id'}} == CONTROLMAPDEFAULT) {
$bug->{'secure_mode'} = 'manual';
} elsif ($min_membercontrol{$bug->{'bug_id'}} == CONTROLMAPMANDATORY) {
$bug->{'secure_mode'} = 'implied';
} }
} }
} }
......
...@@ -50,3 +50,8 @@ tr.bz_secure td.first-child { ...@@ -50,3 +50,8 @@ tr.bz_secure td.first-child {
background-color: inherit; background-color: inherit;
} }
tr.bz_secure_mode_implied td.first-child {
}
tr.bz_secure_mode_manual td.first-child {
}
...@@ -50,3 +50,8 @@ tr.bz_secure td.first-child { ...@@ -50,3 +50,8 @@ tr.bz_secure td.first-child {
background-color: inherit; background-color: inherit;
} }
tr.bz_secure_mode_implied td.first-child {
}
tr.bz_secure_mode_manual td.first-child {
}
...@@ -152,7 +152,8 @@ ...@@ -152,7 +152,8 @@
bz_[% bug.priority FILTER css_class_quote %] bz_[% bug.priority FILTER css_class_quote %]
bz_[% bug.bug_status FILTER css_class_quote %] bz_[% bug.bug_status FILTER css_class_quote %]
[%+ "bz_$bug.resolution" FILTER css_class_quote IF bug.resolution %] [%+ "bz_$bug.resolution" FILTER css_class_quote IF bug.resolution %]
[%+ "bz_secure" IF bug.isingroups %] [%+ "bz_secure" IF bug.secure_mode %]
[%+ "bz_secure_mode_$bug.secure_mode" FILTER css_class_quote IF bug.secure_mode %]
[%+ count % 2 == 1 ? "bz_odd" : "bz_even" %] [%+ count % 2 == 1 ? "bz_odd" : "bz_even" %]
"> ">
......
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