diff options
author | jake%acutex.net <> | 2001-10-20 22:03:14 +0200 |
---|---|---|
committer | jake%acutex.net <> | 2001-10-20 22:03:14 +0200 |
commit | 1a7dfa3a2850476442545f60f7795db8bcbdd56d (patch) | |
tree | 38181903ef39814d299a8291af931c9ccd1ee736 /globals.pl | |
parent | 16c15e5201a38a2dda0cf5daf654dae39b043cc2 (diff) | |
download | bugzilla-1a7dfa3a2850476442545f60f7795db8bcbdd56d.tar.gz bugzilla-1a7dfa3a2850476442545f60f7795db8bcbdd56d.tar.xz |
Bug 71840 - Make comments referenceable using a #c4 to get the fourth comment.
Patch by Gerv <gerv@mozilla.org> and Myself.
r= jake@acutex.net, gerv@mozilla.org, justdave@syndicomm.com
Diffstat (limited to 'globals.pl')
-rw-r--r-- | globals.pl | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/globals.pl b/globals.pl index 834c08d1c..32a55d143 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{<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++; |