* [misc] add default product when create story action.

This commit is contained in:
sunguangming
2025-10-23 05:28:22 +00:00
parent f19f43006c
commit 5e2d66c769
2 changed files with 9 additions and 9 deletions
+4 -4
View File
@@ -88,7 +88,7 @@ class actionTao extends actionModel
switch($objectType)
{
case 'story':
list($product, $project, $execution) = $this->getStoryActionRelated($actionType, $objectID, (int)$extra);
list($product, $project, $execution) = $this->getStoryActionRelated($objectType, $actionType, $objectID, (int)$extra);
break;
case 'productplan':
case 'branch':
@@ -139,16 +139,16 @@ class actionTao extends actionModel
* 获取用户故事相关的产品、项目、阶段。
* Get story related product, project, stage.
*
* @param string $objectType
* @param string $actionType
* @param int $objectID
* @param int $extra
* @access public
* @return array
*/
public function getStoryActionRelated(string $actionType, int $objectID, int $extra): array
public function getStoryActionRelated(string $objectType, string $actionType, int $objectID, int $extra): array
{
$product = array(0);
$project = $execution = 0;
list($product, $project, $execution) = $this->getGenerateRelated($objectType, $objectID);
switch($actionType)
{
case 'linked2build':
@@ -35,13 +35,13 @@ zenData('project')->loadYaml('execution')->gen(1);
zenData('project')->gen(11, false, false);
zenData('projectstory')->gen(5);
$actionTest = new actionTest();
global $tester;
$actionTypeList = array('linked2build', 'unlinkedfrombuild', 'estimated', 'created');
$objectIDList = array(1, 2);
$extraList = array(1, 101);
r($actionTest->getStoryActionRelated($actionTypeList[0], $objectIDList[0], $extraList[0])) && p('0:0;1;2') && e('0,11,101'); //获取操作类型为linked2build,extra为1的用户故事相关产品,项目和执行信息。
r($actionTest->getStoryActionRelated($actionTypeList[1], $objectIDList[0], $extraList[0])) && p('0:0;1;2') && e('0,11,101'); //获取操作类型为unlinkedfrombuild,extra为1的用户故事相关产品,项目和执行信息。
r($actionTest->getStoryActionRelated($actionTypeList[2], $objectIDList[0], $extraList[1])) && p('0:0;1;2') && e('0,11,101'); //获取操作类型为estimated,extra为1的用户故事相关产品,项目和执行信息。
r($actionTest->getStoryActionRelated($actionTypeList[3], $objectIDList[1], $extraList[1])) && p('0:0;1;2') && e('0,11,0'); //获取操作类型为created,extra为1的用户故事相关产品,项目和执行信息。
r($tester->loadModel('action')->getStoryActionRelated('story', $actionTypeList[0], $objectIDList[0], $extraList[0])) && p('0:0;1;2') && e('1,11,101'); //获取操作类型为linked2build,extra为1的用户故事相关产品,项目和执行信息。
r($tester->loadModel('action')->getStoryActionRelated('story', $actionTypeList[1], $objectIDList[0], $extraList[0])) && p('0:0;1;2') && e('1,11,101'); //获取操作类型为unlinkedfrombuild,extra为1的用户故事相关产品,项目和执行信息。
r($tester->loadModel('action')->getStoryActionRelated('story', $actionTypeList[2], $objectIDList[0], $extraList[1])) && p('0:0;1;2') && e('1,11,101'); //获取操作类型为estimated,extra为1的用户故事相关产品,项目和执行信息。
r($tester->loadModel('action')->getStoryActionRelated('story', $actionTypeList[3], $objectIDList[1], $extraList[1])) && p('0:0;1;2') && e('1,11,0'); //获取操作类型为created,extra为1的用户故事相关产品,项目和执行信息。