From e8603eef32e2ff44486865cc87cbede7e30f3f5f Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 19 Jul 2022 15:25:43 +0800 Subject: [PATCH] * Finish task #61181. --- module/execution/config.php | 11 +++++++---- module/execution/model.php | 4 ++-- module/execution/view/batchedit.html.php | 21 ++++++++++----------- module/execution/view/create.html.php | 2 ++ module/execution/view/edit.html.php | 2 ++ module/execution/view/view.html.php | 3 ++- 6 files changed, 25 insertions(+), 18 deletions(-) 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' : ''; ?>
'>
@@ -54,7 +53,7 @@ execution->projectName;?> execution->$name;?> - execution->$code;?> + execution->$code;?> '>execution->$PM;?> '>execution->PO;?> '>execution->QD;?> @@ -86,7 +85,7 @@ project, "class='form-control picker-select' data-lastselected='{$executions[$executionID]->project}' onchange='changeProject(this, $executionID, {$executions[$executionID]->project})'");?> name, "id='names{$executionID}' class='form-control'");?> - code, "class='form-control'");?> + code, "class='form-control'");?> ' style='overflow:visible'>PM, "class='form-control picker-select'");?> ' style='overflow:visible'>PO, "class='form-control picker-select'");?> ' style='overflow:visible'>QD, "class='form-control picker-select'");?> diff --git a/module/execution/view/create.html.php b/module/execution/view/create.html.php index 18fff781b3..2d4d4eff1a 100644 --- a/module/execution/view/create.html.php +++ b/module/execution/view/create.html.php @@ -70,10 +70,12 @@ + setCode) or $config->setCode == 1):?> execution->execCode : $lang->execution->code;?> + execution->dateRange;?> diff --git a/module/execution/view/edit.html.php b/module/execution/view/edit.html.php index d1c59a4cf3..e8043c98f2 100644 --- a/module/execution/view/edit.html.php +++ b/module/execution/view/edit.html.php @@ -39,10 +39,12 @@ execution->name;?> name, "class='form-control' required");?> + setCode) or $config->setCode == 1):?> execution->code;?> code, "class='form-control' required");?> + execution->dateRange;?> diff --git a/module/execution/view/view.html.php b/module/execution/view/view.html.php index 719f49369c..1307ded6a8 100644 --- a/module/execution/view/view.html.php +++ b/module/execution/view/view.html.php @@ -158,7 +158,8 @@
-

id;?> code;?> name;?>

+ setCode) and $config->setCode == 0) ? 'hidden' : '';?> +

id;?> code;?> name;?>