From 53c075cbeeb24d6048c57367b92d2cce0f1bf55a Mon Sep 17 00:00:00 2001 From: lichengjun Date: Thu, 15 Jul 2021 16:39:58 +0800 Subject: [PATCH] *Adjust code. --- module/gitlab/config.php | 2 +- module/gitlab/lang/en.php | 2 +- module/gitlab/view/importissue.html.php | 3 +-- module/story/control.php | 8 ++++---- module/story/view/create.html.php | 2 +- module/task/control.php | 4 ++-- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/module/gitlab/config.php b/module/gitlab/config.php index 14917d23b7..a7564b7ee3 100644 --- a/module/gitlab/config.php +++ b/module/gitlab/config.php @@ -103,6 +103,6 @@ $config->gitlab->objectTables->bug = TABLE_BUG; $config->gitlab->objectTypes = array(); $config->gitlab->objectTypes[''] = ''; $config->gitlab->objectTypes['task'] = '任务'; -$config->gitlab->objectTypes['bug'] = 'bug'; +$config->gitlab->objectTypes['bug'] = 'Bug'; $config->gitlab->objectTypes['story'] = '需求'; diff --git a/module/gitlab/lang/en.php b/module/gitlab/lang/en.php index 17dbaabd4b..c1d4f9a784 100644 --- a/module/gitlab/lang/en.php +++ b/module/gitlab/lang/en.php @@ -21,7 +21,7 @@ $lang->gitlab->zentaoProduct = 'Zentao Product'; $lang->gitlab->objectType = 'Type'; // task, bug, story $lang->gitlab->id = 'ID'; -$lang->gitlab->name = "{$lang->gitlab->common}name"; +$lang->gitlab->name = "{$lang->gitlab->common} Name"; $lang->gitlab->url = 'GitLab URL'; $lang->gitlab->token = 'Token'; $lang->gitlab->defaultProject = 'Default Project'; diff --git a/module/gitlab/view/importissue.html.php b/module/gitlab/view/importissue.html.php index dcbf7f6a3a..477c7bdef1 100644 --- a/module/gitlab/view/importissue.html.php +++ b/module/gitlab/view/importissue.html.php @@ -41,8 +41,7 @@ - - + save);?> createLink('repo', 'maintain', ""), $lang->goback, '', 'class="btn btn-wide"'); ?> diff --git a/module/story/control.php b/module/story/control.php index 905a0b1d9c..3e99151dd6 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -300,9 +300,7 @@ class story extends control $executionID = $objectID; $gitlabProjects = $this->gitlab->getProjectsByExecution($executionID); foreach($allGitlabs as $id => $name) if($id and !isset($gitlabProjects[$id])) unset($allGitlabs[$id]); - $this->view->gitlabList = $allGitlabs; - $this->view->gitlabProjects = $gitlabProjects; - + $this->view->title = $product->name . $this->lang->colon . $this->lang->story->create; $this->view->position[] = html::a($this->createLink('product', 'browse', "product=$productID&branch=$branch"), $product->name); $this->view->position[] = $this->lang->story->common; @@ -332,6 +330,8 @@ class story extends control $this->view->URS = $type == 'story' ? $this->story->getRequierements($productID) : ''; $this->view->needReview = ($this->app->user->account == $product->PO || $objectID > 0 || $this->config->story->needReview == 0) ? "checked='checked'" : ""; $this->view->type = $type; + $this->view->gitlabList = $allGitlabs; + $this->view->gitlabProjects = $gitlabProjects; $this->display(); } @@ -995,7 +995,7 @@ class story extends control $this->loadModel('gitlab'); $relation = $this->gitlab->getRelationByObject('story', $storyID); if(!empty($relation)) $this->gitlab->deleteIssue('story', $storyID, $relation->issueID); - + $this->story->delete(TABLE_STORY, $storyID); if($story->parent > 0) { diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index f09edc694b..be4f97590f 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -256,7 +256,7 @@ story->sync2Gitlab;?> - + diff --git a/module/task/control.php b/module/task/control.php index 42cfb1c31d..8e303cbd06 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -221,8 +221,6 @@ class task extends control $allGitlabs = $this->gitlab->getPairs(); $gitlabProjects = $this->gitlab->getProjectsByExecution($executionID); foreach($allGitlabs as $id => $name) if($id and !isset($gitlabProjects[$id])) unset($allGitlabs[$id]); - $this->view->gitlabList = $allGitlabs; - $this->view->gitlabProjects = $gitlabProjects; $this->view->customFields = $customFields; $this->view->showFields = $this->config->task->custom->createFields; @@ -239,6 +237,8 @@ class task extends control $this->view->members = $members; $this->view->blockID = $blockID; $this->view->moduleOptionMenu = $moduleOptionMenu; + $this->view->gitlabList = $allGitlabs; + $this->view->gitlabProjects = $gitlabProjects; $this->display(); }