* Finish task #59646.
This commit is contained in:
@@ -745,6 +745,8 @@ class bugModel extends model
|
||||
|
||||
if($bug->execution and $bug->status != $oldBug->status) $this->loadModel('kanban')->updateLane($bug->execution, 'bug');
|
||||
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldBug->feedback) $this->loadModel('feedback')->updateStatus('bug', $oldBug->feedback, $bug->status, $oldBug->status);
|
||||
|
||||
return common::createChanges($oldBug, $bug);
|
||||
}
|
||||
}
|
||||
@@ -845,6 +847,9 @@ class bugModel extends model
|
||||
unset($bug);
|
||||
}
|
||||
|
||||
$isBiz = $this->config->edition == 'biz';
|
||||
$isMax = $this->config->edition == 'max';
|
||||
|
||||
/* Update bugs. */
|
||||
foreach($bugs as $bugID => $bug)
|
||||
{
|
||||
@@ -866,6 +871,12 @@ class bugModel extends model
|
||||
$this->executeHooks($bugID);
|
||||
|
||||
$allChanges[$bugID] = common::createChanges($oldBug, $bug);
|
||||
|
||||
if(($isBiz || $isMax) && $oldBug->feedback && !isset($feedbacks[$oldBug->feedback]))
|
||||
{
|
||||
$feedbacks[$oldBug->feedback] = $oldBug->feedback;
|
||||
$this->loadModel('feedback')->updateStatus('bug', $oldBug->feedback, $bug->status, $oldBug->status);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1138,6 +1149,8 @@ class bugModel extends model
|
||||
/* Link bug to build and release. */
|
||||
$this->linkBugToBuild($bugID, $bug->resolvedBuild);
|
||||
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldBug->feedback) $this->loadModel('feedback')->updateStatus('bug', $oldBug->feedback, $bug->status, $oldBug->status);
|
||||
|
||||
return common::createChanges($oldBug, $bug);
|
||||
}
|
||||
|
||||
@@ -1252,6 +1265,9 @@ class bugModel extends model
|
||||
$modules = array();
|
||||
while($module = $stmt->fetch()) $modules[$module->id] = $module;
|
||||
|
||||
$isBiz = $this->config->edition == 'biz';
|
||||
$isMax = $this->config->edition == 'max';
|
||||
|
||||
$changes = array();
|
||||
foreach($bugIDList as $i => $bugID)
|
||||
{
|
||||
@@ -1297,6 +1313,12 @@ class bugModel extends model
|
||||
|
||||
if($oldBug->execution) $this->loadModel('kanban')->updateLane($oldBug->execution, 'bug');
|
||||
$changes[$bugID] = common::createChanges($oldBug, $bug);
|
||||
|
||||
if(($isBiz || $isMax) && $oldBug->feedback && !isset($feedbacks[$oldBug->feedback]))
|
||||
{
|
||||
$feedbacks[$oldBug->feedback] = $oldBug->feedback;
|
||||
$this->loadModel('feedback')->updateStatus('bug', $oldBug->feedback, $bug->status, $oldBug->status);
|
||||
}
|
||||
}
|
||||
|
||||
/* Link bug to build and release. */
|
||||
@@ -1408,6 +1430,8 @@ class bugModel extends model
|
||||
if(isset($output['toColID'])) $this->kanban->moveCard($bugID, $output['fromColID'], $output['toColID'], $output['fromLaneID'], $output['toLaneID']);
|
||||
}
|
||||
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldBug->feedback) $this->loadModel('feedback')->updateStatus('bug', $oldBug->feedback, $bug->status, $oldBug->status);
|
||||
|
||||
return common::createChanges($oldBug, $bug);
|
||||
}
|
||||
|
||||
|
||||
@@ -958,6 +958,7 @@ class storyModel extends model
|
||||
|
||||
unset($oldStory->parent);
|
||||
unset($story->parent);
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldStory->feedback) $this->loadModel('feedback')->updateStatus('story', $oldStory->feedback, $story->status, $oldStory->status);
|
||||
return common::createChanges($oldStory, $story);
|
||||
}
|
||||
}
|
||||
@@ -1065,6 +1066,8 @@ class storyModel extends model
|
||||
$actionID = $this->loadModel('action')->create('story', $parentID, $action, '', '', '', false);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldParentStory->feedback) $this->loadModel('feedback')->updateStatus('story', $oldParentStory->feedback, $newParentStory->status, $oldParentStory->status);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1290,6 +1293,12 @@ class storyModel extends model
|
||||
if($story->type == 'story') $this->batchChangeStage(array($storyID), $story->stage);
|
||||
if($story->closedReason == 'done') $this->loadModel('score')->create('story', 'close');
|
||||
$allChanges[$storyID] = common::createChanges($oldStory, $story);
|
||||
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldStory->feedback && !isset($feedbacks[$oldStory->feedback]))
|
||||
{
|
||||
$feedbacks[$oldStory->feedback] = $oldStory->feedback;
|
||||
$this->loadModel('feedback')->updateStatus('story', $oldStory->feedback, $story->status, $oldStory->status);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1605,6 +1614,8 @@ class storyModel extends model
|
||||
{
|
||||
$this->setStage($storyID);
|
||||
$this->loadModel('score')->create('story', 'close', $storyID);
|
||||
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldStory->feedback) $this->loadModel('feedback')->updateStatus('story', $oldStory->feedback, $story->status, $oldStory->status);
|
||||
}
|
||||
return common::createChanges($oldStory, $story);
|
||||
}
|
||||
@@ -1668,6 +1679,12 @@ class storyModel extends model
|
||||
if($oldStory->parent > 0) $this->updateParentStatus($storyID, $oldStory->parent);
|
||||
$this->setStage($storyID);
|
||||
$allChanges[$storyID] = common::createChanges($oldStory, $story);
|
||||
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldStory->feedback && !isset($feedbacks[$oldStory->feedback]))
|
||||
{
|
||||
$feedbacks[$oldStory->feedback] = $oldStory->feedback;
|
||||
$this->loadModel('feedback')->updateStatus('story', $oldStory->feedback, $story->status, $oldStory->status);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+53
-19
@@ -754,6 +754,8 @@ class taskModel extends model
|
||||
$actionID = $this->loadModel('action')->create('task', $parentID, $action, '', '', '', false);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $parentTask->feedback) $this->loadModel('feedback')->udpateStatus('task', $parentTask->feedback, $status, $parentTask->status);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1148,6 +1150,9 @@ class taskModel extends model
|
||||
|
||||
unset($oldTask->parent);
|
||||
unset($task->parent);
|
||||
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldTask->feedback) $this->loadModel('feedback')->updateStatus('task', $oldTask->feedback, $task->status, $oldTask->status);
|
||||
|
||||
return common::createChanges($oldTask, $task);
|
||||
}
|
||||
}
|
||||
@@ -1359,6 +1364,8 @@ class taskModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
$isBiz = $this->config->edition == 'biz';
|
||||
$isMax = $this->config->edition == 'max';
|
||||
foreach($tasks as $taskID => $task)
|
||||
{
|
||||
if(strpos(',doing,pause,', $task->status) && empty($teams) && $task->parent >= 0 && empty($task->left))
|
||||
@@ -1418,6 +1425,11 @@ class taskModel extends model
|
||||
if($task->status == 'done') $this->loadModel('score')->create('task', 'finish', $taskID);
|
||||
if($task->status == 'closed') $this->loadModel('score')->create('task', 'close', $taskID);
|
||||
if($task->status != $oldTask->status) $this->loadModel('kanban')->updateLane($oldTask->execution, 'task', $oldTask->id);
|
||||
if(($isBiz || $isMax) && $oldTask->feedback && !isset($feedbacks[$oldTask->feedback]))
|
||||
{
|
||||
$feedbacks[$oldTask->feedback] = $oldTask->feedback;
|
||||
$this->loadModel('feedback')->updateStatus('task', $oldTask->feedback, $task->status, $oldTask->status);
|
||||
}
|
||||
$allChanges[$taskID] = common::createChanges($oldTask, $task);
|
||||
}
|
||||
}
|
||||
@@ -1698,6 +1710,7 @@ class taskModel extends model
|
||||
$this->loadModel('kanban');
|
||||
if(!isset($output['toColID']) or $task->status == 'done') $this->kanban->updateLane($oldTask->execution, 'task', $taskID);
|
||||
if(isset($output['toColID']) and $task->status == 'doing') $this->kanban->moveCard($taskID, $output['fromColID'], $output['toColID'], $output['fromLaneID'], $output['toLaneID']);
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldTask->feedback) $this->loadModel('feedback')->updateStatus('task', $oldTask->feedback, $task->status, $oldTask->status);
|
||||
if(!dao::isError()) return common::createChanges($oldTask, $task);
|
||||
}
|
||||
|
||||
@@ -1969,17 +1982,25 @@ class taskModel extends model
|
||||
->where('id')->eq((int)$taskID)
|
||||
->exec();
|
||||
|
||||
if($oldTask->parent > 0) $this->updateParentStatus($taskID);
|
||||
if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story);
|
||||
if($task->status == 'done' && !dao::isError())
|
||||
if(!dao::isError())
|
||||
{
|
||||
$this->loadModel('score')->create('task', 'finish', $taskID);
|
||||
if($oldTask->parent > 0) $this->updateParentStatus($taskID);
|
||||
if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story);
|
||||
if($task->status == 'done')
|
||||
{
|
||||
$this->loadModel('score')->create('task', 'finish', $taskID);
|
||||
|
||||
$this->loadModel('kanban');
|
||||
if(!isset($output['toColID'])) $this->kanban->updateLane($oldTask->execution, 'task', $taskID);
|
||||
if(isset($output['toColID'])) $this->kanban->moveCard($taskID, $output['fromColID'], $output['toColID'], $output['fromLaneID'], $output['toLaneID']);
|
||||
$this->loadModel('kanban');
|
||||
if(!isset($output['toColID'])) $this->kanban->updateLane($oldTask->execution, 'task', $taskID);
|
||||
if(isset($output['toColID'])) $this->kanban->moveCard($taskID, $output['fromColID'], $output['toColID'], $output['fromLaneID'], $output['toLaneID']);
|
||||
}
|
||||
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldTask->feedback) $this->loadModel('feedback')->updateStatus('task', $oldTask->feedback, $task->status, $oldTask->status);
|
||||
|
||||
return common::createChanges($oldTask, $task);
|
||||
}
|
||||
if(!dao::isError()) return common::createChanges($oldTask, $task);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2060,6 +2081,8 @@ class taskModel extends model
|
||||
if(!isset($output['toColID'])) $this->kanban->updateLane($oldTask->execution, 'task', $taskID);
|
||||
if(isset($output['toColID'])) $this->kanban->moveCard($taskID, $output['fromColID'], $output['toColID'], $output['fromLaneID'], $output['toLaneID']);
|
||||
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldTask->feedback) $this->loadModel('feedback')->updateStatus('task', $oldTask->feedback, $task->status, $oldTask->status);
|
||||
|
||||
return common::createChanges($oldTask, $task);
|
||||
}
|
||||
}
|
||||
@@ -2258,6 +2281,13 @@ class taskModel extends model
|
||||
return $this->processTask($task);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get project id.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getProjectID($executionID = 0)
|
||||
{
|
||||
return $this->dao->select('project')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch('project');
|
||||
@@ -2764,19 +2794,23 @@ class taskModel extends model
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_TASK)->data($data)->where('id')->eq($task->id)->exec();
|
||||
if($task->parent > 0) $this->updateParentStatus($task->id);
|
||||
if($task->story) $this->loadModel('story')->setStage($task->story);
|
||||
if(!dao::isError())
|
||||
{
|
||||
if($task->parent > 0) $this->updateParentStatus($task->id);
|
||||
if($task->story) $this->loadModel('story')->setStage($task->story);
|
||||
|
||||
$oldTask = new stdClass();
|
||||
$oldTask->consumed = $task->consumed;
|
||||
$oldTask->left = $task->left;
|
||||
$oldTask->status = $task->status;
|
||||
$oldTask = new stdClass();
|
||||
$oldTask->consumed = $task->consumed;
|
||||
$oldTask->left = $task->left;
|
||||
$oldTask->status = $task->status;
|
||||
|
||||
$newTask = new stdClass();
|
||||
$newTask->consumed = $data->consumed;
|
||||
$newTask->left = $data->left;
|
||||
$newTask->status = $data->status;
|
||||
if(!dao::isError()) return common::createChanges($oldTask, $newTask);
|
||||
$newTask = new stdClass();
|
||||
$newTask->consumed = $data->consumed;
|
||||
$newTask->left = $data->left;
|
||||
$newTask->status = $data->status;
|
||||
|
||||
return common::createChanges($oldTask, $newTask);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+32
-4
@@ -303,6 +303,7 @@ class todoModel extends model
|
||||
{
|
||||
$this->file->updateObjectID($this->post->uid, $todoID, 'todo');
|
||||
if(!empty($oldTodo->cycle)) $this->createByCycle(array($todoID => $todo));
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $todo->type == 'feedback' && $todo->idvalue) $this->loadModel('feedback')->updateStatus('todo', $todo->idvalue, $todo->status);
|
||||
return common::createChanges($oldTodo, $todo);
|
||||
}
|
||||
}
|
||||
@@ -367,6 +368,12 @@ class todoModel extends model
|
||||
|
||||
if(!dao::isError())
|
||||
{
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $todo->type == 'feedback' && $todo->idvalue && !isset($feedbacks[$todo->idvalue]))
|
||||
{
|
||||
$feedbacks[$todo->idvalue] = $todo->idvalue;
|
||||
$this->loadModel('feedback')->updateStatus('todo', $todo->idvalue, $todo->status);
|
||||
}
|
||||
|
||||
$allChanges[$todoID] = common::createChanges($oldTodo, $todo);
|
||||
}
|
||||
else
|
||||
@@ -409,8 +416,18 @@ class todoModel extends model
|
||||
->set('finishedDate')->eq(helper::now())
|
||||
->where('id')->eq((int)$todoID)
|
||||
->exec();
|
||||
$this->loadModel('action')->create('todo', $todoID, 'finished', '', 'done');
|
||||
return;
|
||||
if(!dao::isError())
|
||||
{
|
||||
$this->loadModel('action')->create('todo', $todoID, 'finished', '', 'done');
|
||||
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max'))
|
||||
{
|
||||
$feedbackID = $this->dao->select('idvalue')->from(TABLE_TODO)->where('id')->eq($todoID)->andWhere('type')->eq('feedback')->fetch('idvalue');
|
||||
if($feedbackID) $this->loadModel('feedback')->updateStatus('todo', $feedbackID, 'done');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -767,8 +784,19 @@ class todoModel extends model
|
||||
->set('assignedDate')->eq($now)
|
||||
->where('id')->eq((int)$todoID)
|
||||
->exec();
|
||||
$this->loadModel('action')->create('todo', $todoID, 'closed', '', 'closed');
|
||||
return !dao::isError();
|
||||
|
||||
if(!dao::isError())
|
||||
{
|
||||
$this->loadModel('action')->create('todo', $todoID, 'closed', '', 'closed');
|
||||
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max'))
|
||||
{
|
||||
$feedbackID = $this->dao->select('idvalue')->from(TABLE_TODO)->where('id')->eq($todoID)->andWhere('type')->eq('feedback')->fetch('idvalue');
|
||||
if($feedbackID) $this->loadModel('feedback')->updateStatus('todo', $feedbackID, 'closed');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user