summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-06-19 08:11:59 +0200
committerlpsolit%gmail.com <>2006-06-19 08:11:59 +0200
commitccec3de0ed12a612343915b8c5fd2d903cca0408 (patch)
treed3aed133178000ac030a05948b08f93f60070fe4
parent7649fcfd8dd1f91bcec401fdaed6c8ee49c3af56 (diff)
downloadbugzilla-ccec3de0ed12a612343915b8c5fd2d903cca0408.tar.gz
bugzilla-ccec3de0ed12a612343915b8c5fd2d903cca0408.tar.xz
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
-rwxr-xr-xshow_bug.cgi8
-rw-r--r--skins/standard/show_multiple.css5
-rw-r--r--template/en/default/bug/show-multiple.html.tmpl17
3 files changed, 28 insertions, 2 deletions
diff --git a/show_bug.cgi b/show_bug.cgi
index 36e325057..578b6a7a8 100755
--- a/show_bug.cgi
+++ b/show_bug.cgi
@@ -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);
+ }
}
}
diff --git a/skins/standard/show_multiple.css b/skins/standard/show_multiple.css
index 573a587b6..50875382d 100644
--- a/skins/standard/show_multiple.css
+++ b/skins/standard/show_multiple.css
@@ -45,3 +45,8 @@ h1 {
.bugfields table.timetracking th, .bugfields table.timetracking td {
width: 10em;
}
+
+.error {
+ color: red;
+ font-weight: bold;
+}
diff --git a/template/en/default/bug/show-multiple.html.tmpl b/template/en/default/bug/show-multiple.html.tmpl
index 9244592d8..023cb9573 100644
--- a/template/en/default/bug/show-multiple.html.tmpl
+++ b/template/en/default/bug/show-multiple.html.tmpl
@@ -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>