* Fix bug #32255.
This commit is contained in:
@@ -833,6 +833,22 @@ 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);
|
||||
|
||||
foreach($datas as $data)
|
||||
{
|
||||
/* Set planDuration and realDuration. */
|
||||
@@ -846,6 +862,7 @@ class programplanModel extends model
|
||||
$data->days = helper::diffDate($data->end, $data->begin) + 1;
|
||||
$data->order = current($orders);
|
||||
|
||||
|
||||
if($data->id)
|
||||
{
|
||||
$stageID = $data->id;
|
||||
@@ -985,22 +1002,6 @@ class programplanModel extends model
|
||||
$this->computeProgress($stageID, 'create');
|
||||
}
|
||||
}
|
||||
|
||||
$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 . */
|
||||
|
||||
Reference in New Issue
Block a user