Merge branch 'jihu' of https://gitlab.zcorp.cc/easycorp/zentaopms into jihu
This commit is contained in:
@@ -2449,6 +2449,10 @@ class execution extends control
|
||||
$_POST = array();
|
||||
foreach($storyIdList as $storyID)
|
||||
{
|
||||
/* Delete related issue in gitlab. */
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
|
||||
if(!empty($relation)) $this->loadModel('gitlab')->deleteIssue('story', $storyID, $relation->issueID);
|
||||
|
||||
$this->execution->unlinkStory($executionID, $storyID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,7 +295,6 @@ class gitlabModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
>>>>>>> 388f6365c925b48fc5fe9db65977f00ad4bda236
|
||||
* Get current user.
|
||||
*
|
||||
* @param string $host
|
||||
|
||||
+14
-48
@@ -830,16 +830,8 @@ class storyModel extends model
|
||||
$this->dao->insert(TABLE_STORYREVIEW)->data($reviewData)->exec();
|
||||
}
|
||||
/* update story to gitlab issue. */
|
||||
$object = $this->getByID($storyID);
|
||||
|
||||
if(!empty($object))
|
||||
{
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
|
||||
if($relation)
|
||||
{
|
||||
if(!empty($object)) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $object);
|
||||
}
|
||||
}
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
|
||||
if($relation) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story);
|
||||
|
||||
unset($oldStory->parent);
|
||||
unset($story->parent);
|
||||
@@ -1168,16 +1160,8 @@ class storyModel extends model
|
||||
if($oldStory->plan != $story->plan) $this->updateStoryOrderOfPlan($storyID, $story->plan, $oldStory->plan);
|
||||
|
||||
/* update story to gitlab issue. */
|
||||
$object = $this->getByID($storyID);
|
||||
|
||||
if(!empty($object))
|
||||
{
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
|
||||
if($relation)
|
||||
{
|
||||
if(!empty($object)) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $object);
|
||||
}
|
||||
}
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
|
||||
if(!empty($relation)) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story);
|
||||
|
||||
$this->executeHooks($storyID);
|
||||
if($story->type == 'story') $this->batchChangeStage(array($storyID), $story->stage);
|
||||
@@ -1446,17 +1430,13 @@ class storyModel extends model
|
||||
->checkIF($story->closedReason == 'duplicate', 'duplicateStory', 'notempty')
|
||||
->where('id')->eq($storyID)->exec();
|
||||
|
||||
$object = $this->getByID($storyID);
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
|
||||
|
||||
if(!empty($relation))
|
||||
{
|
||||
$singleIssue = $this->loadModel('gitlab')->apiGetSingleIssue($relation->gitlabID, $relation->issueID);
|
||||
|
||||
if($singleIssue->state != 'closed')
|
||||
{
|
||||
if(!empty($object)) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $object);
|
||||
}
|
||||
if($singleIssue->state != 'closed') $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story);
|
||||
}
|
||||
|
||||
/* Update parent story status. */
|
||||
@@ -1526,17 +1506,11 @@ class storyModel extends model
|
||||
$this->setStage($storyID);
|
||||
$allChanges[$storyID] = common::createChanges($oldStory, $story);
|
||||
|
||||
$object = $this->getByID($storyID);
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
|
||||
|
||||
if(!empty($relation))
|
||||
{
|
||||
$singleIssue = $this->loadModel('gitlab')->apiGetSingleIssue($relation->gitlabID, $relation->issueID);
|
||||
|
||||
if($singleIssue->state != 'closed')
|
||||
{
|
||||
if(!empty($object)) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $object);
|
||||
}
|
||||
if($singleIssue->state != 'closed') $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1816,13 +1790,8 @@ class storyModel extends model
|
||||
if(!dao::isError())
|
||||
{
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
|
||||
$attribute = $this->getByID($storyID);
|
||||
$attribute->assignee_id = $this->loadModel('gitlab')->getGitlabUserID($relation->gitlabID, $story->assignedTo);
|
||||
if($attribute->assignee_id != '')
|
||||
{
|
||||
// TODO(dingguodong) we should alert to operator when can not find the user, and the operator should reconfigure user binding.
|
||||
$this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $attribute);
|
||||
}
|
||||
$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);
|
||||
return common::createChanges($oldStory, $story);
|
||||
}
|
||||
return false;
|
||||
@@ -1856,15 +1825,8 @@ class storyModel extends model
|
||||
if(!dao::isError())
|
||||
{
|
||||
/* Push this story to gitlab issue. */
|
||||
$object = $this->getByID($storyID);
|
||||
if(!empty($object))
|
||||
{
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
|
||||
if($relation)
|
||||
{
|
||||
if(!empty($object)) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $object);
|
||||
}
|
||||
}
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
|
||||
if(!empty($relation)) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story);
|
||||
}
|
||||
}
|
||||
return $allChanges;
|
||||
@@ -1900,6 +1862,10 @@ class storyModel extends model
|
||||
/* Update parent story status. */
|
||||
if($oldStory->parent > 0) $this->updateParentStatus($storyID, $oldStory->parent);
|
||||
|
||||
/* 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);
|
||||
|
||||
return common::createChanges($oldStory, $story);
|
||||
}
|
||||
|
||||
|
||||
+12
-35
@@ -999,18 +999,9 @@ class taskModel extends model
|
||||
->batchCheckIF($task->closedReason == 'cancel', 'finishedBy, finishedDate', 'empty')
|
||||
->where('id')->eq((int)$taskID)->exec();
|
||||
|
||||
/* update story to gitlab issue. */
|
||||
$object = $this->getByID($taskID);
|
||||
|
||||
if(!empty($object))
|
||||
{
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('task', $taskID);
|
||||
if($relation)
|
||||
{
|
||||
if(!empty($object)) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $object);
|
||||
}
|
||||
|
||||
}
|
||||
/* update story to gitlab issue. */
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('task', $taskID);
|
||||
if(!empty($relation)) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task);
|
||||
|
||||
if(!dao::isError())
|
||||
{
|
||||
@@ -1398,13 +1389,8 @@ class taskModel extends model
|
||||
->where('id')->eq($taskID)->exec();
|
||||
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('task', $taskID);
|
||||
$attribute = $this->getByID($taskID);
|
||||
$attribute->assignee_id = $this->loadModel('gitlab')->getGitlabUserID($relation->gitlabID, $task->assignedTo);
|
||||
if($attribute->assignee_id != '')
|
||||
{
|
||||
// TODO(dingguodong) we should alert to operator when can not find the user, and the operator should reconfigure user binding.
|
||||
$this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, $attribute);
|
||||
}
|
||||
$task->assignee_id = $this->loadModel('gitlab')->getGitlabUserID($relation->gitlabID, $task->assignedTo);
|
||||
if($task->assignee_id != '') $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, $task);
|
||||
|
||||
if(!dao::isError()) return common::createChanges($oldTask, $task);
|
||||
}
|
||||
@@ -1746,12 +1732,7 @@ class taskModel extends model
|
||||
{
|
||||
$singleIssue = new stdclass();
|
||||
$singleIssue = $this->loadModel('gitlab')->apiGetSingleIssue($relation->gitlabID, $relation->issueID);
|
||||
|
||||
if($singleIssue->state != 'closed')
|
||||
{
|
||||
$object = $this->getByID($taskID);
|
||||
$this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $object);
|
||||
}
|
||||
if($singleIssue->state != 'closed') $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task);
|
||||
}
|
||||
|
||||
if($oldTask->parent > 0) $this->updateParentStatus($taskID);
|
||||
@@ -1810,17 +1791,13 @@ class taskModel extends model
|
||||
|
||||
$this->dao->update(TABLE_TASK)->data($task)->autoCheck()->where('id')->eq((int)$taskID)->exec();
|
||||
|
||||
$object = $this->getByID($bugID);
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('task', $taskID);
|
||||
if(!empty($relation))
|
||||
{
|
||||
$singleIssue = new stdclass();
|
||||
$singleIssue = $this->loadModel('gitlab')->apiGetSingleIssue($relation->gitlabID, $relation->issueID);
|
||||
|
||||
if($singleIssue->state != 'closed')
|
||||
{
|
||||
if(!empty($object)) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $object);
|
||||
}
|
||||
if($singleIssue->state != 'closed') $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $task);
|
||||
}
|
||||
|
||||
if(!dao::isError())
|
||||
@@ -1867,17 +1844,13 @@ class taskModel extends model
|
||||
}
|
||||
if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story);
|
||||
|
||||
$object = $this->getByID($taskID);
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('task', $taskID);
|
||||
if(!empty($relation))
|
||||
{
|
||||
$singleIssue = new stdclass();
|
||||
$singleIssue = $this->loadModel('gitlab')->apiGetSingleIssue($relation->gitlabID, $relation->issueID);
|
||||
|
||||
if($singleIssue->state != 'closed')
|
||||
{
|
||||
if(!empty($object)) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $object);
|
||||
}
|
||||
if($singleIssue->state != 'closed') $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task);
|
||||
}
|
||||
|
||||
if(!dao::isError()) return common::createChanges($oldTask, $task);
|
||||
@@ -1944,6 +1917,10 @@ class taskModel extends model
|
||||
$this->computeWorkingHours($taskID);
|
||||
}
|
||||
if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story);
|
||||
|
||||
$relation = $this->loadModel('gitlab')->getRelationByObject('task', $taskID);
|
||||
if(!empty($relation)) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task);
|
||||
|
||||
if(!dao::isError()) return common::createChanges($oldTask, $task);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user