* Revert to original business logic of creating stages.

This commit is contained in:
chentao
2023-07-14 17:36:23 +08:00
parent 5fd889a2cb
commit 8962f3bb63
+9 -1
View File
@@ -681,15 +681,23 @@ class programplanModel extends model
/* Get linked product by projectID. */
$linkProducts = array();
$linkBranches = array();
$productList = $this->loadModel('product')->getProducts($projectID);
if($project->stageBy == 'product')
if($project->stageBy)
{
$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);
/* Set each plans. */
foreach($plans as $plan)