summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcyeh%bluemartini.com <>2000-04-26 10:43:51 +0200
committercyeh%bluemartini.com <>2000-04-26 10:43:51 +0200
commit14f53bd7f091ae5dd40671ad1154ed11be7a2c8e (patch)
tree22130c5e79fe8bc08880ac6a35fc293f9dd694ec
parente057014bdfe4e7441f44da458eabec52b13c7b22 (diff)
downloadbugzilla-14f53bd7f091ae5dd40671ad1154ed11be7a2c8e.tar.gz
bugzilla-14f53bd7f091ae5dd40671ad1154ed11be7a2c8e.tar.xz
better implementation of realnames support. remove overhead of two sql
calls from bug_form.
-rw-r--r--bug_form.pl15
-rw-r--r--globals.pl10
2 files changed, 13 insertions, 12 deletions
diff --git a/bug_form.pl b/bug_form.pl
index 735dd2f1d..176c38035 100644
--- a/bug_form.pl
+++ b/bug_form.pl
@@ -118,11 +118,8 @@ my $assignedtoid = $bug{'assigned_to'};
my $reporterid = $bug{'reporter'};
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{'reporter'} = DBID_to_name($bug{'reporter'});
+$bug{'assigned_to'} = DBID_to_real_or_loginname($bug{'assigned_to'});
+$bug{'reporter'} = DBID_to_real_or_loginname($bug{'reporter'});
print qq{<FORM NAME="changeform" METHOD="POST" ACTION="process_bug.cgi">\n};
@@ -186,7 +183,7 @@ print "
<TD ALIGN=RIGHT><B>OS:</B></TD>
<TD><SELECT NAME=op_sys>" .
make_options(\@::legal_opsys, $bug{'op_sys'}) .
- "</SELECT><TD ALIGN=RIGHT><B>Reporter:</B></TD><TD>$bug{'reporter'} $bug{'reporter_name'}</TD>
+ "</SELECT><TD ALIGN=RIGHT><B>Reporter:</B></TD><TD>$bug{'reporter'}</TD>
</TDTR><TR>
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html\">Status:</A></B></TD>
<TD>$bug{'bug_status'}</TD>
@@ -205,7 +202,7 @@ print "
</TR><TR>
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#assigned_to\">Assigned&nbsp;To:
</A></B></TD>
- <TD>$bug{'assigned_to'} $bug{'assigned_name'}</TD>";
+ <TD>$bug{'assigned_to'}</TD>";
if (Param("usetargetmilestone")) {
my $url = "";
@@ -431,6 +428,10 @@ if ($canedit || $::userid == $assignedtoid ||
Resolve bug, mark it as duplicate of bug #
<INPUT NAME=dup_id SIZE=6 ONCHANGE=\"document.changeform.knob\[$knum\].checked=true\"><br>\n";
$knum++;
+ if ( $bug{'assigned_to'} =~ /(.*)\((.*)\)/ ) {
+ $bug{'assigned_to'} = $1;
+ chop($bug{'assigned_to'});
+ }
my $assign_element = "<INPUT NAME=\"assigned_to\" SIZE=32 ONCHANGE=\"document.changeform.knob\[$knum\].checked=true\" VALUE=\"$bug{'assigned_to'}\">";
print "<INPUT TYPE=radio NAME=knob VALUE=reassign>
diff --git a/globals.pl b/globals.pl
index 948fa7feb..32772df56 100644
--- a/globals.pl
+++ b/globals.pl
@@ -546,14 +546,14 @@ sub InsertNewUser {
return $password;
}
-sub DBID_to_real_name {
+sub DBID_to_real_or_loginname {
my ($id) = (@_);
- SendSQL("SELECT realname FROM profiles WHERE userid = $id");
- my ($r) = FetchSQLData();
+ SendSQL("SELECT login_name,realname FROM profiles WHERE userid = $id");
+ my ($l, $r) = FetchSQLData();
if ($r eq "") {
- return;
+ return $l;
} else {
- return "($r)";
+ return "$l ($r)";
}
}