From ad619c4909eeba97eb60e345c83fa8355a49fd82 Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Tue, 25 Aug 2020 11:09:42 +0800 Subject: [PATCH] * Code for story and requirement. --- module/block/control.php | 15 +- .../block/view/programstatisticblock.html.php | 4 +- module/milestone/lang/zh-cn.php | 1 + module/product/control.php | 1 + module/product/view/browse.html.php | 2 +- module/programplan/control.php | 2 +- module/story/control.php | 46 ++- module/story/css/view.css | 1 + module/story/js/view.js | 14 + module/story/lang/en.php | 98 +++--- module/story/lang/zh-cn.php | 10 + module/story/model.php | 283 +++++++++++++++++- module/story/view/edit.html.php | 28 -- module/story/view/linkstory.html.php | 22 +- module/story/view/track.html.php | 86 ++++++ module/story/view/view.html.php | 74 +++++ 16 files changed, 568 insertions(+), 119 deletions(-) create mode 100644 module/story/view/track.html.php diff --git a/module/block/control.php b/module/block/control.php index effeedadba..5df76e81ed 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -1178,7 +1178,7 @@ class block extends control $begin = $program->begin; $today = helper::today(); - $end = date('Y-m-d', strtotime("$today + 7 days")); + $end = date('Y-m-d', strtotime($today)); $projects = $this->project->getProjectsByProgram($program); $projectIdList = array_keys($projects); @@ -1188,14 +1188,15 @@ class block extends control $charts['AC'] = '['; $i = 1; $start = $begin; + $longProgram = helper::diffDate($today, $begin) / 7 > 10; while($start < $end) { - $charts['labels'][] = $this->lang->milestone->chart->time . $i . $this->lang->milestone->chart->week; - $sunday = $this->weekly->getThisSunday($start); - $charts['PV'] .= $this->milestone->getPV($projectIdList, $begin, $sunday) . ','; - $charts['EV'] .= $this->milestone->getEV($projectIdList, $begin, $sunday) . ','; - $charts['AC'] .= $this->milestone->getAC($projectIdList, $begin, $sunday) . ','; - $start = date('Y-m-d', strtotime("$start + 7 days")); + $charts['labels'][] = $longProgram ? $this->lang->milestone->chart->time . $i . $this->lang->milestone->chart->month : $this->lang->milestone->chart->time . $i . $this->lang->milestone->chart->week; + $stageEnd = $longProgram ? date('Y-m-t', strtotime($start)) : $this->weekly->getThisSunday($start); + $charts['PV'] .= $this->milestone->getPV($projectIdList, $begin, $stageEnd) . ','; + $charts['EV'] .= $this->milestone->getEV($projectIdList, $begin, $stageEnd) . ','; + $charts['AC'] .= $this->milestone->getAC($projectIdList, $begin, $stageEnd) . ','; + $start = $longProgram ? date('Y-m-d', strtotime("$start + 1 month")) : date('Y-m-d', strtotime("$start + 7 days")); $i ++; } diff --git a/module/block/view/programstatisticblock.html.php b/module/block/view/programstatisticblock.html.php index d6a321b4e9..ba8897a7b8 100644 --- a/module/block/view/programstatisticblock.html.php +++ b/module/block/view/programstatisticblock.html.php @@ -148,8 +148,8 @@ $(function()

program->allInput;?>

- teamCount;?> - estimate;?> + program->membersUnit, $program->teamCount);?> + program->hoursUnit, $program->estimate);?> budget . ' ' . zget($lang->program->unitList, $program->budgetUnit);?>
diff --git a/module/milestone/lang/zh-cn.php b/module/milestone/lang/zh-cn.php index 00ac6dd5b2..0cb32ccea8 100644 --- a/module/milestone/lang/zh-cn.php +++ b/module/milestone/lang/zh-cn.php @@ -81,6 +81,7 @@ $lang->milestone->chart = new stdclass(); $lang->milestone->chart->title = '到目前为止项目进展趋势图'; $lang->milestone->chart->time = '第'; $lang->milestone->chart->week = '周'; +$lang->milestone->chart->month = '月'; $lang->milestone->chart->workhour = '研发工作量分析图'; $lang->milestone->otherproblem = '6.其它问题'; diff --git a/module/product/control.php b/module/product/control.php index be6867b8f8..87cd3d9be2 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -180,6 +180,7 @@ class product extends control $this->view->position[] = $this->products[$productID]; $this->view->position[] = $this->lang->product->browse; $this->view->productID = $productID; + $this->view->program = $this->loadModel('project')->getById($this->session->program); $this->view->product = $this->product->getById($productID); $this->view->productName = $this->products[$productID]; $this->view->moduleID = $moduleID; diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index f5aa3b4af6..42c8b1e49d 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -24,7 +24,7 @@ js::set('unfoldID', $config->product->browse->unfoldID); js::set('unfoldAll', $lang->project->treeLevel['all']); js::set('foldAll', $lang->project->treeLevel['root']); js::set('storyType', $storyType); -$lang->story->create = $storyType == 'story' ? $lang->story->createStory : $lang->story->createRequirement; +if($program->template == 'cmmi') $lang->story->create = $storyType == 'story' ? $lang->story->createStory : $lang->story->createRequirement; ?>