From 1c54d00d3199ef7fb135e52f7c5a811d07dd73dc Mon Sep 17 00:00:00 2001 From: liuruogu Date: Wed, 21 Sep 2022 02:24:15 +0000 Subject: [PATCH] * Finish task #69015. --- module/story/control.php | 25 ++++++++++++++++--------- module/story/view/create.html.php | 4 ++-- module/story/view/edit.html.php | 6 +++--- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index b14517377d..0f1eb2af62 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -381,21 +381,24 @@ class story extends control ->fetch('id'); } - /* Get users in team. */ - $teamUsers = $product->reviewer; - if(!$teamUsers and $product->acl != 'open') $teamUsers = $this->loadModel('user')->getProductViewListUsers($product, '', '', '', ''); + /* Get reviewers. */ + $reviewers = $product->reviewer; + if(!$reviewers and $product->acl != 'open') $reviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', '', ''); /* Hidden some fields of projects without products. */ $this->view->hiddenProduct = false; $this->view->hiddenPlan = false; $this->view->hiddenURS = false; + $this->view->teamUsers = array(); if($this->app->tab === 'project' || $this->app->tab === 'execution') { $project = $this->dao->findById((int)$objectID)->from(TABLE_PROJECT)->fetch(); + if(!empty($project->project)) $project = $this->dao->findById((int)$project->project)->from(TABLE_PROJECT)->fetch(); if(empty($project->hasProduct)) { + $this->view->teamUsers = $this->project->getTeamMemberPairs($project->id); $this->view->hiddenProduct = true; if($project->model !== 'scrum') $this->view->hiddenPlan = true; @@ -428,7 +431,7 @@ class story extends control $this->view->stories = $this->story->getParentStoryPairs($productID); $this->view->productID = $productID; $this->view->product = $product; - $this->view->teamUsers = $this->user->getPairs('noclosed|nodeleted', '', 0, $teamUsers); + $this->view->reviewers = $this->user->getPairs('noclosed|nodeleted', '', 0, $reviewers); $this->view->objectID = $objectID; $this->view->estimate = $estimate; $this->view->storyTitle = $title; @@ -858,13 +861,16 @@ class story extends control $this->view->hiddenProduct = false; $this->view->hiddenPlan = false; $this->view->hiddenURS = false; + $this->view->teamUsers = array(); if($this->app->tab === 'project' || $this->app->tab === 'execution') { $project = $this->dao->findById((int)$objectID)->from(TABLE_PROJECT)->fetch(); + if(!empty($project->project)) $project = $this->dao->findById((int)$project->project)->from(TABLE_PROJECT)->fetch(); if(empty($project->hasProduct)) { + $this->view->teamUsers = $this->project->getTeamMemberPairs($project->id); $this->view->hiddenProduct = true; if($project->model !== 'scrum') $this->view->hiddenPlan = true; @@ -888,9 +894,9 @@ class story extends control $reviewedBy = explode(',', trim($story->reviewedBy, ',')); foreach($reviewedBy as $reviewer) $reviewedReviewer[] = zget($users, $reviewer); - /* Get users in team. */ - $teamUsers = $product->reviewer; - if(!$teamUsers and $product->acl != 'open') $teamUsers = $this->loadModel('user')->getProductViewListUsers($product, '', '', '', ''); + /* Get product reviewers. */ + $productReviewers = $product->reviewer; + if(!$productReviewers and $product->acl != 'open') $productReviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', '', ''); /* Process the module when branch products are switched to normal products. */ if($product->type == 'normal' and !empty($story->branch)) $this->view->moduleOptionMenu += $this->tree->getModulesName($story->module); @@ -911,7 +917,7 @@ class story extends control $this->view->branchTagOption = $branchTagOption; $this->view->reviewers = array_keys($reviewerList); $this->view->reviewedReviewer = $reviewedReviewer; - $this->view->teamUsers = $this->user->getPairs('noclosed|nodeleted', array_keys($reviewerList), 0, $teamUsers); + $this->view->productReviewers = $this->user->getPairs('noclosed|nodeleted', array_keys($reviewerList), 0, $productReviewers); $this->display(); } @@ -2102,6 +2108,7 @@ class story extends control /* Get story and product. */ $story = $this->story->getById($storyID); $products = $this->product->getPairs(); + $product = $this->product->getById($story->product); /* Set menu. */ $this->product->setMenu($story->product, $story->branch); @@ -2111,7 +2118,7 @@ class story extends control $this->view->story = $story; $this->view->storyType = $storyType; $this->view->actions = $this->action->getList('story', $storyID); - $this->view->users = ($this->config->vision == 'lite') ? $this->loadModel('user')->getTeamMemberPairs($this->session->project) : $this->loadModel('user')->getPairs('nodeleted|noclosed|pofirst|noletter'); + $this->view->users = ($this->config->vision == 'lite' || !empty($product->shadow)) ? $this->loadModel('user')->getTeamMemberPairs($this->session->project) : $this->loadModel('user')->getPairs('nodeleted|noclosed|pofirst|noletter'); $this->display(); } diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index 5f7f04e431..5ba9b5c1a0 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -130,7 +130,7 @@ foreach(explode(',', $config->story->create->requiredFields) as $field) story->assignedTo;?> - +
@@ -151,7 +151,7 @@ foreach(explode(',', $config->story->create->requiredFields) as $field) story->checkForceReview() ? 'required' : '';?> story->checkForceReview() ? '' : html::hidden('needNotReview', 1);?>
- PO : '', "class='form-control picker-select' multiple $required");?> + PO : '', "class='form-control picker-select' multiple $required");?>
diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php index 020d7f51e7..dcbb58163d 100644 --- a/module/story/view/edit.html.php +++ b/module/story/view/edit.html.php @@ -54,7 +54,7 @@
story->checkForceReview()):?>
- +
@@ -66,7 +66,7 @@
- +
@@ -273,7 +273,7 @@ status == 'reviewing'):?> story->reviewers;?> - + status == 'closed'):?>