From e5c46baa1c1d8e95bc07628bf3bdc3bac96ade4c Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 31 Oct 2019 14:32:03 +0800 Subject: [PATCH] * finish task #9246. --- framework/control.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/framework/control.class.php b/framework/control.class.php index a7e731ebe8..01fa89a34f 100644 --- a/framework/control.class.php +++ b/framework/control.class.php @@ -36,11 +36,16 @@ 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($field->buildin or !$field->show or !isset($layouts[$field->field])) continue; + 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) { if(!isset($this->config->{$this->moduleName})) $this->config->{$this->moduleName} = new stdclass();