* add new version and upgrade.

This commit is contained in:
wangyidong
2020-02-12 09:48:05 +08:00
parent c13b25c318
commit d24304332f
22 changed files with 1067 additions and 14 deletions
+4 -3
View File
@@ -59,6 +59,7 @@ class control extends baseControl
}
}
/* Append editor field to this module config from workflow. */
$textareaFields = $this->dao->select('*')->from(TABLE_WORKFLOWFIELD)->where('module')->eq($this->moduleName)->andWhere('control')->eq('textarea')->andWhere('buildin')->eq('0')->fetchAll('field');
if($textareaFields)
{
@@ -306,14 +307,14 @@ class control extends baseControl
$notEmptyRule = $this->loadModel('workflowrule')->getByTypeAndRule('system', 'notempty');
$requiredFields = '';
$mustPostValue = '';
$mustPostFields = '';
foreach($fields as $field)
{
if($field->buildin or !$field->show or !isset($layouts[$field->field])) continue;
if($notEmptyRule && strpos(",$field->rules,", ",$notEmptyRule->id,") !== false)
{
$requiredFields .= ",{$field->field}";
if($field->control == 'radio' or $field->control == 'checkbox') $mustPostValue .= ",{$field->field}";
if($field->control == 'radio' or $field->control == 'checkbox') $mustPostFields .= ",{$field->field}";
}
}
@@ -329,7 +330,7 @@ class control extends baseControl
{
$message[$requiredField][] = sprintf($this->lang->error->notempty, $fields[$requiredField]->name);
}
elseif(strpos(",{$mustPostValue},", ",{$requiredField},") !== false and !isset($_POST[$requiredField]))
elseif(strpos(",{$mustPostFields},", ",{$requiredField},") !== false and !isset($_POST[$requiredField]))
{
$message[$requiredField][] = sprintf($this->lang->error->notempty, $fields[$requiredField]->name);
}