* Fix format code.
This commit is contained in:
@@ -647,7 +647,7 @@ class bugModel extends model
|
||||
if(!empty($bug->resolvedBy)) $this->loadModel('score')->create('bug', 'resolve', $bugID);
|
||||
$this->file->updateObjectID($this->post->uid, $bugID, 'bug');
|
||||
|
||||
$relation = $this->loadModel('gitlab')->getGitlabIDprojectID('bug',$bugID);
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('bug',$bugID);
|
||||
if($relation) $this->loadModel('gitlab')->pushToIssue('bug', $bugID, $relation->gitlabID, $relation->projectID);
|
||||
|
||||
return common::createChanges($oldBug, $bug);
|
||||
|
||||
@@ -209,7 +209,7 @@ class gitlabModel extends model
|
||||
*/
|
||||
public function getRelationByObject($objectType, $objectID)
|
||||
{
|
||||
return $this->dao->select('id,extra as gitlabID, BVersion as projectID, BID as issueID')->from(TABLE_RELATION)
|
||||
return $this->dao->select('*, id, extra as gitlabID, BVersion as projectID, BID as issueID')->from(TABLE_RELATION)
|
||||
->where('relation')->eq('gitlab')
|
||||
->andWhere('Atype')->eq($objectType)
|
||||
->andWhere('AID')->eq($objectID)
|
||||
@@ -506,8 +506,7 @@ class gitlabModel extends model
|
||||
*/
|
||||
public function apiGetSingleIssue($gitlabID, $projectID, $issueID)
|
||||
{
|
||||
$apiRoot = $this->getApiRoot($gitlabID);
|
||||
$url = sprintf($apiRoot, "/issues/{$issueID}");
|
||||
$url = sprintf($this->getApiRoot($gitlabID), "/issues/{$issueID}");
|
||||
return json_decode(commonModel::http($url));
|
||||
}
|
||||
|
||||
@@ -838,7 +837,7 @@ class gitlabModel extends model
|
||||
if(empty($object)) return false;
|
||||
if(!$gitlabID or !$projectID)
|
||||
{
|
||||
$result = $this->getGitlabIDprojectID($objectType, $objectID);
|
||||
$result = $this->getRelationByObject($objectType, $objectID);
|
||||
$gitlabID = $result->gitlabID;
|
||||
$projectID = $result->projectID;
|
||||
}
|
||||
@@ -871,7 +870,7 @@ class gitlabModel extends model
|
||||
public function deleteIssue($gitlabID, $projectID, $objectType, $objectID, $issueID)
|
||||
{
|
||||
$object = $this->loadModel($objectType)->getByID($objectID);
|
||||
$relationID = $this->getRelationID($objectType, $objectID);
|
||||
$relationID = $this->getRelationByObject($objectType, $objectID);
|
||||
if(!empty($relationID)) $this->dao->delete()->from(TABLE_RELATION)->where('id')->eq($relationID)->exec();
|
||||
$this->apiDeleteIssue($gitlabID, $projectID, $issueID);
|
||||
}
|
||||
|
||||
@@ -1674,7 +1674,7 @@ class taskModel extends model
|
||||
->where('id')->eq((int)$taskID)
|
||||
->exec();
|
||||
|
||||
$objectID = $this->loadModel('gitlab')->getGitlabIDprojectID('task',$taskID);
|
||||
$objectID = $this->loadModel('gitlab')->getRelationByObject('task',$taskID);
|
||||
if($objectID) $this->loadModel('gitlab')->pushToissue('task', $taskID, $objectID->gitlabID, $objectID->projectID);
|
||||
|
||||
if($oldTask->parent > 0) $this->updateParentStatus($taskID);
|
||||
|
||||
Reference in New Issue
Block a user