diff --git a/module/my/control.php b/module/my/control.php index 5937f71649..8c62335e4c 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -408,13 +408,23 @@ EOF; /* Get tasks. */ $tasks = $this->loadModel('task')->getUserTasks($this->app->user->account, $type, 0, $pager, $sort); - $parents = array(); + $parents = array(); + $executionIDList = array(); foreach($tasks as $task) { + if($this->config->systemMode == 'new') $executionIDList[$task->execution] = $task->execution; if($task->parent > 0) $parents[$task->parent] = $task->parent; } $parents = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($parents)->fetchAll('id'); + if($this->config->systemMode == 'new') + { + $projectPairs = $this->dao->select('t2.id,t1.name')->from(TABLE_PROJECT)->alias('t1') + ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.id=t2.parent') + ->where('t2.id')->in($executionIDList) + ->fetchPairs(); + } + foreach($tasks as $task) { if($task->parent > 0) @@ -436,21 +446,21 @@ EOF; $this->app->loadLang('story'); /* Assign. */ - $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->task; - $this->view->position[] = $this->lang->my->task; - $this->view->tabID = 'task'; - $this->view->tasks = $tasks; - $this->view->summary = $this->loadModel('execution')->summary($tasks); - $this->view->type = $type; - $this->view->kanbanList = $this->execution->getPairs(0, 'kanban'); - $this->view->recTotal = $recTotal; - $this->view->recPerPage = $recPerPage; - $this->view->pageID = $pageID; - $this->view->orderBy = $orderBy; - $this->view->projects = $this->loadModel('project')->getPairsByProgram(); - $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->pager = $pager; - $this->view->mode = 'task'; + $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->task; + $this->view->position[] = $this->lang->my->task; + $this->view->tabID = 'task'; + $this->view->tasks = $tasks; + $this->view->summary = $this->loadModel('execution')->summary($tasks); + $this->view->type = $type; + $this->view->kanbanList = $this->execution->getPairs(0, 'kanban'); + $this->view->recTotal = $recTotal; + $this->view->recPerPage = $recPerPage; + $this->view->pageID = $pageID; + $this->view->orderBy = $orderBy; + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->pager = $pager; + $this->view->mode = 'task'; + $this->view->projectPairs = isset($projectPairs) ? $projectPairs : array(); if($this->app->viewType == 'json') $this->view->tasks = array_values($this->view->tasks); $this->display(); diff --git a/module/my/view/task.html.php b/module/my/view/task.html.php index ca0ef8eade..535768923a 100644 --- a/module/my/view/task.html.php +++ b/module/my/view/task.html.php @@ -100,7 +100,7 @@ children)) echo '';?> systemMode == 'new'):?> - createLink('project', 'index', "projectID=$task->project"), $task->projectName);?> + createLink('project', 'index', "projectID=$task->project"), zget($projectPairs, $task->execution, ''));?> createLink('execution', 'task', "executionID=$task->execution"), $task->executionName, '');?> diff --git a/module/task/model.php b/module/task/model.php index a2c8691cd9..c6d1ebca6e 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -326,7 +326,7 @@ class taskModel extends model $data[$i]->openedBy = $this->app->user->account; $data[$i]->openedDate = $now; $data[$i]->parent = $tasks->parent[$i]; - $data[$i]->vision = isset($tasks->vision[$i]) ? $tasks->vision[$i] : 'common'; + $data[$i]->vision = isset($tasks->vision[$i]) ? $tasks->vision[$i] : 'rnd'; if($story) $data[$i]->storyVersion = $this->loadModel('story')->getVersion($data[$i]->story); if($assignedTo) $data[$i]->assignedDate = $now; if(strpos($this->config->task->create->requiredFields, 'estStarted') !== false and empty($estStarted)) $data[$i]->estStarted = ''; diff --git a/module/upgrade/model.php b/module/upgrade/model.php index d60247161f..3899aec5fd 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -461,7 +461,6 @@ class upgradeModel extends model } $this->deletePatch(); - $this->adjustPRJ4Task(); return true; } @@ -5959,24 +5958,4 @@ class upgradeModel extends model } file_put_contents($filePath, $content); } - - /** - * Adjust the project field of the zt_task. - * - * @access public - * @return bool - */ - public function adjustPRJ4Task() - { - $executionPairs = $this->dao->select('id,project')->from(TABLE_PROJECT)->where('type')->in('sprint,stage,kanban')->fetchPairs(); - $noProjectTasks = $this->dao->select('*')->from(TABLE_TASK)->where('project')->eq(0)->fetchAll('id'); - foreach($noProjectTasks as $taskID => $task) - { - if(!$task->execution) continue; - $projectID = zget($executionPairs, $task->execution, 0); - $this->dao->update(TABLE_TASK)->set('project')->eq($projectID)->where('id')->eq($taskID)->exec(); - } - - return true; - } }