From 9c1ff185a2db20a7f79bca12d66677a92f16be0c Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Thu, 20 Aug 2020 15:06:08 +0800 Subject: [PATCH] * Add issue block. --- module/block/control.php | 2 +- module/block/view/cmmiissueblock.html.php | 10 +++++---- module/issue/lang/zh-cn.php | 10 ++++----- module/issue/view/batchcreate.html.php | 2 +- module/issue/view/create.html.php | 2 +- module/issue/view/edit.html.php | 2 +- module/weekly/model.php | 25 ++++++++++++----------- 7 files changed, 28 insertions(+), 25 deletions(-) diff --git a/module/block/control.php b/module/block/control.php index 1ce25ab946..4a034203b5 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -1001,7 +1001,6 @@ class block extends control ->andWhere('parent')->lt(1) ->fetch(); - $this->view->pv = $this->weekly->getPV($this->session->program, $today); $this->view->ev = $this->weekly->getEV($this->session->program, $today); $this->view->ac = $this->weekly->getAC($this->session->program, $today); @@ -1034,6 +1033,7 @@ class block extends control $uri = $this->app->getURI(true); $this->session->set('riskList', $uri); if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die(); + $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->issues = $this->loadModel('issue')->getBlockIssues($this->params->type, $this->viewType == 'json' ? 0 : (int)$this->params->num, null, $this->params->orderBy); } diff --git a/module/block/view/cmmiissueblock.html.php b/module/block/view/cmmiissueblock.html.php index 2c3494926e..2812fdb5d2 100644 --- a/module/block/view/cmmiissueblock.html.php +++ b/module/block/view/cmmiissueblock.html.php @@ -15,11 +15,12 @@ idAB;?> issue->type;?> - issue->name;?> + issue->title;?> - issue->severity;?> - issue->pri;?> + issue->severity;?> + issue->pri;?> + issue->owner;?> issue->assignedTo;?> issue->status;?> @@ -32,11 +33,12 @@ id);?> issue->typeList, $issue->type);?> - name?> + title);?> issue->severityList, $issue->severity, $issue->severity)?> issue->priList, $issue->pri, $issue->pri)?> + owner, $issue->owner)?> assignedTo, $issue->assignedTo)?> issue->statusList, $issue->status);?> diff --git a/module/issue/lang/zh-cn.php b/module/issue/lang/zh-cn.php index eabb76d33f..662743a67d 100644 --- a/module/issue/lang/zh-cn.php +++ b/module/issue/lang/zh-cn.php @@ -51,11 +51,11 @@ $lang->issue->priList['2'] = 2; $lang->issue->priList['3'] = 3; $lang->issue->priList['4'] = 4; -$lang->issue->serverityList[''] = ''; -$lang->issue->serverityList['1'] = '严重'; -$lang->issue->serverityList['2'] = '较严重'; -$lang->issue->serverityList['3'] = '较小'; -$lang->issue->serverityList['4'] = '建议'; +$lang->issue->severityList[''] = ''; +$lang->issue->severityList['1'] = '严重'; +$lang->issue->severityList['2'] = '较严重'; +$lang->issue->severityList['3'] = '较小'; +$lang->issue->severityList['4'] = '建议'; $lang->issue->typeList[''] = ''; $lang->issue->typeList['design'] = '设计问题'; diff --git a/module/issue/view/batchcreate.html.php b/module/issue/view/batchcreate.html.php index 62331b46a4..f231614fe0 100644 --- a/module/issue/view/batchcreate.html.php +++ b/module/issue/view/batchcreate.html.php @@ -38,7 +38,7 @@ issue->typeList, '', 'class="form-control chosen chosen-controled" id="dataList'.$i.'type"')?> - issue->serverityList, '', 'class="form-control chosen chosen-controled" id="dataList'.$i.'severity"')?> + issue->severityList, '', 'class="form-control chosen chosen-controled" id="dataList'.$i.'severity"')?> diff --git a/module/issue/view/create.html.php b/module/issue/view/create.html.php index df2384481f..d1b607a15b 100644 --- a/module/issue/view/create.html.php +++ b/module/issue/view/create.html.php @@ -34,7 +34,7 @@ issue->severity;?> - issue->serverityList, '', 'class="form-control chosen"');?> + issue->severityList, '', 'class="form-control chosen"');?> diff --git a/module/issue/view/edit.html.php b/module/issue/view/edit.html.php index a59f0e42b5..d2addf77ca 100644 --- a/module/issue/view/edit.html.php +++ b/module/issue/view/edit.html.php @@ -34,7 +34,7 @@ issue->severity;?> - issue->serverityList, $issue->severity, 'class="form-control chosen"');?> + issue->severityList, $issue->severity, 'class="form-control chosen"');?> diff --git a/module/weekly/model.php b/module/weekly/model.php index 4f8a7df181..5366dcfd2e 100644 --- a/module/weekly/model.php +++ b/module/weekly/model.php @@ -112,12 +112,13 @@ class weeklyModel extends model $sunday = $this->getThisSunday($date); $projects = $this->loadModel('project')->getList($status = 'all', $limit = 0, $productID = 0, $branch = 0, $type = 'project', $program); $projectIdList = array_keys($projects); - return $this->dao->select('count(distinct account) as count') - ->from(TABLE_EFFORT) - ->where('objectType')->eq('task') - ->andWhere('project')->in($projectIdList) - ->andWhere('date')->ge($monday) - ->andWhere('date')->le($sunday) + + return $this->dao->select('count(distinct t1.account) as count') + ->from(TABLE_TASKESTIMATE)->alias('t1') + ->leftJoin(TABLE_TASK)->alias('t2')->on('t1.task=t2.id') + ->where('t2.project')->in($projectIdList) + ->andWhere('t1.date')->ge($monday) + ->andWhere('t1.date')->lt($sunday) ->fetch('count'); } @@ -312,12 +313,12 @@ class weeklyModel extends model $projects = $this->loadModel('project')->getList($status = 'all', $limit = 0, $productID = 0, $branch = 0, $type = 'project', $program); $projectIdList = array_keys($projects); - $AC = $this->dao->select('sum(consumed) as consumed') - ->from(TABLE_EFFORT) - ->where('objectType')->eq('task') - ->andWhere('project')->in($projectIdList) - ->andWhere('date')->ge($monday) - ->andWhere('date')->lt($nextMonday) + $AC = $this->dao->select('sum(t1.consumed) as consumed') + ->from(TABLE_TASKESTIMATE)->alias('t1') + ->leftJoin(TABLE_TASK)->alias('t2')->on('t1.task=t2.id') + ->where('t2.project')->in($projectIdList) + ->andWhere('t1.date')->ge($monday) + ->andWhere('t1.date')->lt($nextMonday) ->fetch('consumed'); return round($AC, 2);