* Fix bug#50694,50689
This commit is contained in:
@@ -166,7 +166,31 @@ class gitModel extends model
|
||||
' task:' . join(' ', $objects['tasks']) .
|
||||
' bug:' . join(',', $objects['bugs']));
|
||||
|
||||
$this->repo->saveAction2PMS($objects, $log, $this->repoRoot, $repo->encoding, 'git');
|
||||
if($repo->SCM == 'Gitlab')
|
||||
{
|
||||
if(!isset($gitlabAccountPairs))
|
||||
{
|
||||
$gitlabAccountPairs = array();
|
||||
$gitlabUserList = $this->loadModel('gitlab')->apiGetUsers($repo->gitlab);
|
||||
$acountIDPairs = $this->gitlab->getUserIdAccountPairs($repo->gitlab);
|
||||
foreach($acountIDPairs as $openID => $account)
|
||||
{
|
||||
foreach($gitlabUserList as $gitlabUser)
|
||||
{
|
||||
if($gitlabUser->id == $openID)
|
||||
{
|
||||
$gitlabAccountPairs[$gitlabUser->realname] = $account;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->repo->saveAction2PMS($objects, $log, $this->repoRoot, $repo->encoding, 'git', $gitlabAccountPairs);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->repo->saveAction2PMS($objects, $log, $this->repoRoot, $repo->encoding, 'git');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -555,6 +555,9 @@ class mrModel extends model
|
||||
->fetch();
|
||||
if(empty($todoDesc))
|
||||
{
|
||||
$acountPairs = $this->gitlab->getUserIdRealnamePairs($gitlabID);
|
||||
$author = isset($acountPairs[$rawTodo->author->id]) ? $acountPairs[$rawTodo->author->id] : $rawTodo->author->name;
|
||||
|
||||
$todo = new stdClass;
|
||||
$todo->account = $this->app->user->account;
|
||||
$todo->assignedTo = $account;
|
||||
@@ -567,7 +570,7 @@ class mrModel extends model
|
||||
$todo->idvalue = $rawTodo->id;
|
||||
$todo->pri = 3;
|
||||
$todo->name = $this->lang->mr->common . ": " . $rawTodo->target->title;
|
||||
$todo->desc = $rawTodo->target->assignee->name . ' ' . $this->lang->mr->at . ' ' . '<a href="' . $this->gitlab->apiGetSingleProject($gitlabID, $projectID)->web_url . '" target="_blank">' . $rawTodo->project->path .'</a>' . ' ' . $this->lang->mr->todomessage . '<a href="' . $rawTodo->target->web_url . '" target="_blank">' . ' ' . $this->lang->mr->common .'</a>' . '。';
|
||||
$todo->desc = $author . ' ' . $this->lang->mr->at . ' ' . '<a href="' . $this->gitlab->apiGetSingleProject($gitlabID, $projectID)->web_url . '" target="_blank">' . $rawTodo->project->path .'</a>' . ' ' . $this->lang->mr->todomessage . '<a href="' . $rawTodo->target->web_url . '" target="_blank">' . ' ' . $this->lang->mr->common .'</a>' . '。';
|
||||
$todo->status = 'wait';
|
||||
$todo->finishedBy = '';
|
||||
|
||||
|
||||
@@ -1533,11 +1533,16 @@ class repoModel extends model
|
||||
* @param array $objects
|
||||
* @param object $log
|
||||
* @param string $repoRoot
|
||||
* @param string $encodings
|
||||
* @param string $scm
|
||||
* @param array $gitlabAccountPairs
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function saveAction2PMS($objects, $log, $repoRoot = '', $encodings = 'utf-8', $scm = 'svn')
|
||||
public function saveAction2PMS($objects, $log, $repoRoot = '', $encodings = 'utf-8', $scm = 'svn', $gitlabAccountPairs = array())
|
||||
{
|
||||
$log->author = isset($gitlabAccountPairs[$log->author]) ? $gitlabAccountPairs[$log->author] : $log->author;
|
||||
|
||||
if(isset($this->app->user))
|
||||
{
|
||||
$account = $this->app->user->account;
|
||||
|
||||
Reference in New Issue
Block a user