* Code for bug#31949.

This commit is contained in:
xieqiyu
2023-02-08 08:48:09 +08:00
parent bfe1a0ef5e
commit 975b755c54
+17 -34
View File
@@ -740,8 +740,6 @@ class programplanModel extends model
$datas[] = $plan;
}
$project = $this->loadModel('project')->getByID($projectID);
$productList = $this->loadModel('product')->getProducts($projectID);
$totalPercent = 0;
$totalDevType = 0;
@@ -873,22 +871,6 @@ class programplanModel extends model
if($data->acl != 'open') $this->user->updateUserView($stageID, 'sprint');
$linkProducts = array();
$linkBranches = array();
if($project->division)
{
$linkProducts = array(0 => $productID);
$linkBranches = array(0 => $productList[$productID]->branches);
}
else
{
$linkProducts = array_keys($productList);
foreach($linkProducts as $index => $productID) $linkBranches[$index] = $productList[$productID]->branches;
}
$this->post->set('products', $linkProducts);
$this->post->set('branch', $linkBranches);
$this->execution->updateProducts($stageID);
/* Record version change information. */
if($planChanged)
{
@@ -965,22 +947,6 @@ class programplanModel extends model
$this->setTreePath($stageID);
if($data->acl != 'open') $this->user->updateUserView($stageID, 'sprint');
$linkProducts = array();
$linkBranches = array();
if($project->division)
{
$linkProducts = array(0 => $productID);
$linkBranches = array(0 => $productList[$productID]->branches);
}
else
{
$linkProducts = array_keys($productList);
foreach($linkProducts as $index => $productID) $linkBranches[$index] = $productList[$productID]->branches;
}
$this->post->set('products', $linkProducts);
$this->post->set('branch', $linkBranches);
$this->execution->updateProducts($stageID);
/* Record version change information. */
$spec = new stdclass();
$spec->project = $stageID;
@@ -1002,6 +968,23 @@ class programplanModel extends model
}
}
$linkProducts = array();
$linkBranches = array();
$productList = $this->loadModel('product')->getProducts($projectID);
if($project->division)
{
$linkProducts = array(0 => $productID);
$linkBranches = array(0 => $productList[$productID]->branches);
}
else
{
$linkProducts = array_keys($productList);
foreach($linkProducts as $index => $productID) $linkBranches[$index] = $productList[$productID]->branches;
}
$this->post->set('products', $linkProducts);
$this->post->set('branch', $linkBranches);
$this->execution->updateProducts($stageID);
/* If child plans has milestone, update parent plan set milestone eq 0 . */
if($parentID and $milestone) $this->dao->update(TABLE_PROJECT)->set('milestone')->eq(0)->where('id')->eq($parentID)->exec();