From dbdea2e48ccf16e10a0695b8b37afdf338b985a9 Mon Sep 17 00:00:00 2001 From: dingguodong Date: Tue, 3 Aug 2021 15:21:01 +0800 Subject: [PATCH] * Add lang for gitlab module and adjust codes after code review. --- module/gitlab/control.php | 23 ++--------------------- module/gitlab/lang/en.php | 1 + module/gitlab/lang/zh-cn.php | 1 + module/gitlab/lang/zh-tw.php | 1 + module/gitlab/view/importissue.html.php | 6 +++--- 5 files changed, 8 insertions(+), 24 deletions(-) diff --git a/module/gitlab/control.php b/module/gitlab/control.php index c70fcfeaca..f1964f60b6 100644 --- a/module/gitlab/control.php +++ b/module/gitlab/control.php @@ -300,6 +300,7 @@ class gitlab extends control /* 'not[iids]' option in gitlab API has a issue when iids is too long. */ $gitlabIssues = $this->gitlab->apiGetIssues($gitlabID, $projectID, '&state=opened'); + if(empty($gitlabIssues)) return $this->send(array('result' => 'fail', 'message' => $this->lang->gitlab->serverFail, 'locate' => $this->server->http_referer)); foreach($gitlabIssues as $index => $issue) { foreach($savedIssueIDList as $savedIssueID) @@ -344,26 +345,6 @@ class gitlab extends control { $options .= ""; } - die($options); - } - - /** - * AJAX: Get gitlab project pipeline. - * - * @param int $repoID - * @access public - * @return void - */ - public function ajaxGetPipeline($repoID) - { - if(empty($repoID)) die(json_encode(array('' => ''))); - $this->loadModel('repo'); - $repo = $this->repo->getRepoByID($repoID); - if(empty($repo)) die(json_encode(array('' => ''))); - - $gitlabID = $repo->gitlab; - $projectID = $repo->projectID; - $pipeline = $this->gitlab->getPipeline($gitlabID, $projectID); - die(json_encode($pipeline)); + return $this->send($options); } } diff --git a/module/gitlab/lang/en.php b/module/gitlab/lang/en.php index 7da95d681a..b4ddbddb75 100644 --- a/module/gitlab/lang/en.php +++ b/module/gitlab/lang/en.php @@ -12,6 +12,7 @@ $lang->gitlab->delete = 'Delete GitLab'; $lang->gitlab->confirmDelete = 'Do you want to delete this GitLab server?'; $lang->gitlab->gitlabAccount = 'GitLab Account'; $lang->gitlab->zentaoAccount = 'Zentao Account'; +$lang->gitlab->serverFail = 'Conntect to GitLab server failed, please check the GitLab server.'; $lang->gitlab->browseAction = 'GitLab List'; $lang->gitlab->deleteAction = 'Delete GitLab'; diff --git a/module/gitlab/lang/zh-cn.php b/module/gitlab/lang/zh-cn.php index 6babb7617a..4a37a0cbc4 100644 --- a/module/gitlab/lang/zh-cn.php +++ b/module/gitlab/lang/zh-cn.php @@ -12,6 +12,7 @@ $lang->gitlab->delete = '删除GitLab'; $lang->gitlab->confirmDelete = '确认删除该GitLab吗?'; $lang->gitlab->gitlabAccount = 'GitLab用户'; $lang->gitlab->zentaoAccount = '禅道用户'; +$lang->gitlab->serverFail = '连接GitLab服务器异常,请检查GitLab服务器。'; $lang->gitlab->browseAction = 'GitLab列表'; $lang->gitlab->deleteAction = '删除GitLab'; diff --git a/module/gitlab/lang/zh-tw.php b/module/gitlab/lang/zh-tw.php index 5481002fe1..26a625999e 100644 --- a/module/gitlab/lang/zh-tw.php +++ b/module/gitlab/lang/zh-tw.php @@ -12,6 +12,7 @@ $lang->gitlab->delete = '刪除GitLab'; $lang->gitlab->confirmDelete = '確認刪除該GitLab嗎?'; $lang->gitlab->gitlabAccount = 'GitLab用戶'; $lang->gitlab->zentaoAccount = '禪道用戶'; +$lang->gitlab->serverFail = '連接GitLab服務器異常,請檢查GitLab服務器。'; $lang->gitlab->browseAction = 'GitLab列表'; $lang->gitlab->deleteAction = '刪除GitLab'; diff --git a/module/gitlab/view/importissue.html.php b/module/gitlab/view/importissue.html.php index a570b38e59..dfb478ea02 100644 --- a/module/gitlab/view/importissue.html.php +++ b/module/gitlab/view/importissue.html.php @@ -31,9 +31,9 @@ web_url}' target='_blank'>$issue->title";?> - iid}]", $objectTypes, '', "class='form-control'" );?> - iid}]", $products, '', "class='form-control'" );?> - iid}]", '', '', "class='form-control'" );?> + iid}]", $objectTypes, '', "class='form-control select chosen'" );?> + iid}]", $products, '', "class='form-control select chosen'" );?> + iid}]", '', '', "class='form-control select chosen'" );?>