* Code for task#56393,#56390,#56389.

This commit is contained in:
xieqiyu
2022-06-08 10:15:01 +08:00
parent 6a1f0a9562
commit 86561ba4ca
12 changed files with 54 additions and 6 deletions
+2 -2
View File
@@ -1496,7 +1496,7 @@ class execution extends control
$this->view->name = $name;
$this->view->code = $code;
$this->view->team = $team;
$this->view->teams = array(0 => '', $projectID => (isset($project->name) ? $project->name : '')) + $this->execution->getCanCopyObjects((int)$projectID);
$this->view->teams = array(0 => '') + $this->execution->getCanCopyObjects((int)$projectID);
$this->view->allProjects = array(0 => '') + $this->project->getPairsByModel('all', 0, 'noclosed');
$this->view->executionID = $executionID;
$this->view->productID = $productID;
@@ -2730,7 +2730,7 @@ class execution extends control
$currentMembers = $this->execution->getTeamMembers($executionID);
$members2Import = $this->execution->getMembers2Import($team2Import, array_keys($currentMembers));
$teams2Import = $this->loadModel('personnel')->getCopiedObjects($executionID, 'sprint');
$teams2Import = $this->loadModel('personnel')->getCopiedObjects($executionID, 'sprint', true);
$teams2Import = array('' => '') + $teams2Import;
/* Append users for get users. */
+1
View File
@@ -396,6 +396,7 @@ $lang->execution->projectNotEmpty = 'Project cannot be empty.';
$lang->execution->confirmStoryToTask = $lang->SRCommon . '%s are converted to tasks in the current. Do you want to convert them anyways?';
$lang->execution->ge = "『%s』should be >= actual begin『%s』.";
$lang->execution->storyDragError = "The {$lang->SRCommon} is still a draft or has been changed, please drag it after the review";
$lang->execution->countTip = ' (%s member)';
/* Statistics. */
$lang->execution->charts = new stdclass();
+1
View File
@@ -396,6 +396,7 @@ $lang->execution->projectNotEmpty = '所属项目不能为空。';
$lang->execution->confirmStoryToTask = '%s' . $lang->SRCommon . '已经在当前' . $lang->execution->common . '中转了任务,请确认是否重复转任务。';
$lang->execution->ge = "『%s』应当不小于实际开始时间『%s』。";
$lang->execution->storyDragError = "该{$lang->SRCommon}还是草稿或已变更状态,请评审通过后再拖动";
$lang->execution->countTip = '(%s人)';
/* 统计。*/
$lang->execution->charts = new stdclass();
+19 -2
View File
@@ -2743,14 +2743,31 @@ class executionModel extends model
$objectPairs = $this->dao->select('id,name')->from(TABLE_PROJECT)
->where('deleted')->eq(0)
->andWhere('project', true)->eq($projectID)
->andWhere('type')->ne('project')
->andWhere('(project')->eq($projectID)
->orWhere('id')->eq($projectID)
->markRight(1)
->orWhere('id')->eq($projectID)
->orderBy('type_asc,openedDate_desc')
->limit('9')
->fetchPairs();
$countPairs = $this->dao->select('root, COUNT(*) as count')->from(TABLE_TEAM)
->where('( type')->eq('project')
->andWhere('root')->eq($projectID)
->markRight(1)
->orWhere('( type')->eq('execution')
->andWhere('root')->in(array_keys($objectPairs))
->markRight(1)
->groupBy('root')
->fetchPairs('root');
foreach($objectPairs as $objectID => $objectName)
{
$memberCount = zget($countPairs, $objectID, 0);
$countTip = $memberCount > 1 ? str_replace('member', 'members', $this->lang->execution->countTip) : $this->lang->execution->countTip;
$objectPairs[$objectID] = $objectName . sprintf($countTip, $memberCount);
}
return $objectPairs;
}