* Rename some functions after code review.

This commit is contained in:
dingguodong
2021-07-01 15:55:20 +08:00
parent 688890ee84
commit d4d8185131
8 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -1552,7 +1552,7 @@ class bug extends control
else
{
/* Delete related issue in gitlab. */
$relation = $this->loadModel('gitlab')->getGitlabIssueFromRelation('bug', $bugID);
$relation = $this->loadModel('gitlab')->getRelationByObject('bug', $bugID);
if(!empty($relation)) $this->loadModel('gitlab')->deleteIssue($relation->gitlabID, $relation->projectID, 'bug', $bugID, $relation->issueID);
$this->bug->delete(TABLE_BUG, $bugID);
+2 -2
View File
@@ -856,7 +856,7 @@ class bugModel extends model
->autoCheck()
->where('id')->eq($bugID)->exec();
$relation = $this->loadModel('gitlab')->getGitlabIssueFromRelation('bug', $bugID);
$relation = $this->loadModel('gitlab')->getRelationByObject('bug', $bugID);
$attribute = new stdclass();
$attribute->assignee_id = $this->loadModel('gitlab')->getGitlabUserID($relation->gitlabID, $bug->assignedTo);
if($attribute->assignee_id != '')
@@ -1226,7 +1226,7 @@ class bugModel extends model
->remove('comment')
->get();
$relation = $this->loadModel('gitlab')->getGitlabIssueFromRelation('bug', $bugID);
$relation = $this->loadModel('gitlab')->getRelationByObject('bug', $bugID);
$singleIssue = new stdclass();
$singleIssue = $this->loadModel('gitlab')->apiSingleIssue($relation->gitlabID, $relation->issueID);
+1 -1
View File
@@ -776,7 +776,7 @@ class gitlabModel extends model
* @access public
* @return void
*/
public function saveRelation($products, $gitlabID, $gitlabProjectID)
public function saveProjectRelation($products, $gitlabID, $gitlabProjectID)
{
$programs = $this->dao->select('id,program')->from(TABLE_PRODUCT)->where('id')->in($products)->fetchPairs();
+2 -2
View File
@@ -232,7 +232,7 @@ class repoModel extends model
if($this->post->SCM == 'Gitlab')
{
$this->loadModel("gitlab")->saveRelation($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
$this->loadModel("gitlab")->saveProjectRelation($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
/* create webhook for zentao */
$this->loadModel("gitlab")->createWebhook($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
@@ -293,7 +293,7 @@ class repoModel extends model
$this->rmClientVersionFile();
if($repo->SCM == 'Gitlab') $this->loadModel("gitlab")->saveRelation($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
if($repo->SCM == 'Gitlab') $this->loadModel("gitlab")->saveProjectRelation($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
if($repo->path != $data->path)
{
$this->dao->delete()->from(TABLE_REPOHISTORY)->where('repo')->eq($id)->exec();
+1 -1
View File
@@ -988,7 +988,7 @@ class story extends control
else
{
/* Delete related issue in gitlab. */
$relation = $this->loadModel('gitlab')->getGitlabIssueFromRelation('story', $storyID);
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
$this->loadModel('gitlab')->deleteIssue($relation->gitlabID, $relation->projectID, 'story', $storyID, $relation->issueID);
$this->story->delete(TABLE_STORY, $storyID);
+1 -1
View File
@@ -1772,7 +1772,7 @@ class storyModel extends model
if(!dao::isError())
{
$relation = $this->loadModel('gitlab')->getGitlabIssueFromRelation('story', $storyID);
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
$attribute = new stdclass();
$attribute->assignee_id = $this->loadModel('gitlab')->getGitlabUserID($relation->gitlabID, $story->assignedTo);
if($attribute->assignee_id != '')
+1 -1
View File
@@ -1281,7 +1281,7 @@ class task extends control
else
{
/* Delete related issue in gitlab. */
$relation = $this->loadModel('gitlab')->getGitlabIssueFromRelation('task', $taskID);
$relation = $this->loadModel('gitlab')->getRelationByObject('task', $taskID);
$this->loadModel('gitlab')->deleteIssue($relation->gitlabID, $relation->projectID, 'task', $taskID, $relation->issueID);
$this->task->delete(TABLE_TASK, $taskID);
+1 -1
View File
@@ -1330,7 +1330,7 @@ class taskModel extends model
->check('left', 'float')
->where('id')->eq($taskID)->exec();
$relation = $this->loadModel('gitlab')->getGitlabIssueFromRelation('task', $taskID);
$relation = $this->loadModel('gitlab')->getRelationByObject('task', $taskID);
$attribute = new stdclass();
$attribute->assignee_id = $this->loadModel('gitlab')->getGitlabUserID($relation->gitlabID, $task->assignedTo);
if($attribute->assignee_id != '')