From 0b39085e997c5b4d1fdc279f910cfeb823bf8505 Mon Sep 17 00:00:00 2001 From: wangyuting2 <851424971@qq.com> Date: Tue, 20 Sep 2022 08:59:10 +0000 Subject: [PATCH 1/7] * Fix bug #27593 and bug #27592. --- module/upgrade/model.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/module/upgrade/model.php b/module/upgrade/model.php index f4be29dbdd..14d6d0916d 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -7637,7 +7637,9 @@ class upgradeModel extends model $project->id = $projectID; $this->createProjectDocLib($project); - $this->processMergedData($programID, $projectID, '', array(), array($sprint->id)); + + $productIdList = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($sprint->id)->fetchPairs(); + $this->processMergedData($programID, $projectID, '', $productIdList, array($sprint->id)); } $this->fixProjectPath($programID); @@ -7707,7 +7709,9 @@ class upgradeModel extends model $project->id = $projectID; $this->createProjectDocLib($project); - $this->processMergedData($programID, $projectID, '', array(), array_keys($sprints)); + + $productIdList = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($sprints))->fetchPairs(); + $this->processMergedData($programID, $projectID, '', $productIdList, array_keys($sprints)); } $this->fixProjectPath($programID); From 5025bf75486ea5661a76f33ede1c616e1c152a99 Mon Sep 17 00:00:00 2001 From: wangyuting2 <851424971@qq.com> Date: Tue, 20 Sep 2022 09:08:53 +0000 Subject: [PATCH 2/7] * Fix bug #27587. --- module/product/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/product/model.php b/module/product/model.php index 2fadb0242c..2137a29efa 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -1309,7 +1309,7 @@ class productModel extends model if(empty($productID)) return array(); $project = $this->loadModel('project')->getByID($projectID); - $orderBy = $project->model == 'waterfall' ? 'begin_asc,id_asc' : 'begin_desc,id_desc'; + $orderBy = $project && $project->model == 'waterfall' ? 'begin_asc,id_asc' : 'begin_desc,id_desc'; $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') @@ -1324,7 +1324,7 @@ class productModel extends model /* The waterfall project needs to show the hierarchy and remove the parent stage. */ $executionList = array('0' => ''); - if($project->model == 'waterfall') + if($project && $project->model == 'waterfall') { foreach($executions as $id => $execution) { From 8490bf7dbfa5a4724179ede772c93958f9acc274 Mon Sep 17 00:00:00 2001 From: daitingting Date: Wed, 21 Sep 2022 01:12:39 +0000 Subject: [PATCH 3/7] * Rename noExecution to noSprint. * Optimize codes. --- module/block/lang/de.php | 4 ++-- module/block/lang/en.php | 4 ++-- module/block/lang/fr.php | 4 ++-- module/block/lang/zh-cn.php | 4 ++-- module/block/model.php | 2 +- module/bug/view/create.html.php | 4 ++-- module/common/lang/menu.php | 8 ++++---- module/common/model.php | 4 ++-- module/group/view/manageprojectadmin.html.php | 6 +++--- module/project/model.php | 14 +++++--------- module/upgrade/model.php | 6 +++--- 11 files changed, 28 insertions(+), 32 deletions(-) diff --git a/module/block/lang/de.php b/module/block/lang/de.php index 655c4df0de..6f30292284 100644 --- a/module/block/lang/de.php +++ b/module/block/lang/de.php @@ -322,7 +322,7 @@ $lang->block->default['full']['my']['10']['title'] = 'Project List'; $lang->block->default['full']['my']['10']['block'] = 'project'; $lang->block->default['full']['my']['10']['source'] = 'project'; $lang->block->default['full']['my']['10']['grid'] = 8; -if(!isset($config->projectMode) || $config->projectMode != 'noExecution') +if(!isset($config->projectMode) || $config->projectMode != 'noSprint') { $lang->block->default['full']['my']['10']['block'] = 'project'; $lang->block->default['full']['my']['10']['source'] = 'project'; @@ -355,7 +355,7 @@ $lang->block->availableBlocks->feedback = 'My Feedbacks'; $lang->block->moduleList['product'] = $lang->productCommon; $lang->block->moduleList['project'] = 'Project'; -if(!isset($config->projectMode) || $config->projectMode != 'noExecution') $lang->block->moduleList['execution'] = $lang->execution->common; +if(!isset($config->projectMode) || $config->projectMode != 'noSprint') $lang->block->moduleList['execution'] = $lang->execution->common; $lang->block->moduleList['qa'] = 'QA'; $lang->block->moduleList['todo'] = 'Todos'; diff --git a/module/block/lang/en.php b/module/block/lang/en.php index 214b1fd45f..b085a9443e 100644 --- a/module/block/lang/en.php +++ b/module/block/lang/en.php @@ -322,7 +322,7 @@ $lang->block->default['full']['my']['10']['title'] = 'Project List'; $lang->block->default['full']['my']['10']['block'] = 'project'; $lang->block->default['full']['my']['10']['source'] = 'project'; $lang->block->default['full']['my']['10']['grid'] = 8; -if(!isset($config->projectMode) || $config->projectMode != 'noExecution') +if(!isset($config->projectMode) || $config->projectMode != 'noSprint') { $lang->block->default['full']['my']['10']['block'] = 'execution'; $lang->block->default['full']['my']['10']['source'] = 'execution'; @@ -355,7 +355,7 @@ $lang->block->availableBlocks->feedback = 'My Feedbacks'; $lang->block->moduleList['product'] = $lang->productCommon; $lang->block->moduleList['project'] = 'Project'; -if(!isset($config->projectMode) || $config->projectMode != 'noExecution') $lang->block->moduleList['execution'] = $lang->execution->common; +if(!isset($config->projectMode) || $config->projectMode != 'noSprint') $lang->block->moduleList['execution'] = $lang->execution->common; $lang->block->moduleList['qa'] = 'Test'; $lang->block->moduleList['todo'] = 'Todo'; diff --git a/module/block/lang/fr.php b/module/block/lang/fr.php index d0e712551e..9b6c1e8db1 100644 --- a/module/block/lang/fr.php +++ b/module/block/lang/fr.php @@ -322,7 +322,7 @@ $lang->block->default['full']['my']['10']['title'] = 'Project List'; $lang->block->default['full']['my']['10']['block'] = 'project'; $lang->block->default['full']['my']['10']['source'] = 'project'; $lang->block->default['full']['my']['10']['grid'] = 8; -if(!isset($config->projectMode) || $config->projectMode != 'noExecution') +if(!isset($config->projectMode) || $config->projectMode != 'noSprint') { $lang->block->default['full']['my']['10']['block'] = 'project'; $lang->block->default['full']['my']['10']['source'] = 'project'; @@ -355,7 +355,7 @@ $lang->block->availableBlocks->feedback = 'My Feedbacks'; $lang->block->moduleList['product'] = $lang->productCommon; $lang->block->moduleList['project'] = 'Project'; -if(!isset($config->projectMode) || $config->projectMode != 'noExecution') $lang->block->moduleList['execution'] = $lang->execution->common; +if(!isset($config->projectMode) || $config->projectMode != 'noSprint') $lang->block->moduleList['execution'] = $lang->execution->common; $lang->block->moduleList['qa'] = 'Test'; $lang->block->moduleList['todo'] = 'Todo'; diff --git a/module/block/lang/zh-cn.php b/module/block/lang/zh-cn.php index 2e5712c535..2a4ac76a7a 100644 --- a/module/block/lang/zh-cn.php +++ b/module/block/lang/zh-cn.php @@ -322,7 +322,7 @@ $lang->block->default['full']['my']['10']['title'] = '项目列表'; $lang->block->default['full']['my']['10']['block'] = 'project'; $lang->block->default['full']['my']['10']['source'] = 'project'; $lang->block->default['full']['my']['10']['grid'] = 8; -if(!isset($config->projectMode) || $config->projectMode != 'noExecution') +if(!isset($config->projectMode) || $config->projectMode != 'noSprint') { $lang->block->default['full']['my']['10']['block'] = 'execution'; $lang->block->default['full']['my']['10']['source'] = 'execution'; @@ -355,7 +355,7 @@ $lang->block->availableBlocks->feedback = '反馈'; $lang->block->moduleList['product'] = $lang->productCommon; $lang->block->moduleList['project'] = '项目'; -if(!isset($config->projectMode) || $config->projectMode != 'noExecution') $lang->block->moduleList['execution'] = $lang->execution->common; +if(!isset($config->projectMode) || $config->projectMode != 'noSprint') $lang->block->moduleList['execution'] = $lang->execution->common; $lang->block->moduleList['qa'] = '测试'; $lang->block->moduleList['todo'] = '待办'; diff --git a/module/block/model.php b/module/block/model.php index 3d3f6aeaff..29a9538e3e 100644 --- a/module/block/model.php +++ b/module/block/model.php @@ -137,7 +137,7 @@ class blockModel extends model ->andWhere('vision')->eq($this->config->vision) ->andWhere('hidden')->eq(0) ->beginIF($type)->andWhere('type')->eq($type)->fi() - ->beginIF(isset($this->config->projectMode) && $this->config->projectMode == 'noExecution')->andWhere('source')->ne('execution')->fi() + ->beginIF(isset($this->config->projectMode) && $this->config->projectMode == 'noSprint')->andWhere('source')->ne('execution')->fi() ->orderBy('`order`') ->fetchAll('id'); } diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index e385e28e06..418c3668fa 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -78,7 +78,7 @@ if($this->app->tab == 'project') js::set('objectID', $projectID); - projectMode) and $config->projectMode == 'noExecution');?> + projectMode) and $config->projectMode == 'noSprint');?> bug->project : $lang->bug->type;?> @@ -111,7 +111,7 @@ if($this->app->tab == 'project') js::set('objectID', $projectID); - +
diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index 174f0b54e2..bf91f22500 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -62,7 +62,7 @@ $lang->mainNav->menuOrder[55] = 'system'; $lang->mainNav->menuOrder[60] = 'admin'; if($config->systemMode == 'lean') unset($lang->mainNav->program, $lang->mainNav->menuOrder[10]); -if(isset($config->projectMode) and $config->projectMode == 'noExecution') unset($lang->mainNav->execution, $lang->mainNav->menuOrder[25]); +if(isset($config->projectMode) and $config->projectMode == 'noSprint') unset($lang->mainNav->execution, $lang->mainNav->menuOrder[25]); /* My menu. */ $lang->my->menu = new stdclass(); @@ -89,7 +89,7 @@ $lang->my->menuOrder[45] = 'score'; $lang->my->menuOrder[50] = 'contacts'; if(!$config->systemScore) unset($lang->my->menu->score, $lang->my->menuOrder[45]); -if(isset($config->projectMode) and $config->projectMode == 'noExecution') unset($lang->my->menu->execution, $lang->my->menuOrder[30]); +if(isset($config->projectMode) and $config->projectMode == 'noSprint') unset($lang->my->menu->execution, $lang->my->menuOrder[30]); $lang->my->menu->work['subMenu'] = new stdclass(); $lang->my->menu->work['subMenu']->task = array('link' => "{$lang->task->common}|my|work|mode=task", 'subModule' => 'task'); @@ -488,13 +488,13 @@ $lang->doc->menuOrder[30] = 'project'; $lang->doc->menuOrder[35] = 'execution'; $lang->doc->menuOrder[36] = 'api'; $lang->doc->menuOrder[40] = 'custom'; -if(isset($config->projectMode) and $config->projectMode == 'noExecution') unset($lang->doc->menu->execution, $lang->doc->menuOrder[35]); +if(isset($config->projectMode) and $config->projectMode == 'noSprint') unset($lang->doc->menu->execution, $lang->doc->menuOrder[35]); $lang->doc->menu->product['subMenu'] = new stdclass(); $lang->doc->menu->project['subMenu'] = new stdclass(); $lang->doc->menu->execution['subMenu'] = new stdclass(); $lang->doc->menu->custom['subMenu'] = new stdclass(); -if(isset($config->projectMode) and $config->projectMode == 'noExecution') unset($lang->doc->menu->execution['subMenu']); +if(isset($config->projectMode) and $config->projectMode == 'noSprint') unset($lang->doc->menu->execution['subMenu']); $lang->doc->menu->api['subMenu'] = new stdclass(); $lang->doc->menu->api['subMenu']->index = array('link' => "{$lang->doc->apiDoc}|api|index|libID=%s", 'alias' => 'create,edit'); diff --git a/module/common/model.php b/module/common/model.php index 60bdd68bd0..bfc9312ab0 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -613,7 +613,7 @@ class commonModel extends model if($config->edition == 'open') unset($lang->createIcons['effort']); if($config->systemMode != 'new') unset($lang->createIcons['program']); - if(!isset($config->projectMode) || $config->projectMode == 'noExecution') unset($lang->createIcons['execution']); + if(!isset($config->projectMode) || $config->projectMode == 'noSprint') unset($lang->createIcons['execution']); /* Check whether the creation permission is available, and print create buttons. */ @@ -1240,7 +1240,7 @@ class commonModel extends model $searchObjects = $lang->searchObjects; if($config->systemMode != 'new') unset($searchObjects['program']); - if(!isset($config->projectMode) || $config->projectMode == 'noExecution') unset($searchObjects['execution']); + if(!isset($config->projectMode) || $config->projectMode == 'noSprint') unset($searchObjects['execution']); foreach($searchObjects as $key => $value) { diff --git a/module/group/view/manageprojectadmin.html.php b/module/group/view/manageprojectadmin.html.php index 1523a76f7e..5fce996e72 100644 --- a/module/group/view/manageprojectadmin.html.php +++ b/module/group/view/manageprojectadmin.html.php @@ -43,7 +43,7 @@ systemMode == 'new' ? '' : 'hidden';?> systemMode == 'new' ? 4 : 3;?> - projectMode) and $config->projectMode == 'noExecution');?> + projectMode) and $config->projectMode == 'noSprint');?> $group):?> @@ -104,7 +104,7 @@ group]", array(1 => ''), $group->products == 'all' ? 1 : '', "onchange=toggleDisabled(this);");?> - +
@@ -173,7 +173,7 @@ ''), '', "onchange=toggleDisabled(this);");?> - +
diff --git a/module/project/model.php b/module/project/model.php index 867448ffd8..ba83cafc12 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2493,29 +2493,25 @@ class projectModel extends model $this->config->resetNavGroup['execution'] = 'execution'; $this->config->resetNavGroup[$moduleName] = $navGroup; - $project = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($objectID)->andWhere('noSprint')->eq(1)->fetch(); + $project = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($objectID)->andWhere('noSprint')->eq('1')->fetch(); if(empty($project)) return; + if($project->type != 'project' and $project->type != 'sprint') return; if($project->type == 'project') { $projectID = $project->id; - $executionID = $this->dao->select('*')->from(TABLE_EXECUTION) + $executionID = $this->dao->select('id')->from(TABLE_EXECUTION) ->where('project')->eq($projectID) ->andWhere('noSprint')->eq(1) ->andWhere('type')->eq('sprint') - ->andWhere('deleted')->eq(0) + ->andWhere('deleted')->eq('0') ->fetch('id'); } elseif($project->type == 'sprint') { $executionID = $project->id; - $projectID = $this->dao->select('*')->from(TABLE_PROJECT) - ->where('id')->eq($project->project) - ->andWhere('noSprint')->eq(1) - ->andWhere('type')->eq('project') - ->andWhere('deleted')->eq(0) - ->fetch('id'); + $projectID = $project->project; } if(empty($projectID) or empty($executionID)) return; diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 14d6d0916d..d9a09635b7 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -7538,8 +7538,8 @@ class upgradeModel extends model */ public function classic2Lean($programID) { - /* Set project mode as noExecution. */ - $this->loadModel('setting')->setItem('system.common.global.projectMode', 'noExecution'); + /* Set project mode as noSprint. */ + $this->loadModel('setting')->setItem('system.common.global.projectMode', 'noSprint'); $this->upgradeInProjectMode($programID); @@ -7625,7 +7625,7 @@ class upgradeModel extends model $project->lastEditedDate = $now; $project->grade = 2; $project->acl = $sprint->acl == 'open' ? 'open' : 'private'; - if($projectMode == 'noExecution') $project->noExecution = '1'; + if($projectMode == 'noSprint') $project->noSprint = '1'; $this->dao->insert(TABLE_PROJECT)->data($project)->check('name', 'unique', "type='project' AND parent=$programID AND deleted='0'")->exec(); if(dao::isError()) return false; From 42e85921d6b4dcd4d789b551f5f26e7c12e82776 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 21 Sep 2022 09:19:47 +0800 Subject: [PATCH 4/7] * code for task #69715. --- module/execution/control.php | 4 ++-- module/execution/view/story.html.php | 8 ++++---- module/project/model.php | 3 +++ module/story/model.php | 2 +- module/task/control.php | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 6146f67905..5ca2a32984 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -3123,11 +3123,11 @@ class execution extends control } /* Get projects, executions and products. */ - $object = $this->project->getByID($objectID, $this->app->tab == 'project' ? 'project' : 'sprint,stage,kanban'); + $object = $this->project->getByID($objectID, 'project,sprint,stage,kanban'); $products = $this->product->getProducts($objectID); $queryID = ($browseType == 'bySearch') ? (int)$param : 0; $browseLink = $this->session->executionStoryList; - if($this->app->tab == 'project') $browseLink = $this->createLink('projectstory', 'story', "objectID=$objectID"); + if($this->app->tab == 'project' and empty($object->noSprint)) $browseLink = $this->createLink('projectstory', 'story', "objectID=$objectID"); $this->session->set('storyList', $this->app->getURI(true), $this->app->tab); // Save session. diff --git a/module/execution/view/story.html.php b/module/execution/view/story.html.php index 45f9ce52d7..0d177416b9 100644 --- a/module/execution/view/story.html.php +++ b/module/execution/view/story.html.php @@ -69,7 +69,7 @@
id", " " . $lang->story->export, '', "class='btn btn-link export iframe' data-app='execution'"); + common::printLink('story', 'export', "productID=$productID&orderBy=id_desc&executionID=$execution->id", " " . $lang->story->export, '', "class='btn btn-link export iframe'"); if(common::canModify('execution', $execution)) { @@ -96,14 +96,14 @@ $hidden = empty($buttonLink) ? 'hidden' : ''; echo "