* Add lang for gitlab module and adjust codes after code review.

This commit is contained in:
dingguodong
2021-08-03 15:21:01 +08:00
parent d93ec01d15
commit dbdea2e48c
5 changed files with 8 additions and 24 deletions
+2 -21
View File
@@ -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 .= "<option value='{$index}' data-name='{$execution}'>{$execution}</option>";
}
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);
}
}
+1
View File
@@ -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';
+1
View File
@@ -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';
+1
View File
@@ -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';
+3 -3
View File
@@ -31,9 +31,9 @@
<?php foreach($gitlabIssues as $issue):?>
<tr>
<td><?php echo "<a href='{$issue->web_url}' target='_blank'>$issue->title</a>";?></td>
<td><?php echo html::select("objectTypeList[{$issue->iid}]", $objectTypes, '', "class='form-control'" );?></td>
<td><?php echo html::select("productList[{$issue->iid}]", $products, '', "class='form-control'" );?></td>
<td><?php echo html::select("executionList[{$issue->iid}]", '', '', "class='form-control'" );?></td>
<td><?php echo html::select("objectTypeList[{$issue->iid}]", $objectTypes, '', "class='form-control select chosen'" );?></td>
<td><?php echo html::select("productList[{$issue->iid}]", $products, '', "class='form-control select chosen'" );?></td>
<td><?php echo html::select("executionList[{$issue->iid}]", '', '', "class='form-control select chosen'" );?></td>
<input type='hidden' name='gitlabID' value='<?php echo $gitlabID;?>' />
<input type='hidden' name='gitlabProjectID' value='<?php echo $gitlabProjectID;?>'/>
</tr>