+ Accept a MR.

This commit is contained in:
dingguodong
2021-08-31 11:05:03 +08:00
parent 99fdb29327
commit b2f1fd3f3c
+15
View File
@@ -132,6 +132,7 @@ class mr extends control
}
/**
<<<<<<< HEAD
* Crontab sync MR from GitLab API to Zentao database, default time 5 minutes to execute once.
*
* @access public
@@ -150,6 +151,20 @@ class mr extends control
echo 'success';
}
/** Accept a MR.
*
* @param int $MRID
* @access public
* @return void
*/
public function accept($MRID)
{
$MR = $this->mr->getByID($MRID);
if(isset($MR->gitlabID)) $rawMR = $this->mr->apiAcceptMR($MR->gitlabID, $MR->targetProject, $MR->mriid);
if(isset($rawMR->state) and $rawMR->state == 'merged') return array('result' => 'success', 'message' => $this->lang->mr->mergeSuccess);
return array('result' => 'fail', 'message' => $this->lang->mr->mergeFailed);
}
/**
* AJAX: Get MR target projects.
*