]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 71840 - Make comments referenceable. Patch by gerv; r=myk, jake (ish :-).
authorgerv%gerv.net <>
Fri, 12 Oct 2001 06:07:54 +0000 (06:07 +0000)
committergerv%gerv.net <>
Fri, 12 Oct 2001 06:07:54 +0000 (06:07 +0000)
bug_form.pl
globals.pl

index af6618db5d8b5ca369bbba10291103eaac042cd4..8e54c8a18dc063fb3efcd9f8f02760ec046fbbb7 100644 (file)
@@ -569,7 +569,7 @@ if ( Param("move-enabled") && (defined $::COOKIE{"Bugzilla_login"}) && ($::COOKI
 print "<BR></FORM>";
 
 print "
-<table><tr><td align=left><B>Description:</B></td>
+<table><tr><td align=left><B><a name=\"0\" href=\"#0\">Description:</a></B></td>
 <td align=right width=100%>Opened: $bug{'creation_ts'}</td></tr></table>
 <HR>
 ";
index eedfa12e3b94c78ce345ecba6f90121e4a78a9f1..401d9eef292ec0f1d5989a56a740a327c4f09bcc 100644 (file)
@@ -884,6 +884,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 = $6;
+        $item = GetBugLink($bugnum, $item);
+        $item =~ s/(id=\d+)/$1#$comnum/;
+        $things[$count++] = $item;
+    }
+    while ($text =~ s/\bcom(ment)?(\s|%\#)*(\d+)/"##$count##"/ei) {
+        my $item = $&;
+        my $num = $3;
+        $item = value_quote($item);
+        $item = qq{<A HREF="#$num">$item</A>};
+        $things[$count++] = $item;
+    }
     while ($text =~ s/\bbug(\s|%\#)*(\d+)/"##$count##"/ei) {
         my $item = $&;
         my $num = $2;
@@ -1040,16 +1056,16 @@ 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 .= "<BR><BR><I>------- Additional Comment <a name='$count' href='#$count'>#$count</a> From ";
+            if ($who) {
+                $result .= qq{<A HREF="mailto:$email">$who</A> } .
+                    time2str("%Y-%m-%d %H:%M", str2time($when));
+            } else {
+                $result .= qq{<A HREF="mailto:$email">$email</A> } .
+                    time2str("%Y-%m-%d %H:%M", str2time($when));
+            }
+              
+            $result .= " -------</I><BR>\n";
         }
         $result .= "<PRE>" . quoteUrls(\%knownattachments, $text) . "</PRE>\n";
         $count++;