Merge branch release/22.0.beta of zentao/zentaopms (#13331)

This commit is contained in:
刘刚
2026-01-16 09:03:20 +08:00
committed by Gitfox
3 changed files with 27 additions and 8 deletions
+1 -1
View File
@@ -1 +1 @@
21.7.8
22.0.beta
+21 -3
View File
@@ -887,12 +887,29 @@ class storyModel extends model
if($story->product != $oldStory->product || $story->branch != $oldStory->branch)
{
$this->loadModel('productplan');
$oldPlans = explode(',', $oldStory->plan);
foreach($oldPlans as $oldPlanID)
{
if(!$oldPlanID) continue;
$this->productplan->unlinkStory($storyID, (int)$oldPlanID);
}
$this->dao->update(TABLE_PROJECTSTORY)->set('product')->eq($story->product)->where('story')->eq($storyID)->exec();
$childStories = $this->getAllChildId($storyID, false);
$story->id = $storyID;
foreach($childStories as $childStoryID)
$childStories = $this->getAllChildId($storyID, false);
$childStoryAndPlan = $this->dao->select('id,plan')->from(TABLE_STORY)->where('id')->in($childStories)->fetchPairs();
$story->id = $storyID;
foreach($childStoryAndPlan as $childStoryID => $planIDList)
{
$this->updateStoryProduct($childStoryID, $story, $story->product);
/* 切换产品后,移除子需求与原产品下计划的关联。*/
$plans = explode(',', $planIDList);
foreach($plans as $planID)
{
if(!$planID) continue;
$this->productplan->unlinkStory($childStoryID, (int)$planID);
}
}
}
if($story->grade != $oldStory->grade) $this->syncGrade($oldStory, $story);
@@ -1000,6 +1017,7 @@ class storyModel extends model
->set('product')->eq($parent->product)
->set('branch')->eq($parent->branch)
->set('module')->eq(0)
->set('plan')->eq('')
->set('root')->eq($parent->id)
->set('path')->eq($childPath)
->where('id')->eq($storyID)
+5 -4
View File
@@ -1,5 +1,6 @@
#!/usr/bin/env php
<?php
/**
title=测试 storyModel->update();
@@ -10,12 +11,12 @@ cid=18593
- 属性title @编辑后的名称1
- 属性pri @1
- 属性sourceNote @来源备注1
- 属性estimate @1
- 属性estimate @1.00
- 编辑需求,判断返回的信息
- 属性title @编辑后的名称2
- 属性pri @2
- 属性sourceNote @来源备注2
- 属性estimate @2
- 属性estimate @2.00
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
@@ -36,5 +37,5 @@ $story = new storyModelTest();
$result1 = $story->updateTest(1, $params1);
$result2 = $story->updateTest(2, $params2);
r($result1) && p('title,pri,sourceNote,estimate') && e('编辑后的名称1,1,来源备注1,1'); // 编辑需求,判断返回的信息
r($result2) && p('title,pri,sourceNote,estimate') && e('编辑后的名称2,2,来源备注2,2'); // 编辑需求,判断返回的信息
r($result1) && p('title,pri,sourceNote,estimate') && e('编辑后的名称1,1,来源备注1,1.00'); // 编辑需求,判断返回的信息
r($result2) && p('title,pri,sourceNote,estimate') && e('编辑后的名称2,2,来源备注2,2.00'); // 编辑需求,判断返回的信息