From e70fec4e041eb802dc557acd079f84c792cd21f5 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 31 Oct 2019 14:36:46 +0800 Subject: [PATCH] * code for task #9246. --- framework/control.class.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/framework/control.class.php b/framework/control.class.php index 01fa89a34f..7e05dcf79a 100644 --- a/framework/control.class.php +++ b/framework/control.class.php @@ -36,15 +36,11 @@ class control extends baseControl if(!isset($this->config->bizVersion)) return false; /* Code for task #9224. Set requiredFields for workflow. */ $fields = $this->loadModel('workflowaction')->getFields($this->moduleName, $this->methodName); - $exportFields = $this->dao->select('*')->from(TABLE_WORKFLOWFIELD)->where('module')->eq($this->moduleName)->andWhere('canExport')->eq('1')->andWhere('buildin')->eq('0')->fetchAll('field'); $layouts = $this->loadModel('workflowlayout')->getFields($this->moduleName, $this->methodName); $notEmptyRule = $this->loadModel('workflowrule')->getByTypeAndRule('system', 'notempty'); + foreach($fields as $field) { - if(isset($exportFields[$field->field]) and isset($this->config->{$this->moduleName}) and isset($this->config->{$this->moduleName}->exportFields)) - { - $this->config->{$this->moduleName}->exportFields .= ",{$field->field}"; - } if($notEmptyRule && strpos(",$field->rules,", ",$notEmptyRule->id,") !== false) { @@ -54,6 +50,12 @@ class control extends baseControl $this->config->{$this->moduleName}->{$this->methodName}->requiredFields .= ",{$field->field}"; } } + + if(isset($this->config->{$this->moduleName}) and isset($this->config->{$this->moduleName}->exportFields)) + { + $exportFields = $this->dao->select('*')->from(TABLE_WORKFLOWFIELD)->where('module')->eq($this->moduleName)->andWhere('canExport')->eq('1')->andWhere('buildin')->eq('0')->fetchAll('field'); + foreach($exportFields as $field) $this->config->{$this->moduleName}->exportFields .= ",{$field->field}"; + } } /**