From 56b4e30328c1726a586235de298a9483e8ed2f1c Mon Sep 17 00:00:00 2001 From: zenggang Date: Wed, 27 Jul 2022 06:45:26 +0000 Subject: [PATCH] * Code for task#61964 --- module/block/model.php | 15 +++++++++------ module/task/model.php | 2 +- module/task/view/view.html.php | 2 +- module/user/model.php | 3 ++- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/module/block/model.php b/module/block/model.php index 837f4435f7..dc75037e58 100644 --- a/module/block/model.php +++ b/module/block/model.php @@ -221,13 +221,16 @@ class blockModel extends model ->andWhere('t1.deadline')->ne('0000-00-00') ->andWhere('t1.deadline')->lt($today) ->andWhere('t1.deleted')->eq(0) + ->andWhere('t3.deleted')->eq(0) ->fetch('count'); - $data['delayBug'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_BUG) - ->where('assignedTo')->eq($this->app->user->account) - ->andWhere('status')->eq('active') - ->andWhere('deadline')->ne('0000-00-00') - ->andWhere('deadline')->lt($today) - ->andWhere('deleted')->eq(0) + $data['delayBug'] = (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.status')->eq('active') + ->andWhere('t1.deadline')->ne('0000-00-00') + ->andWhere('t1.deadline')->lt($today) + ->andWhere('t1.deleted')->eq(0) + ->andWhere('t2.deleted')->eq(0) ->fetch('count'); $data['delayProject'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_PROJECT) ->where('status')->in('wait,doing') diff --git a/module/task/model.php b/module/task/model.php index 6b51e33d4c..c601c8f05a 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -3625,7 +3625,7 @@ class taskModel extends model public function printAssignedHtml($task, $users) { $btnTextClass = ''; - $assignedToText = (!empty($task->team) and $task->mode == 'multi') ? $this->lang->task->team : zget($users, $task->assignedTo); + $assignedToText = (!empty($task->team) and $task->mode == 'multi' and $task->status != 'closed') ? $this->lang->task->team : zget($users, $task->assignedTo); if(empty($task->assignedTo)) { diff --git a/module/task/view/view.html.php b/module/task/view/view.html.php index 844e44a79f..28fca9b311 100644 --- a/module/task/view/view.html.php +++ b/module/task/view/view.html.php @@ -269,7 +269,7 @@ task->assignedTo;?> team) and $task->mode == 'multi') + if(!empty($task->team) and $task->mode == 'multi' and $task->status != 'closed') { foreach($task->team as $member) echo ' ' . zget($users, $member->account); } diff --git a/module/user/model.php b/module/user/model.php index b5e0db6f1d..8afd9f4677 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -2829,7 +2829,8 @@ class userModel extends model $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'); + $allLibs = $this->loadModel('doc')->getLibs('all'); + $personalData['createdDocs'] = $this->dao->select($count)->from(TABLE_DOC)->where('addedBy')->eq($account)->andWhere('lib')->in(array_keys($allLibs))->andWhere('deleted')->eq('0')->fetch('count'); $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')