Commit b9ea507b authored by cyeh%bluemartini.com's avatar cyeh%bluemartini.com

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.
parent 03262a36
...@@ -118,6 +118,9 @@ my $assignedtoid = $bug{'assigned_to'}; ...@@ -118,6 +118,9 @@ my $assignedtoid = $bug{'assigned_to'};
my $reporterid = $bug{'reporter'}; my $reporterid = $bug{'reporter'};
my $qacontactid = $bug{'qa_contact'}; my $qacontactid = $bug{'qa_contact'};
$bug{'assigned_name'} = DBID_to_real_name($bug{'assigned_to'});
$bug{'reporter_name'} = DBID_to_real_name($bug{'reporter'});
$bug{'assigned_to'} = DBID_to_name($bug{'assigned_to'}); $bug{'assigned_to'} = DBID_to_name($bug{'assigned_to'});
$bug{'reporter'} = DBID_to_name($bug{'reporter'}); $bug{'reporter'} = DBID_to_name($bug{'reporter'});
...@@ -183,8 +186,8 @@ print " ...@@ -183,8 +186,8 @@ print "
<TD ALIGN=RIGHT><B>OS:</B></TD> <TD ALIGN=RIGHT><B>OS:</B></TD>
<TD><SELECT NAME=op_sys>" . <TD><SELECT NAME=op_sys>" .
make_options(\@::legal_opsys, $bug{'op_sys'}) . make_options(\@::legal_opsys, $bug{'op_sys'}) .
"</SELECT><TD ALIGN=RIGHT><B>Reporter:</B></TD><TD>$bug{'reporter'}</TD> "</SELECT><TD ALIGN=RIGHT><B>Reporter:</B></TD><TD>$bug{'reporter'} $bug{'reporter_name'}</TD>
</TR><TR> </TDTR><TR>
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html\">Status:</A></B></TD> <TD ALIGN=RIGHT><B><A HREF=\"bug_status.html\">Status:</A></B></TD>
<TD>$bug{'bug_status'}</TD> <TD>$bug{'bug_status'}</TD>
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#priority\">Priority:</A></B></TD> <TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#priority\">Priority:</A></B></TD>
...@@ -202,7 +205,7 @@ print " ...@@ -202,7 +205,7 @@ print "
</TR><TR> </TR><TR>
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#assigned_to\">Assigned&nbsp;To: <TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#assigned_to\">Assigned&nbsp;To:
</A></B></TD> </A></B></TD>
<TD>$bug{'assigned_to'}</TD>"; <TD>$bug{'assigned_to'} $bug{'assigned_name'}</TD>";
if (Param("usetargetmilestone")) { if (Param("usetargetmilestone")) {
my $url = ""; my $url = "";
......
...@@ -546,6 +546,16 @@ sub InsertNewUser { ...@@ -546,6 +546,16 @@ sub InsertNewUser {
return $password; 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 { sub DBID_to_name {
my ($id) = (@_); my ($id) = (@_);
...@@ -721,7 +731,7 @@ sub GetLongDescriptionAsHTML { ...@@ -721,7 +731,7 @@ sub GetLongDescriptionAsHTML {
$knownattachments{FetchOneColumn()} = 1; $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 " . " longdescs.thetext " .
"FROM longdescs, profiles " . "FROM longdescs, profiles " .
"WHERE profiles.userid = longdescs.who " . "WHERE profiles.userid = longdescs.who " .
...@@ -740,12 +750,18 @@ sub GetLongDescriptionAsHTML { ...@@ -740,12 +750,18 @@ sub GetLongDescriptionAsHTML {
$query .= "ORDER BY longdescs.bug_when"; $query .= "ORDER BY longdescs.bug_when";
SendSQL($query); SendSQL($query);
while (MoreSQLData()) { while (MoreSQLData()) {
my ($who, $when, $text) = (FetchSQLData()); my ($who, $email, $when, $text) = (FetchSQLData());
if ($count) { if ($count) {
$result .= "<BR><BR><I>------- Additional Comments From " . $result .= "<BR><BR><I>------- Additional Comments From ";
qq{<A HREF="mailto:$who">$who</A> } . if ($who) {
time2str("%Y-%m-%d %H:%M", str2time($when)) . $result .= qq{<A HREF="mailto:$email">$who</A> } .
" -------</I><BR>\n"; 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"; $result .= "<PRE>" . quoteUrls(\%knownattachments, $text) . "</PRE>\n";
$count++; $count++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment