This commit is contained in:
Yagami
2023-02-24 16:32:12 +08:00
5 changed files with 29 additions and 27 deletions
+2 -1
View File
@@ -506,9 +506,10 @@ class execution extends control
$execution = $this->commonAction($toExecution);
$toExecution = $execution->id;
$project = $this->loadModel('project')->getByID($execution->project);
$branches = $this->execution->getBranches($toExecution);
$tasks = $this->execution->getTasks2Imported($toExecution, $branches);
$executions = $this->execution->getToImport(array_keys($tasks), $execution->type);
$executions = $this->execution->getToImport(array_keys($tasks), $execution->type, $project->model);
unset($executions[$toExecution]);
unset($tasks[$toExecution]);
+6 -3
View File
@@ -2799,17 +2799,19 @@ class executionModel extends model
* Get executions to import
*
* @param array $executionIds
* @param string $type sprint|stage
* @param string $type sprint|stage|kanban
* @param string $model
* @access public
* @return array
*/
public function getToImport($executionIds, $type)
public function getToImport($executionIds, $type, $model = '')
{
return $this->dao->select('t1.id,concat_ws(" / ", t2.name, t1.name) as name')->from(TABLE_EXECUTION)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t2.id=t1.project')
->where('t1.id')->in($executionIds)
->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->sprints)->fi()
->andWhere('t1.type')->eq($type)
->beginIF(empty($model) or strpos(',waterfallplus,agileplus,', ",$model,") === false)->andWhere('t1.type')->eq($type)->fi()
->beginIF(!empty($model) and $model == 'agileplus')->andWhere('t1.type')->in(array('sprint', 'kanban'))->fi()
->andWhere('t1.deleted')->eq(0)
->orderBy('t1.id desc')
->fetchPairs('id', 'name');
@@ -2894,6 +2896,7 @@ class executionModel extends model
->where('project')->in($brotherProjects)
->andWhere('multiple')->eq('1')
->andWhere('status')->ne('closed')
->andWhere('deleted')->eq(0)
->fetchPairs('id');
$branches = str_replace(',', "','", $branches);
@@ -37,16 +37,12 @@ $parentIDList = array(1, 2, 3, 4);
$programplan = new programplanTest();
r($programplan->getParentChildrenTypesTest($parentIDList[0])) && p('stage') && e('stage'); // 查找父ID为 1 未删除的阶段类型 stage
r($programplan->getParentChildrenTypesTest($parentIDList[0])) && p('sprint') && e(''); // 查找父ID为 1 未删除的阶段类型 sprint
r($programplan->getParentChildrenTypesTest($parentIDList[0])) && p('kanban') && e('kanban'); // 查找父ID为 1 未删除的阶段类型 kanban
r(count($programplan->getParentChildrenTypesTest($parentIDList[0]))) && p() && e('2'); // 查找父ID为 1 未删除的阶段类型数量
r($programplan->getParentChildrenTypesTest($parentIDList[1])) && p('stage') && e(''); // 查找父ID为 2 未删除的阶段类型 stage
r($programplan->getParentChildrenTypesTest($parentIDList[1])) && p('sprint') && e('sprint'); // 查找父ID为 2 未删除的阶段类型 sprint
r($programplan->getParentChildrenTypesTest($parentIDList[1])) && p('kanban') && e(''); // 查找父ID为 2 未删除的阶段类型 kanban
r(count($programplan->getParentChildrenTypesTest($parentIDList[1]))) && p() && e('1'); // 查找父ID为 2 未删除的阶段类型数量
r($programplan->getParentChildrenTypesTest($parentIDList[2])) && p('stage') && e('stage'); // 查找父ID为 3 未删除的阶段类型 stage
r($programplan->getParentChildrenTypesTest($parentIDList[2])) && p('sprint') && e('sprint'); // 查找父ID为 3 未删除的阶段类型 sprint
r($programplan->getParentChildrenTypesTest($parentIDList[2])) && p('kanban') && e(''); // 查找父ID为 3 未删除的阶段类型 kanban
r(count($programplan->getParentChildrenTypesTest($parentIDList[2]))) && p() && e('2'); // 查找父ID为 3 未删除的阶段类型数量
r($programplan->getParentChildrenTypesTest($parentIDList[3])) && p('stage') && e('0'); // 查找父ID为 1 未删除的阶段类型 stage
r($programplan->getParentChildrenTypesTest($parentIDList[3])) && p('sprint') && e('0'); // 查找父ID为 1 未删除的阶段类型 sprint
+18 -18
View File
@@ -18,7 +18,7 @@ pid=1
测试批量创建瀑布项目的阶段 4 >> 7
测试批量创建瀑布项目的百分比为空的阶段 >> 『工作量占比』不能为空。
测试批量创建瀑布项目的类型为空的阶段 >> 『阶段类型』不能为空。
测试批量创建瀑布项目的百分比非法的阶段 >> 工作量占比应当是数字,可以是小数。
测试批量创建瀑布项目的百分比非法的阶段 >> 『工作量占比』应当是数字,可以是小数。
测试批量创建瀑布项目的百分比超出100的阶段 >> 工作量占比累计不应当超过100%
测试批量创建融合瀑布项目的阶段 1 >> 2
测试批量创建融合瀑布项目的阶段 2 >> 4
@@ -26,7 +26,7 @@ pid=1
测试批量创建融合瀑布项目的阶段 4 >> 7
测试批量创建融合瀑布项目的百分比为空的阶段 >> 『工作量占比』不能为空。
测试批量创建融合瀑布项目的类型为空的阶段 >> 『阶段类型』不能为空。
测试批量创建融合瀑布项目的百分比非法的阶段 >> 工作量占比应当是数字,可以是小数。
测试批量创建融合瀑布项目的百分比非法的阶段 >> 『工作量占比』应当是数字,可以是小数。
测试批量创建融合瀑布项目的百分比超出100的阶段 >> 工作量占比累计不应当超过100%
*/
@@ -64,19 +64,19 @@ $param8 = array('name' => $name1, 'percent' => $percentOver, 'type' => $ty
$stage = new stageTest();
r($stage->batchCreateTest($param1)) && p() && e('2'); // 测试批量创建瀑布项目的阶段 1
r($stage->batchCreateTest($param2)) && p() && e('4'); // 测试批量创建瀑布项目的阶段 2
r($stage->batchCreateTest($param3)) && p() && e('6'); // 测试批量创建瀑布项目的阶段 3
r($stage->batchCreateTest($param4)) && p() && e('7'); // 测试批量创建瀑布项目的阶段 4
r($stage->batchCreateTest($param5)) && p('percent:0') && e('『工作量占比』不能为空。'); // 测试批量创建瀑布项目的百分比为空的阶段
r($stage->batchCreateTest($param6)) && p('type:0') && e('『阶段类型』不能为空。'); // 测试批量创建瀑布项目的类型为空的阶段
r($stage->batchCreateTest($param7)) && p('percent:0') && e('工作量占比应当是数字,可以是小数。'); // 测试批量创建瀑布项目的百分比非法的阶段
r($stage->batchCreateTest($param8)) && p('message:0') && e('工作量占比累计不应当超过100%'); // 测试批量创建瀑布项目的百分比超出100的阶段
r($stage->batchCreateTest($param1, 'waterfallplus')) && p() && e('2'); // 测试批量创建融合瀑布项目的阶段 1
r($stage->batchCreateTest($param2, 'waterfallplus')) && p() && e('4'); // 测试批量创建融合瀑布项目的阶段 2
r($stage->batchCreateTest($param3, 'waterfallplus')) && p() && e('6'); // 测试批量创建融合瀑布项目的阶段 3
r($stage->batchCreateTest($param4, 'waterfallplus')) && p() && e('7'); // 测试批量创建融合瀑布项目的阶段 4
r($stage->batchCreateTest($param5, 'waterfallplus')) && p('percent:0') && e('『工作量占比』不能为空。'); // 测试批量创建融合瀑布项目的百分比为空的阶段
r($stage->batchCreateTest($param6, 'waterfallplus')) && p('type:0') && e('『阶段类型』不能为空。'); // 测试批量创建融合瀑布项目的类型为空的阶段
r($stage->batchCreateTest($param7, 'waterfallplus')) && p('percent:0') && e('工作量占比应当是数字,可以是小数。'); // 测试批量创建融合瀑布项目的百分比非法的阶段
r($stage->batchCreateTest($param8, 'waterfallplus')) && p('message:0') && e('工作量占比累计不应当超过100%'); // 测试批量创建融合瀑布项目的百分比超出100的阶段
r($stage->batchCreateTest($param1)) && p() && e('2'); // 测试批量创建瀑布项目的阶段 1
r($stage->batchCreateTest($param2)) && p() && e('4'); // 测试批量创建瀑布项目的阶段 2
r($stage->batchCreateTest($param3)) && p() && e('6'); // 测试批量创建瀑布项目的阶段 3
r($stage->batchCreateTest($param4)) && p() && e('7'); // 测试批量创建瀑布项目的阶段 4
r($stage->batchCreateTest($param5)) && p('percent:0') && e('『工作量占比』不能为空。'); // 测试批量创建瀑布项目的百分比为空的阶段
r($stage->batchCreateTest($param6)) && p('type:0') && e('『阶段类型』不能为空。'); // 测试批量创建瀑布项目的类型为空的阶段
r($stage->batchCreateTest($param7)) && p('percent:0') && e('『工作量占比』应当是数字,可以是小数。'); // 测试批量创建瀑布项目的百分比非法的阶段
r($stage->batchCreateTest($param8)) && p('message:0') && e('工作量占比累计不应当超过100%'); // 测试批量创建瀑布项目的百分比超出100的阶段
r($stage->batchCreateTest($param1, 'waterfallplus')) && p() && e('2'); // 测试批量创建融合瀑布项目的阶段 1
r($stage->batchCreateTest($param2, 'waterfallplus')) && p() && e('4'); // 测试批量创建融合瀑布项目的阶段 2
r($stage->batchCreateTest($param3, 'waterfallplus')) && p() && e('6'); // 测试批量创建融合瀑布项目的阶段 3
r($stage->batchCreateTest($param4, 'waterfallplus')) && p() && e('7'); // 测试批量创建融合瀑布项目的阶段 4
r($stage->batchCreateTest($param5, 'waterfallplus')) && p('percent:0') && e('『工作量占比』不能为空。'); // 测试批量创建融合瀑布项目的百分比为空的阶段
r($stage->batchCreateTest($param6, 'waterfallplus')) && p('type:0') && e('『阶段类型』不能为空。'); // 测试批量创建融合瀑布项目的类型为空的阶段
r($stage->batchCreateTest($param7, 'waterfallplus')) && p('percent:0') && e('『工作量占比』应当是数字,可以是小数。'); // 测试批量创建融合瀑布项目的百分比非法的阶段
r($stage->batchCreateTest($param8, 'waterfallplus')) && p('message:0') && e('工作量占比累计不应当超过100%'); // 测试批量创建融合瀑布项目的百分比超出100的阶段
+3 -1
View File
@@ -19,6 +19,8 @@ pid=1
*/
zdTable('stage')->gen(10);
$stage = new stageTest();
r($stage->getStagesTest()) && p('1:name,percent,type') && e('需求,10,request'); // 测试获取阶段 1
@@ -26,4 +28,4 @@ r($stage->getStagesTest()) && p('2:name,percent,type') && e('设计,10,design');
r($stage->getStagesTest()) && p('3:name,percent,type') && e('开发,50,dev'); // 测试获取阶段 3
r($stage->getStagesTest()) && p('4:name,percent,type') && e('测试,15,qa'); // 测试获取阶段 4
r($stage->getStagesTest()) && p('5:name,percent,type') && e('发布,10,release'); // 测试获取阶段 5
r($stage->getStagesTest()) && p('6:name,percent,type') && e('总结评审,5,review'); // 测试获取阶段 6
r($stage->getStagesTest()) && p('6:name,percent,type') && e('总结评审,5,review'); // 测试获取阶段 6