]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2005-05-11 09:52:23 by cjwatson]
authorcjwatson <>
Wed, 11 May 2005 16:52:23 +0000 (08:52 -0800)
committercjwatson <>
Wed, 11 May 2005 16:52:23 +0000 (08:52 -0800)
Properly support multiple submitter addresses on a single bug.

cgi/bugreport.cgi
cgi/common.pl
cgi/pkgindex.cgi
debian/changelog

index 166d2d821eab3a441f6637e856c5f55fecfbb4e1..28035e21624dbf3d1cef4b1b145296d44067c2bc 100755 (executable)
@@ -181,8 +181,8 @@ if  ($status{severity} eq 'normal') {
 $indexentry .= "<p>$showseverity";
 $indexentry .= htmlpackagelinks($status{package}, 0);
 
-$indexentry .= "Reported by: <a href=\"" . submitterurl($status{originator})
-              . "\">" . htmlsanit($status{originator}) . "</a>;\n";
+$indexentry .= htmladdresslinks("Reported by: ", \&submitterurl,
+                                $status{originator}) . ";\n";
 
 $indexentry .= "Owned by: " . htmlsanit($status{owner}) . ";\n"
               if length $status{owner};
index 2c0bf94501625e87b50622ce2bc86c520c4e7275..db9d1f4dd7ee096a9927ca5bdc5b69bbf52b0a02 100644 (file)
@@ -244,25 +244,34 @@ sub htmlpackagelinks {
            ) . ";\n";
 }
 
-# Generate a comma-separated list of HTML links to each maintainer given in
-# $maints, which should be a comma-separated list of RFC822 addresses.
-sub htmlmaintlinks {
-    my ($prefixfunc, $maints) = @_;
-    if (defined $maints and $maints ne '') {
-        my @maintaddrs = getparsedaddrs($maints);
-        my $prefix = (ref $prefixfunc) ? $prefixfunc->(scalar @maintaddrs)
+# Generate a comma-separated list of HTML links to each address given in
+# $addresses, which should be a comma-separated list of RFC822 addresses.
+# $urlfunc should be a reference to a function like mainturl or submitterurl
+# which returns the URL for each individual address.
+sub htmladdresslinks {
+    my ($prefixfunc, $urlfunc, $addresses) = @_;
+    if (defined $addresses and $addresses ne '') {
+        my @addrs = getparsedaddrs($addresses);
+        my $prefix = (ref $prefixfunc) ? $prefixfunc->(scalar @addrs)
                                        : $prefixfunc;
         return $prefix .
                join ', ', map { sprintf '<a href="%s">%s</a>',
-                                        mainturl($_->address),
+                                        $urlfunc->($_->address),
                                         htmlsanit($_->format) || '(unknown)'
-                              } @maintaddrs;
+                              } @addrs;
     } else {
         my $prefix = (ref $prefixfunc) ? $prefixfunc->(1) : $prefixfunc;
-        return sprintf '%s<a href="%s">(unknown)</a>', $prefix, mainturl('');
+        return sprintf '%s<a href="%s">(unknown)</a>', $prefix, $urlfunc->('');
     }
 }
 
+# Generate a comma-separated list of HTML links to each maintainer given in
+# $maints, which should be a comma-separated list of RFC822 addresses.
+sub htmlmaintlinks {
+    my ($prefixfunc, $maints) = @_;
+    return htmladdresslinks($prefixfunc, \&mainturl, $maints);
+}
+
 sub htmlindexentry {
     my $ref = shift;
     my %status = %{getbugstatus($ref)};
@@ -286,8 +295,8 @@ sub htmlindexentrystatus {
 
     $result .= htmlpackagelinks($status{"package"}, 1);
     $result .= $showseverity;
-    $result .= "Reported by: <a href=\"" . submitterurl($status{originator})
-               . "\">" . htmlsanit($status{originator}) . "</a>";
+    $result .= htmladdresslinks("Reported by: ", \&submitterurl,
+                                $status{originator});
     $result .= ";\nOwned by: " . htmlsanit($status{owner})
                if length $status{owner};
     $result .= ";\nTags: <strong>" 
index 029ecd872b808e30d6f3d271c1edeef3761b0f8d..585467131e0529d1761d5350946d89be70ee3bd8 100755 (executable)
@@ -110,11 +110,14 @@ if ($indexon eq "pkg") {
 } elsif ($indexon eq "submitter") {
   $tag = "submitter";
   my %fullname = ();
-  %count = countbugs(sub {my %d=@_; my $f = $d{"submitter"} || "";
-                          my $em = emailfromrfc822($f);
-                          $fullname{$em} = $f if (!defined $fullname{$em});
-                         return $em;
-                       });
+  %count = countbugs(sub {my %d=@_;
+                          my @se = getparsedaddrs($d{"submitter"} || "");
+                          foreach my $addr (@se) {
+                            $fullname{$addr->address} = $addr->format
+                              unless exists $fullname{$addr->address};
+                          }
+                          map { $_->address } @se;
+                         });
   foreach my $sub (keys %count) {
     $sortkey{$sub} = lc $fullname{$sub};
     $htmldescrip{$sub} = sprintf('<a href="%s">%s</a>',
index e1b25e454a7d8459884e6c354904baee1be627d7..02ddaed42410b1202cad59f8c9c8bd95a04f65a4 100644 (file)
@@ -25,6 +25,7 @@ debbugs (2.4.2) UNRELEASED; urgency=low
       (closes: #222077).
     - Decode RFC1522 mail headers for display in the web interface.
       bugreport.cgi and pkgreport.cgi now output UTF-8.
+    - Properly support multiple submitter addresses on a single bug.
 
   * Adam Heath:
     - Rewrite filtering in cgi's common.pl, to make it completely generic.