Merge branch 'jihu' of https://gitlab.zcorp.cc/easycorp/zentaopms into jihu
This commit is contained in:
@@ -1464,6 +1464,15 @@ class bug extends control
|
||||
$bugs = $this->bug->getByList($bugIDList);
|
||||
foreach($bugs as $bugID => $bug)
|
||||
{
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('bug', $bugID);
|
||||
if(!empty($relation))
|
||||
{
|
||||
$singleIssue = new stdclass();
|
||||
$singleIssue = $this->loadModel('gitlab')->apiGetSingleIssue($relation->gitlabID, $relation->issueID);
|
||||
|
||||
if($singleIssue->state != 'closed') $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug);
|
||||
}
|
||||
|
||||
if($bug->status != 'resolved')
|
||||
{
|
||||
if($bug->status != 'closed') $skipBugs[$bugID] = $bugID;
|
||||
|
||||
+23
-2
@@ -89,8 +89,7 @@ class bugModel extends model
|
||||
{
|
||||
$bugID = $this->dao->lastInsertID();
|
||||
|
||||
$object = $this->getByID($bugID);
|
||||
$this->loadModel('gitlab')->apiCreateIssue($this->post->gitlab, $this->post->gitlabProject, 'bug', $bugID, $object);
|
||||
$this->loadModel('gitlab')->apiCreateIssue($this->post->gitlab, $this->post->gitlabProject, 'bug', $bugID, $bug);
|
||||
|
||||
$this->file->updateObjectID($this->post->uid, $bugID, 'bug');
|
||||
$this->file->saveUpload('bug', $bugID);
|
||||
@@ -824,6 +823,12 @@ class bugModel extends model
|
||||
/* Update bugs. */
|
||||
foreach($activateBugs as $bugID => $bug)
|
||||
{
|
||||
if(!empty($bug))
|
||||
{
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('bug', $bugID);
|
||||
if($relation) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', (Object)$bug);
|
||||
}
|
||||
|
||||
$oldBug = $bugs[$bugID];
|
||||
$this->dao->update(TABLE_BUG)->data($bug, $skipFields = 'comment')->autoCheck()->where('id')->eq((int)$bugID)->exec();
|
||||
if(dao::isError()) die(js::error('bug#' . $bugID . dao::getError(true)));
|
||||
@@ -920,6 +925,12 @@ class bugModel extends model
|
||||
$bug->lastEditedDate = $now;
|
||||
$bug->confirmed = 1;
|
||||
|
||||
if(!empty($bug))
|
||||
{
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('bug', $bugID);
|
||||
if($relation) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug);
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_BUG)->data($bug)->where('id')->eq($bugID)->exec();
|
||||
$this->executeHooks($bugID);
|
||||
}
|
||||
@@ -1143,6 +1154,10 @@ class bugModel extends model
|
||||
$this->dao->update(TABLE_BUG)->data($bug)->where('id')->eq($bugID)->exec();
|
||||
$this->executeHooks($bugID);
|
||||
|
||||
/* batch resolve issure bugs.*/
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('bug', $bugID);
|
||||
if($relation) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug);
|
||||
|
||||
$changes[$bugID] = common::createChanges($oldBug, $bug);
|
||||
}
|
||||
|
||||
@@ -1200,6 +1215,12 @@ class bugModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($bug))
|
||||
{
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('bug', $bugID);
|
||||
if($relation) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug);
|
||||
}
|
||||
|
||||
$bug->activatedCount += 1;
|
||||
return common::createChanges($oldBug, $bug);
|
||||
}
|
||||
|
||||
@@ -1824,6 +1824,10 @@ class storyModel extends model
|
||||
$this->dao->update(TABLE_STORY)->data($story)->autoCheck()->where('id')->eq((int)$storyID)->exec();
|
||||
if(!dao::isError())
|
||||
{
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
|
||||
$story->assignee_id = $this->loadModel('gitlab')->getGitlabUserID($relation->gitlabID, $story->assignedTo);
|
||||
if($story->assignee_id != '') $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story);
|
||||
|
||||
/* Push this story to gitlab issue. */
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
|
||||
if(!empty($relation)) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story);
|
||||
|
||||
@@ -572,6 +572,9 @@ class task extends control
|
||||
|
||||
$task = $this->task->getByID($taskID);
|
||||
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('task', $taskID);
|
||||
$this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task);
|
||||
|
||||
$members = $this->loadModel('user')->getTeamMemberPairs($executionID, 'execution', 'nodeleted');
|
||||
|
||||
/* Compute next assignedTo. */
|
||||
@@ -645,6 +648,9 @@ class task extends control
|
||||
if(isset($muletipleTasks[$taskID]) and $task->assignedTo != $this->app->user->account) continue;
|
||||
if(isset($muletipleTasks[$taskID]) and !isset($muletipleTasks[$taskID][$this->post->assignedTo])) continue;
|
||||
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('task', $taskID);
|
||||
$this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task);
|
||||
|
||||
$changes = $this->task->assign($taskID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$actionID = $this->action->create('task', $taskID, 'Assigned', $this->post->comment, $this->post->assignedTo);
|
||||
|
||||
Reference in New Issue
Block a user