* Finish Task #77799
This commit is contained in:
@@ -898,7 +898,7 @@ class execution extends control
|
||||
$storyBugs = $this->loadModel('bug')->getStoryBugCounts($storyIdList, $executionID);
|
||||
$storyCases = $this->loadModel('testcase')->getStoryCaseCounts($storyIdList);
|
||||
|
||||
$plans = $this->execution->getPlans($products, 'skipParent|withMainPlan');
|
||||
$plans = $this->execution->getPlans($products, 'skipParent|withMainPlan', $executionID);
|
||||
$allPlans = array('' => '');
|
||||
if(!empty($plans))
|
||||
{
|
||||
@@ -1645,7 +1645,20 @@ class execution extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
return print(js::confirm($this->lang->execution->importPlanStory, inlink('create', "projectID=$projectID&executionID=$executionID©ExecutionID=&planID=$planID&confirm=yes"), inlink('create', "projectID=$projectID&executionID=$executionID")));
|
||||
$executionProductList = $this->loadModel('product')->getProducts($executionID);
|
||||
$hasMultiBranchProduct = false;
|
||||
foreach($executionProductList as $executionProduct)
|
||||
{
|
||||
if($executionProduct->type != 'normal')
|
||||
{
|
||||
$hasMultiBranchProduct = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$replaceString = $hasMultiBranchProduct ? $this->lang->execution->importPlanStoryEx : '';
|
||||
$importPlanStoryTips = sprintf($this->lang->execution->importPlanStory, $replaceString);
|
||||
|
||||
return print(js::confirm($importPlanStoryTips, inlink('create', "projectID=$projectID&executionID=$executionID©ExecutionID=&planID=$planID&confirm=yes"), inlink('create', "projectID=$projectID&executionID=$executionID")));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4122,10 +4135,10 @@ class execution extends control
|
||||
if(!empty($planStory))
|
||||
{
|
||||
$projectProducts = $this->loadModel('project')->getBranchesByProject($executionID);
|
||||
$projectProducts = zget($projectProducts, $productID, array());
|
||||
|
||||
foreach($planStory as $id => $story)
|
||||
{
|
||||
$projectProducts = zget($projectProducts, $story->product, array());
|
||||
if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($projectProducts) and !isset($projectProducts[$story->branch])))
|
||||
{
|
||||
$count++;
|
||||
|
||||
@@ -276,8 +276,9 @@ $lang->execution->treeViewTask = 'Tree View Task';
|
||||
$lang->execution->treeViewStory = 'Tree View Story';
|
||||
$lang->execution->storyKanban = 'Story Kanban';
|
||||
$lang->execution->storySort = 'Story sortieren';
|
||||
$lang->execution->importPlanStory = '' . $lang->executionCommon . ' wurde erstellt!\nMöchten Sie Storys aus dem Plan importieren?';
|
||||
$lang->execution->importEditPlanStory = $lang->executionCommon . ' is edited!\nDo you want to import stories that have been linked to the plan? The stories in the draft will be automatically filtered out when imported.';
|
||||
$lang->execution->importPlanStory = $lang->executionCommon . ' is created!\nDo you want to import stories that have been linked to the plan? The stories in the draft will be automatically filtered %s out when imported.';
|
||||
$lang->execution->importEditPlanStory = $lang->executionCommon . ' is edited!\nDo you want to import stories that have been linked to the plan? The stories in the draft will be automatically filtered %s out when imported.';
|
||||
$lang->execution->importPlanStoryEx = "and only the activation story for the branch associated with this {$lang->executionCommon}";
|
||||
$lang->execution->needLinkProducts = 'The execution has not been linked with any product, and the related functions cannot be used. Please link the product first and try again.';
|
||||
$lang->execution->iteration = 'Iteration';
|
||||
$lang->execution->iterationInfo = '%s Iterationen';
|
||||
|
||||
@@ -276,8 +276,9 @@ $lang->execution->treeViewTask = 'Tree View Task';
|
||||
$lang->execution->treeViewStory = 'Tree View Story';
|
||||
$lang->execution->storyKanban = 'Story Kanban';
|
||||
$lang->execution->storySort = 'Rank Story';
|
||||
$lang->execution->importPlanStory = $lang->executionCommon . ' is created!\nDo you want to import stories that have been linked to the plan? The stories in the draft will be automatically filtered out when imported.';
|
||||
$lang->execution->importEditPlanStory = $lang->executionCommon . ' is edited!\nDo you want to import stories that have been linked to the plan? The stories in the draft will be automatically filtered out when imported.';
|
||||
$lang->execution->importPlanStory = $lang->executionCommon . ' is created!\nDo you want to import stories that have been linked to the plan? The stories in the draft will be automatically filtered %s out when imported.';
|
||||
$lang->execution->importEditPlanStory = $lang->executionCommon . ' is edited!\nDo you want to import stories that have been linked to the plan? The stories in the draft will be automatically filtered %s out when imported.';
|
||||
$lang->execution->importPlanStoryEx = "and only the activation story for the branch associated with this {$lang->executionCommon}";
|
||||
$lang->execution->needLinkProducts = 'The execution has not been linked with any product, and the related functions cannot be used. Please link the product first and try again.';
|
||||
$lang->execution->iteration = 'Iterations';
|
||||
$lang->execution->iterationInfo = '%s Iterations';
|
||||
|
||||
@@ -276,8 +276,9 @@ $lang->execution->treeViewTask = 'Seulement les Tâches';
|
||||
$lang->execution->treeViewStory = 'Seulement les Stories';
|
||||
$lang->execution->storyKanban = 'Story Kanban';
|
||||
$lang->execution->storySort = 'Rang Story';
|
||||
$lang->execution->importPlanStory = $lang->executionCommon . ' est créé!\nVoulez-vous importer des stories qui ont été ajoutées au Plan ?';
|
||||
$lang->execution->importEditPlanStory = $lang->executionCommon . ' is edited!\nDo you want to import stories that have been linked to the plan? The stories in the draft will be automatically filtered out when imported.';
|
||||
$lang->execution->importPlanStory = $lang->executionCommon . ' is created!\nDo you want to import stories that have been linked to the plan? The stories in the draft will be automatically filtered %s out when imported.';
|
||||
$lang->execution->importEditPlanStory = $lang->executionCommon . ' is edited!\nDo you want to import stories that have been linked to the plan? The stories in the draft will be automatically filtered %s out when imported.';
|
||||
$lang->execution->importPlanStoryEx = "and only the activation story for the branch associated with this {$lang->executionCommon}";
|
||||
$lang->execution->needLinkProducts = 'The execution has not been linked with any product, and the related functions cannot be used. Please link the product first and try again.';
|
||||
$lang->execution->iteration = 'Itérations';
|
||||
$lang->execution->iterationInfo = '%s Itérations';
|
||||
|
||||
@@ -276,8 +276,9 @@ $lang->execution->treeViewTask = '树状图查看任务';
|
||||
$lang->execution->treeViewStory = "树状图查看{$lang->SRCommon}";
|
||||
$lang->execution->storyKanban = "{$lang->SRCommon}看板";
|
||||
$lang->execution->storySort = "{$lang->SRCommon}排序";
|
||||
$lang->execution->importPlanStory = '创建' . $lang->executionCommon . '成功!\n是否导入计划关联的相关' . $lang->SRCommon . '?导入时将自动过滤掉草稿状态的' . $lang->SRCommon . '。';
|
||||
$lang->execution->importEditPlanStory = '编辑' . $lang->executionCommon . '成功!\n是否导入计划关联的相关' . $lang->SRCommon . '?导入时将自动过滤掉草稿状态的' . $lang->SRCommon . '。';
|
||||
$lang->execution->importPlanStory = '创建' . $lang->executionCommon . '成功!\n是否导入计划关联的相关' . $lang->SRCommon . '?导入时将%s自动过滤掉草稿状态的' . $lang->SRCommon . '。';
|
||||
$lang->execution->importEditPlanStory = '编辑' . $lang->executionCommon . '成功!\n是否导入计划关联的相关' . $lang->SRCommon . '?导入时将%s自动过滤掉草稿状态的' . $lang->SRCommon . '。';
|
||||
$lang->execution->importPlanStoryEx = "只关联本{$lang->executionCommon}所关联分支的激活需求和";
|
||||
$lang->execution->needLinkProducts = '该执行还未关联任何产品,相关功能无法使用,请先关联产品后再试。';
|
||||
$lang->execution->iteration = '版本迭代';
|
||||
$lang->execution->iterationInfo = '迭代%s次';
|
||||
|
||||
@@ -2882,19 +2882,21 @@ class executionModel extends model
|
||||
*/
|
||||
public function linkStories($executionID)
|
||||
{
|
||||
$plans = $this->dao->select('plan')->from(TABLE_PROJECTPRODUCT)
|
||||
$plans = $this->dao->select('product, plan')->from(TABLE_PROJECTPRODUCT)
|
||||
->where('project')->eq($executionID)
|
||||
->fetchPairs('plan');
|
||||
->fetchPairs('product', 'plan');
|
||||
|
||||
$planStories = array();
|
||||
$planProducts = array();
|
||||
$this->loadModel('story');
|
||||
if(!empty($plans))
|
||||
{
|
||||
foreach($plans as $planIdList)
|
||||
$executionProducts = $this->loadModel('project')->getBranchesByProject($executionID);
|
||||
foreach($plans as $productID => $planIdList)
|
||||
{
|
||||
if(empty($planIdList)) continue;
|
||||
$planIdList = explode(',', $planIdList);
|
||||
$executionProducts = zget($executionProducts, $productID, array());
|
||||
foreach($planIdList as $planID)
|
||||
{
|
||||
$planStory = $this->story->getPlanStories($planID);
|
||||
@@ -2902,7 +2904,7 @@ class executionModel extends model
|
||||
{
|
||||
foreach($planStory as $id => $story)
|
||||
{
|
||||
if($story->status == 'draft' or $story->status == 'reviewing')
|
||||
if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($executionProducts) and !isset($executionProducts[$story->branch])))
|
||||
{
|
||||
unset($planStory[$id]);
|
||||
continue;
|
||||
@@ -4623,14 +4625,13 @@ class executionModel extends model
|
||||
$branchGroups = $this->getBranchByProduct(array_keys($products), $executionID, 'noclosed');
|
||||
foreach($branchGroups as $branches)
|
||||
{
|
||||
foreach($branches as $branchID => $branchName) $branchIdList[$branchID] = $branchID;
|
||||
foreach($branches as $branchID => $branchName) $branchIdList[] = $branchID;
|
||||
}
|
||||
|
||||
$branchQuery = '';
|
||||
$branchQuery = '(';
|
||||
if(!empty($branchIdList))
|
||||
{
|
||||
$branchQuery .= '(';
|
||||
$branchCount = count($branchIdList);
|
||||
$branchCount = count($branchIdList);
|
||||
foreach($branchIdList as $index => $branchID)
|
||||
{
|
||||
$branchQuery .= "FIND_IN_SET('$branchID', branch)";
|
||||
|
||||
Reference in New Issue
Block a user