From f47daae58967535241f59fc3895042e558b96a2e Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Mon, 22 Aug 2022 14:34:37 +0800 Subject: [PATCH] * Modify story review and other about story. --- module/execution/lang/de.php | 2 +- module/execution/lang/en.php | 2 +- module/execution/lang/fr.php | 2 +- module/execution/lang/zh-cn.php | 2 +- module/product/view/view.html.php | 20 ++++++------- module/projectstory/lang/de.php | 2 ++ module/projectstory/lang/en.php | 2 ++ module/projectstory/lang/fr.php | 2 ++ module/projectstory/lang/vi.php | 12 +++++--- module/projectstory/lang/zh-cn.php | 2 ++ module/report/view/productsummary.html.php | 14 +++++---- module/story/control.php | 8 ++--- module/story/lang/de.php | 6 ++-- module/story/lang/en.php | 6 ++-- module/story/lang/fr.php | 6 ++-- module/story/lang/vi.php | 6 ++-- module/story/lang/zh-cn.php | 6 ++-- module/story/model.php | 35 +++++++++++++--------- 18 files changed, 84 insertions(+), 51 deletions(-) diff --git a/module/execution/lang/de.php b/module/execution/lang/de.php index 7ab7927d18..cd761fa8f0 100644 --- a/module/execution/lang/de.php +++ b/module/execution/lang/de.php @@ -411,7 +411,7 @@ $lang->execution->unresolvedBug = "[%s] unresolved bugs. "; $lang->execution->projectNotEmpty = 'Project cannot be empty.'; $lang->execution->confirmStoryToTask = $lang->SRCommon . '%s are converted to tasks in the current. Do you want to convert them anyways?'; $lang->execution->ge = "『%s』should be >= actual begin『%s』."; -$lang->execution->storyDragError = "The {$lang->SRCommon} is still a draft or has been changed, please drag it after the review"; +$lang->execution->storyDragError = "The {$lang->SRCommon} is not active. Please activate and drag again."; $lang->execution->countTip = ' (%s member)'; $lang->execution->pleaseInput = "Enter"; $lang->execution->week = 'week'; diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index cf11af6af7..0d4e0e4cb9 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -411,7 +411,7 @@ $lang->execution->unresolvedBug = "[%s] unresolved bugs. "; $lang->execution->projectNotEmpty = 'Project cannot be empty.'; $lang->execution->confirmStoryToTask = $lang->SRCommon . '%s are converted to tasks in the current. Do you want to convert them anyways?'; $lang->execution->ge = "『%s』should be >= actual begin『%s』."; -$lang->execution->storyDragError = "The {$lang->SRCommon} is still a draft or has been changed, please drag it after the review"; +$lang->execution->storyDragError = "The {$lang->SRCommon} is not active. Please activate and drag again."; $lang->execution->countTip = ' (%s member)'; $lang->execution->pleaseInput = "Enter"; $lang->execution->week = 'week'; diff --git a/module/execution/lang/fr.php b/module/execution/lang/fr.php index 6dea9a32aa..bb0ce80a9e 100644 --- a/module/execution/lang/fr.php +++ b/module/execution/lang/fr.php @@ -411,7 +411,7 @@ $lang->execution->unresolvedBug = "[%s] unresolved bugs. "; $lang->execution->projectNotEmpty = 'Project cannot be empty.'; $lang->execution->confirmStoryToTask = $lang->SRCommon . '%s are converted to tasks in the current. Do you want to convert them anyways?'; $lang->execution->ge = "『%s』should be >= actual begin『%s』."; -$lang->execution->storyDragError = "The {$lang->SRCommon} is still a draft or has been changed, please drag it after the review"; +$lang->execution->storyDragError = "The {$lang->SRCommon} is not active. Please activate and drag again."; $lang->execution->countTip = ' (%s member)'; $lang->execution->pleaseInput = "Enter"; $lang->execution->week = 'week'; diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index a064ccd15c..cfe984b4b3 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -411,7 +411,7 @@ $lang->execution->unresolvedBug = "[%s]个未解决的bug,"; $lang->execution->projectNotEmpty = '所属项目不能为空。'; $lang->execution->confirmStoryToTask = '%s' . $lang->SRCommon . '已经在当前' . $lang->execution->common . '中转了任务,请确认是否重复转任务。'; $lang->execution->ge = "『%s』应当不小于实际开始时间『%s』。"; -$lang->execution->storyDragError = "该{$lang->SRCommon}还是草稿或已变更状态,请评审通过后再拖动"; +$lang->execution->storyDragError = "该{$lang->SRCommon}不是激活状态,请激活后再拖动"; $lang->execution->countTip = '(%s人)'; $lang->execution->pleaseInput = "请输入"; $lang->execution->week = '周'; diff --git a/module/product/view/view.html.php b/module/product/view/view.html.php index 8bdeddae92..2f516016e5 100644 --- a/module/product/view/view.html.php +++ b/module/product/view/view.html.php @@ -141,14 +141,6 @@ product->bugs?> bugs?> - - story->statusList['changing'] . $space . $lang->story->common;?> - stories['changing']?> - product->releases?> - releases?> - product->cases?> - cases?> - story->statusList['draft'] . $space . $lang->story->common;?> stories['draft']?> @@ -158,8 +150,16 @@ docs?> - story->statusList['closed'] . $space . $lang->story->common;?> - stories['closed']?> + story->statusList['changing'] . $space . $lang->story->common;?> + stories['changing']?> + product->releases?> + releases?> + product->cases?> + cases?> + + + story->statusList['reviewing'] . $space . $lang->story->common;?> + stories['reviewing']?> systemMode == 'new'):?> product->projects?> projects?> diff --git a/module/projectstory/lang/de.php b/module/projectstory/lang/de.php index 712bdfa71a..85d9e04cb9 100644 --- a/module/projectstory/lang/de.php +++ b/module/projectstory/lang/de.php @@ -26,6 +26,8 @@ global $app; $app->loadLang('product'); $lang->projectstory->featureBar['story']['allstory'] = $lang->product->allStory; $lang->projectstory->featureBar['story']['unclosed'] = $lang->product->unclosed; +$lang->projectstory->featureBar['story']['draft'] = $lang->product->draftStory; +$lang->projectstory->featureBar['story']['reviewing'] = $lang->product->reviewingStory; $lang->projectstory->featureBar['story']['changing'] = $lang->product->changingStory; $lang->projectstory->featureBar['story']['closed'] = $lang->product->closedStory; $lang->projectstory->featureBar['story']['linkedExecution'] = 'Linked ' . $lang->execution->common; diff --git a/module/projectstory/lang/en.php b/module/projectstory/lang/en.php index 7d4d228632..46d47f3073 100644 --- a/module/projectstory/lang/en.php +++ b/module/projectstory/lang/en.php @@ -26,6 +26,8 @@ global $app; $app->loadLang('product'); $lang->projectstory->featureBar['story']['allstory'] = $lang->product->allStory; $lang->projectstory->featureBar['story']['unclosed'] = $lang->product->unclosed; +$lang->projectstory->featureBar['story']['draft'] = $lang->product->draftStory; +$lang->projectstory->featureBar['story']['reviewing'] = $lang->product->reviewingStory; $lang->projectstory->featureBar['story']['changing'] = $lang->product->changingStory; $lang->projectstory->featureBar['story']['closed'] = $lang->product->closedStory; $lang->projectstory->featureBar['story']['linkedExecution'] = 'Linked ' . $lang->execution->common; diff --git a/module/projectstory/lang/fr.php b/module/projectstory/lang/fr.php index 712bdfa71a..85d9e04cb9 100644 --- a/module/projectstory/lang/fr.php +++ b/module/projectstory/lang/fr.php @@ -26,6 +26,8 @@ global $app; $app->loadLang('product'); $lang->projectstory->featureBar['story']['allstory'] = $lang->product->allStory; $lang->projectstory->featureBar['story']['unclosed'] = $lang->product->unclosed; +$lang->projectstory->featureBar['story']['draft'] = $lang->product->draftStory; +$lang->projectstory->featureBar['story']['reviewing'] = $lang->product->reviewingStory; $lang->projectstory->featureBar['story']['changing'] = $lang->product->changingStory; $lang->projectstory->featureBar['story']['closed'] = $lang->product->closedStory; $lang->projectstory->featureBar['story']['linkedExecution'] = 'Linked ' . $lang->execution->common; diff --git a/module/projectstory/lang/vi.php b/module/projectstory/lang/vi.php index 94347508b9..e41803b496 100644 --- a/module/projectstory/lang/vi.php +++ b/module/projectstory/lang/vi.php @@ -18,7 +18,11 @@ $lang->projectstory->batchUnlinkTip = 'Other requirements are removed. The follo global $app; $app->loadLang('product'); -$lang->projectstory->featureBar['story']['allstory'] = $lang->product->allStory; -$lang->projectstory->featureBar['story']['unclosed'] = $lang->product->unclosed; -$lang->projectstory->featureBar['story']['changing'] = $lang->product->changingStory; -$lang->projectstory->featureBar['story']['closed'] = $lang->product->closedStory; +$lang->projectstory->featureBar['story']['allstory'] = $lang->product->allStory; +$lang->projectstory->featureBar['story']['unclosed'] = $lang->product->unclosed; +$lang->projectstory->featureBar['story']['draft'] = $lang->product->draftStory; +$lang->projectstory->featureBar['story']['reviewing'] = $lang->product->reviewingStory; +$lang->projectstory->featureBar['story']['changing'] = $lang->product->changingStory; +$lang->projectstory->featureBar['story']['closed'] = $lang->product->closedStory; +$lang->projectstory->featureBar['story']['linkedExecution'] = 'Linked ' . $lang->execution->common; +$lang->projectstory->featureBar['story']['unlinkedExecution'] = 'Unlinked ' . $lang->execution->common; diff --git a/module/projectstory/lang/zh-cn.php b/module/projectstory/lang/zh-cn.php index 00b3a4fa8f..567ac9cbd0 100644 --- a/module/projectstory/lang/zh-cn.php +++ b/module/projectstory/lang/zh-cn.php @@ -26,6 +26,8 @@ global $app; $app->loadLang('product'); $lang->projectstory->featureBar['story']['allstory'] = $lang->product->allStory; $lang->projectstory->featureBar['story']['unclosed'] = $lang->product->unclosed; +$lang->projectstory->featureBar['story']['draft'] = $lang->product->draftStory; +$lang->projectstory->featureBar['story']['reviewing'] = $lang->product->reviewingStory; $lang->projectstory->featureBar['story']['changing'] = $lang->product->changingStory; $lang->projectstory->featureBar['story']['closed'] = $lang->product->closedStory; $lang->projectstory->featureBar['story']['linkedExecution'] = '已关联' . $lang->execution->common; diff --git a/module/report/view/productsummary.html.php b/module/report/view/productsummary.html.php index 83633ad364..e4438f2a86 100644 --- a/module/report/view/productsummary.html.php +++ b/module/report/view/productsummary.html.php @@ -48,6 +48,7 @@ productplan->begin;?> productplan->end;?> story->statusList['draft'];?> + story->statusList['reviewing'];?> story->statusList['active'];?> story->statusList['changing'];?> story->statusList['closed'];?> @@ -71,16 +72,18 @@ begin == '2030-01-01' ? $lang->productplan->future : $plan->begin;?> end == '2030-01-01' ? $lang->productplan->future : $plan->end;?> status['draft']) ? $plan->status['draft'] : 0; - $activeCount = isset($plan->status['active']) ? $plan->status['active'] : 0; - $changedCount = isset($plan->status['changing']) ? $plan->status['changing'] : 0; - $closedCount = isset($plan->status['closed']) ? $plan->status['closed'] : 0; + $draftCount = isset($plan->status['draft']) ? $plan->status['draft'] : 0; + $reviewingCount = isset($plan->status['reviewing']) ? $plan->status['reviewing'] : 0; + $activeCount = isset($plan->status['active']) ? $plan->status['active'] : 0; + $changedCount = isset($plan->status['changing']) ? $plan->status['changing'] : 0; + $closedCount = isset($plan->status['closed']) ? $plan->status['closed'] : 0; ?> + - + "?> @@ -95,6 +98,7 @@ 0 0 0 + 0 diff --git a/module/story/control.php b/module/story/control.php index 802ff75c8f..f9087962bc 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1202,7 +1202,7 @@ class story extends control /* Assign. */ $this->view->title = $this->lang->story->activate . "STORY" . $this->lang->colon . $this->view->story->title; - $this->view->users = $this->user->getPairs('pofirst|nodeleted', $this->view->story->closedBy); + $this->view->users = $this->user->getPairs('pofirst|nodeleted|noclosed', $this->view->story->closedBy); $this->view->position[] = $this->lang->story->activate; $this->display(); } @@ -1510,7 +1510,7 @@ class story extends control if($confirm == 'no') { $confirmTips = $story->status == 'changing' ? $this->lang->story->confirmRecallChange : $this->lang->story->confirmRecallReview; - return print(js::confirm($confirmTips, $this->createLink('story', 'recall', "storyID=$storyID&from=lite&confirm=yes"))); + return print(js::confirm($confirmTips, $this->createLink('story', 'recall', "storyID=$storyID&from=$from&confirm=yes"))); } else { @@ -1520,10 +1520,10 @@ class story extends control $action = $story->status == 'changing' ? 'recalledChange' : 'Recalled'; $this->loadModel('action')->create('story', $storyID, $action); - if($from == 'view') return print(js::locate($this->createLink('story', 'view', "storyID={$storyID}&from=view"))); + if($from == 'view') return print(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent')); $locateLink = $this->session->storyList ? $this->session->storyList : $this->createLink('product', 'browse', "productID={$story->product}"); - echo js::locate($locateLink, 'parent'); + return print(js::locate($locateLink, 'parent')); } } diff --git a/module/story/lang/de.php b/module/story/lang/de.php index de44ec1319..4d48e2b9cc 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -462,8 +462,10 @@ $lang->story->subDivideTip['planned'] = 'The Story has been planned and cannot $lang->story->subDivideTip['projected'] = 'The Story has been initiated and cannot be subdivided.'; $lang->story->subDivideTip['notActive'] = 'The Story is not active and cannot be subdivided.'; -$lang->story->featureBar['browse']['all'] = $lang->all; -$lang->story->featureBar['browse']['unclosed'] = $lang->story->unclosed; +$lang->story->featureBar['browse']['all'] = $lang->all; +$lang->story->featureBar['browse']['unclosed'] = $lang->story->unclosed; +$lang->story->featureBar['browse']['draft'] = $lang->story->statusList['draft']; +$lang->story->featureBar['browse']['reviewing'] = $lang->story->statusList['reviewing']; $lang->story->recallList = array(); $lang->story->recallList['recallReview'] = $lang->story->recall; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index c129d9f956..47992876b5 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -462,8 +462,10 @@ $lang->story->subDivideTip['planned'] = 'The Story has been planned and cannot $lang->story->subDivideTip['projected'] = 'The Story has been initiated and cannot be subdivided.'; $lang->story->subDivideTip['notActive'] = 'The Story is not active and cannot be subdivided.'; -$lang->story->featureBar['browse']['all'] = $lang->all; -$lang->story->featureBar['browse']['unclosed'] = $lang->story->unclosed; +$lang->story->featureBar['browse']['all'] = $lang->all; +$lang->story->featureBar['browse']['unclosed'] = $lang->story->unclosed; +$lang->story->featureBar['browse']['draft'] = $lang->story->statusList['draft']; +$lang->story->featureBar['browse']['reviewing'] = $lang->story->statusList['reviewing']; $lang->story->recallList = array(); $lang->story->recallList['recallReview'] = $lang->story->recall; diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index a8e0d948aa..0609cde540 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -462,8 +462,10 @@ $lang->story->subDivideTip['planned'] = 'Cette Story est planifiée et ne peut $lang->story->subDivideTip['projected'] = 'Cette Story a été créée et ne peut être subdivisée.'; $lang->story->subDivideTip['notActive'] = "Cette Story n'est pas active et ne peut être subdivisée."; -$lang->story->featureBar['browse']['all'] = $lang->all; -$lang->story->featureBar['browse']['unclosed'] = $lang->story->unclosed; +$lang->story->featureBar['browse']['all'] = $lang->all; +$lang->story->featureBar['browse']['unclosed'] = $lang->story->unclosed; +$lang->story->featureBar['browse']['draft'] = $lang->story->statusList['draft']; +$lang->story->featureBar['browse']['reviewing'] = $lang->story->statusList['reviewing']; $lang->story->recallList = array(); $lang->story->recallList['recallReview'] = $lang->story->recall; diff --git a/module/story/lang/vi.php b/module/story/lang/vi.php index c9ac6134ff..3871b12490 100644 --- a/module/story/lang/vi.php +++ b/module/story/lang/vi.php @@ -454,8 +454,10 @@ $lang->story->subDivideTip['planned'] = 'The Story has been planned and cannot $lang->story->subDivideTip['projected'] = 'The Story has been initiated and cannot be subdivided.'; $lang->story->subDivideTip['notActive'] = 'The Story is not active and cannot be subdivided.'; -$lang->story->featureBar['browse']['all'] = $lang->all; -$lang->story->featureBar['browse']['unclosed'] = $lang->story->unclosed; +$lang->story->featureBar['browse']['all'] = $lang->all; +$lang->story->featureBar['browse']['unclosed'] = $lang->story->unclosed; +$lang->story->featureBar['browse']['draft'] = $lang->story->statusList['draft']; +$lang->story->featureBar['browse']['reviewing'] = $lang->story->statusList['reviewing']; $lang->story->recallList = array(); $lang->story->recallList['recallReview'] = $lang->story->recall; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 7439fcf443..3d57497266 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -462,8 +462,10 @@ $lang->story->subDivideTip['planned'] = '该需求已计划,无法进行细 $lang->story->subDivideTip['projected'] = '该需求已立项,无法进行细分操作'; $lang->story->subDivideTip['notActive'] = '需求不是激活状态,无法进行细分操作'; -$lang->story->featureBar['browse']['all'] = $lang->all; -$lang->story->featureBar['browse']['unclosed'] = $lang->story->unclosed; +$lang->story->featureBar['browse']['all'] = $lang->all; +$lang->story->featureBar['browse']['unclosed'] = $lang->story->unclosed; +$lang->story->featureBar['browse']['draft'] = $lang->story->statusList['draft']; +$lang->story->featureBar['browse']['reviewing'] = $lang->story->statusList['reviewing']; $lang->story->recallList = array(); $lang->story->recallList['recallReview'] = $lang->story->recall; diff --git a/module/story/model.php b/module/story/model.php index 64909ca66a..4fbfbcb72b 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -709,6 +709,7 @@ class storyModel extends model ->remove('files,labels,reviewer,comment,needNotReview,uid') ->get(); + $story = $this->loadModel('file')->processImgURL($story, $this->config->story->editor->change['id'], $this->post->uid); $this->dao->update(TABLE_STORY)->data($story, 'spec,verify') ->autoCheck() @@ -757,12 +758,15 @@ class storyModel extends model $reviewData->reviewer = $reviewer; $this->dao->insert(TABLE_STORYREVIEW)->data($reviewData)->exec(); } + + if($reviewerHasChanged) + { + $oldStory->reviewers = implode(',', array_keys($oldStoryReviewers)); + $story->reviewers = implode(',', $_POST['reviewer']); + } } $this->file->updateObjectID($this->post->uid, $storyID, 'story'); - - $oldStory->reviewers = implode(',', array_keys($oldStoryReviewers)); - $story->reviewers = implode(',', $_POST['reviewer']); return common::createChanges($oldStory, $story); } } @@ -1438,6 +1442,8 @@ class storyModel extends model ->add('id', $storyID) ->remove('result,comment') ->get(); + + $story->reviewedBy = implode(',', array_unique(explode(',', $story->reviewedBy))); $story = $this->loadModel('file')->processImgURL($story, $this->config->story->editor->review['id'], $this->post->uid); /* Fix bug #671. */ @@ -3051,15 +3057,6 @@ class storyModel extends model if(empty($normalProducts) and empty($branchProducts)) $storyQuery .= '1 = 1'; $storyQuery .= ') '; - if($this->app->moduleName == 'release' or $this->app->moduleName == 'build') - { - $storyQuery .= " AND `status` NOT IN ('draft', 'reviewing')"; // Fix bug #990. - } - else - { - $storyQuery .= " AND `status` NOT IN ('draft', 'reviewing', 'closed')"; - } - if($this->app->rawModule == 'build' and $this->app->rawMethod == 'linkstory') $storyQuery .= " AND `parent` != '-1'"; } elseif(strpos($storyQuery, $allBranch) !== false) @@ -3072,6 +3069,15 @@ class storyModel extends model } $storyQuery = preg_replace("/`plan` +LIKE +'%([0-9]+)%'/i", "CONCAT(',', `plan`, ',') LIKE '%,$1,%'", $storyQuery); + if($this->app->moduleName == 'release' or $this->app->moduleName == 'build') + { + $storyQuery .= " AND `status` NOT IN ('draft', 'reviewing')"; // Fix bug #990. + } + else + { + $storyQuery .= " AND `status` NOT IN ('draft', 'reviewing', 'closed')"; + } + return $this->getBySQL($queryProductID, $storyQuery, $orderBy, $pager, $type); } @@ -3225,7 +3231,7 @@ class storyModel extends model ->beginIF($execution->type == 'project') ->beginIF(!empty($productID))->andWhere('t1.product')->eq($productID) ->beginIF($type == 'bybranch' and $branchParam !== '')->andWhere('t2.branch')->in("0,$branchParam")->fi() - ->beginIF(strpos('changing|closed', $type) !== false)->andWhere('t2.status')->eq($type)->fi() + ->beginIF(strpos('draft|reviewing|changing|closed', $type) !== false)->andWhere('t2.status')->eq($type)->fi() ->beginIF($type == 'unclosed')->andWhere('t2.status')->in(array_keys($unclosedStatus))->fi() ->beginIF($type == 'linkedexecution')->andWhere('t2.id')->in($storyIdList)->fi() ->beginIF($type == 'unlinkedexecution')->andWhere('t2.id')->notIn($storyIdList)->fi() @@ -4129,7 +4135,7 @@ class storyModel extends model if($action == 'assignto') return $story->status != 'closed'; if($action == 'createcase') return $story->type != 'requirement'; if($action == 'batchcreate' and $story->parent > 0) return false; - if($action == 'batchcreate' and $story->type == 'requirement' and $story->status != 'closed') return $story->status != 'draft'; + if($action == 'batchcreate' and $story->type == 'requirement' and $story->status != 'closed') return strpos('draft,reviewing,changing', $story->status) === false; if($action == 'batchcreate' and $config->vision == 'lite' and ($story->status == 'active' and ($story->stage == 'wait' or $story->stage == 'projected'))) return true; if($action == 'batchcreate' and ($story->status != 'active' or $story->stage != 'wait' or !empty($story->plan))) return false; @@ -4237,6 +4243,7 @@ class storyModel extends model if($type == 'view') { $menu .= $this->buildMenu('story', 'change', $params, $story, $type, 'alter', '', 'showinonlybody'); + if($story->status == 'draft') $menu .= $this->buildMenu('story', 'submitReview', $params, $story, $type, 'sub-review', '', 'showinonlybody iframe', true, "data-width='50%'"); $title = $story->status == 'changing' ? $this->lang->story->recallChange : $this->lang->story->recall; $menu .= $this->buildMenu('story', 'recall', $params . '&from=view', $story, $type, 'undo', 'hiddenwin', 'showinonlybody', false, '', $title);