From 2dc084e911736683e3099e9ce559a1b51fdd18be Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Wed, 2 Jun 2021 10:25:21 +0800 Subject: [PATCH] * Modify the required item prompt language item. --- module/common/lang/menu.php | 2 +- module/execution/model.php | 26 ++++++++++++++++++-------- module/story/view/batchedit.html.php | 2 +- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index 3479738ffb..2e2107aefa 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -185,7 +185,7 @@ $lang->scrum->menu->index = array('link' => "{$lang->dashboard}|project|inde $lang->scrum->menu->execution = array('link' => "$lang->executionCommon|project|execution|status=all&projectID=%s", 'exclude' => 'execution-testreport'); $lang->scrum->menu->story = array('link' => "$lang->SRCommon|projectstory|story|projectID=%s", 'subModule' => 'projectstory,tree', 'alias' => 'story,track'); $lang->scrum->menu->doc = array('link' => "{$lang->doc->common}|doc|objectLibs|type=project&objectID=%s", 'subModule' => 'doc'); -$lang->scrum->menu->qa = array('link' => "{$lang->qa->common}|project|bug|projectID=%s", 'subModule' => 'testcase,testtask,bug,testreport,execution', 'alias' => 'bug,testtask,testcase,testreport', 'exclude' => 'execution-create'); +$lang->scrum->menu->qa = array('link' => "{$lang->qa->common}|project|bug|projectID=%s", 'subModule' => 'testcase,testtask,bug,testreport,execution', 'alias' => 'bug,testtask,testcase,testreport', 'exclude' => 'execution-create,execution-batchedit'); $lang->scrum->menu->devops = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&branchID=&objectID=%s", 'subModule' => 'repo'); $lang->scrum->menu->build = array('link' => "{$lang->build->common}|project|build|project=%s"); $lang->scrum->menu->release = array('link' => "{$lang->release->common}|projectrelease|browse|project=%s", 'subModule' => 'projectrelease'); diff --git a/module/execution/model.php b/module/execution/model.php index e5363a982f..5480cce204 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -567,6 +567,23 @@ class executionModel extends model $oldExecutions = $this->getByIdList($this->post->executionIDList); $nameList = array(); $codeList = array(); + + /* Replace required language. */ + if($this->app->openApp == 'project') + { + $projectModel = $this->dao->select('model')->from(TABLE_PROJECT)->where('id')->eq($this->session->project)->fetch('model'); + if($projectModel == 'scrum') + { + $this->lang->project->name = $this->lang->execution->name; + $this->lang->project->code = $this->lang->execution->code; + } + else + { + $this->lang->project->name = str_replace($this->lang->project->common, $this->lang->project->stage, $this->lang->project->name); + $this->lang->project->code = str_replace($this->lang->project->common, $this->lang->project->stage, $this->lang->project->code); + } + } + foreach($data->executionIDList as $executionID) { $executionName = $data->names[$executionID]; @@ -602,13 +619,6 @@ class executionModel extends model } if(dao::isError()) die(js::error(dao::getError())); - /* Replace required language. */ - if($this->app->openApp == 'project') - { - $this->lang->project->name = $this->lang->execution->name; - $this->lang->project->code = $this->lang->execution->code; - } - foreach($executions as $executionID => $execution) { $oldExecution = $oldExecutions[$executionID]; @@ -620,7 +630,7 @@ class executionModel extends model ->checkIF($execution->begin != '', 'begin', 'date') ->checkIF($execution->end != '', 'end', 'date') ->checkIF($execution->end != '', 'end', 'gt', $execution->begin) - ->check('code', 'unique', "id NOT " . helper::dbIN($data->executionIDList) . " and deleted='0'") + ->checkIF($execution->code != '', 'code', 'unique', "id NOT " . helper::dbIN($data->executionIDList) . " and deleted='0'") ->where('id')->eq($executionID) ->limit(1) ->exec(); diff --git a/module/story/view/batchedit.html.php b/module/story/view/batchedit.html.php index d910cd3928..5f16b51bbe 100644 --- a/module/story/view/batchedit.html.php +++ b/module/story/view/batchedit.html.php @@ -109,7 +109,7 @@ foreach(explode(',', $showFields) as $field)
- title, "class='form-control input-story-title'"); ?> + title, "class='form-control input-story-title' disabled"); ?>