diff --git a/module/custom/config.php b/module/custom/config.php index 9045fe6ec3..f5e4b2ef6a 100644 --- a/module/custom/config.php +++ b/module/custom/config.php @@ -28,30 +28,31 @@ $config->custom->requiredModules[75] = 'doc'; $config->custom->requiredModules[85] = 'user'; -$config->custom->fieldList['product']['create'] = 'name,code,line,PO,QD,RD,type,desc'; -$config->custom->fieldList['product']['edit'] = 'name,code,line,PO,QD,RD,type,desc,status'; -$config->custom->fieldList['story']['create'] = 'module,plan,source,title,pri,estimate,keywords'; -$config->custom->fieldList['story']['change'] = 'title,comment'; -$config->custom->fieldList['story']['close'] = 'closedReason,comment'; -$config->custom->fieldList['story']['review'] = 'reviewedDate,assignedTo,reviewedBy,comment'; -$config->custom->fieldList['productplan'] = 'title,begin,end,desc'; -$config->custom->fieldList['release'] = 'name,build,date,desc'; -$config->custom->fieldList['project']['create'] = 'name,code,begin,end,days,type,desc'; -$config->custom->fieldList['project']['edit'] = 'name,code,begin,end,days,type,desc,PO,PM,QD,RD'; -$config->custom->fieldList['task']['create'] = 'type,story,name,pri,estimate,desc,estStarted,deadline'; -$config->custom->fieldList['task']['edit'] = 'type,name,pri,estimate,estStarted,deadline'; -$config->custom->fieldList['task']['finish'] = 'consumed,finishedDate,comment'; -$config->custom->fieldList['task']['activate'] = 'assignedTo,left,comment'; -$config->custom->fieldList['build'] = 'product,name,builder,date,scmPath,filePath,desc'; -$config->custom->fieldList['bug']['create'] = 'module,project,openedBuild,deadline,type,os,browser,title,severity,pri,steps,keywords'; -$config->custom->fieldList['bug']['edit'] = 'productplan,openedBuild,assignedTo,deadline,type,os,browser,title,severity,pri,steps,keywords'; -$config->custom->fieldList['bug']['resolve'] = 'resolution,resolvedBuild,resolvedDate,assignedTo,comment'; -$config->custom->fieldList['testcase']['create'] = 'type,stage,story,title,pri,precondition,keywords'; -$config->custom->fieldList['testcase']['edit'] = 'type,stage,story,title,pri,precondition,keywords,status'; -$config->custom->fieldList['testsuite'] = 'name,desc'; -$config->custom->fieldList['testcase']['createcase'] = 'lib,type,stage,title,pri,precondition,keywords'; -$config->custom->fieldList['testreport'] = 'begin,end,owner,members,title,report'; -$config->custom->fieldList['testtask'] = 'project,build,,owner,pri,begin,end,status,name,desc'; -$config->custom->fieldList['doc'] = 'title,keywords,content'; -$config->custom->fieldList['user']['create'] = 'dept,account,realname,password,password1,password2,role,email,commiter'; -$config->custom->fieldList['user']['edit'] = 'dept,account,realname,role,email,commiter,skype,qq,mobile,phone,address,zipcode,wangwang,gtalk'; +$config->custom->fieldList['product']['create'] = 'line,PO,QD,RD,type,desc'; +$config->custom->fieldList['product']['edit'] = 'line,PO,QD,RD,type,desc,status'; +$config->custom->fieldList['story']['create'] = 'module,plan,source,pri,estimate,keywords'; +$config->custom->fieldList['story']['change'] = 'comment'; +$config->custom->fieldList['story']['close'] = 'comment'; +$config->custom->fieldList['story']['review'] = 'reviewedDate,comment'; +$config->custom->fieldList['productplan'] = 'begin,end,desc'; +$config->custom->fieldList['release']['create'] = 'build,desc'; +$config->custom->fieldList['release']['edit'] = 'desc'; +$config->custom->fieldList['project']['create'] = 'days,type,desc'; +$config->custom->fieldList['project']['edit'] = 'days,type,desc,PO,PM,QD,RD'; +$config->custom->fieldList['task']['create'] = 'story,pri,estimate,desc,estStarted,deadline'; +$config->custom->fieldList['task']['edit'] = 'pri,estimate,estStarted,deadline'; +$config->custom->fieldList['task']['finish'] = 'finishedDate,comment'; +$config->custom->fieldList['task']['activate'] = 'assignedTo,comment'; +$config->custom->fieldList['build'] = 'scmPath,filePath,desc'; +$config->custom->fieldList['bug']['create'] = 'module,project,deadline,type,os,browser,severity,pri,steps,keywords'; +$config->custom->fieldList['bug']['edit'] = 'productplan,assignedTo,deadline,type,os,browser,severity,pri,steps,keywords'; +$config->custom->fieldList['bug']['resolve'] = 'resolvedBuild,resolvedDate,assignedTo,comment'; +$config->custom->fieldList['testcase']['create'] = 'stage,story,pri,precondition,keywords'; +$config->custom->fieldList['testcase']['edit'] = 'stage,story,pri,precondition,keywords,status'; +$config->custom->fieldList['testsuite'] = 'desc'; +$config->custom->fieldList['testcase']['createcase'] = 'lib,stage,pri,precondition,keywords'; +$config->custom->fieldList['testreport'] = 'begin,end,members,report'; +$config->custom->fieldList['testtask'] = 'owner,pri,status,desc'; +$config->custom->fieldList['doc'] = 'keywords,content'; +$config->custom->fieldList['user']['create'] = 'dept,role,email,commiter'; +$config->custom->fieldList['user']['edit'] = 'dept,role,email,commiter,skype,qq,mobile,phone,address,zipcode,wangwang,gtalk'; diff --git a/module/custom/control.php b/module/custom/control.php index 9401051774..cdf8390b67 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -270,7 +270,7 @@ class custom extends control { if(empty($moduleName)) $moduleName = current($this->config->custom->requiredModules); - if($_POST) + if($_SERVER['REQUEST_METHOD'] == 'POST') { $this->custom->saveRequiredFields($moduleName); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload')); diff --git a/module/custom/model.php b/module/custom/model.php index c9b5419f73..7963d8a248 100644 --- a/module/custom/model.php +++ b/module/custom/model.php @@ -447,19 +447,22 @@ class customModel extends model $data = fixer::input('post')->get(); $requiredFields = array(); - foreach($data->requiredFields as $method => $fields) + if(!empty($data->requiredFields)) { - $method = strtolower($method); - $systemField = $this->config->$moduleName->$method->requiredFields; - - $fields = join(',', $fields); - foreach(explode(',', $systemField) as $field) + foreach($data->requiredFields as $method => $fields) { - $field = trim($field); - if(strpos(",$fields,", ",$field,") === false) $fields .= ",$field"; - } + $method = strtolower($method); + $systemField = $this->config->$moduleName->$method->requiredFields; - $requiredFields[$method]['requiredFields'] = $fields; + $fields = join(',', $fields); + foreach(explode(',', $systemField) as $field) + { + $field = trim($field); + if(strpos(",$fields,", ",$field,") === false) $fields .= ",$field"; + } + + $requiredFields[$method]['requiredFields'] = $fields; + } } $this->loadModel('setting')->setItems("system.{$moduleName}", $requiredFields);