]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 189366 : real name columns should fall back to e-mail name
authortravis%sedsystems.ca <>
Wed, 16 Feb 2005 01:16:07 +0000 (01:16 +0000)
committertravis%sedsystems.ca <>
Wed, 16 Feb 2005 01:16:07 +0000 (01:16 +0000)
Patch by Marc Schumann <wurblzap@gmail.com>   r=LpSolit,jpeshkin  a=justdave

Bugzilla/Search.pm
buglist.cgi

index 10d9d907a79f412b7cc7d688afb734c2ba92793c..05cdc21f0c6df7aad7cb6687eb9bad40236d071d 100644 (file)
@@ -98,20 +98,17 @@ sub init {
     &::GetVersionTable();
     
     # First, deal with all the old hard-coded non-chart-based poop.
-    if (lsearch($fieldsref, 'map_assigned_to.login_name') >= 0 || 
-        lsearch($fieldsref, 'map_assigned_to.realname') >= 0) {
+    if (grep(/map_assigned_to/, @$fieldsref)) {
         push @supptables, "profiles AS map_assigned_to";
         push @wherepart, "bugs.assigned_to = map_assigned_to.userid";
     }
 
-    if (lsearch($fieldsref, 'map_reporter.login_name') >= 0 || 
-        lsearch($fieldsref, 'map_reporter.realname') >= 0) {
+    if (grep(/map_reporter/, @$fieldsref)) {
         push @supptables, "profiles AS map_reporter";
         push @wherepart, "bugs.reporter = map_reporter.userid";
     }
 
-    if (lsearch($fieldsref, 'map_qa_contact.login_name') >= 0 || 
-        lsearch($fieldsref, 'map_qa_contact.realname') >= 0) {
+    if (grep(/map_qa_contact/, @$fieldsref)) {
         push @supptables, "LEFT JOIN profiles map_qa_contact ON bugs.qa_contact = map_qa_contact.userid";
     }
 
index d748b07571d25e3edb735c0ab031665266794279..f6869b34914befdfedc19d5188e8aa38adf4c97d 100755 (executable)
@@ -475,11 +475,17 @@ DefineColumn("bug_severity"      , "bugs.bug_severity"          , "Severity"
 DefineColumn("priority"          , "bugs.priority"              , "Priority"         );
 DefineColumn("rep_platform"      , "bugs.rep_platform"          , "Hardware"         );
 DefineColumn("assigned_to"       , "map_assigned_to.login_name" , "Assignee"         );
-DefineColumn("assigned_to_realname", "map_assigned_to.realname" , "Assignee"         );
 DefineColumn("reporter"          , "map_reporter.login_name"    , "Reporter"         );
-DefineColumn("reporter_realname" , "map_reporter.realname"      , "Reporter"         );
 DefineColumn("qa_contact"        , "map_qa_contact.login_name"  , "QA Contact"       );
-DefineColumn("qa_contact_realname", "map_qa_contact.realname"   , "QA Contact"       );
+if ($format->{'extension'} eq 'html') {
+    DefineColumn("assigned_to_realname", "CASE WHEN map_assigned_to.realname = '' THEN map_assigned_to.login_name ELSE map_assigned_to.realname END", "Assignee"  );
+    DefineColumn("reporter_realname"   , "CASE WHEN map_reporter.realname    = '' THEN map_reporter.login_name    ELSE map_reporter.realname    END", "Reporter"  );
+    DefineColumn("qa_contact_realname" , "CASE WHEN map_qa_contact.realname  = '' THEN map_qa_contact.login_name  ELSE map_qa_contact.realname  END", "QA Contact");
+} else {
+    DefineColumn("assigned_to_realname", "map_assigned_to.realname" , "Assignee"         );
+    DefineColumn("reporter_realname"   , "map_reporter.realname"    , "Reporter"         );
+    DefineColumn("qa_contact_realname" , "map_qa_contact.realname"  , "QA Contact"       );
+}
 DefineColumn("bug_status"        , "bugs.bug_status"            , "Status"           );
 DefineColumn("resolution"        , "bugs.resolution"            , "Result"           );
 DefineColumn("short_short_desc"  , "bugs.short_desc"            , "Summary"          );