* Fix filter class.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user