From: jake%acutex.net <> Date: Sat, 20 Oct 2001 20:03:14 +0000 (+0000) Subject: Bug 71840 - Make comments referenceable using a #c4 to get the fourth comment. X-Git-Tag: bugzilla-2.14.1~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1a7dfa3a2850476442545f60f7795db8bcbdd56d;p=thirdparty%2Fbugzilla.git Bug 71840 - Make comments referenceable using a #c4 to get the fourth comment. Patch by Gerv and Myself. r= jake@acutex.net, gerv@mozilla.org, justdave@syndicomm.com --- diff --git a/bug_form.pl b/bug_form.pl index d3311fee5b..b39570d4e1 100644 --- a/bug_form.pl +++ b/bug_form.pl @@ -569,11 +569,11 @@ if ( Param("move-enabled") && (defined $::COOKIE{"Bugzilla_login"}) && ($::COOKI print "
"; -print " - +print qq| +
Description:
Description: Opened: $bug{'creation_ts'}

-"; +|; print $bug{'long_desc'}; print "
\n"; diff --git a/globals.pl b/globals.pl index 834c08d1cc..32a55d143d 100644 --- a/globals.pl +++ b/globals.pl @@ -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{$item}; + $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 .= "

------- Additional Comments From "; - if ($who) { - $result .= qq{$who } . - time2str("%Y-%m-%d %H:%M", str2time($when)) . - " -------
\n"; - } else { - $result .= qq{$email } . - time2str("%Y-%m-%d %H:%M", str2time($when)) . - " -------
\n"; - } + $result .= qq|

------- Additional Comment #$count From |; + if ($who) { + $result .= qq{$who }; + } else { + $result .= qq{$email }; + } + + $result .= time2str("%Y-%m-%d %H:%M", str2time($when)) . " -------
\n"; } $result .= "
" . quoteUrls(\%knownattachments, $text) . "
\n"; $count++;