Merge branch 'sprint/169'

This commit is contained in:
王怡栋
2021-11-02 09:54:05 +08:00
50 changed files with 306 additions and 223 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ $lang->gitlab->gitlabAccount = 'GitLab Account';
$lang->gitlab->zentaoAccount = 'Zentao Account';
$lang->gitlab->bindingStatus = 'Binding Status';
$lang->gitlab->binded = 'Binded';
$lang->gitlab->serverFail = 'Conntect to GitLab server failed, please check the GitLab server.';
$lang->gitlab->serverFail = 'Connect to GitLab server failed, please check the GitLab server.';
$lang->gitlab->browseAction = 'GitLab List';
$lang->gitlab->deleteAction = 'Delete GitLab';
+7 -8
View File
@@ -386,7 +386,7 @@ class gitlabModel extends model
if(is_numeric($host)) $host = $this->getApiRoot($host);
if(strpos($host, 'http://') !== 0 and strpos($host, 'https://') !== 0) return false;
$url = sprintf($apiRoot, $api);
$url = sprintf($host, $api);
return json_decode(commonModel::http($url, $data, $options));
}
@@ -474,7 +474,7 @@ class gitlabModel extends model
*
* @param int $gitlabID
* @access public
* @return void
* @return array
*/
public function apiGetProjects($gitlabID)
{
@@ -691,6 +691,7 @@ class gitlabModel extends model
public function apiUpdateHook($gitlabID, $projectID, $hookID)
{
$apiRoot = $this->getApiRoot($gitlabID);
$url = sprintf($apiRoot, "/projects/{$projectID}/hooks/{$hookID}");
$postData = new stdclass;
$postData->enable_ssl_verification = "false";
@@ -699,8 +700,6 @@ class gitlabModel extends model
$postData->push_events = "true";
$postData->tag_push_events = "true";
$postData->note_events = "true";
$postData->url = $url;
$postData->token = $token;
$url = sprintf($apiRoot, "/projects/{$projectID}/hooks/{$hookID}");
return commonModel::http($url, $postData, $options = array(CURLOPT_CUSTOMREQUEST => 'PUT'));
@@ -1249,9 +1248,9 @@ class gitlabModel extends model
/**
* Create webhook for zentao.
*
* @param int $products
* @param int $gitlabID
* @param int $projectID
* @param array $products
* @param int $gitlabID
* @param int $projectID
* @access public
* @return bool
*/
@@ -1364,7 +1363,7 @@ class gitlabModel extends model
if($value) $issue->$field = $value;
}
if($isset($issue->assignee_id) and $issue->assignee_id == 'closed') unset($issue->assignee_id);
if(isset($issue->assignee_id) and $issue->assignee_id == 'closed') unset($issue->assignee_id);
/* issue->state is null when creating it, we should put status_event when updating it. */
if(isset($issue->state) and $issue->state == 'closed') $issue->state_event = 'close';
-1
View File
@@ -27,4 +27,3 @@
</div>
<?php include '../../common/view/footer.html.php';?>