resolve conflict
This commit is contained in:
+3
-17
@@ -790,11 +790,7 @@ 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);
|
||||
if(in_array($bug->status, array('resolved', 'closed'))) $this->loadModel('action')->create('feedback', $oldBug->feedback, 'processed', '', "bug {$bug->status}");
|
||||
}
|
||||
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);
|
||||
}
|
||||
@@ -932,7 +928,6 @@ class bugModel extends model
|
||||
{
|
||||
$feedbacks[$oldBug->feedback] = $oldBug->feedback;
|
||||
$this->loadModel('feedback')->updateStatus('bug', $oldBug->feedback, $bug->status, $oldBug->status);
|
||||
if(in_array($bug->status, array('resolved', 'closed'))) $this->loadModel('action')->create('feedback', $oldBug->feedback, 'processed', '', "bug {$bug->status}");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1230,11 +1225,7 @@ 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);
|
||||
if(in_array($bug->status, array('resolved', 'closed'))) $this->loadModel('action')->create('feedback', $oldBug->feedback, 'processed', '', "bug {$bug->status}");
|
||||
}
|
||||
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);
|
||||
}
|
||||
@@ -1413,7 +1404,6 @@ class bugModel extends model
|
||||
{
|
||||
$feedbacks[$oldBug->feedback] = $oldBug->feedback;
|
||||
$this->loadModel('feedback')->updateStatus('bug', $oldBug->feedback, $bug->status, $oldBug->status);
|
||||
$this->loadModel('action')->create('feedback', $oldBug->feedback, 'processed', '', 'bug resolved');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1526,11 +1516,7 @@ 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);
|
||||
$this->loadModel('action')->create('feedback', $oldBug->feedback, 'processed', '', 'bug closed');
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
+4
-22
@@ -363,11 +363,7 @@ class storyModel extends model
|
||||
$this->loadModel('action')->create('bug', $bugID, 'ToStory', '', $storyID);
|
||||
$this->action->create('bug', $bugID, 'Closed');
|
||||
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && !dao::isError() && $oldBug->feedback)
|
||||
{
|
||||
$this->loadModel('feedback')->updateStatus('bug', $oldBug->feedback, 'closed', $oldBug->status);
|
||||
$this->loadModel('action')->create('feedback', $oldBug->feedback, 'processed', '', "bug closed");
|
||||
}
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && !dao::isError() && $oldBug->feedback) $this->loadModel('feedback')->updateStatus('bug', $oldBug->feedback, 'closed', $oldBug->status);
|
||||
|
||||
/* add files to story from bug. */
|
||||
$files = $this->dao->select('*')->from(TABLE_FILE)
|
||||
@@ -1024,11 +1020,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);
|
||||
if($story->status == 'closed') $this->loadModel('action')->create('feedback', $oldStory->feedback, 'processed', '', "story {$story->status}");
|
||||
}
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldStory->feedback) $this->loadModel('feedback')->updateStatus('story', $oldStory->feedback, $story->status, $oldStory->status);
|
||||
|
||||
$linkStoryField = $oldStory->type == 'story' ? 'linkStories' : 'linkRequirements';
|
||||
$linkStories = explode(',', $story->{$linkStoryField});
|
||||
@@ -1163,11 +1155,7 @@ class storyModel extends model
|
||||
$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);
|
||||
if($newParentStory->status == 'closed') $this->loadModel('action')->create('feedback', $oldParentStory->feedback, 'processed', '', "story {$newParentStory->status}");
|
||||
}
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldParentStory->feedback) $this->loadModel('feedback')->updateStatus('story', $oldParentStory->feedback, $newParentStory->status, $oldParentStory->status);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1407,7 +1395,6 @@ class storyModel extends model
|
||||
{
|
||||
$feedbacks[$oldStory->feedback] = $oldStory->feedback;
|
||||
$this->loadModel('feedback')->updateStatus('story', $oldStory->feedback, $story->status, $oldStory->status);
|
||||
if($story->status == 'closed') $this->loadModel('action')->create('feedback', $oldStory->feedback, 'processed', '', "story {$story->status}");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1809,11 +1796,7 @@ 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);
|
||||
$this->loadModel('action')->create('feedback', $oldStory->feedback, 'processed', '', "story closed");
|
||||
}
|
||||
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);
|
||||
}
|
||||
@@ -1882,7 +1865,6 @@ class storyModel extends model
|
||||
{
|
||||
$feedbacks[$oldStory->feedback] = $oldStory->feedback;
|
||||
$this->loadModel('feedback')->updateStatus('story', $oldStory->feedback, $story->status, $oldStory->status);
|
||||
$this->loadModel('action')->create('feedback', $oldStory->feedback, 'processed', '', "story closed");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
+5
-21
@@ -752,11 +752,7 @@ class taskModel extends model
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldParentTask->feedback)
|
||||
{
|
||||
$this->loadModel('feedback')->updateStatus('task', $oldParentTask->feedback, $newParentTask->status, $oldParentTask->status);
|
||||
if(in_array($newParentTask->status, array('done', 'closed'))) $this->loadModel('action')->create('feedback', $oldParentTask->feedback, 'processed', '', "task {$newParentTask->status}");
|
||||
}
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldParentTask->feedback) $this->loadModel('feedback')->updateStatus('task', $oldParentTask->feedback, $newParentTask->status, $oldParentTask->status);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1253,11 +1249,8 @@ 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);
|
||||
if(in_array($task->status, array('done', 'closed'))) $this->loadModel('action')->create('feedback', $oldTask->feedback, 'processed', '', "task {$task->status}");
|
||||
}
|
||||
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldTask->feedback) $this->loadModel('feedback')->updateStatus('task', $oldTask->feedback, $task->status, $oldTask->status);
|
||||
|
||||
if(isset($oldTask->team))
|
||||
{
|
||||
$users = $this->loadModel('user')->getPairs('noletter|noempty');
|
||||
@@ -1548,7 +1541,6 @@ class taskModel extends model
|
||||
{
|
||||
$feedbacks[$oldTask->feedback] = $oldTask->feedback;
|
||||
$this->loadModel('feedback')->updateStatus('task', $oldTask->feedback, $task->status, $oldTask->status);
|
||||
if(in_array($task->status, array('done', 'closed'))) $this->loadModel('action')->create('feedback', $oldTask->feedback, 'processed', '', "task {$task->status}");
|
||||
}
|
||||
$allChanges[$taskID] = common::createChanges($oldTask, $task);
|
||||
}
|
||||
@@ -2059,11 +2051,7 @@ class taskModel extends model
|
||||
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);
|
||||
$this->loadModel('action')->create('feedback', $oldTask->feedback, 'processed', '', "task done");
|
||||
}
|
||||
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);
|
||||
}
|
||||
@@ -2149,11 +2137,7 @@ 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);
|
||||
$this->loadModel('action')->create('feedback', $oldTask->feedback, 'processed', '', "task closed");
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -305,11 +305,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);
|
||||
if(in_array($todo->status, array('done', 'closed'))) $this->loadModel('action')->create('feedback', $todo->idvalue, 'processed', '', "todo {$todo->status}");
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -381,7 +377,6 @@ class todoModel extends model
|
||||
{
|
||||
$feedbacks[$todo->idvalue] = $todo->idvalue;
|
||||
$this->loadModel('feedback')->updateStatus('todo', $todo->idvalue, $todo->status);
|
||||
if(in_array($todo->status, array('done', 'closed'))) $this->loadModel('action')->create('feedback', $todo->idvalue, 'processed', '', "todo {$todo->status}");
|
||||
}
|
||||
|
||||
$allChanges[$todoID] = common::createChanges($oldTodo, $todo);
|
||||
@@ -434,7 +429,6 @@ class todoModel extends model
|
||||
{
|
||||
$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');
|
||||
$this->loadModel('action')->create('feedback', $feedbackID, 'processed', '', 'todo done');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -804,7 +798,6 @@ class todoModel extends model
|
||||
{
|
||||
$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');
|
||||
$this->loadModel('action')->create('feedback', $feedbackID, 'processed', '', 'todo closed');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -706,6 +706,8 @@ class upgradeModel extends model
|
||||
$this->addFlowActions('biz7.4');
|
||||
$this->addFlowFields('biz7.4');
|
||||
break;
|
||||
case 'biz7_6':
|
||||
$this->processFeedbackModule();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7278,4 +7280,59 @@ class upgradeModel extends model
|
||||
|
||||
$this->dao->delete()->from(TABLE_TEAM)->where('type')->eq('task')->exec();
|
||||
}
|
||||
|
||||
/*
|
||||
* Process feedback module
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function processFeedbackModule()
|
||||
{
|
||||
|
||||
$products = $this->dao->select('id, name')->from(TABLE_PRODUCT)->fetchAll();
|
||||
$modules = $this->dao->select('*')->from(TABLE_MODULE)->where('type')->eq('feedback')->andWhere('root')->eq(0)->fetchAll('id');
|
||||
$feedbacks = $this->dao->select('*')->from(TABLE_FEEDBACK)->fetchAll();
|
||||
|
||||
$allProductRelation = array();
|
||||
foreach($products as $product)
|
||||
{
|
||||
$productID = $product->id;
|
||||
$relation = array();
|
||||
foreach($modules as $moduleID => $module)
|
||||
{
|
||||
unset($module->id);
|
||||
$module->root = $productID;
|
||||
$this->dao->insert(TABLE_MODULE)->data($module)->exec();
|
||||
$newModuleID = $this->dao->lastInsertID();
|
||||
$relation[$moduleID] = $newModuleID;
|
||||
$allProductRelation[$productID][$moduleID] = $newModuleID;
|
||||
$newPaths = array();
|
||||
foreach(explode(',', trim($module->path, ',')) as $path)
|
||||
{
|
||||
if(isset($relation[$path])) $newPaths[] = $relation[$path];
|
||||
}
|
||||
$newPaths = join(',', $newPaths);
|
||||
$parent = !empty($module->parent) and isset($relation[$module->parent]) ? $relation[$module->parent] : 0;
|
||||
$this->dao->update(TABLE_MODULE)->set('path')->eq($newPaths)->set('parent')->eq($parent)->where('id')->eq($newModuleID)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
/* Update feedback module */
|
||||
foreach($feedbacks as $feedback)
|
||||
{
|
||||
$moduleID = $feedback->module;
|
||||
$product = $feedback->product;
|
||||
if(empty($moduleID)) continue;
|
||||
$newModuleID = $allProductRelation[$product][$moduleID];
|
||||
if(empty($newModuleID)) continue;
|
||||
|
||||
$this->dao->update(TABLE_FEEDBACK)->set('module')->eq($newModuleID)->where('id')->eq($feedback->id)->exec();
|
||||
}
|
||||
|
||||
/* Delete history module */
|
||||
$this->dao->delete()->from(TABLE_MODULE)->where('type')->eq('feedback')->andWhere('root')->eq(0)->exec();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user