* fix bug for install.

This commit is contained in:
wangyidong
2019-11-08 14:26:28 +08:00
parent 793319d21b
commit bd4b58d951
+19 -16
View File
@@ -35,26 +35,29 @@ 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);
$layouts = $this->loadModel('workflowlayout')->getFields($this->moduleName, $this->methodName);
$notEmptyRule = $this->loadModel('workflowrule')->getByTypeAndRule('system', 'notempty');
foreach($fields as $field)
if($this->dbh)
{
$fields = $this->loadModel('workflowaction')->getFields($this->moduleName, $this->methodName);
$layouts = $this->loadModel('workflowlayout')->getFields($this->moduleName, $this->methodName);
$notEmptyRule = $this->loadModel('workflowrule')->getByTypeAndRule('system', 'notempty');
if($notEmptyRule && strpos(",$field->rules,", ",$notEmptyRule->id,") !== false)
foreach($fields as $field)
{
if(!isset($this->config->{$this->moduleName})) $this->config->{$this->moduleName} = new stdclass();
if(!isset($this->config->{$this->moduleName}->{$this->methodName})) $this->config->{$this->moduleName}->{$this->methodName} = new stdclass();
if(!isset($this->config->{$this->moduleName}->{$this->methodName}->requiredFields)) $this->config->{$this->moduleName}->{$this->methodName}->requiredFields = '';
$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}";
if($notEmptyRule && strpos(",$field->rules,", ",$notEmptyRule->id,") !== false)
{
if(!isset($this->config->{$this->moduleName})) $this->config->{$this->moduleName} = new stdclass();
if(!isset($this->config->{$this->moduleName}->{$this->methodName})) $this->config->{$this->moduleName}->{$this->methodName} = new stdclass();
if(!isset($this->config->{$this->moduleName}->{$this->methodName}->requiredFields)) $this->config->{$this->moduleName}->{$this->methodName}->requiredFields = '';
$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}";
}
}
}