summaryrefslogtreecommitdiffstats
path: root/globals.pl
diff options
context:
space:
mode:
authorcyeh%bluemartini.com <>2000-04-22 03:45:48 +0200
committercyeh%bluemartini.com <>2000-04-22 03:45:48 +0200
commitb9ea507b3a467385d5f1c34e64b3c56e15167aff (patch)
tree6d9d126f0aa0da2ece5af6f5c329ca304b0bebf7 /globals.pl
parent03262a3659abca6bdab5fc1cc251405e5be2f0fe (diff)
downloadbugzilla-b9ea507b3a467385d5f1c34e64b3c56e15167aff.tar.gz
bugzilla-b9ea507b3a467385d5f1c34e64b3c56e15167aff.tar.xz
Add conditional support to display users real name in bug reports if user
entered in that information. Thanks to Chris Baldwin <cbaldwin@redback.com> for providing the patch.
Diffstat (limited to 'globals.pl')
-rw-r--r--globals.pl28
1 files changed, 22 insertions, 6 deletions
diff --git a/globals.pl b/globals.pl
index 2d22038a3..948fa7feb 100644
--- a/globals.pl
+++ b/globals.pl
@@ -546,6 +546,16 @@ sub InsertNewUser {
return $password;
}
+sub DBID_to_real_name {
+ my ($id) = (@_);
+ SendSQL("SELECT realname FROM profiles WHERE userid = $id");
+ my ($r) = FetchSQLData();
+ if ($r eq "") {
+ return;
+ } else {
+ return "($r)";
+ }
+}
sub DBID_to_name {
my ($id) = (@_);
@@ -721,7 +731,7 @@ sub GetLongDescriptionAsHTML {
$knownattachments{FetchOneColumn()} = 1;
}
- my ($query) = ("SELECT profiles.login_name, longdescs.bug_when, " .
+ my ($query) = ("SELECT profiles.realname, profiles.login_name, longdescs.bug_when, " .
" longdescs.thetext " .
"FROM longdescs, profiles " .
"WHERE profiles.userid = longdescs.who " .
@@ -740,12 +750,18 @@ sub GetLongDescriptionAsHTML {
$query .= "ORDER BY longdescs.bug_when";
SendSQL($query);
while (MoreSQLData()) {
- my ($who, $when, $text) = (FetchSQLData());
+ my ($who, $email, $when, $text) = (FetchSQLData());
if ($count) {
- $result .= "<BR><BR><I>------- Additional Comments From " .
- qq{<A HREF="mailto:$who">$who</A> } .
- time2str("%Y-%m-%d %H:%M", str2time($when)) .
- " -------</I><BR>\n";
+ $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 .= "<PRE>" . quoteUrls(\%knownattachments, $text) . "</PRE>\n";
$count++;