]> git.donarmstrong.com Git - debbugs.git/blobdiff - cgi/bugreport.cgi
[project @ 2003-08-18 01:16:14 by cjwatson]
[debbugs.git] / cgi / bugreport.cgi
index a0d100b5bb8e0be5bf59ad64f2f2361bd76b19ca..dad91a0c7ebbcf94a12051c0991ebc1df7fe750e 100755 (executable)
@@ -97,10 +97,10 @@ sub display_entity ($$$$\$\@) {
        }
     }
 
-    return if $disposition eq 'attachment' and not defined($att);
+    return if not $top and $disposition eq 'attachment' and not defined($att);
     return unless ($type =~ m[^text/?] and $type !~ m[^text/html(?:;|$)]) or
                  $type =~ m[^application/pgp(?:;|$)] or
-                 $entity->is_multipart;
+                 $entity->parts;
 
     if ($entity->is_multipart) {
        my @parts = $entity->parts;
@@ -109,6 +109,16 @@ sub display_entity ($$$$\$\@) {
                           $$this, @$attachments);
            $$this .= "\n";
        }
+    } elsif ($entity->parts) {
+       # We must be dealing with a nested message.
+       $$this .= "<blockquote>\n";
+       my @parts = $entity->parts;
+       foreach my $part (@parts) {
+           display_entity($part, $ref, 1, $xmessage,
+                          $$this, @$attachments);
+           $$this .= "\n";
+       }
+       $$this .= "</blockquote>\n";
     } else {
        $$this .= htmlsanit($entity->bodyhandle->as_string) unless ($terse);
     }
@@ -188,7 +198,22 @@ if (@merged) {
        push @descstates, $descmerged;
 }
 
-if (length($status{done})) {
+if (@{$status{found_versions}}) {
+    my $foundtext = 'Found in ';
+    $foundtext .= (@{$status{found_versions}} == 1) ? 'version ' : 'versions ';
+    $foundtext .= join ', ', map htmlsanit($_), @{$status{found_versions}};
+    push @descstates, $foundtext;
+}
+
+if (@{$status{fixed_versions}}) {
+    my $fixedtext = '<strong>Fixed</strong> in ';
+    $fixedtext .= (@{$status{fixed_versions}} == 1) ? 'version ' : 'versions ';
+    $fixedtext .= join ', ', map htmlsanit($_), @{$status{fixed_versions}};
+    if (length($status{done})) {
+       $fixedtext .= ' by ' . htmlsanit($status{done});
+    }
+    push @descstates, $fixedtext;
+} elsif (length($status{done})) {
        push @descstates, "<strong>Done:</strong> ".htmlsanit($status{done});
 } elsif (length($status{forwarded})) {
        push @descstates, "<strong>Forwarded</strong> to ".maybelink($status{forwarded});
@@ -201,15 +226,17 @@ foreach my $pkg (@tpacks) {
     my $tmaint = defined($maintainer{$pkg}) ? $maintainer{$pkg} : '(unknown)';
     my $tsrc = defined($pkgsrc{$pkg}) ? $pkgsrc{$pkg} : '(unknown)';
 
-    $descriptivehead .= "Maintainer for $pkg is\n".
-            '<a href="'.mainturl($tmaint).'">'.htmlsanit($tmaint).'</a>';
+    $descriptivehead .=
+            htmlmaintlinks(sub { $_[0] == 1 ? "Maintainer for $pkg is\n"
+                                            : "Maintainers for $pkg are\n" },
+                           $tmaint);
     $descriptivehead .= ";\nSource for $pkg is\n".
             '<a href="'.srcurl($tsrc)."\">$tsrc</a>" if ($tsrc ne "(unknown)");
     $descriptivehead .= ".\n<br>";
 }
 
 open L, "<$buglog" or &quitcgi("open log for $ref: $!");
-if ($buglog !~ m#^\Q$gSpoolDir/db-h/#) {
+if ($buglog !~ m#^\Q$gSpoolDir/db#) {
     $descriptivehead .= "\n<p>Bug is <strong>archived</strong>. No further changes may be made.</p>";
 }
 
@@ -406,14 +433,16 @@ if ( $mbox ) {
 }
 print "Content-Type: text/html\n\n";
 
+my $title = htmlsanit($status{subject});
+
 print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
 print "<HTML><HEAD>\n" . 
-    "<TITLE>$debbugs::gProject $debbugs::gBug report logs - $short</TITLE>\n" .
+    "<TITLE>$debbugs::gProject $debbugs::gBug report logs - $short - $title</TITLE>\n" .
     "</HEAD>\n" .
     '<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#800080">' .
     "\n";
-print "<H1>" .  "$debbugs::gProject $debbugs::gBug report logs - <A HREF=\"mailto:$ref\@$gEmailDomain\">$short</A>" .
-      "<BR>" . htmlsanit($status{subject}) . "</H1>\n";
+print "<H1>" . "$debbugs::gProject $debbugs::gBug report logs - <A HREF=\"mailto:$ref\@$gEmailDomain\">$short</A>" .
+      "<BR>" . $title . "</H1>\n";
 
 print "$descriptivehead\n";
 printf "<p>View this report as an <a href=\"%s\">mbox folder</a>.</p>\n", mboxurl($ref);