]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 71840 - Make comments referenceable using a #c4 to get the fourth comment.
authorjake%acutex.net <>
Sat, 20 Oct 2001 20:03:14 +0000 (20:03 +0000)
committerjake%acutex.net <>
Sat, 20 Oct 2001 20:03:14 +0000 (20:03 +0000)
Patch by Gerv <gerv@mozilla.org> and Myself.
r= jake@acutex.net, gerv@mozilla.org, justdave@syndicomm.com

bug_form.pl
globals.pl

index d3311fee5bdfc161876f8e2ba11acf95515e2118..b39570d4e123c73165633d4e83840178b79aa9c0 100644 (file)
@@ -569,11 +569,11 @@ if ( Param("move-enabled") && (defined $::COOKIE{"Bugzilla_login"}) && ($::COOKI
 
 print "<BR></FORM>";
 
-print "
-<table><tr><td align=left><B>Description:</B></td>
+print qq|
+<table><tr><td align=left><B><a name="0" href="#c0">Description:</a></B></td>
 <td align=right width=100%>Opened: $bug{'creation_ts'}</td></tr></table>
 <HR>
-";
+|;
 print $bug{'long_desc'};
 print "
 <HR>\n";
index 834c08d1ccf9c98469c9e1d89510f1b8b1ff8197..32a55d143d8c79d8bf9c3b45f30561b38548881e 100644 (file)
@@ -891,6 +891,22 @@ sub quoteUrls {
 
         $things[$count++] = $item;
     }
+    # Either a comment string or no comma and a compulsory #.
+    while ($text =~ s/\bbug(\s|%\#)*(\d+),?\s*comment\s*(\s|%\#)(\d+)/"##$count##"/ei) {
+        my $item = $&;
+        my $bugnum = $2;
+        my $comnum = $4;
+        $item = GetBugLink($bugnum, $item);
+        $item =~ s/(id=\d+)/$1#c$comnum/;
+        $things[$count++] = $item;
+    }
+    while ($text =~ s/\bcomment(\s|%\#)*(\d+)/"##$count##"/ei) {
+        my $item = $&;
+        my $num = $2;
+        $item = value_quote($item);
+        $item = qq{<A HREF="#c$num">$item</A>};
+        $things[$count++] = $item;
+    }
     while ($text =~ s/\bbug(\s|%\#)*(\d+)/"##$count##"/ei) {
         my $item = $&;
         my $num = $2;
@@ -1047,16 +1063,14 @@ sub GetLongDescriptionAsHTML {
         my ($who, $email, $when, $text) = (FetchSQLData());
         $email .= Param('emailsuffix');
         if ($count) {
-            $result .= "<BR><BR><I>------- Additional Comments From ";
-              if ($who) {
-                  $result .= qq{<A HREF="mailto:$email">$who</A> } .
-                      time2str("%Y-%m-%d %H:%M", str2time($when)) .
-                          " -------</I><BR>\n";
-              } else {
-                  $result .= qq{<A HREF="mailto:$email">$email</A> } .
-                      time2str("%Y-%m-%d %H:%M", str2time($when)) .
-                          " -------</I><BR>\n";
-              }
+            $result .= qq|<BR><BR><I>------- Additional Comment <a name="c$count" href="#c$count">#$count</a> From |;
+            if ($who) {
+                $result .= qq{<A HREF="mailto:$email">$who</A> };
+            } else {
+                $result .= qq{<A HREF="mailto:$email">$email</A> };
+            }
+              
+            $result .= time2str("%Y-%m-%d %H:%M", str2time($when)) . " -------</I><BR>\n";
         }
         $result .= "<PRE>" . quoteUrls(\%knownattachments, $text) . "</PRE>\n";
         $count++;