diff --git a/module/project/control.php b/module/project/control.php index 260801420f..f6f57af86a 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -2190,7 +2190,7 @@ class project extends control } $oldProducts = $this->product->getProducts($projectID); - if($project->multiple and $project->model != 'waterfall') $oldExecutionProducts = $this->dao->select('project,product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($executions))->fetchGroup('project', 'product'); + if($project->multiple and $project->model != 'waterfall' and $project->model != 'waterfallplus') $oldExecutionProducts = $this->dao->select('project,product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($executions))->fetchGroup('project', 'product'); $this->project->updateProducts($projectID); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); @@ -2216,7 +2216,7 @@ class project extends control } } - if($project->multiple and $project->model != 'waterfall') + if($project->multiple and $project->model != 'waterfall' and $project->model != 'waterfallplus') { $unlinkedProducts = array_diff($oldProductIDs, $newProductIDs); if(!empty($unlinkedProducts)) diff --git a/module/project/model.php b/module/project/model.php index 5ed1730316..94343659c6 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2503,6 +2503,13 @@ class projectModel extends model $this->dao->update(TABLE_PROJECT)->set('division')->eq('1')->where('id')->eq((int)$projectID)->exec(); $this->dao->update(TABLE_EXECUTION)->set('division')->eq('1')->where('project')->eq((int)$projectID)->exec(); } + + $project = $this->getByID($projectID); + if(!empty($project) and ($project->model == 'waterfall' or $project->model == 'waterfallplus') and empty($project->division) and !empty($executions)) + { + $this->loadModel('execution'); + foreach($executions as $executionID) $this->execution->updateProducts($executionID); + } } $oldProductKeys = array_keys($oldProjectProducts);