* Add update story to gitlab issue.

This commit is contained in:
lichengjun
2021-06-29 08:36:51 +08:00
parent d15cb6ed42
commit 38a0f4bbfd
2 changed files with 22 additions and 7 deletions
+15
View File
@@ -77,6 +77,21 @@ class gitlabModel extends model
->fetchPairs();
}
/**
* Get gitlab gitlabID and gitlabProjectID.
*
* @param int $gitlab
* @access public
* @return void
*/
public function getGitlabToGitlabProject($storyID)
{
return $this->dao->select('BID,BVersion')->from(TABLE_RELATION)
->where('relation')->eq('gitlab')
->andWhere('AID')->eq($storyID)
->fetchAll();
}
/**
* Get zentao account gitlab user id pairs of one gitlab.
*
+7 -7
View File
@@ -828,10 +828,10 @@ class storyModel extends model
$reviewData->version = $oldStory->version;
$reviewData->reviewer = $reviewer;
$this->dao->insert(TABLE_STORYREVIEW)->data($reviewData)->exec();
}
/* Push this story to gitlab issue. */
$this->loadModel('gitlab')->pushStory($storyID, $this->post->gitlab, $this->post->gitlabProject);
}
/* update story to gitlab issue. */
$objectID = $this->loadModel('gitlab')->getGitlabToGitlabProject($storyID);
if($objectID) $this->loadModel('gitlab')->pushToissue('story', $storyID, $this->post->gitlab, $this->post->gitlabProject);
unset($oldStory->parent);
unset($story->parent);
@@ -1767,11 +1767,11 @@ class storyModel extends model
$story->assignedTo = $assignedTo;
$story->assignedDate = $now;
$this->dao->update(TABLE_STORY)->data($story)->autoCheck()->where('id')->eq((int)$storyID)->exec();
if(!dao::isError())
{
/* Push this story to gitlab issue. */
$this->loadModel('gitlab')->pushStory($storyID, $this->post->gitlab, $this->post->gitlabProject);
/* Update this story to gitlab issue. */
$objectID = $this->loadModel('gitlab')->getGitlabToGitlabProject($storyID);
if($objectID) $this->loadModel('gitlab')->pushToissue('story', $storyID, $this->post->gitlab, $this->post->gitlabProject);
return common::createChanges($oldStory, $story);
}