Bug 341924: When viewing several bugs at once using show_bug.cgi?format=multiple, invalid bugs should generate an error message - Patch by Frédéric Buclin <LpSolit@gmail.com> r=timeless a=myk

git-svn-id: svn://10.0.0.236/trunk@200254 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
lpsolit%gmail.com
2006-06-18 23:11:59 +00:00
parent a0815a02f5
commit 6bcef64942
3 changed files with 28 additions and 2 deletions

View File

@@ -78,8 +78,12 @@ if ($single) {
}
} else {
foreach my $id ($cgi->param('id')) {
my $bug = new Bugzilla::Bug($id, Bugzilla->user->id);
push @bugs, $bug;
# Be kind enough and accept URLs of the form: id=1,2,3.
my @ids = split(/,/, $id);
foreach (@ids) {
my $bug = new Bugzilla::Bug($_, Bugzilla->user->id);
push(@bugs, $bug);
}
}
}

View File

@@ -45,3 +45,8 @@ h1 {
.bugfields table.timetracking th, .bugfields table.timetracking td {
width: 10em;
}
.error {
color: red;
font-weight: bold;
}

View File

@@ -59,6 +59,22 @@
</h1>
<table class="bugfields">
[% IF bug.error %]
<tr>
<td class="error">
[% IF bug.error == "InvalidBugId" %]
'[%+ bug.bug_id FILTER html %]' is not a valid [% terms.bug %] number
[%- IF Param("usebugaliases") %] nor a known [% terms.bug %] alias[% END %].
[% ELSIF bug.error == "NotPermitted" %]
You are not allowed to view this [% terms.bug %].
[% ELSIF bug.error == "NotFound" %]
This [% terms.bug %] cannot be found.
[% ELSE %]
[%+ bug.error FILTER html %]
[% END %]
</td>
</tr>
[% ELSE %]
[%# The rightcell block (also called by the row block) automatically shows
# the fields from rightcells %]
[% rightcells = ['reporter', 'assigned_to'] %]
@@ -237,6 +253,7 @@
</td>
</tr>
[% END %]
[% END %]
</table>