From 7973da34a61b2aa10aed0f9ed5eb7014617f0898 Mon Sep 17 00:00:00 2001 From: zenggang Date: Tue, 26 Jul 2022 06:03:35 +0000 Subject: [PATCH 1/8] * Finish task#61964 --- module/block/control.php | 20 ++++++++------ module/block/model.php | 8 +++--- module/bug/model.php | 1 + module/my/control.php | 3 ++- module/my/model.php | 55 ++++++++++++++++++++++++++++++--------- module/testtask/model.php | 2 ++ module/user/model.php | 26 ++++++++++-------- 7 files changed, 80 insertions(+), 35 deletions(-) diff --git a/module/block/control.php b/module/block/control.php index e7baea9b88..fecf665e14 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -1748,6 +1748,7 @@ class block extends control ->beginIF($objectType == 'story' or $objectType == 'requirement')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')->fi() ->beginIF($objectType == 'bug')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')->fi() ->beginIF($objectType == 'task')->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.execution=t2.id')->fi() + ->beginIF($objectType == 'issue' or $objectType == 'risk')->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id')->fi() ->where('t1.deleted')->eq(0) ->andWhere('t1.assignedTo')->eq($this->app->user->account)->fi() ->beginIF($objectType == 'story')->andWhere('t1.type')->eq('story')->andWhere('t2.deleted')->eq('0')->fi() @@ -1757,6 +1758,7 @@ class block extends control ->beginIF($objectType == 'todo')->andWhere('t1.cycle')->eq(0)->andWhere('t1.status')->eq('wait')->andWhere('t1.vision')->eq($this->config->vision)->fi() ->beginIF($objectType != 'todo')->andWhere('t1.status')->ne('closed')->fi() ->beginIF($objectType == 'feedback')->andWhere('t1.status')->in('wait, noreview')->fi() + ->beginIF($objectType == 'issue' or $objectType == 'risk')->andWhere('t2.deleted')->eq(0)->fi() ->orderBy($orderBy) ->beginIF($limitCount)->limit($limitCount)->fi() ->fetchAll(); @@ -1813,16 +1815,18 @@ class block extends control $now = date('H:i:s', strtotime(helper::now())); $meetingCount = isset($params->meetingCount) ? isset($params->meetingCount) : 0; - $meetings = $this->dao->select('*')->from(TABLE_MEETING) - ->where('deleted')->eq('0') - ->andWhere('(date')->gt($today) - ->orWhere('(begin')->gt($now) - ->andWhere('date')->eq($today) + $meetings = $this->dao->select('*')->from(TABLE_MEETING)->alias('t1') + ->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') + ->where('t1.deleted')->eq('0') + ->andWhere('t2.deleted')->eq('0') + ->andWhere('(t1.date')->gt($today) + ->orWhere('(t1.begin')->gt($now) + ->andWhere('t1.date')->eq($today) ->markRight(2) - ->andwhere('(host')->eq($this->app->user->account) - ->orWhere('participant')->in($this->app->user->account) + ->andwhere('(t1.host')->eq($this->app->user->account) + ->orWhere('t1.participant')->in($this->app->user->account) ->markRight(1) - ->orderBy('id_desc') + ->orderBy('t1.id_desc') ->beginIF($meetingCount)->limit($meetingCount)->fi() ->fetchAll(); diff --git a/module/block/model.php b/module/block/model.php index 1c9b01f470..837f4435f7 100644 --- a/module/block/model.php +++ b/module/block/model.php @@ -185,9 +185,11 @@ class blockModel extends model $data['tasks'] = isset($tasks->tasks) ? $tasks->tasks : 0; $data['doneTasks'] = isset($tasks->doneTasks) ? $tasks->doneTasks : 0; - $data['bugs'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_BUG) - ->where('assignedTo')->eq($this->app->user->account) - ->andWhere('deleted')->eq(0) + $data['bugs'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_BUG)->alias('t1') + ->leftJoin(TABLE_PRODUCT)->alias('t2')->on("t1.product = t2.id") + ->where('t1.assignedTo')->eq($this->app->user->account) + ->andWhere('t1.deleted')->eq(0) + ->andWhere('t2.deleted')->eq(0) ->fetch('count'); $data['stories'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_STORY)->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id') diff --git a/module/bug/model.php b/module/bug/model.php index d68d6e40da..69f4486fdc 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1691,6 +1691,7 @@ class bugModel extends model return $this->dao->select('t1.*,t2.name as productName')->from(TABLE_BUG)->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id') ->where('t1.deleted')->eq(0) + ->andWhere('t2.deleted')->eq('0') ->beginIF($type == 'bySearch')->andWhere($query)->fi() ->beginIF($executionID)->andWhere('t1.execution')->eq($executionID)->fi() ->beginIF($type != 'closedBy' and $this->app->moduleName == 'block')->andWhere('t1.status')->ne('closed')->fi() diff --git a/module/my/control.php b/module/my/control.php index f9b16e7c7a..e03cf44f96 100755 --- a/module/my/control.php +++ b/module/my/control.php @@ -993,7 +993,7 @@ EOF; * @access public * @return void */ - public function nc($browseType = 'assignedToMe', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function nc($browseType = 'assignedToMe', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { $this->loadModel('nc'); $this->session->set('ncList', $this->app->getURI(true)); @@ -1015,6 +1015,7 @@ EOF; $this->view->projects = $this->loadModel('project')->getPairsByProgram(); $this->view->pager = $pager; $this->view->orderBy = $orderBy; + $this->view->param = $param; $this->view->mode = 'nc'; $this->display(); } diff --git a/module/my/model.php b/module/my/model.php index efd54ce73d..ec5ba989ea 100644 --- a/module/my/model.php +++ b/module/my/model.php @@ -334,21 +334,52 @@ class myModel extends model ->fetchAll('objectID'); if(empty($objectIDList)) return array(); - $objectList = $this->dao->select('*')->from($this->config->objectTables[$module]) - ->where('deleted')->eq(0) - ->andWhere('id')->in(array_keys($objectIDList)) - ->beginIF($objectType == 'requirement' or $objectType == 'story')->andWhere('type')->eq($objectType)->fi() - ->orderBy($orderBy) - ->page($pager) - ->fetchAll('id'); + if($objectType == 'task') + { + $objectList = $this->dao->select('t1.*, t2.name as executionName')->from($this->config->objectTables[$module])->alias('t1') + ->leftJoin(TABLE_EXECUTION)->alias('t2')->on("t1.execution = t2.id") + ->where('t1.deleted')->eq(0) + ->andWhere('t2.deleted')->eq(0) + ->andWhere('t1.id')->in(array_keys($objectIDList)) + ->orderBy('t1.' . $orderBy) + ->page($pager) + ->fetchAll('id'); + } + elseif($objectType == 'requirement' or $objectType == 'story') + { + $objectList = $this->dao->select('t1.*')->from($this->config->objectTables[$module])->alias('t1') + ->leftJoin(TABLE_PRODUCT)->alias('t2')->on("t1.product = t2.id") + ->where('t1.deleted')->eq(0) + ->andWhere('t2.deleted')->eq(0) + ->andWhere('t1.id')->in(array_keys($objectIDList)) + ->andWhere('t1.type')->eq($objectType) + ->orderBy('t1.' . $orderBy) + ->page($pager) + ->fetchAll('id'); + } + elseif($objectType == 'risk' or $objectType == 'issue') + { + $objectList = $this->dao->select('t1.*')->from($this->config->objectTables[$module])->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on("t1.project = t2.id") + ->where('t1.deleted')->eq(0) + ->andWhere('t2.deleted')->eq(0) + ->andWhere('t1.id')->in(array_keys($objectIDList)) + ->orderBy('t1.' . $orderBy) + ->page($pager) + ->fetchAll('id'); + } + else + { + $objectList = $this->dao->select('*')->from($this->config->objectTables[$module]) + ->where('deleted')->eq(0) + ->andWhere('id')->in(array_keys($objectIDList)) + ->orderBy($orderBy) + ->page($pager) + ->fetchAll('id'); + } if($objectType == 'task') { - $executionList = array(); - foreach($objectList as $task) $executionList[$task->execution] = $task->execution; - $objectPairs = $this->dao->select('id,name')->from(TABLE_PROJECT)->where('id')->in($executionList)->fetchPairs('id'); - foreach($objectList as $task) $task->executionName = zget($objectPairs, $task->execution, ''); - if($objectList) return $this->loadModel('task')->processTasks($objectList); return $objectList; } diff --git a/module/testtask/model.php b/module/testtask/model.php index 26ed83ef72..a5a4fc5c6a 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -292,7 +292,9 @@ class testtaskModel extends model ->from(TABLE_TESTTASK)->alias('t1') ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id') ->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build = t3.id') + ->leftJoin(TABLE_PRODUCT)->alias('t4')->on('t1.product = t4.id') ->where('t1.deleted')->eq(0) + ->andWhere('t4.deleted')->eq(0) ->andWhere('t1.auto')->ne('unit') ->andWhere('t1.owner')->eq($account) ->andWhere('t2.id')->in($this->app->user->view->sprints) diff --git a/module/user/model.php b/module/user/model.php index 034d190f21..b5e0db6f1d 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -2813,25 +2813,29 @@ class userModel extends model { if(empty($account)) $account = $this->app->user->account; $count = 'count(id) AS count'; + $t1Count = 'count(t1.id) AS count'; $personalData = array(); $personalData['createdTodos'] = $this->dao->select($count)->from(TABLE_TODO)->where('account')->eq($account)->andWhere('deleted')->eq('0')->fetch('count'); - $personalData['createdRequirements'] = $this->dao->select($count)->from(TABLE_STORY)->where('openedBy')->eq($account)->andWhere('deleted')->eq('0')->andWhere('type')->eq('requirement')->fetch('count'); - $personalData['createdStories'] = $this->dao->select($count)->from(TABLE_STORY)->where('openedBy')->eq($account)->andWhere('deleted')->eq('0')->andWhere('type')->eq('story')->fetch('count'); - $personalData['createdBugs'] = $this->dao->select($count)->from(TABLE_BUG)->where('openedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count'); - $personalData['resolvedBugs'] = $this->dao->select($count)->from(TABLE_BUG)->where('resolvedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count'); + $personalData['createdRequirements'] = $this->dao->select($t1Count)->from(TABLE_STORY)->alias('t1')->leftjoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')->where('t1.openedBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->andWhere('t1.type')->eq('requirement')->fetch('count'); + $personalData['createdStories'] = $this->dao->select($t1Count)->from(TABLE_STORY)->alias('t1')->leftjoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')->where('t1.openedBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->andWhere('t1.type')->eq('story')->fetch('count'); + $personalData['createdBugs'] = $this->dao->select($t1Count)->from(TABLE_BUG)->alias('t1')->leftjoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')->where('t1.openedBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->fetch('count'); + $personalData['resolvedBugs'] = $this->dao->select($t1Count)->from(TABLE_BUG)->alias('t1')->leftjoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')->where('t1.resolvedBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->fetch('count'); $personalData['createdCases'] = $this->dao->select($count)->from(TABLE_CASE)->where('openedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count'); if($this->config->edition == 'max') { - $personalData['createdRisks'] = $this->dao->select($count)->from(TABLE_RISK)->where('createdBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count'); - $personalData['resolvedRisks'] = $this->dao->select($count)->from(TABLE_RISK)->where('resolvedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count'); - $personalData['createdIssues'] = $this->dao->select($count)->from(TABLE_ISSUE)->where('createdBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count'); - $personalData['resolvedIssues'] = $this->dao->select($count)->from(TABLE_ISSUE)->where('resolvedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count'); + $personalData['createdRisks'] = $this->dao->select($t1Count)->from(TABLE_RISK)->alias('t1')->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')->where('t1.createdBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->fetch('count'); + $personalData['resolvedRisks'] = $this->dao->select($t1Count)->from(TABLE_RISK)->alias('t1')->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')->where('t1.resolvedBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->fetch('count'); + $personalData['createdIssues'] = $this->dao->select($t1Count)->from(TABLE_ISSUE)->alias('t1')->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')->where('t1.createdBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->fetch('count'); + $personalData['resolvedIssues'] = $this->dao->select($t1Count)->from(TABLE_ISSUE)->alias('t1')->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')->where('t1.resolvedBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->fetch('count'); } $personalData['createdDocs'] = $this->dao->select($count)->from(TABLE_DOC)->where('addedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count'); - $personalData['finishedTasks'] = $this->dao->select($count)->from(TABLE_TASK)->where('deleted')->eq('0') - ->andWhere('finishedBy', true)->eq($account) - ->orWhere('finishedList')->like("%,{$account},%") + $personalData['finishedTasks'] = $this->dao->select($t1Count)->from(TABLE_TASK)->alias('t1') + ->leftjoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id') + ->where('t1.deleted')->eq('0') + ->andWhere('t2.deleted')->eq('0') + ->andWhere('t1.finishedBy', true)->eq($account) + ->orWhere('t1.finishedList')->like("%,{$account},%") ->markRight(1) ->fetch('count'); From 6f3544c2d2e67f9c65a82774467690e596a7e3b0 Mon Sep 17 00:00:00 2001 From: zenggang Date: Tue, 26 Jul 2022 06:07:10 +0000 Subject: [PATCH 2/8] * Adjust code --- module/my/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/my/model.php b/module/my/model.php index ec5ba989ea..b55ec9bd4d 100644 --- a/module/my/model.php +++ b/module/my/model.php @@ -357,7 +357,7 @@ class myModel extends model ->page($pager) ->fetchAll('id'); } - elseif($objectType == 'risk' or $objectType == 'issue') + elseif($objectType == 'risk' or $objectType == 'issue' or $objectType == 'nc') { $objectList = $this->dao->select('t1.*')->from($this->config->objectTables[$module])->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on("t1.project = t2.id") From b176ea09677af66ffc03d7d0727c532a48ba2639 Mon Sep 17 00:00:00 2001 From: zenggang Date: Tue, 26 Jul 2022 07:33:14 +0000 Subject: [PATCH 3/8] * Adjust code --- module/my/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/my/model.php b/module/my/model.php index b55ec9bd4d..5986ff02ec 100644 --- a/module/my/model.php +++ b/module/my/model.php @@ -345,14 +345,14 @@ class myModel extends model ->page($pager) ->fetchAll('id'); } - elseif($objectType == 'requirement' or $objectType == 'story') + elseif($objectType == 'requirement' or $objectType == 'story' or $objectType == 'bug') { $objectList = $this->dao->select('t1.*')->from($this->config->objectTables[$module])->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t2')->on("t1.product = t2.id") ->where('t1.deleted')->eq(0) ->andWhere('t2.deleted')->eq(0) ->andWhere('t1.id')->in(array_keys($objectIDList)) - ->andWhere('t1.type')->eq($objectType) + ->beginIF($objectType == 'requirement' or $objectType == 'story')->andWhere('t1.type')->eq($objectType)->fi() ->orderBy('t1.' . $orderBy) ->page($pager) ->fetchAll('id'); From 85bee8b23d22029ad7a9adf9fe0f0b481260be27 Mon Sep 17 00:00:00 2001 From: zenggang Date: Tue, 26 Jul 2022 07:55:52 +0000 Subject: [PATCH 4/8] * Adjust code --- module/todo/model.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/module/todo/model.php b/module/todo/model.php index a251f011b2..8c29dc00f6 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -540,6 +540,31 @@ class todoModel extends model if(empty($account)) $account = $this->app->user->account; + $deletedTaskIds = $this->dao->select('t1.id')->from(TABLE_TODO)->alias('t1') + ->leftJoin(TABLE_TASK)->alias('t2')->on('t1.idvalue=t2.id') + ->leftJoin(TABLE_EXECUTION)->alias('t3')->on('t2.execution=t3.id') + ->where('t1.type')->eq('task') + ->andWhere('t3.deleted')->eq('1') + ->fetchPairs(); + $deletedBugs = $this->dao->select('t1.id')->from(TABLE_TODO)->alias('t1') + ->leftJoin(TABLE_BUG)->alias('t2')->on('t1.idvalue=t2.id') + ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t2.product=t3.id') + ->where('t1.type')->eq('bug') + ->andWhere('t3.deleted')->eq('1') + ->fetchPairs(); + $deletedStories = $this->dao->select('t1.id')->from(TABLE_TODO)->alias('t1') + ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.idvalue=t2.id') + ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t2.product=t3.id') + ->where('t1.type')->eq('story') + ->andWhere('t3.deleted')->eq('1') + ->fetchPairs(); + $deletedMeeting = $this->dao->select('t1.id')->from(TABLE_TODO)->alias('t1') + ->leftJoin(TABLE_MEETING)->alias('t2')->on('t1.idvalue=t2.id') + ->leftJoin(TABLE_PROJECT)->alias('t3')->on('t2.project=t3.id') + ->where('t1.type')->eq('meeting') + ->andWhere('t3.deleted')->eq('1') + ->fetchPairs(); + $deletedIds = $deletedTaskIds + $deletedBugs + $deletedStories + $deletedMeeting; $stmt = $this->dao->select('*')->from(TABLE_TODO) ->where('deleted')->eq('0') ->andWhere('vision')->eq($this->config->vision) @@ -555,6 +580,7 @@ class todoModel extends model ->beginIF($type == 'cycle')->andWhere('cycle')->eq('1')->fi() ->beginIF($type != 'cycle')->andWhere('cycle')->eq('0')->fi() ->beginIF($type == 'assignedtoother')->andWhere('assignedTo')->notin(array($account, ''))->fi() + ->beginIF($deletedIds)->andWhere('id')->notin($deletedIds)->fi() ->orderBy($orderBy) ->beginIF($limit > 0)->limit($limit)->fi() ->page($pager) From bdc6e882447847f423da5257325aa8f298544bc9 Mon Sep 17 00:00:00 2001 From: zenggang Date: Tue, 26 Jul 2022 08:03:25 +0000 Subject: [PATCH 5/8] * Adjust code --- module/todo/model.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/module/todo/model.php b/module/todo/model.php index 8c29dc00f6..be1a8ffa7e 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -558,12 +558,16 @@ class todoModel extends model ->where('t1.type')->eq('story') ->andWhere('t3.deleted')->eq('1') ->fetchPairs(); - $deletedMeeting = $this->dao->select('t1.id')->from(TABLE_TODO)->alias('t1') - ->leftJoin(TABLE_MEETING)->alias('t2')->on('t1.idvalue=t2.id') - ->leftJoin(TABLE_PROJECT)->alias('t3')->on('t2.project=t3.id') - ->where('t1.type')->eq('meeting') - ->andWhere('t3.deleted')->eq('1') - ->fetchPairs(); + $deletedMeeting = array(); + if($this->config->edition == 'max') + { + $deletedMeeting = $this->dao->select('t1.id')->from(TABLE_TODO)->alias('t1') + ->leftJoin(TABLE_MEETING)->alias('t2')->on('t1.idvalue=t2.id') + ->leftJoin(TABLE_PROJECT)->alias('t3')->on('t2.project=t3.id') + ->where('t1.type')->eq('meeting') + ->andWhere('t3.deleted')->eq('1') + ->fetchPairs(); + } $deletedIds = $deletedTaskIds + $deletedBugs + $deletedStories + $deletedMeeting; $stmt = $this->dao->select('*')->from(TABLE_TODO) ->where('deleted')->eq('0') From 0baf0d5fdacf8f17dbe372de668a8c37e5fd0f16 Mon Sep 17 00:00:00 2001 From: zenggang Date: Tue, 26 Jul 2022 08:51:47 +0000 Subject: [PATCH 6/8] * Finish task#62107 --- module/user/view/task.html.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/module/user/view/task.html.php b/module/user/view/task.html.php index d8c609f963..afd669394d 100644 --- a/module/user/view/task.html.php +++ b/module/user/view/task.html.php @@ -41,15 +41,15 @@ id}&type=$type&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"; ?> - idAB;?> + idAB);?> priAB);?> task->execution);?> task->name);?> - task->estimateAB;?> - task->consumedAB;?> - task->leftAB;?> - task->deadlineAB;?> - statusAB;?> + task->estimateAB);?> + task->consumedAB);?> + task->leftAB);?> + task->deadlineAB);?> + statusAB);?> From 389710847318ae5a46a96e1fb05c2d6a3f47c622 Mon Sep 17 00:00:00 2001 From: zenggang Date: Wed, 27 Jul 2022 01:23:11 +0000 Subject: [PATCH 7/8] * Adjust code --- module/todo/model.php | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/module/todo/model.php b/module/todo/model.php index be1a8ffa7e..a251f011b2 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -540,35 +540,6 @@ class todoModel extends model if(empty($account)) $account = $this->app->user->account; - $deletedTaskIds = $this->dao->select('t1.id')->from(TABLE_TODO)->alias('t1') - ->leftJoin(TABLE_TASK)->alias('t2')->on('t1.idvalue=t2.id') - ->leftJoin(TABLE_EXECUTION)->alias('t3')->on('t2.execution=t3.id') - ->where('t1.type')->eq('task') - ->andWhere('t3.deleted')->eq('1') - ->fetchPairs(); - $deletedBugs = $this->dao->select('t1.id')->from(TABLE_TODO)->alias('t1') - ->leftJoin(TABLE_BUG)->alias('t2')->on('t1.idvalue=t2.id') - ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t2.product=t3.id') - ->where('t1.type')->eq('bug') - ->andWhere('t3.deleted')->eq('1') - ->fetchPairs(); - $deletedStories = $this->dao->select('t1.id')->from(TABLE_TODO)->alias('t1') - ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.idvalue=t2.id') - ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t2.product=t3.id') - ->where('t1.type')->eq('story') - ->andWhere('t3.deleted')->eq('1') - ->fetchPairs(); - $deletedMeeting = array(); - if($this->config->edition == 'max') - { - $deletedMeeting = $this->dao->select('t1.id')->from(TABLE_TODO)->alias('t1') - ->leftJoin(TABLE_MEETING)->alias('t2')->on('t1.idvalue=t2.id') - ->leftJoin(TABLE_PROJECT)->alias('t3')->on('t2.project=t3.id') - ->where('t1.type')->eq('meeting') - ->andWhere('t3.deleted')->eq('1') - ->fetchPairs(); - } - $deletedIds = $deletedTaskIds + $deletedBugs + $deletedStories + $deletedMeeting; $stmt = $this->dao->select('*')->from(TABLE_TODO) ->where('deleted')->eq('0') ->andWhere('vision')->eq($this->config->vision) @@ -584,7 +555,6 @@ class todoModel extends model ->beginIF($type == 'cycle')->andWhere('cycle')->eq('1')->fi() ->beginIF($type != 'cycle')->andWhere('cycle')->eq('0')->fi() ->beginIF($type == 'assignedtoother')->andWhere('assignedTo')->notin(array($account, ''))->fi() - ->beginIF($deletedIds)->andWhere('id')->notin($deletedIds)->fi() ->orderBy($orderBy) ->beginIF($limit > 0)->limit($limit)->fi() ->page($pager) From 4bd33b9cba1e14d44ddad81c23205ae3220ae221 Mon Sep 17 00:00:00 2001 From: zenggang Date: Wed, 27 Jul 2022 01:53:26 +0000 Subject: [PATCH 8/8] * Adjust code --- module/task/model.php | 1 + module/testtask/model.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/module/task/model.php b/module/task/model.php index 6f8d4795ac..360d8d110b 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -2559,6 +2559,7 @@ class taskModel extends model ->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.execution = t2.id') ->where('t1.assignedTo')->eq($account) ->andWhere('t1.deleted')->eq(0) + ->andWhere('t2.deleted')->eq(0) ->beginIF($this->config->vision)->andWhere('t1.vision')->eq($this->config->vision)->fi() ->beginIF($status != 'all')->andWhere('t1.status')->in($status)->fi() ->beginIF(!empty($skipExecutionIDList))->andWhere('t1.execution')->notin($skipExecutionIDList)->fi() diff --git a/module/testtask/model.php b/module/testtask/model.php index a5a4fc5c6a..0e9a9dbb14 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -1111,8 +1111,10 @@ class testtaskModel extends model $stmt = $this->dao->select('t1.id, t1.name, t2.name as execution') ->from(TABLE_TESTTASK)->alias('t1') ->leftjoin(TABLE_EXTENSION)->alias('t2')->on('t1.execution = t2.id') + ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product=t3.id') ->where('t1.owner')->eq($account) ->andWhere('t1.deleted')->eq(0) + ->andWhere('t3.deleted')->eq(0) ->beginIF($status != 'all')->andWhere('t1.status')->in($status)->fi() ->beginIF(!empty($skipProductIDList))->andWhere('t1.product')->notin($skipProductIDList)->fi() ->beginIF(!empty($skipExecutionIDList))->andWhere('t1.execution')->notin($skipExecutionIDList)->fi()