This commit is contained in:
lichengjun
2021-06-28 14:05:05 +08:00
4 changed files with 18 additions and 3 deletions
+7
View File
@@ -56,6 +56,7 @@ $filter->webhook = new stdclass();
$filter->git = new stdclass();
$filter->svn = new stdclass();
$filter->search = new stdclass();
$filter->gitlab = new stdclass();
$filter->block->default = new stdclass();
$filter->block->main = new stdclass();
@@ -130,6 +131,7 @@ $filter->webhook->bind = new stdclass();
$filter->user->ajaxgetmore = new stdclass();
$filter->repo->ajaxsynccommit = new stdclass();
$filter->search->index = new stdclass();
$filter->gitlab->webhook = new stdclass();
$filter->bug->batchcreate->cookie['preBranch'] = 'int';
$filter->bug->browse->cookie['bugModule'] = 'int';
@@ -308,3 +310,8 @@ $filter->webhook->bind->cookie['selectedDepts'] = 'reg::checked';
$filter->search->index->get['words'] = 'reg::any';
$filter->search->index->get['type'] = 'code';
$filter->gitlab->webhook->get['gitlab'] = 'int';
$filter->gitlab->webhook->get['product'] = 'int';
$filter->gitlab->webhook->get['project'] = 'int';
$filter->gitlab->webhook->get['token'] = 'reg::any';
+5
View File
@@ -82,3 +82,8 @@ $config->gitlab->bugStateMap['active'] = 'reopen';
$config->gitlab->bugStateMap['resolved'] = 'reopen';
$config->gitlab->bugStateMap['closed'] = 'close';
$config->gitlab->objectTables = new stdclass;
$config->gitlab->objectTables->story = TABLE_STORY;
$config->gitlab->objectTables->task = TABLE_TASK;
$config->gitlab->objectTables->bug = TABLE_BUG;
+2 -2
View File
@@ -216,7 +216,7 @@ class gitlab extends control
//$input = file_get_contents('php://input');
$requestBody = json_decode($input);
$result = $this->gitlab->webhookParseBody($requestBody, $gitlab);
a($result);exit;
$logFile = $this->app->getLogRoot() . 'webhook.'. date('Ymd') . '.log.php';
if(!file_exists($logFile)) file_put_contents($logFile, '<?php die(); ?' . '>');
@@ -233,7 +233,7 @@ class gitlab extends control
$this->view->result = 'success';
$this->view->status = 'ok';
$this->view->data = 'ougiugjvh';
$this->view->data = $result->object;
$this->display();
}
+4 -1
View File
@@ -878,6 +878,9 @@ class gitlabModel extends model
$issue->issue->objectType = $object->type;
$issue->issue->objectID = $object->id;
/* Parse markdown description to html. */
$issue->issue->description = $this->app->loadClass('hyperdown')->makeHtml($issue->issue->description);
if(!isset($this->config->gitlab->maps->{$object->type})) return false;
$issue->object = $this->issueToZentaoObject($issue->issue, $gitlabID);
return $issue;
@@ -967,7 +970,7 @@ class gitlabModel extends model
if(!isset($this->config->gitlab->maps->{$issue->objectType})) return null;
$maps = $this->config->gitlab->maps->{$issue->objectType};
$gitlabUsers = $this->getUserAccountIdPairs($gitlabID);
$gitlabUsers = $this->getUserIdAccountPairs($gitlabID);
$object = new stdclass;
$object->id = $issue->objectID;