From 361af390939852b07fd4fdab9588fb02cd0ee62f Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 5 Mar 2021 09:25:26 +0800 Subject: [PATCH] * adjust code for todo module. --- module/todo/control.php | 14 +++++++------- module/todo/js/view.js | 2 +- module/todo/model.php | 12 ++++++------ module/todo/view/view.html.php | 8 ++++---- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/module/todo/control.php b/module/todo/control.php index 56615c8b73..06b55c6080 100644 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -399,8 +399,8 @@ class todo extends control $this->lang->set('menugroup.todo', $from); } - $projects = $this->loadModel('program')->getPRJPairs(); - if(!isset($this->session->PRJ)) $this->session->set('PRJ', key($projects)); + $projects = $this->loadModel('project')->getPairs(); + if(!isset($this->session->project)) $this->session->set('project', key($projects)); $this->view->title = $this->app->user->account == $todo->account ? "{$this->lang->todo->common} #$todo->id $todo->name" : $this->lang->todo->common ; $this->view->position[] = $this->lang->todo->view; @@ -411,9 +411,9 @@ class todo extends control $this->view->actions = $this->loadModel('action')->getList('todo', $todoID); $this->view->from = $from; $this->view->projects = $projects; - $this->view->executions = $this->loadModel('project')->getExecutionPairs($this->session->PRJ); + $this->view->executions = $this->loadModel('execution')->getPairs($this->session->project); $this->view->products = $this->loadModel('product')->getPairs(); - $this->view->projectProducts = $this->loadModel('product')->getProductPairsByProject($this->session->PRJ); + $this->view->projectProducts = $this->loadModel('product')->getProductPairsByProject($this->session->project); $this->display(); } @@ -661,9 +661,9 @@ class todo extends control */ public function ajaxGetExecutionPairs($projectID) { - $this->session->set('PRJ', $projectID); + $this->session->set('project', $projectID); - $executions = $this->loadModel('project')->getExecutionsByProject($projectID, 'undone'); + $executions = $this->loadModel('execution')->getByProject($projectID, 'undone'); foreach($executions as $id => $execution) $executions[$id] = $execution->name; die(html::select('execution', $executions, '', "class='form-control chosen'")); @@ -678,7 +678,7 @@ class todo extends control */ public function ajaxGetProductPairs($projectID) { - $this->session->set('PRJ', $projectID); + $this->session->set('project', $projectID); $products = $this->loadModel('product')->getProductPairsByProject($projectID); die(html::select('product', $products, '', "class='form-control chosen'")); diff --git a/module/todo/js/view.js b/module/todo/js/view.js index fa303d8f09..70b1d6c92b 100644 --- a/module/todo/js/view.js +++ b/module/todo/js/view.js @@ -22,7 +22,7 @@ $(function() } var onlybody = config.onlybody; var projectID = $('#project').val(); - var link = createLink('task', 'create', 'projectID=' + executionID + '&storyID=0&moduleID=0&taskID=0&todoID=' + todoID, config.defaultView, 'no', projectID); + var link = createLink('task', 'create', 'executionID=' + executionID + '&storyID=0&moduleID=0&taskID=0&todoID=' + todoID, config.defaultView, 'no', projectID); location.href = link; }) diff --git a/module/todo/model.php b/module/todo/model.php index 0ad17ce375..213e01ce63 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -758,12 +758,12 @@ class todoModel extends model } $todoIdList = array_unique($todoIdList); - if($type == 'task') $projectIdList[$type] = $this->dao->select('id,PRJ')->from(TABLE_TASK)->where('id')->in($todoIdList)->fetchPairs('id', 'PRJ'); - if($type == 'bug') $projectIdList[$type] = $this->dao->select('id,PRJ')->from(TABLE_BUG)->where('id')->in($todoIdList)->fetchPairs('id', 'PRJ'); - if($type == 'issue') $projectIdList[$type] = $this->dao->select('id,PRJ')->from(TABLE_ISSUE)->where('id')->in($todoIdList)->fetchPairs('id', 'PRJ'); - if($type == 'risk') $projectIdList[$type] = $this->dao->select('id,PRJ')->from(TABLE_RISK)->where('id')->in($todoIdList)->fetchPairs('id', 'PRJ'); - if($type == 'review') $projectIdList[$type] = $this->dao->select('id,PRJ')->from(TABLE_REVIEW)->where('id')->in($todoIdList)->fetchPairs('id', 'PRJ'); - if($type == 'testtask') $projectIdList[$type] = $this->dao->select('id,PRJ')->from(TABLE_TESTTASK)->where('id')->in($todoIdList)->fetchPairs('id', 'PRJ'); + if($type == 'task') $projectIdList[$type] = $this->dao->select('id,project')->from(TABLE_TASK)->where('id')->in($todoIdList)->fetchPairs('id', 'project'); + if($type == 'bug') $projectIdList[$type] = $this->dao->select('id,project')->from(TABLE_BUG)->where('id')->in($todoIdList)->fetchPairs('id', 'project'); + if($type == 'issue') $projectIdList[$type] = $this->dao->select('id,project')->from(TABLE_ISSUE)->where('id')->in($todoIdList)->fetchPairs('id', 'project'); + if($type == 'risk') $projectIdList[$type] = $this->dao->select('id,project')->from(TABLE_RISK)->where('id')->in($todoIdList)->fetchPairs('id', 'project'); + if($type == 'review') $projectIdList[$type] = $this->dao->select('id,project')->from(TABLE_REVIEW)->where('id')->in($todoIdList)->fetchPairs('id', 'project'); + if($type == 'testtask') $projectIdList[$type] = $this->dao->select('id,project')->from(TABLE_TESTTASK)->where('id')->in($todoIdList)->fetchPairs('id', 'project'); } return $projectIdList; diff --git a/module/todo/view/view.html.php b/module/todo/view/view.html.php index 5a919babe1..a9c7c7547f 100644 --- a/module/todo/view/view.html.php +++ b/module/todo/view/view.html.php @@ -78,7 +78,7 @@ echo ""; echo ""; if($isonlybody) $_GET['onlybody'] = 'yes'; @@ -187,12 +187,12 @@
-