diff --git a/module/execution/model.php b/module/execution/model.php index 6acd189014..6981b76abe 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -5767,6 +5767,12 @@ class executionModel extends model $post = $_POST; $_POST = array(); + $extendFields = $this->getExtendFields(); + foreach(array_keys($extendFields) as $field) + { + if(isset($post[$field])) $_POST[$field] = $post[$field]; + } + $_POST['project'] = $projectID; $_POST['name'] = $project->name; $_POST['begin'] = $project->begin; @@ -5820,6 +5826,12 @@ class executionModel extends model $post = $_POST; $_POST = array(); + $extendFields = $this->getExtendFields(); + foreach(array_keys($extendFields) as $field) + { + if(isset($post[$field])) $_POST[$field] = $post[$field]; + } + $_POST['project'] = $projectID; $_POST['name'] = $project->name; $_POST['begin'] = $project->begin; @@ -6001,4 +6013,23 @@ class executionModel extends model } return $sortedExecutions; } + + /** + * Get Extend Fields in workflow. + * + * @param string $module + * @access public + * @return array + */ + public function getExtendFields($module = 'project') + { + $extendFields = $this->dao->select('field') + ->from(TABLE_WORKFLOWFIELD) + ->where('module')->eq('project') + ->andWhere('buildin')->eq(0) + ->andWhere('role')->eq('custom') + ->fetchPairs('field'); + + return $extendFields; + } } diff --git a/test/class/execution.class.php b/test/class/execution.class.php index 5c79afdd64..a773c81725 100644 --- a/test/class/execution.class.php +++ b/test/class/execution.class.php @@ -2979,4 +2979,17 @@ class executionTest } return $executionIDList; } + + /** + * Get user custom workflow field. + * + * @param string $moduleName + * @access public + * @return array + */ + public function getExtendFieldsTest($moduleName = 'project') + { + $extendFields = $this->executionModel->getExtendFields($moduleName); + return $extendFields; + } }