From 5d37062ad684bdacde3e29f06009a97d092d229d Mon Sep 17 00:00:00 2001 From: zenggang Date: Wed, 29 Sep 2021 10:46:07 +0800 Subject: [PATCH 1/6] * Fix bug#15359 --- module/execution/view/task.html.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/execution/view/task.html.php b/module/execution/view/task.html.php index b8e969cbf2..6da2ab904f 100644 --- a/module/execution/view/task.html.php +++ b/module/execution/view/task.html.php @@ -149,13 +149,13 @@ body {margin-bottom: 25px;} From 3efa1338279493879adb8c58a23a2e0c58afbd17 Mon Sep 17 00:00:00 2001 From: zenggang Date: Wed, 29 Sep 2021 10:59:27 +0800 Subject: [PATCH 2/6] * Fix bug#15278 --- module/story/model.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/module/story/model.php b/module/story/model.php index bbf818311e..d4e00bfbc3 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3866,7 +3866,7 @@ class storyModel extends model { $requirements = $this->dao->select('t3.*')->from(TABLE_PROJECTSTORY)->alias('t1') ->leftJoin(TABLE_RELATION)->alias('t2')->on("t1.story=t2.AID && t2.AType='story'") - ->leftJoin(TABLE_STORY)->alias('t3')->on("t2.BID=t3.id && t2.BType='requirement'") + ->leftJoin(TABLE_STORY)->alias('t3')->on("t2.BID=t3.id && t2.BType='requirement' && t3.deleted='0'") ->where('t1.project')->eq($projectID) ->andWhere('t1.product')->eq($productID) ->andWhere('t3.id')->ne('') @@ -3919,11 +3919,13 @@ class storyModel extends model $tracks = $requirements; /* Get no requirements story. */ - $excludeStories = $this->dao->select('BID')->from(TABLE_RELATION) - ->where('AType')->eq('requirement') - ->andWhere('BType')->eq('story') - ->andWhere('relation')->eq('subdivideinto') - ->andWhere('product')->eq($productID) + $excludeStories = $this->dao->select('t1.BID')->from(TABLE_RELATION)->alias('t1') + ->leftJoin(TABLE_STORY)->alias('t2')->on("t1.AID=t2.id") + ->where('t2.deleted')->eq('0') + ->andWhere('t1.AType')->eq('requirement') + ->andWhere('t1.BType')->eq('story') + ->andWhere('t1.relation')->eq('subdivideinto') + ->andWhere('t1.product')->eq($productID) ->fetchPairs('BID', 'BID'); if($projectID) { From f139f00e61b31270215cb05739cc6de5f3aa8fed Mon Sep 17 00:00:00 2001 From: zenggang Date: Thu, 30 Sep 2021 11:19:05 +0800 Subject: [PATCH 3/6] * Task 42862,previously committed to the master branch, now resubmit to the 165 branch --- module/build/control.php | 4 ++-- module/execution/model.php | 3 ++- module/product/model.php | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index 2d9d1d6c36..b244f129a6 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -46,7 +46,7 @@ class build extends control if($this->app->tab == 'project') { $this->loadModel('project')->setMenu($projectID); - $executions = $this->execution->getPairs($projectID); + $executions = $this->execution->getPairs($projectID, 'all', 'stagefilter'); $executionID = empty($executionID) ? key($executions) : $executionID; $this->session->set('project', $projectID); } @@ -136,7 +136,7 @@ class build extends control $execution->name = ''; } - $executions = $this->product->getExecutionPairsByProduct($build->product, $build->branch, 'id_desc', $this->session->project); + $executions = $this->product->getExecutionPairsByProduct($build->product, $build->branch, 'id_desc', $this->session->project, 'stagefilter'); if(!isset($executions[$build->execution])) $executions[$build->execution] = $execution->name; $productGroups = $this->execution->getProducts($build->execution); diff --git a/module/execution/model.php b/module/execution/model.php index 8b87219dea..2f4a2f8758 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -986,7 +986,7 @@ class executionModel extends model * * @param int $projectID * @param string $type all|sprint|stage|kanban - * @param string $mode all|noclosed or empty + * @param string $mode all|noclosed|stagefilter or empty * @access public * @return array */ @@ -1024,6 +1024,7 @@ class executionModel extends model foreach($executions as $execution) { if(strpos($mode, 'noclosed') !== false and ($execution->status == 'done' or $execution->status == 'closed')) continue; + if(strpos($mode, 'stagefilter') !== false and isset($executionModel) and $executionModel == 'waterfall' and in_array($execution->attribute, array('request', 'design', 'review'))) continue; // Some stages of waterfall not need. $pairs[$execution->id] = $execution->name; } diff --git a/module/product/model.php b/module/product/model.php index 5ce4f4783a..8e481a7496 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -1026,10 +1026,11 @@ class productModel extends model * @param int $branch * @param string $orderBy * @param int $projectID + * @param string $mode stagefilter or empty * @access public * @return array */ - public function getExecutionPairsByProduct($productID, $branch = 0, $orderBy = 'id_asc', $projectID = 0) + public function getExecutionPairsByProduct($productID, $branch = 0, $orderBy = 'id_asc', $projectID = 0, $mode = '') { if(empty($productID)) return array(); if(empty($projectID) or $this->config->systemMode == 'classic') return $this->getAllExecutionPairsByProduct($productID, $branch); @@ -1037,7 +1038,7 @@ class productModel extends model $project = $this->loadModel('project')->getByID($projectID); $orderBy = $project->model == 'waterfall' ? 'begin_asc,id_asc' : 'begin_desc,id_desc'; - $executions = $this->dao->select('t2.id,t2.name,t2.grade,t2.parent')->from(TABLE_PROJECTPRODUCT)->alias('t1') + $executions = $this->dao->select('t2.id,t2.name,t2.grade,t2.parent,t2.attribute')->from(TABLE_PROJECTPRODUCT)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') ->where('t1.product')->eq($productID) ->andWhere('t2.project')->eq($projectID) @@ -1068,6 +1069,7 @@ class productModel extends model $executionList = $executionList + $execution->children; continue; } + if(strpos($mode, 'stagefilter') !== false and in_array($execution->attribute, array('request', 'design', 'review'))) continue; // Some stages of waterfall not need. $executionList[$execution->id] = $execution->name; } } From cc28a1a0377386373c6c2b6b70dea467e0c9e7d8 Mon Sep 17 00:00:00 2001 From: zenggang Date: Thu, 30 Sep 2021 14:53:36 +0800 Subject: [PATCH 4/6] * Fix bug#14382 --- module/project/lang/de.php | 4 ++-- module/project/lang/en.php | 4 ++-- module/project/lang/fr.php | 4 ++-- module/project/lang/vi.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/module/project/lang/de.php b/module/project/lang/de.php index 4a847945ea..55a95073d0 100644 --- a/module/project/lang/de.php +++ b/module/project/lang/de.php @@ -81,9 +81,9 @@ $lang->project->bycard = 'Card'; $lang->project->mine = 'My'; $lang->project->myProject = 'Meine Zuständigkeit'; $lang->project->other = 'Andere'; -$lang->project->acl = 'Access control'; +$lang->project->acl = 'ACL'; $lang->project->setPlanduration = 'Set Duration'; -$lang->project->auth = 'Access Control'; +$lang->project->auth = 'Privileges'; $lang->project->durationEstimation = 'Estimated Workload'; $lang->project->teamCount = 'Man'; $lang->project->teamSumCount = '%s people in total'; diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 748946e8d0..2f9bb44c73 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -117,9 +117,9 @@ $lang->project->bycard = 'Card'; $lang->project->mine = 'My'; $lang->project->myProject = 'Mine'; $lang->project->other = 'Others'; -$lang->project->acl = 'Access control'; +$lang->project->acl = 'ACL'; $lang->project->setPlanduration = 'Set Duration'; -$lang->project->auth = 'Access Control'; +$lang->project->auth = 'Privileges'; $lang->project->durationEstimation = 'Estimated Workload'; $lang->project->leftStories = 'Left Stories'; $lang->project->leftTasks = 'Left Tasks'; diff --git a/module/project/lang/fr.php b/module/project/lang/fr.php index 93cdeed8f5..ad8cc6e623 100644 --- a/module/project/lang/fr.php +++ b/module/project/lang/fr.php @@ -81,9 +81,9 @@ $lang->project->bycard = 'Card'; $lang->project->mine = 'My'; $lang->project->myProject = 'Mine'; $lang->project->other = 'Others'; -$lang->project->acl = 'Access control'; +$lang->project->acl = 'ACL'; $lang->project->setPlanduration = 'Set Duration'; -$lang->project->auth = 'Access Control'; +$lang->project->auth = 'Privileges'; $lang->project->durationEstimation = 'Estimated Workload'; $lang->project->teamCount = 'Man'; $lang->project->teamSumCount = '%s people in total'; diff --git a/module/project/lang/vi.php b/module/project/lang/vi.php index 57050f31f5..78cf1f7963 100644 --- a/module/project/lang/vi.php +++ b/module/project/lang/vi.php @@ -81,9 +81,9 @@ $lang->project->bycard = 'Card'; $lang->project->mine = 'My'; $lang->project->myProject = 'Mine'; $lang->project->other = 'Others'; -$lang->project->acl = 'Access control'; +$lang->project->acl = 'ACL'; $lang->project->setPlanduration = 'Set Duration'; -$lang->project->auth = 'Access Control'; +$lang->project->auth = 'Privileges'; $lang->project->durationEstimation = 'Estimated Workload'; $lang->project->teamCount = 'Man'; $lang->project->teamSumCount = '%s people in total'; From 189bc062b3feb0e51e798b65948e5563ce552abe Mon Sep 17 00:00:00 2001 From: zenggang Date: Thu, 30 Sep 2021 16:17:48 +0800 Subject: [PATCH 5/6] * Fix bug#15363 --- module/common/model.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/module/common/model.php b/module/common/model.php index 0fee18a258..4bcd62386f 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -674,6 +674,23 @@ class commonModel extends model } } + /* Check whether other methods under the module have permissions. If yes, point to other methods. */ + if($display == false and isset($lang->$currentModule->menu)) + { + foreach($lang->$currentModule->menu as $menu) + { + $linkPart = explode('|', $menu['link']); + if(isset($linkPart[2])) $method = $linkPart[2]; + else continue; + if(common::hasPriv($currentModule, $method)) + { + $display = true; + $currentMethod = $method; + if(!isset($menu['target'])) break; // Try to jump to the method without opening a new window. + } + } + } + if(!$display) continue; /* Assign vars. */ From 77a9b33191ffc5156f6a28b1285204049fd2a8a9 Mon Sep 17 00:00:00 2001 From: zenggang Date: Fri, 8 Oct 2021 02:27:50 +0000 Subject: [PATCH 6/6] * Adjust code style --- module/common/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/common/model.php b/module/common/model.php index 4bcd62386f..955489e1b8 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -680,8 +680,8 @@ class commonModel extends model foreach($lang->$currentModule->menu as $menu) { $linkPart = explode('|', $menu['link']); - if(isset($linkPart[2])) $method = $linkPart[2]; - else continue; + if(!isset($linkPart[2])) continue; + $method = $linkPart[2]; if(common::hasPriv($currentModule, $method)) { $display = true;