From 0a46aa55127d416a113d80b16ddc6b13171222ef Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Thu, 3 Sep 2020 15:54:12 +0800 Subject: [PATCH] * Fix problems found in code review. --- module/action/model.php | 1 + module/block/control.php | 8 +++++--- module/block/view/scrumroadmapblock.html.php | 4 +++- module/issue/lang/en.php | 2 +- module/issue/lang/zh-cn.php | 4 ++-- module/issue/view/browse.html.php | 9 ++++++--- module/program/control.php | 10 +++++----- 7 files changed, 23 insertions(+), 15 deletions(-) diff --git a/module/action/model.php b/module/action/model.php index 8db6743c10..4b170b5fdf 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -145,6 +145,7 @@ class actionModel extends model /* If objectType is product or project, return the objectID. */ if($objectType == 'product') return array('product' => ",$objectID,", 'project' => 0); + if($objectType == 'program') return array('product' => "", 'project' => $objectID); if($objectType == 'project') { $products = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($objectID)->fetchPairs('product'); diff --git a/module/block/control.php b/module/block/control.php index 04519d1343..810fdaa76e 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -1358,13 +1358,15 @@ class block extends control */ public function printProgramDynamicBlock() { - $projects = $this->loadModel('project')->getPairs(); - $products = $this->loadModel('product')->getPairs(); + $programID = $this->session->program; + + $projects = $this->loadModel('project')->getPairs('', $programID); + $products = $this->loadModel('product')->getPairs('', $programID); $count = isset($this->params->count) ? (int)$this->params->count : 10; $actions = array(); $actions = $this->dao->select('*')->from(TABLE_ACTION) - ->where('project')->eq($this->session->program) + ->where('project')->eq($programID) ->beginIF($projects)->markLeft()->orWhere('project')->in(array_keys($projects))->fi()->markRight() ->beginIF($products)->markLeft()->orWhere('product')->in(array_keys($products))->fi()->markRight() ->orderBy('date_desc') diff --git a/module/block/view/scrumroadmapblock.html.php b/module/block/view/scrumroadmapblock.html.php index aeebb95ad4..b8f84f56d0 100644 --- a/module/block/view/scrumroadmapblock.html.php +++ b/module/block/view/scrumroadmapblock.html.php @@ -22,7 +22,9 @@ echo $sync ? '
' : ''; #productList{width:32%; position: absolute; top: 6px; left: 96px;}
-
+
+ +
diff --git a/module/issue/lang/en.php b/module/issue/lang/en.php index 64d6bf4043..6ccce00952 100644 --- a/module/issue/lang/en.php +++ b/module/issue/lang/en.php @@ -48,7 +48,7 @@ $lang->issue->search = 'Search'; $lang->issue->basicInfo = 'Basic Information'; $lang->issue->activate = 'Activate'; $lang->issue->assignTo = 'Assign'; -$lang->issue->create = 'Create'; +$lang->issue->create = 'Create Issue'; $lang->issue->edit = 'Edit'; $lang->issue->batchCreate = 'Batch Create'; diff --git a/module/issue/lang/zh-cn.php b/module/issue/lang/zh-cn.php index 5534a3ab76..14c2945653 100644 --- a/module/issue/lang/zh-cn.php +++ b/module/issue/lang/zh-cn.php @@ -9,7 +9,7 @@ * @version $Id: zh-cn.php 4729 2013-05-03 07:53:55Z chencongzhi520@gmail.com $ * @link http://www.zentao.net */ -$lang->issue->common = '项目问题'; +$lang->issue->common = '问题'; $lang->issue->browse = '问题列表'; $lang->issue->resolvedBy = '解决者'; $lang->issue->program = '所属项目'; @@ -48,7 +48,7 @@ $lang->issue->search = '搜索'; $lang->issue->basicInfo = '基本信息'; $lang->issue->activate = '激活'; $lang->issue->assignTo = '指派'; -$lang->issue->create = '新建'; +$lang->issue->create = '新建问题'; $lang->issue->edit = '编辑'; $lang->issue->batchCreate = '批量新建'; diff --git a/module/issue/view/browse.html.php b/module/issue/view/browse.html.php index c850b12ccf..041abd767e 100644 --- a/module/issue/view/browse.html.php +++ b/module/issue/view/browse.html.php @@ -23,8 +23,8 @@ issue->search;?>
- " . $lang->issue->create, '', "class='btn btn-primary'");?> " . $lang->issue->batchCreate, '', "class='btn btn-primary'");?> + " . $lang->issue->create, '', "class='btn btn-primary'");?>
@@ -54,7 +54,7 @@ id);?> issue->typeList, $issue->type);?> id", $issue->title);?> - issue->severityList, $issue->severity);?> + issue->severityList, $issue->severity);?> pri;?> assignedTo);?> owner);?> @@ -83,7 +83,10 @@ -
noData;?>
+
+ noData;?> + createLink('issue', 'create'), ' ' . $lang->issue->create, '', 'class="btn btn-info"')?> +
diff --git a/module/program/control.php b/module/program/control.php index eca8ae8dba..95d85cb4c3 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -98,7 +98,7 @@ class program extends control $projectID = $this->program->create(); if(dao::isError()) $this->send(array('result' => 'fail', 'message' => $this->processErrors(dao::getError()))); - $this->loadModel('action')->create('project', $projectID, 'opened'); + $this->loadModel('action')->create('program', $projectID, 'opened'); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse', array('status' => 'wait', 'orderBy' => 'order_desc')))); } @@ -472,7 +472,7 @@ class program extends control if($this->post->comment != '' or !empty($changes)) { - $actionID = $this->action->create('project', $projectID, 'Started', $this->post->comment); + $actionID = $this->action->create('program', $projectID, 'Started', $this->post->comment); $this->action->logHistory($actionID, $changes); } $this->executeHooks($projectID); @@ -528,7 +528,7 @@ class program extends control if($this->post->comment != '' or !empty($changes)) { - $actionID = $this->action->create('project', $projectID, 'Suspended', $this->post->comment); + $actionID = $this->action->create('program', $projectID, 'Suspended', $this->post->comment); $this->action->logHistory($actionID, $changes); } $this->executeHooks($projectID); @@ -562,7 +562,7 @@ class program extends control if($this->post->comment != '' or !empty($changes)) { - $actionID = $this->action->create('project', $projectID, 'Activated', $this->post->comment); + $actionID = $this->action->create('program', $projectID, 'Activated', $this->post->comment); $this->action->logHistory($actionID, $changes); } $this->executeHooks($projectID); @@ -603,7 +603,7 @@ class program extends control if($this->post->comment != '' or !empty($changes)) { - $actionID = $this->action->create('project', $projectID, 'Closed', $this->post->comment); + $actionID = $this->action->create('program', $projectID, 'Closed', $this->post->comment); $this->action->logHistory($actionID, $changes); } $this->executeHooks($projectID);