* Fix filter class.

This commit is contained in:
Yagami
2019-07-23 09:24:55 +08:00
parent 0d413b3f65
commit 3ce866ab08
2 changed files with 33 additions and 1 deletions
+32
View File
@@ -30,4 +30,36 @@ class validater extends baseValidater
*/
class fixer extends baseFixer
{
public function get($fields = '')
{
$fields = str_replace(' ', '', trim($fields));
global $config;
$flowFields = array();
if(isset($config->bizVersion))
{
global $app, $dbh;
$moduleName = $app->getModuleName();
$stmt = $dbh->query("SELECT * FROM " . TABLE_WORKFLOWFIELD . " WHERE `module` = '{$moduleName}' and `buildin` = '0'");
while($flowField = $stmt->fetch()) $flowFields[$flowField->field] = $flowField;
}
foreach($this->data as $field => $value)
{
if(isset($flowFields[$field]) and is_array($value)) $this->data->$field = implode(',', $value);
$this->specialChars($field);
}
if(empty($fields)) return $this->data;
if(strpos($fields, ',') === false) return $this->data->$fields;
$fields = array_flip(explode(',', $fields));
foreach($this->data as $field => $value)
{
if(!isset($fields[$field])) unset($this->data->$field);
if(!in_array($field, $this->stripedFields)) $this->specialChars($field);
}
return $this->data;
}
}
+1 -1
View File
@@ -299,7 +299,7 @@ js::set('oldResolvedBuild' , $bug->resolvedBuild);
</tbody>
</table>
</div>
<?php if(isset($this->config->bizVersion)) $this->loadModel('flow')->printFields($app->moduleName, $app->methodName, 'div', 'position=right&divCell=false');?>
<?php if(isset($this->config->bizVersion)) $this->loadModel('flow')->printFields($app->moduleName, $app->methodName, $bug, 'div', 'position=right&divCell=false');?>
</div>
</div>
</div>