From: gerv%gerv.net <> Date: Fri, 12 Oct 2001 06:07:54 +0000 (+0000) Subject: Bug 71840 - Make comments referenceable. Patch by gerv; r=myk, jake (ish :-). X-Git-Tag: bugzilla-2.14.1~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67b3cc06cb39fa6a8dac48041e3483e54ba3228a;p=thirdparty%2Fbugzilla.git Bug 71840 - Make comments referenceable. Patch by gerv; r=myk, jake (ish :-). --- diff --git a/bug_form.pl b/bug_form.pl index af6618db5d..8e54c8a18d 100644 --- a/bug_form.pl +++ b/bug_form.pl @@ -569,7 +569,7 @@ if ( Param("move-enabled") && (defined $::COOKIE{"Bugzilla_login"}) && ($::COOKI print "
"; print " - +
Description:
Description: Opened: $bug{'creation_ts'}

"; diff --git a/globals.pl b/globals.pl index eedfa12e3b..401d9eef29 100644 --- a/globals.pl +++ b/globals.pl @@ -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{$item}; + $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 .= "

------- 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 .= "

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