* Finish task #7520;

This commit is contained in:
holan20180123
2020-07-27 14:17:27 +08:00
parent 5c2a141a78
commit db4a3db53d
2 changed files with 24 additions and 47 deletions
+10 -20
View File
@@ -1406,8 +1406,16 @@ class bug extends control
*/
public function ajaxGetModuleOwner($moduleID, $productID = 0)
{
$owner = $this->bug->getModuleOwner($moduleID, $productID);
die($owner);
$account = $this->bug->getModuleOwner($moduleID, $productID);
$realName = '';
if(!empty($account))
{
$user = $this->dao->select('realname')->from(TABLE_USER)->where('account')->eq($account)->fetch();
$firstLetter = ucfirst(substr($account, 0, 1)) . ':';
if(!empty($this->config->isINT)) $firstLetter = '';
$realName = $firstLetter . ($user->realname ? $user->realname : $account);
}
die(json_encode(array($account, $realName)));
}
/**
@@ -1704,22 +1712,4 @@ class bug extends control
die(json_encode(array('modules' => $modules, 'categories' => $type, 'versions' => $builds, 'severities' => $severity, 'priorities' => $pri)));
}
/**
* AJAX: Get bug assigned title of a module.
*
* @param string $owner
* @access public
* @return string
*/
public function ajaxGetModuleAssignedTitle($owner)
{
$user = $this->dao->select('realname')->from(TABLE_USER)->where('account')->eq($owner)->fetch();
$firstLetter = ucfirst(substr($owner, 0, 1)) . ':';
if(!empty($this->config->isINT)) $firstLetter = '';
$title = $firstLetter . ($user->realname ? $user->realname : $owner);
die($title);
}
}