diff --git a/lib/filter/filter.class.php b/lib/filter/filter.class.php index cf3004b723..03c47426ac 100644 --- a/lib/filter/filter.class.php +++ b/lib/filter/filter.class.php @@ -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; + } } diff --git a/module/bug/view/edit.html.php b/module/bug/view/edit.html.php index 7a91cd7e64..0f20be12b5 100644 --- a/module/bug/view/edit.html.php +++ b/module/bug/view/edit.html.php @@ -299,7 +299,7 @@ js::set('oldResolvedBuild' , $bug->resolvedBuild); - config->bizVersion)) $this->loadModel('flow')->printFields($app->moduleName, $app->methodName, 'div', 'position=right&divCell=false');?> + config->bizVersion)) $this->loadModel('flow')->printFields($app->moduleName, $app->methodName, $bug, 'div', 'position=right&divCell=false');?>