ORDER BY votes.bug_id',
undef, ($who->id, $product->id));
+ $user->visible_bugs([map { $_->[0] } @$vote_list]);
foreach (@$vote_list) {
my ($id, $count, $summary) = @$_;
$total += $count;
foreach my $id ($cgi->param('id')) {
# Be kind enough and accept URLs of the form: id=1,2,3.
my @ids = split(/,/, $id);
+ my @check_bugs;
+
foreach my $bug_id (@ids) {
next unless $bug_id;
my $bug = new Bugzilla::Bug($bug_id);
- if (!$bug->{error} && $user->can_see_bug($bug->bug_id)) {
+ if (!$bug->{error}) {
+ push(@check_bugs, $bug);
+ }
+ else {
+ push(@illegal_bugs, { bug_id => trim($bug_id), error => $bug->{error} });
+ }
+ }
+
+ $user->visible_bugs(\@check_bugs);
+
+ foreach my $bug (@check_bugs) {
+ if ($user->can_see_bug($bug->id)) {
push(@bugs, $bug);
}
else {
- push(@illegal_bugs, { bug_id => trim($bug_id),
- error => $bug->{error} || 'NotPermitted' });
+ push(@illegal_bugs, { bug_id => $bug->id, error => 'NotPermitted' });
}
}
}
q{SELECT bug_status, resolution, short_desc
FROM bugs
WHERE bugs.bug_id = ?});
-foreach my $k (keys(%seen)) {
+
+my @bug_ids = keys %seen;
+$user->visible_bugs(\@bug_ids);
+foreach my $k (@bug_ids) {
# Retrieve bug information from the database
my ($stat, $resolution, $summary) = $dbh->selectrow_array($sth, undef, $k);
# Record this depth in the global $realdepth variable if it's farther
# than we've gone before.
$realdepth = max($realdepth, $depth);
-
+ Bugzilla->user->visible_bugs(\@dependencies);
foreach my $dep_id (@dependencies) {
# Get this dependency's record from the database and generate
# its sub-tree if we haven't already done so (which happens
function=>"summarize_time"});
}
@bugs = get_blocker_ids($bugs[0]);
- @bugs = grep { $user->can_see_bug($_) } @bugs;
+ @bugs = @{ $user->visible_bugs(\@bugs) };
}
$start_date = trim $cgi->param('start_date');
[% IF bugs.size > 0 %]
<td valign="middle" class="bz_query_buttons">
<form method="post" action="show_bug.cgi">
- [% FOREACH id = buglist %]
- <input type="hidden" name="id" value="[% id FILTER html %]">
- [% END %]
+ [% id = buglist.join(",") %]
+ <input type="hidden" name="id" value="[% id FILTER html %]">
<input type="hidden" name="format" value="multiple">
<input type="submit" id="long_format" value="Long Format">
</form>