diff --git a/module/common/model.php b/module/common/model.php index b14520ef4e..e94433adf3 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -56,7 +56,7 @@ class commonModel extends model $project = $this->syncProjectStatus($execution); $this->syncProgramStatus($project); } - if($rawModule == 'execution') + if($rawModule == 'execution' or $rawModule == 'marketresearch') { $executionID = $objectID; $execution = $this->dao->select('id, project, grade, parent, status, deleted')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch(); @@ -113,8 +113,9 @@ class commonModel extends model */ public function syncProjectStatus($execution) { - $projectID = $execution->project; - $project = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch(); + $projectID = $execution->project; + $project = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch(); + $objectType = 'project'; $today = helper::today(); if($project->status == 'wait') @@ -126,7 +127,8 @@ class commonModel extends model ->exec(); $actionType = $project->multiple ? 'syncproject' : 'syncmultipleproject'; - $this->loadModel('action')->create('project', $projectID, $actionType); + if($project->model == 'research') $objectType = 'marketresearch'; + $this->loadModel('action')->create($objectType, $projectID, $actionType); } return $project; } diff --git a/module/execution/control.php b/module/execution/control.php index 1e2376a043..ab5846189f 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2309,7 +2309,7 @@ class execution extends control } $project = $this->loadModel('project')->getById($execution->project); - if($project->model == 'waterfall' or $project->model == 'waterfallplus') $this->loadModel('programplan')->computeProgress($executionID, 'start'); + if(in_array($project->model, array('waterfall', 'waterfallplus', 'research'))) $this->loadModel('programplan')->computeProgress($executionID, 'start'); $this->loadModel('common')->syncPPEStatus($executionID); $this->executeHooks($executionID); diff --git a/module/programplan/model.php b/module/programplan/model.php index 1033588cee..c713749fab 100755 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -1629,7 +1629,7 @@ class programplanModel extends model { $stage = $this->loadModel('execution')->getByID($stageID); $project = $this->loadModel('project')->getByID($stage->project); - if(empty($stage) or empty($stage->path) or (!in_array($project->model, array('waterfall','waterfallplus','ipd')))) return false; + if(empty($stage) or empty($stage->path) or (!in_array($project->model, array('waterfall','waterfallplus','ipd', 'research')))) return false; $this->loadModel('execution'); $this->loadModel('action');