diff --git a/module/execution/config.php b/module/execution/config.php index 2e46428e5b..6886b721d2 100644 --- a/module/execution/config.php +++ b/module/execution/config.php @@ -151,10 +151,13 @@ $config->execution->datatable->fieldList['name']['fixed'] = 'left'; $config->execution->datatable->fieldList['name']['width'] = 'auto'; $config->execution->datatable->fieldList['name']['required'] = 'yes'; -$config->execution->datatable->fieldList['code']['title'] = 'code'; -$config->execution->datatable->fieldList['code']['fixed'] = 'no'; -$config->execution->datatable->fieldList['code']['width'] = '95'; -$config->execution->datatable->fieldList['code']['required'] = 'no'; +if(!isset($config->setCode) or $config->setCode == 1) +{ + $config->execution->datatable->fieldList['code']['title'] = 'code'; + $config->execution->datatable->fieldList['code']['fixed'] = 'no'; + $config->execution->datatable->fieldList['code']['width'] = '95'; + $config->execution->datatable->fieldList['code']['required'] = 'no'; +} $config->execution->datatable->fieldList['project']['title'] = 'project'; $config->execution->datatable->fieldList['project']['fixed'] = 'no'; diff --git a/module/execution/model.php b/module/execution/model.php index 355ee67754..c1cd90d2fc 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -462,7 +462,7 @@ class executionModel extends model $oldExecution = $this->dao->findById($executionID)->from(TABLE_EXECUTION)->fetch(); /* Judgment of required items. */ - if($oldExecution->type != 'stage' and $this->post->code == '') + if($oldExecution->type != 'stage' and $this->post->code == '' and (!isset($this->config->setCode) or $this->config->setCode == 1)) { dao::$errors['code'] = sprintf($this->lang->error->notempty, $this->lang->execution->code); return false; @@ -686,7 +686,7 @@ class executionModel extends model if($executions[$executionID]->status == 'suspended') $executions[$executionID]->suspendedDate = helper::today(); /* Check unique code for edited executions. */ - if($projectModel == 'scrum' and empty($executionCode)) + if($projectModel == 'scrum' and empty($executionCode) and (!isset($this->config->setCode) or $this->config->setCode == 1)) { dao::$errors['code'][] = 'execution#' . $executionID . sprintf($this->lang->error->notempty, $this->lang->project->code); return false; diff --git a/module/execution/view/batchedit.html.php b/module/execution/view/batchedit.html.php index 260211cd5a..aa395cbe56 100755 --- a/module/execution/view/batchedit.html.php +++ b/module/execution/view/batchedit.html.php @@ -34,15 +34,14 @@ if(strpos(",{$config->execution->customBatchEditFields},", ",{$field},") !== false) $visibleFields[$field] = ''; } } - $minWidth = (count($visibleFields) > 5) ? 'w-150px' : ''; - - $name = $from == 'execution' ? 'execName' : 'name'; - $code = $from == 'execution' ? 'execCode' : 'code'; - $PM = $from == 'execution' ? 'execPM' : 'PM'; - $type = $from == 'execution' ? 'execType' : 'type'; - $desc = $from == 'execution' ? 'execDesc' : 'desc'; - $status = $from == 'execution' ? 'execStatus' : 'status'; - + $minWidth = (count($visibleFields) > 5) ? 'w-150px' : ''; + $name = $from == 'execution' ? 'execName' : 'name'; + $code = $from == 'execution' ? 'execCode' : 'code'; + $PM = $from == 'execution' ? 'execPM' : 'PM'; + $type = $from == 'execution' ? 'execType' : 'type'; + $desc = $from == 'execution' ? 'execDesc' : 'desc'; + $status = $from == 'execution' ? 'execStatus' : 'status'; + $hiddenCode = (isset($config->setCode) and $config->setCode == 0) ? 'hidden' : ''; ?>