From 487e80242003c69d4a1d5bfd3380e886c981b997 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 8 Mar 2019 14:48:50 +0800 Subject: [PATCH] * finish task #7499. --- module/common/model.php | 2 +- module/product/lang/en.php | 4 +-- module/product/lang/zh-cn.php | 6 ++--- module/project/control.php | 50 +++++++++++++++++++++++++++++++++-- module/project/lang/en.php | 14 +++++----- module/project/lang/zh-cn.php | 8 +++--- module/task/control.php | 34 +++++++++++++++++++++++- 7 files changed, 98 insertions(+), 20 deletions(-) diff --git a/module/common/model.php b/module/common/model.php index c47a1a0c94..49a6cae306 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1371,7 +1371,7 @@ EOD; { $module = $this->app->getModuleName(); $method = $this->app->getMethodName(); - if(isset($this->app->user->modifyPassword) and $this->app->user->modifyPassword and ($module != 'my' or $method != 'changepassword')) die(js::locate(helper::createLink('my', 'changepassword'))); + if(!empty($this->app->user->modifyPassword) and (($module != 'my' or $method != 'changepassword') and ($module != 'user' or $method != 'logout'))) die(js::locate(helper::createLink('my', 'changepassword'))); if($this->isOpenMethod($module, $method)) return true; if(!$this->loadModel('user')->isLogon() and $this->server->php_auth_user) $this->user->identifyByPhpAuth(); if(!$this->loadModel('user')->isLogon() and $this->cookie->za) $this->user->identifyByCookie(); diff --git a/module/product/lang/en.php b/module/product/lang/en.php index 535c746bc2..86b99cfb6b 100644 --- a/module/product/lang/en.php +++ b/module/product/lang/en.php @@ -58,7 +58,7 @@ $lang->product->accessDenied = "You have no access to {$lang->productCommon}." $lang->product->id = 'ID'; $lang->product->name = 'Name'; $lang->product->code = 'Alias'; -$lang->product->line = 'Product Line'; +$lang->product->line = "{$lang->productCommon} Line"; $lang->product->order = 'Sort'; $lang->product->type = 'Type'; $lang->product->status = 'Status'; @@ -121,7 +121,7 @@ $lang->product->aclList['custom'] = 'Custom (Team members and Whitelist members $lang->product->storySummary = " %s Story(ies), %s hour(s) estimated, case coverage is %s on this page."; $lang->product->checkedSummary = " %total% Checked, %estimate% hour(s) estimated, case coverage is %rate%."; $lang->product->noModule = '
You have no modules
Manage now
'; -$lang->product->noProduct = 'No product. '; +$lang->product->noProduct = "No {$lang->productCommon}. "; $lang->product->noMatched = '"%s" cannot be found.' . $lang->productCommon; $lang->product->featureBar['browse']['allstory'] = $lang->product->allStory; diff --git a/module/product/lang/zh-cn.php b/module/product/lang/zh-cn.php index fc56ecd43c..544eb6ac8c 100644 --- a/module/product/lang/zh-cn.php +++ b/module/product/lang/zh-cn.php @@ -58,7 +58,7 @@ $lang->product->accessDenied = "您无权访问该{$lang->productCommon}"; $lang->product->id = '编号'; $lang->product->name = "{$lang->productCommon}名称"; $lang->product->code = "{$lang->productCommon}代号"; -$lang->product->line = '产品线'; +$lang->product->line = "{$lang->productCommon}线"; $lang->product->order = '排序'; $lang->product->type = "{$lang->productCommon}类型"; $lang->product->status = '状态'; @@ -120,8 +120,8 @@ $lang->product->aclList['custom'] = '自定义白名单(团队成员和白名 $lang->product->storySummary = "本页共 %s 个需求,预计 %s 个工时,用例覆盖率 %s。"; $lang->product->checkedSummary = "选中 %total% 个需求,预计 %estimate% 个工时,用例覆盖率 %rate%。"; -$lang->product->noModule = '
您现在还没有模块信息
请维护产品模块
'; -$lang->product->noProduct = '暂时没有产品。'; +$lang->product->noModule = "
您现在还没有模块信息
请维护{$lang->productCommon}模块
"; +$lang->product->noProduct = "暂时没有{$lang->productCommon}。"; $lang->product->noMatched = '找不到包含"%s"的' . $lang->productCommon; $lang->product->featureBar['browse']['allstory'] = $lang->product->allStory; diff --git a/module/project/control.php b/module/project/control.php index bddc75f2c2..e9daf719af 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -283,11 +283,57 @@ class project extends control } elseif($groupBy == 'assignedTo') { - $groupTasks[$task->assignedToRealName][] = $task; + if(isset($task->team)) + { + foreach($task->team as $team) + { + $cloneTask = clone $task; + $cloneTask->assignedTo = $team->account; + $cloneTask->estimate = $team->estimate; + $cloneTask->consumed = $team->consumed; + $cloneTask->left = $team->left; + if($team->left == 0) $cloneTask->status = 'done'; + + $realname = zget($users, $team->account); + $cloneTask->assignedToRealName = $realname; + $groupTasks[$realname][] = $cloneTask; + } + } + else + { + $groupTasks[$task->assignedToRealName][] = $task; + } } elseif($groupBy == 'finishedBy') { - $groupTasks[$users[$task->finishedBy]][] = $task; + if(isset($task->team)) + { + $task->consumed = $task->estimate = $task->left = 0; + foreach($task->team as $team) + { + if($team->left != 0) + { + $task->estimate += $team->estimate; + $task->consumed += $team->consumed; + $task->left += $team->left; + continue; + } + + $cloneTask = clone $task; + $cloneTask->finishedBy = $team->account; + $cloneTask->estimate = $team->estimate; + $cloneTask->consumed = $team->consumed; + $cloneTask->left = $team->left; + $cloneTask->status = 'done'; + $realname = zget($users, $team->account); + $groupTasks[$realname][] = $cloneTask; + } + if(!empty($task->left)) $groupTasks[$users[$task->finishedBy]][] = $task; + } + else + { + $groupTasks[$users[$task->finishedBy]][] = $task; + } } elseif($groupBy == 'closedBy') { diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 7cccd8460e..020b6db385 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -55,7 +55,7 @@ $lang->project->other = 'Other:'; $lang->project->deleted = 'Deleted'; $lang->project->delayed = 'Delayed'; $lang->project->product = $lang->project->products; -$lang->project->readjustTime = 'Adjust project begin and end time'; +$lang->project->readjustTime = "Adjust {$lang->projectCommon} begin and end time"; $lang->project->readjustTask = 'Adjust task start date and deadline'; $lang->project->effort = 'Effort'; $lang->project->relatedMember = 'Team Member'; @@ -100,7 +100,7 @@ $lang->project->statusList['doing'] = 'Doing'; $lang->project->statusList['suspended'] = 'Suspend'; $lang->project->statusList['closed'] = 'Closed'; -$lang->project->aclList['open'] = "Default (Users who can visit Project have access to it.)"; +$lang->project->aclList['open'] = "Default (Users who can visit {$lang->projectCommon} have access to it.)"; $lang->project->aclList['private'] = 'Private (For team members only.)'; $lang->project->aclList['custom'] = 'Whitelist (Team members and the whitelist members have access to it.)'; @@ -129,7 +129,7 @@ $lang->project->unlinkStoryTasks = 'Unlink'; $lang->project->linkedProducts = 'Linked Product'; $lang->project->unlinkedProducts = 'Unlinked Product'; $lang->project->view = "Overview"; -$lang->project->create = "Create Project"; +$lang->project->create = "Create {$lang->projectCommon}"; $lang->project->copy = "Copy {$lang->projectCommon}"; $lang->project->delete = "Delete"; $lang->project->browse = "Browse"; @@ -192,7 +192,7 @@ $lang->project->aboveAllProduct = "All the above {$lang->productCommon}"; $lang->project->aboveAllProject = "All the above {$lang->projectCommon}"; /* 页面提示。*/ -$lang->project->linkStoryByPlanTips = 'It will link all stories in this plan to the project.'; +$lang->project->linkStoryByPlanTips = "It will link all stories in this plan to the {$lang->projectCommon}."; $lang->project->selectProject = "Select {$lang->projectCommon}"; $lang->project->beginAndEnd = 'Duration'; $lang->project->begin = 'Begin'; @@ -225,7 +225,7 @@ $lang->project->copyFromProject = "Copy from {$lang->projectCommon} $lang->project->cancelCopy = 'Cancel Copy'; $lang->project->byPeriod = 'By Time'; $lang->project->byUser = 'By User'; -$lang->project->noProject = 'No projects. '; +$lang->project->noProject = "No {$lang->projectCommon}. "; $lang->project->noMembers = 'No members. '; /* 交互提示。*/ @@ -262,8 +262,8 @@ $lang->project->charts->burn->graph->reference = 'Ideal'; $lang->project->charts->burn->graph->actuality = 'Actual'; $lang->project->placeholder = new stdclass(); -$lang->project->placeholder->code = 'Abbreviation of project name'; -$lang->project->placeholder->totalLeft = 'Estimates at the beginning of the Project.'; +$lang->project->placeholder->code = "Abbreviation of {$lang->projectCommon} name"; +$lang->project->placeholder->totalLeft = "Estimates at the beginning of the {$lang->projectCommon}."; $lang->project->selectGroup = new stdclass(); $lang->project->selectGroup->done = '(Done)'; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 0ba2af73b9..d8d86cc5e0 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -55,7 +55,7 @@ $lang->project->other = '其他:'; $lang->project->deleted = '已删除'; $lang->project->delayed = '已延期'; $lang->project->product = $lang->project->products; -$lang->project->readjustTime = '调整项目起止时间'; +$lang->project->readjustTime = "调整{$lang->projectCommon}起止时间"; $lang->project->readjustTask = '顺延任务的起止时间'; $lang->project->effort = '日志'; $lang->project->relatedMember = '相关成员'; @@ -192,7 +192,7 @@ $lang->project->aboveAllProduct = "以上所有{$lang->productCommon}"; $lang->project->aboveAllProject = "以上所有{$lang->projectCommon}"; /* 页面提示。*/ -$lang->project->linkStoryByPlanTips = '此操作会将所选计划下面的需求全部关联到此项目中'; +$lang->project->linkStoryByPlanTips = "此操作会将所选计划下面的需求全部关联到此{$lang->projectCommon}中"; $lang->project->selectProject = "请选择{$lang->projectCommon}"; $lang->project->beginAndEnd = '起止时间'; $lang->project->begin = '开始日期'; @@ -225,7 +225,7 @@ $lang->project->copyFromProject = "复制自{$lang->projectCommon} %sproject->cancelCopy = '取消复制'; $lang->project->byPeriod = '按时间段'; $lang->project->byUser = '按用户'; -$lang->project->noProject = '暂时没有项目。'; +$lang->project->noProject = "暂时没有{$lang->projectCommon}。"; $lang->project->noMembers = '暂时没有团队成员。'; /* 交互提示。*/ @@ -263,7 +263,7 @@ $lang->project->charts->burn->graph->actuality = '实际'; $lang->project->placeholder = new stdclass(); $lang->project->placeholder->code = '团队内部的简称'; -$lang->project->placeholder->totalLeft = '项目开始时的总预计工时'; +$lang->project->placeholder->totalLeft = "{$lang->projectCommon}开始时的总预计工时"; $lang->project->selectGroup = new stdclass(); $lang->project->selectGroup->done = '(已结束)'; diff --git a/module/task/control.php b/module/task/control.php index a366a6ee55..125b9c4c80 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -1378,7 +1378,39 @@ class task extends control foreach($tasks as $task) { $task->storyTitle = isset($stories[$task->story]) ? $stories[$task->story]->title : ''; - $groupTasks[$task->$orderBy][] = $task; + if(isset($task->team)) + { + if($orderBy == 'finishedBy') $task->consumed = $task->estimate = $task->left = 0; + foreach($task->team as $team) + { + if($orderBy == 'finishedBy' and $team->left != 0) + { + $task->estimate += $team->estimate; + $task->consumed += $team->consumed; + $task->left += $team->left; + continue; + } + + $cloneTask = clone $task; + $cloneTask->estimate = $team->estimate; + $cloneTask->consumed = $team->consumed; + $cloneTask->left = $team->left; + if($team->left == 0) $cloneTask->status = 'done'; + + if($orderBy == 'assignedTo') + { + $cloneTask->assignedToRealName = zget($users, $team->account); + $cloneTask->assignedTo = $team->account; + } + if($orderBy == 'finishedBy')$cloneTask->finishedBy = $team->account; + $groupTasks[$team->account][] = $cloneTask; + } + if(!empty($task->left) and $orderBy == 'finishedBy') $groupTasks[$task->finishedBy][] = $task; + } + else + { + $groupTasks[$task->$orderBy][] = $task; + } } $tasks = array();