From f6bb08d1e206c94364c2340ce439842b9c4742b1 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Fri, 30 Sep 2022 10:18:25 +0800 Subject: [PATCH 01/36] * Task#70756 Reduction shadow product. --- module/action/model.php | 13 ++++++++++++- module/project/control.php | 7 +++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/module/action/model.php b/module/action/model.php index f66683c290..db82ae616d 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1783,9 +1783,20 @@ class actionModel extends model } elseif(in_array($action->objectType, array('program', 'project', 'execution'))) { - $project = $this->dao->select('id,acl')->from(TABLE_PROJECT)->where('id')->eq($action->objectID)->fetch(); + $project = $this->dao->select('id,acl,name,hasProduct')->from(TABLE_PROJECT)->where('id')->eq($action->objectID)->fetch(); $objecttype = $action->objectType == 'execution' ? 'sprint' : $action->objectType; if($project->acl != 'open') $this->loadModel('user')->updateUserView($project->id, $objecttype); + + /* Reduction shadow product. */ + if(!$project->hasProduct and $action->objectType == 'project') + { + $productID = $this->loadModel('product')->getProductIDByProject($project->id);; + $this->dao->update(TABLE_PRODUCT) + ->set('name')->eq($project->name) + ->set('deleted')->eq(0) + ->where('id')->eq($productID) + ->exec(); + } } elseif($action->objectType == 'module') { diff --git a/module/project/control.php b/module/project/control.php index be45a1d62b..e04888dff3 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1990,6 +1990,13 @@ class project extends control /* Delete the execution under the project. */ $executionIdList = $this->loadModel('execution')->getPairs($projectID); + /* Delete shadow product.*/ + if(!$project->hasProduct) + { + $productID = $this->loadModel('product')->getProductIDByProject($projectID); + $this->dao->update(TABLE_PRODUCT)->set('deleted')->eq(1)->where('id')->eq($productID)->exec(); + } + $message = $this->executeHooks($projectID); if($message) $this->lang->saveSuccess = $message; From b288745d891c1016863b67014839b186b889f9b5 Mon Sep 17 00:00:00 2001 From: liugang Date: Fri, 30 Sep 2022 10:21:27 +0800 Subject: [PATCH 02/36] * Add the projectplan module to the whitelist. --- module/upgrade/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/upgrade/config.php b/module/upgrade/config.php index b77a52270f..2ad2f4080d 100644 --- a/module/upgrade/config.php +++ b/module/upgrade/config.php @@ -375,7 +375,7 @@ $config->delete['17_2'][] = 'extension/lite/workflowrelation/ext/view/admin.flow $config->delete['17_2'][] = 'extension/lite/extension/lite/workflowrule/ext/view/browse.flow.html.hook.php'; $config->delete['17_2'][] = 'extension/lite/extension/lite/workflowrule/ext/view/view.flow.html.hook.php'; -$config->upgrade->openModules = array('action', 'admin', 'api', 'automation', 'backup', 'block', 'branch', 'budget', 'bug', 'build', 'caselib', 'ci', 'client', 'common', 'company', 'compile', 'convert', 'cron', 'custom', 'datatable', 'dept', 'design', 'dev', 'doc', 'durationestimation', 'entry', 'execution', 'extension', 'file', 'git', 'gitlab', 'group', 'holiday', 'im', 'index', 'index.html', 'install', 'issue', 'jenkins', 'job', 'kanban', 'license', 'mail', 'message', 'misc', 'mr', 'my', 'personnel', 'pipeline', 'product', 'productplan', 'productset', 'program', 'programplan', 'project', 'projectbuild', 'projectrelease', 'projectstory', 'qa', 'release', 'repo', 'report', 'risk', 'score', 'search', 'setting', 'sonarqube', 'sso', 'stage', 'stakeholder', 'story', 'subject', 'svn', 'task', 'testcase', 'testreport', 'testsuite', 'testtask', 'todo', 'tree', 'tutorial', 'upgrade', 'user', 'webhook', 'weekly', 'workestimation', 'gitea', 'gogs', 'port'); +$config->upgrade->openModules = array('action', 'admin', 'api', 'automation', 'backup', 'block', 'branch', 'budget', 'bug', 'build', 'caselib', 'ci', 'client', 'common', 'company', 'compile', 'convert', 'cron', 'custom', 'datatable', 'dept', 'design', 'dev', 'doc', 'durationestimation', 'entry', 'execution', 'extension', 'file', 'git', 'gitlab', 'group', 'holiday', 'im', 'index', 'index.html', 'install', 'issue', 'jenkins', 'job', 'kanban', 'license', 'mail', 'message', 'misc', 'mr', 'my', 'personnel', 'pipeline', 'product', 'productplan', 'productset', 'program', 'programplan', 'project', 'projectbuild', 'projectplan', 'projectrelease', 'projectstory', 'qa', 'release', 'repo', 'report', 'risk', 'score', 'search', 'setting', 'sonarqube', 'sso', 'stage', 'stakeholder', 'story', 'subject', 'svn', 'task', 'testcase', 'testreport', 'testsuite', 'testtask', 'todo', 'tree', 'tutorial', 'upgrade', 'user', 'webhook', 'weekly', 'workestimation', 'gitea', 'gogs', 'port'); $config->upgrade->unsetModules = array('design', 'program', 'programplan', 'projectbuild', 'projectrelease', 'stage', 'stakeholder', 'product', 'branch', 'productplan', 'release', 'build', 'qa', 'bug', 'testcase', 'testtask', 'testreport', 'testsuite', 'caselib', 'automation', 'repo', 'ci', 'compile', 'jenkins', 'job', 'svn', 'gitlab', 'sonarqube', 'mr', 'git', 'report', 'sqlbuilder', 'feedback', 'faq', 'attend', 'holiday', 'leave', 'makeup', 'overtime', 'lieu', 'ops', 'host', 'serverroom', 'account', 'domain', 'service', 'deploy', 'conference', 'traincourse', 'pssp', 'baseline', 'classify', 'cm', 'cmcl', 'auditcl', 'reviewcl', 'process', 'activity', 'zoutput', 'auditplan', 'nc', 'subject', 'weekly', 'workestimation', 'issue', 'durationestimation', 'risk', 'opportunity', 'trainplan', 'gapanalysis', 'researchplan', 'researchreport', 'meeting', 'meetingroom', 'budget', 'reviewissue', 'reviewsetting', 'review', 'milestone', 'measurement', 'measrecord', 'assetlib', 'setting', 'im', 'client', 'ldap', 'dev', 'api', 'gitea', 'gogs'); From e1540a49ff4fdb439f04c105330809a46e23ba93 Mon Sep 17 00:00:00 2001 From: liugang Date: Fri, 30 Sep 2022 10:21:59 +0800 Subject: [PATCH 03/36] * Fix bug. --- module/product/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/product/model.php b/module/product/model.php index d3ca62c9b6..a93d1f0555 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -1328,7 +1328,7 @@ class productModel extends model $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) + ->beginIF($projectID)->andWhere('t2.project')->eq($projectID)->fi() ->beginIF($branch !== '')->andWhere('t1.branch')->in($branch)->fi() ->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->sprints)->fi() ->beginIF(strpos($mode, 'noclosed') !== false)->andWhere('t2.status')->ne('closed')->fi() From 7ba36be6683ca58bef520f482a786071182377ba Mon Sep 17 00:00:00 2001 From: daitingting Date: Fri, 30 Sep 2022 03:21:09 +0000 Subject: [PATCH 04/36] * Count assetlib if edition is max. --- module/custom/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/custom/model.php b/module/custom/model.php index 1ecc2d6858..9302ab26f1 100644 --- a/module/custom/model.php +++ b/module/custom/model.php @@ -951,7 +951,8 @@ class customModel extends model */ public function hasAssetlibData() { - return $this->dao->select('*')->from(TABLE_ASSETLIB)->where('deleted')->eq(0)->count(); + if($this->config->edition == 'max') return $this->dao->select('*')->from(TABLE_ASSETLIB)->where('deleted')->eq(0)->count(); + return false; } /** From acc7774419277cc6eef8998724318a2733448fcb Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 30 Sep 2022 13:22:24 +0800 Subject: [PATCH 05/36] * adjust for manage members and products for no multiple project. --- module/execution/model.php | 12 ++++++++++++ module/project/control.php | 19 ++++++++++++++++--- module/project/model.php | 2 +- module/project/view/manageproducts.html.php | 1 + 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 1d86ef375d..54e0572058 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1673,6 +1673,18 @@ class executionModel extends model return $executions; } + /** + * Get no multiple execution id. + * + * @param int $projectID + * @access public + * @return int + */ + public function getNoMultipleID($projectID) + { + return $this->dao->select('id')->from(TABLE_EXECUTION)->where('project')->eq($projectID)->andWhere('multiple')->eq(0)->andWhere('deleted')->eq(0)->fetch('id'); + } + /** * Create the link from module,method,extra * diff --git a/module/project/control.php b/module/project/control.php index e04888dff3..45c906b1df 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1645,19 +1645,25 @@ class project extends control $this->loadModel('dept'); $this->loadModel('execution'); $this->project->setMenu($projectID); + $project = $this->project->getById($projectID); if(!empty($_POST)) { $this->project->manageMembers($projectID); if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); + if(empty($project->multiple)) + { + $executionID = $this->execution->getNoMultipleID($projectID); + if($executionID) $this->execution->manageMembers($executionID); + } + $this->loadModel('action')->create('team', $projectID, 'ManagedTeam'); $link = $this->session->teamList ? $this->session->teamList : $this->createLink('project', 'team', "projectID=$projectID"); return $this->send(array('message' => $this->lang->saveSuccess, 'result' => 'success', 'locate' => $link)); } - $project = $this->project->getById($projectID); $users = $this->user->getPairs('noclosed|nodeleted|devfirst'); $roles = $this->user->getUserRoles(array_keys($users)); $deptUsers = $dept === '' ? array() : $this->dept->getDeptUserPairs($dept); @@ -2113,6 +2119,8 @@ class project extends control { $this->loadModel('product'); $this->loadModel('program'); + $this->loadModel('execution'); + $project = $this->project->getById($projectID); if(!empty($_POST)) { @@ -2126,6 +2134,12 @@ class project extends control $this->project->updateProducts($projectID); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); + if(empty($project->multiple)) + { + $executionID = $this->execution->getNoMultipleID($projectID); + if($executionID) $this->execution->updateProducts($executionID); + } + $oldProducts = array_keys($oldProducts); $newProducts = $this->product->getProducts($projectID); $newProducts = array_keys($newProducts); @@ -2137,7 +2151,6 @@ class project extends control return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locateLink)); } - $project = $this->project->getById($projectID); if($this->app->tab == 'program') { $this->program->setMenu($project->parent); @@ -2177,7 +2190,7 @@ class project extends control /* Assign. */ $this->view->title = $this->lang->project->manageProducts . $this->lang->colon . $project->name; - $this->view->position[] = $this->lang->project->manageProducts; + $this->view->project = $project; $this->view->allProducts = $allProducts; $this->view->linkedProducts = $linkedProducts; $this->view->linkedBranches = $linkedBranches; diff --git a/module/project/model.php b/module/project/model.php index 88bc98e5bd..4ab514ac66 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2031,7 +2031,7 @@ class projectModel extends model if(!empty($linkedProducts)) $this->user->updateUserView(array_keys($linkedProducts), 'product', $changedAccounts); /* Remove execution members. */ - if($removeExecution == 'yes' and !empty($childSprints) and !empty($removedAccounts)) + if($this->post->removeExecution == 'yes' and !empty($childSprints) and !empty($removedAccounts)) { $this->dao->delete()->from(TABLE_TEAM) ->where('root')->in($childSprints) diff --git a/module/project/view/manageproducts.html.php b/module/project/view/manageproducts.html.php index 1a214f23ff..e894e83887 100644 --- a/module/project/view/manageproducts.html.php +++ b/module/project/view/manageproducts.html.php @@ -29,6 +29,7 @@ + multiple)) $isDisabled = '';?> project->notAllowRemoveProducts : $productName;?>
From 7311802c2cf157593e74e7a180c19325e1006c48 Mon Sep 17 00:00:00 2001 From: liugang Date: Fri, 30 Sep 2022 13:46:55 +0800 Subject: [PATCH 06/36] * Fix bug of call undefined property. --- module/testcase/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/testcase/model.php b/module/testcase/model.php index 080b8d1056..fb0c633fb9 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -1935,6 +1935,7 @@ class testcaseModel extends model } else { + $this->app->loadLang('branch'); $productInfo = $this->loadModel('product')->getByID($productID); $this->config->testcase->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$productInfo->type]); $this->config->testcase->search['params']['branch']['values'] = array('' => '', '0' => $this->lang->branch->main) + $this->loadModel('branch')->getPairs($productID, '', $projectID) + array('all' => $this->lang->branch->all); From 1645dbd2637cac2e098ac1b4833e8545c6952f8f Mon Sep 17 00:00:00 2001 From: liugang Date: Fri, 30 Sep 2022 13:48:12 +0800 Subject: [PATCH 07/36] * Fix bug #27896,27898. --- module/execution/control.php | 5 +++-- module/execution/model.php | 15 ++++++++++----- module/execution/view/linkstory.html.php | 12 ++++++++---- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 7f38f9cdb6..8d29b0999d 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -865,7 +865,7 @@ class execution extends control if($project->model != 'scrum') unset($this->config->product->search['fields']['plan']); } - $this->execution->buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, 'executionStory', $executionID); + $this->execution->buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, 'executionStory', $execution); /* Header and position. */ $title = $execution->name . $this->lang->colon . $this->lang->execution->story; @@ -3271,7 +3271,7 @@ class execution extends control /* Build the search form. */ $actionURL = $this->createLink($this->app->rawModule, 'linkStory', "objectID=$objectID&browseType=bySearch&queryID=myQueryID"); $branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products)); - $this->execution->buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, 'linkStory', $objectID); + $this->execution->buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, 'linkStory', $object); if($browseType == 'bySearch') { @@ -3317,6 +3317,7 @@ class execution extends control $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->branchGroups = $branchGroups; $this->view->browseLink = $browseLink; + $this->view->project = $this->loadModel('project')->getByID($object->project); $this->display(); } diff --git a/module/execution/model.php b/module/execution/model.php index 54e0572058..929dddff06 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -2161,19 +2161,18 @@ class executionModel extends model * @param int $queryID * @param string $actionURL * @param string $type - * @param int $objectID + * @param object $execution * @access public * @return void */ - public function buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, $type = 'executionStory', $objectID = 0) + public function buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, $type = 'executionStory', $execution = null) { $this->app->loadLang('branch'); $branchPairs = array(BRANCH_MAIN => $this->lang->branch->main); $productType = 'normal'; $productNum = count($products); $productPairs = array(0 => ''); - $branches = $this->loadModel('project')->getBranchesByProject($objectID); - $hasProduct = $this->dao->select('hasProduct')->from(TABLE_EXECUTION)->where('id')->eq($objectID)->fetch('hasProduct'); + $branches = $this->loadModel('project')->getBranchesByProject($execution->id); foreach($products as $product) { @@ -2225,7 +2224,13 @@ class executionModel extends model } $this->config->product->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $this->lang->story->statusList); - if(empty($hasProduct)) unset($this->config->product->search['fields']['product']); + $project = $this->loadModel('project')->getByID($execution->project); + if(empty($project->hasProduct)) + { + unset($this->config->product->search['fields']['product']); + + if($project->model == 'kanban') unset($this->config->product->search['fields']['plan']); + } $this->loadModel('search')->setSearchParams($this->config->product->search); } diff --git a/module/execution/view/linkstory.html.php b/module/execution/view/linkstory.html.php index 941ace77c6..f4687f63c3 100644 --- a/module/execution/view/linkstory.html.php +++ b/module/execution/view/linkstory.html.php @@ -43,13 +43,15 @@ execution->pri;?>>priAB;?> story->title;?> - hasProduct)):?> + hasProduct):?> story->product;?> story->module;?> + hasProduct || (!$project->hasProduct && $project->model != 'kanban')):?> story->plan;?> + story->stage;?> - hasProduct) && $productType != 'normal'):?> + hasProduct && $productType != 'normal'):?> product->branchName[$productType];?> openedByAB;?> @@ -79,13 +81,15 @@ } ?> - hasProduct)):?> + hasProduct):?> createLink('product', 'browse', "productID=$story->product&branch=$story->branch"), $products[$story->product]->name);?> '>module, '')?> + hasProduct || (!$project->hasProduct && $project->model != 'kanban')):?> planTitle;?> + story->stageList, $story->stage);?> - hasProduct) && $productType != 'normal'):?> + hasProduct && $productType != 'normal'):?> product][$story->branch])) echo $branchGroups[$story->product][$story->branch];?> openedBy);?> From 606ea74471741e5ba8ca04f6a2d81a083b9ceba1 Mon Sep 17 00:00:00 2001 From: wangyuting2 <851424971@qq.com> Date: Fri, 30 Sep 2022 05:52:05 +0000 Subject: [PATCH 08/36] * Optimize code. --- module/custom/lang/de.php | 8 +++++--- module/custom/lang/en.php | 8 +++++--- module/custom/lang/fr.php | 8 +++++--- module/custom/lang/zh-cn.php | 4 +++- module/custom/view/header.html.php | 2 -- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/module/custom/lang/de.php b/module/custom/lang/de.php index 43b81464fa..7c68a383b1 100644 --- a/module/custom/lang/de.php +++ b/module/custom/lang/de.php @@ -100,8 +100,9 @@ $lang->custom->object['testtask'] = 'Build'; $lang->custom->object['todo'] = 'Todo'; $lang->custom->object['user'] = 'User'; $lang->custom->object['block'] = 'ClosedBlock'; -$lang->custom->object['flow'] = '流程'; -$lang->custom->object['score'] = '积分'; +$lang->custom->object['flow'] = 'Flow'; +$lang->custom->object['score'] = 'Score'; +$lang->custom->object['mode'] = 'Mode'; $lang->custom->menuOrder[5] = 'project'; $lang->custom->menuOrder[10] = 'product'; @@ -117,9 +118,10 @@ $lang->custom->menuOrder[55] = 'user'; $lang->custom->menuOrder[60] = 'block'; $lang->custom->menuOrder[65] = 'flow'; $lang->custom->menuOrder[70] = 'score'; +$lang->custom->menuOrder[85] = 'mode'; $lang->custom->dividerMenu = ',story,todo,block,'; -$lang->custom->separatePage = ',execution,product,kanban,flow,score,'; +$lang->custom->separatePage = ',execution,product,kanban,flow,score,mode,'; $lang->custom->block = new stdclass(); $lang->custom->block->fields['closed'] = 'Closed Block'; diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index a51714846f..fe45ae1c2f 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -100,8 +100,9 @@ $lang->custom->object['testtask'] = 'Request'; $lang->custom->object['todo'] = 'Todo'; $lang->custom->object['user'] = 'User'; $lang->custom->object['block'] = 'Block'; -$lang->custom->object['flow'] = '流程'; -$lang->custom->object['score'] = '积分'; +$lang->custom->object['flow'] = 'Flow'; +$lang->custom->object['score'] = 'Score'; +$lang->custom->object['mode'] = 'Mode'; $lang->custom->menuOrder[5] = 'project'; $lang->custom->menuOrder[10] = 'product'; @@ -117,9 +118,10 @@ $lang->custom->menuOrder[55] = 'user'; $lang->custom->menuOrder[60] = 'block'; $lang->custom->menuOrder[65] = 'flow'; $lang->custom->menuOrder[70] = 'score'; +$lang->custom->menuOrder[85] = 'mode'; $lang->custom->dividerMenu = ',story,todo,block,'; -$lang->custom->separatePage = ',execution,product,kanban,flow,score,'; +$lang->custom->separatePage = ',execution,product,kanban,flow,score,mode,'; $lang->custom->block = new stdclass(); $lang->custom->block->fields['closed'] = 'Closed Block'; diff --git a/module/custom/lang/fr.php b/module/custom/lang/fr.php index f43ab88db5..2eb77b2ec4 100644 --- a/module/custom/lang/fr.php +++ b/module/custom/lang/fr.php @@ -100,8 +100,9 @@ $lang->custom->object['testtask'] = 'Build'; $lang->custom->object['todo'] = 'Agenda'; $lang->custom->object['user'] = 'Utilisateur'; $lang->custom->object['block'] = 'Bloc'; -$lang->custom->object['flow'] = '流程'; -$lang->custom->object['score'] = '积分'; +$lang->custom->object['flow'] = 'Flow'; +$lang->custom->object['score'] = 'Score'; +$lang->custom->object['mode'] = 'Mode'; $lang->custom->menuOrder[5] = 'project'; $lang->custom->menuOrder[10] = 'product'; @@ -117,9 +118,10 @@ $lang->custom->menuOrder[55] = 'user'; $lang->custom->menuOrder[60] = 'block'; $lang->custom->menuOrder[65] = 'flow'; $lang->custom->menuOrder[70] = 'score'; +$lang->custom->menuOrder[85] = 'mode'; $lang->custom->dividerMenu = ',story,todo,block,'; -$lang->custom->separatePage = ',execution,product,kanban,flow,score,'; +$lang->custom->separatePage = ',execution,product,kanban,flow,score,mode,'; $lang->custom->block = new stdclass(); $lang->custom->block->fields['closed'] = 'Bloc Fermé'; diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index 0a9561262e..535193bff8 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -102,6 +102,7 @@ $lang->custom->object['user'] = '用户'; $lang->custom->object['block'] = '区块'; $lang->custom->object['flow'] = '流程'; $lang->custom->object['score'] = '积分'; +$lang->custom->object['mode'] = '模式'; $lang->custom->menuOrder[5] = 'project'; $lang->custom->menuOrder[10] = 'product'; @@ -117,9 +118,10 @@ $lang->custom->menuOrder[55] = 'user'; $lang->custom->menuOrder[60] = 'block'; $lang->custom->menuOrder[65] = 'flow'; $lang->custom->menuOrder[70] = 'score'; +$lang->custom->menuOrder[85] = 'mode'; $lang->custom->dividerMenu = ',story,todo,block,'; -$lang->custom->separatePage = ',execution,product,kanban,flow,score,'; +$lang->custom->separatePage = ',execution,product,kanban,flow,score,mode'; $lang->custom->block = new stdclass(); $lang->custom->block->fields['closed'] = '关闭的区块'; diff --git a/module/custom/view/header.html.php b/module/custom/view/header.html.php index 7c5c481711..f8c795c644 100644 --- a/module/custom/view/header.html.php +++ b/module/custom/view/header.html.php @@ -19,8 +19,6 @@ } if($object == 'user') common::printLink('custom', 'required', "", "{$lang->custom->required}", '', "class='btn btn-link' id='requiredTab'"); } - - common::printLink('custom', 'mode', "", "{$lang->custom->mode}", '', "class='btn btn-link' id='modeTab'"); ?>
From 50c33154286420a9d471758ce99cac8830872490 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 30 Sep 2022 14:09:46 +0800 Subject: [PATCH 09/36] * fix bug #28250. --- module/project/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/project/model.php b/module/project/model.php index 4ab514ac66..12ad2d2260 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -922,7 +922,7 @@ class projectModel extends model { unset($privs->$module); } - else + elseif($methods) { foreach($methods as $method => $label) { From 9b403e8b64621cd5fa00260ae7ccb3cba616f058 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 30 Sep 2022 14:20:53 +0800 Subject: [PATCH 10/36] * fix bug #28075. --- module/task/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/model.php b/module/task/model.php index 2b0ca265ba..5b1d540cf7 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -1065,7 +1065,7 @@ class taskModel extends model } /* If a multiple task is assigned to a team member who is not the task, assign to the team member instead. */ - if(!$this->post->assignedTo and !empty($_POST['team'])) $_POST['assignedTo'] = $this->getAssignedTo4Multi($_POST['team'], $oldTask); + if(!$this->post->assignedTo and !empty($oldTask->team) and !empty($_POST['team'])) $_POST['assignedTo'] = $this->getAssignedTo4Multi($_POST['team'], $oldTask); /* When the selected parent task is a common task and has consumption, select other parent tasks. */ if($this->post->parent > 0) From 75cd31c9056c8aaa57e8f8cd9302b2c3d7d33ee8 Mon Sep 17 00:00:00 2001 From: wangjianhua Date: Fri, 30 Sep 2022 15:46:14 +0800 Subject: [PATCH 11/36] * Fix bug #28255. --- module/repo/control.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/repo/control.php b/module/repo/control.php index 5ae6f254b1..cd20316ddf 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -203,8 +203,7 @@ class repo extends control $this->view->projects = $options; } - $products = explode(',', $repo->product); - $projectOptions = $this->filterProject($products); + $projectOptions = $this->filterProject(explode(',', $repo->product), explode(',', $repo->projects)); $this->view->title = $this->lang->repo->common . $this->lang->colon . $this->lang->repo->edit; $this->view->repo = $repo; @@ -1226,6 +1225,7 @@ class repo extends control * Remove projects without privileges. * * @param array $productIDList + * @param array $projectIDList * @access private * @return array */ From a3b9b7bb524b88e4f7880761fbe5de3a842ddc9a Mon Sep 17 00:00:00 2001 From: wangyuting2 <851424971@qq.com> Date: Sat, 8 Oct 2022 00:34:06 +0000 Subject: [PATCH 12/36] * Optimize code. --- module/group/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/group/model.php b/module/group/model.php index f51aa879c3..a303e4bad3 100644 --- a/module/group/model.php +++ b/module/group/model.php @@ -425,7 +425,8 @@ class groupModel extends model { $methodList = (array)zget($this->lang->resource, $moduleName, array()); $methodList = array_keys($methodList); - $this->dao->delete()->from(TABLE_GROUPPRIV)->where('`group`')->eq($groupID) + $this->dao->delete()->from(TABLE_GROUPPRIV) + ->where('`group`')->eq($groupID) ->andWhere('module')->eq($moduleName) ->beginIF($methodList)->andWhere('method')->in($methodList)->fi() ->exec(); From bdf73ff038c632e92ef2da9f0ddea9dac51bd8fe Mon Sep 17 00:00:00 2001 From: sunguangming Date: Sat, 8 Oct 2022 08:52:01 +0800 Subject: [PATCH 13/36] * Fix bug #28140. --- module/productplan/view/view.html.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index 0bf82d588f..613141a1b5 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -550,7 +550,7 @@ parent > 0):?> productplan->parent;?> - id}"), "#{$parentPlan->id} " . $parentPlan->title);?> + id}"), "#{$parentPlan->id} " . $parentPlan->title, '', "data-app={$app->tab}");?> type != 'normal'):?> @@ -572,7 +572,7 @@ productplan->children;?> - id}"), "#{$childrenPlan->id} " . $childrenPlan->title) . '
';?> + id}"), "#{$childrenPlan->id} " . $childrenPlan->title, '', "data-app={$app->tab}") . '
';?> From d325519d52101b2308ce74933af914846766ca08 Mon Sep 17 00:00:00 2001 From: liugang Date: Sat, 8 Oct 2022 09:51:11 +0800 Subject: [PATCH 14/36] * Fix bug #27903. --- module/bug/control.php | 4 +++- module/bug/view/batchcreate.html.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 1f854ad36e..70b645b707 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -833,6 +833,8 @@ class bug extends control } $projectID = $this->lang->navGroup->bug == 'project' ? $this->session->project : (isset($execution) ? $execution->project : 0); + $project = $this->loadModel('project')->getByID($projectID); + if(isset($project->model) && $project->model == 'kanban') $customFields['execution'] = $this->lang->bug->kanban; /* Get branches. */ if($executionID) @@ -853,7 +855,7 @@ class bug extends control $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]); $this->view->position[] = $this->lang->bug->batchCreate; - $this->view->project = $this->loadModel('project')->getByID($projectID); + $this->view->project = $project; $this->view->product = $product; $this->view->productID = $productID; $this->view->stories = $stories; diff --git a/module/bug/view/batchcreate.html.php b/module/bug/view/batchcreate.html.php index 5e167e4891..11bb6edc62 100755 --- a/module/bug/view/batchcreate.html.php +++ b/module/bug/view/batchcreate.html.php @@ -57,7 +57,7 @@ foreach(explode(',', $config->bug->create->requiredFields) as $field) branchBox'> product->branch;?> '> bug->module;?> systemMode == 'new'):?> - projectBox'>model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->project;?> + projectBox'>bug->project;?> executionBox'>model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->execution;?> bug->openedBuild;?> From d8db81e009f9dfacbce19ac03f77bc4bde76a911 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Sat, 8 Oct 2022 10:27:59 +0800 Subject: [PATCH 15/36] * Fix bug #28249. --- module/story/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/story/model.php b/module/story/model.php index c792c6943d..7f85e1e9bd 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3359,6 +3359,7 @@ class storyModel extends model ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id') ->where('t1.project')->eq((int)$executionID) ->andWhere('t2.deleted')->eq(0) + ->andWhere('t2.type')->eq('story') ->beginIF($productID)->andWhere('t2.product')->eq((int)$productID)->fi() ->beginIF($branch !== 'all')->andWhere('t2.branch')->in("0,$branch")->fi() ->beginIF($moduleIdList)->andWhere('t2.module')->in($moduleIdList)->fi() From 22955353b1b762fd1e623ae4e852c60418e9ca3b Mon Sep 17 00:00:00 2001 From: sunguangming Date: Sat, 8 Oct 2022 10:39:06 +0800 Subject: [PATCH 16/36] * Fix bug #28249. --- module/story/control.php | 2 +- module/story/model.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index 7663623d60..2b8fdd8441 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -554,7 +554,7 @@ class story extends control } /* Project or execution linked stories. */ - if($executionID) + if($executionID and $storyType == 'story') { $products = array(); foreach($mails as $story) $products[$story->storyID] = $productID; diff --git a/module/story/model.php b/module/story/model.php index 7f85e1e9bd..309d362f5d 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -300,7 +300,7 @@ class storyModel extends model } /* Project or execution linked story. */ - if($executionID != 0) + if($executionID != 0 and $story->type == 'story') { $this->linkStory($executionID, $this->post->product, $storyID); if($this->config->systemMode == 'new' and $executionID != $this->session->project) $this->linkStory($this->session->project, $this->post->product, $storyID); From 55483c6fcbdef5b06b21500c40eaf0322aa54d77 Mon Sep 17 00:00:00 2001 From: liugang Date: Sat, 8 Oct 2022 10:50:02 +0800 Subject: [PATCH 17/36] * Fix bug #27611. --- module/story/control.php | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index 2b8fdd8441..dd6bec11fc 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -2638,36 +2638,23 @@ class story extends control } $fileName = $storyType == 'requirement' ? $this->lang->URCommon : $this->lang->SRCommon; + $project = null; if($executionID) { - $execution = $this->loadModel('execution')->getByID($executionID); - $executionName = $execution->name; - $hasProduct = true; - if($execution->type == 'project') - { - $hasProduct = $execution->hasProduct; - } - else - { - $project = $this->loadModel('project')->getById($execution->project); - $hasProduct = $project->hasProduct; - } - - /* Unset product field when in single project. */ - if(!$hasProduct) - { - $this->config->story->exportFields = str_replace(array('product,', 'branch,'), array('', ''), $this->config->story->exportFields); - } - - $fileName = $executionName . $this->lang->dash . $fileName; + $execution = $this->loadModel('execution')->getByID($executionID); + $fileName = $execution->name . $this->lang->dash . $fileName; + $project = $execution; + if($execution->type == 'execution') $project = $this->project->getById($execution->project); } else { $productName = $this->lang->product->all; if($productID) { - $product = $this->product->getById($productID); + $product = $this->product->getById($productID); $productName = $product->name; + + if($product->shadow) $project = $this->project->getByShadowProduct($productID); } if(isset($this->lang->product->featureBar['browse'][$browseType])) { @@ -2681,6 +2668,14 @@ class story extends control $fileName = $productName . $this->lang->dash . $browseType . $fileName; } + /* Unset product field when in single project. */ + if(isset($project->hasProduct) && !$project->hasProduct) + { + $filterFields = array('product,', 'branch,'); + if($project->model != 'scrum') $filterFields[] = 'plan'; + $this->config->story->exportFields = str_replace($filterFields, '', $this->config->story->exportFields); + } + $this->view->fileName = $fileName; $this->view->allExportFields = $this->config->story->exportFields; $this->view->customExport = true; From bd32930628cbb08aef5b9cd2a12e425eac5d813c Mon Sep 17 00:00:00 2001 From: sunguangming Date: Sat, 8 Oct 2022 13:02:29 +0800 Subject: [PATCH 18/36] * Fix bug #28247. --- module/testcase/control.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/module/testcase/control.php b/module/testcase/control.php index d94cc822ab..2273700685 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -1442,6 +1442,13 @@ class testcase extends control $objectID = 0; if($this->app->tab == 'project') $objectID = $case->project; if($this->app->tab == 'execution') $objectID = $case->execution; + + unset($this->config->bug->search['fields']['product']); + if($case->project and ($this->app->tab == 'project' or $this->app->tab == 'execution')) + { + $project = $this->loadModel('project')->getById($case->project); + if(!$project->hasProduct and $project->model == 'waterfall') unset($this->config->bug->search['fields']['plan']); + } $this->bug->buildSearchForm($case->product, $this->products, $queryID, $actionURL, $objectID); /* Get cases to link. */ From 783e03d722d5506c60a3615da4bf29e1d81d996f Mon Sep 17 00:00:00 2001 From: sunguangming Date: Sat, 8 Oct 2022 13:17:34 +0800 Subject: [PATCH 19/36] * Fix bug #28246. --- module/testcase/control.php | 19 +++++++++++++++++-- module/testcase/view/linkbugs.html.php | 4 ++++ module/testcase/view/linkcases.html.php | 4 ++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index 2273700685..091113ba4d 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -1393,6 +1393,14 @@ class testcase extends control $objectID = 0; if($this->app->tab == 'project') $objectID = $case->project; if($this->app->tab == 'execution') $objectID = $case->execution; + + /* Unset search field in single project. */ + if($case->project and ($this->app->tab == 'project' or $this->app->tab == 'execution')) + { + $project = $this->loadModel('project')->getById($case->project); + if(!$project->hasProduct) unset($this->config->bug->search['fields']['product']); + } + $this->testcase->buildSearchForm($case->product, $this->products, $queryID, $actionURL, $objectID); /* Get cases to link. */ @@ -1410,6 +1418,7 @@ class testcase extends control $this->view->position[] = html::a($this->createLink('testcase', 'view', "caseID=$caseID"), $case->title); $this->view->position[] = $this->lang->testcase->linkCases; $this->view->case = $case; + $this->view->product = $this->loadModel('product')->getByID($case->product); $this->view->cases2Link = empty($cases2Link) ? $cases2Link : $cases2Link[$pageID - 1]; $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->pager = $pager; @@ -1443,12 +1452,17 @@ class testcase extends control if($this->app->tab == 'project') $objectID = $case->project; if($this->app->tab == 'execution') $objectID = $case->execution; - unset($this->config->bug->search['fields']['product']); + /* Unset search field in single project. */ if($case->project and ($this->app->tab == 'project' or $this->app->tab == 'execution')) { $project = $this->loadModel('project')->getById($case->project); - if(!$project->hasProduct and $project->model == 'waterfall') unset($this->config->bug->search['fields']['plan']); + if(!$project->hasProduct) + { + unset($this->config->bug->search['fields']['product']); + if($project->model == 'waterfall') unset($this->config->bug->search['fields']['plan']); + } } + $this->bug->buildSearchForm($case->product, $this->products, $queryID, $actionURL, $objectID); /* Get cases to link. */ @@ -1463,6 +1477,7 @@ class testcase extends control /* Assign. */ $this->view->position[] = $this->lang->testcase->linkBugs; $this->view->case = $case; + $this->view->product = $this->loadModel('product')->getByID($case->product); $this->view->bugs2Link = empty($bugs2Link) ? $bugs2Link : $bugs2Link[$pageID - 1]; $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->pager = $pager; diff --git a/module/testcase/view/linkbugs.html.php b/module/testcase/view/linkbugs.html.php index a5fc284ba5..2ccb193d87 100644 --- a/module/testcase/view/linkbugs.html.php +++ b/module/testcase/view/linkbugs.html.php @@ -33,7 +33,9 @@ idAB;?> pri;?>>priAB;?> + shadow):?> bug->product;?> + bug->title;?> bug->type;?> openedByAB;?> @@ -52,7 +54,9 @@ id);?> bug->priList, $bug2Link->pri, $bug2Link->pri)?>'>bug->priList, $bug2Link->pri, $bug2Link->pri)?> + shadow):?> createLink('product', 'browse', "productID={$bug2Link->product}&branch={$bug2Link->branch}"), $products[$bug2Link->product], '_blank');?> + createLink('bug', 'view', "bugID=$bug2Link->id"), $bug2Link->title, '_blank');?> bug->typeList, $bug2Link->type);?> openedBy);?> diff --git a/module/testcase/view/linkcases.html.php b/module/testcase/view/linkcases.html.php index e97784fd3b..4d0ef2c496 100644 --- a/module/testcase/view/linkcases.html.php +++ b/module/testcase/view/linkcases.html.php @@ -33,7 +33,9 @@ idAB;?> pri;?>>priAB;?> + shadow):?> testcase->product;?> + testcase->title;?> testcase->type;?> openedByAB;?> @@ -52,7 +54,9 @@ id);?> testcase->priList, $case2Link->pri, $case2Link->pri)?>'>testcase->priList, $case2Link->pri, $case2Link->pri)?> + shadow):?> createLink('product', 'browse', "productID={$case2Link->product}&branch={$case2Link->branch}"), $products[$case2Link->product], '_blank');?> + createLink('testcase', 'view', "caseID=$case2Link->id"), $case2Link->title, '_blank');?> testcase->typeList[$case2Link->type];?> openedBy);?> From 7b2af7a523b23eae4d29b7010c7b3acfeb5cf47f Mon Sep 17 00:00:00 2001 From: sunguangming Date: Sat, 8 Oct 2022 13:25:30 +0800 Subject: [PATCH 20/36] * Fix bug #28245. --- module/testcase/control.php | 19 ++++--------------- module/testcase/view/linkbugs.html.php | 6 ------ module/testcase/view/linkcases.html.php | 6 ------ 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index 091113ba4d..fd8f42cf11 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -1394,13 +1394,7 @@ class testcase extends control if($this->app->tab == 'project') $objectID = $case->project; if($this->app->tab == 'execution') $objectID = $case->execution; - /* Unset search field in single project. */ - if($case->project and ($this->app->tab == 'project' or $this->app->tab == 'execution')) - { - $project = $this->loadModel('project')->getById($case->project); - if(!$project->hasProduct) unset($this->config->bug->search['fields']['product']); - } - + unset($this->config->testcase->search['fields']['product']); $this->testcase->buildSearchForm($case->product, $this->products, $queryID, $actionURL, $objectID); /* Get cases to link. */ @@ -1418,7 +1412,6 @@ class testcase extends control $this->view->position[] = html::a($this->createLink('testcase', 'view', "caseID=$caseID"), $case->title); $this->view->position[] = $this->lang->testcase->linkCases; $this->view->case = $case; - $this->view->product = $this->loadModel('product')->getByID($case->product); $this->view->cases2Link = empty($cases2Link) ? $cases2Link : $cases2Link[$pageID - 1]; $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->pager = $pager; @@ -1452,15 +1445,12 @@ class testcase extends control if($this->app->tab == 'project') $objectID = $case->project; if($this->app->tab == 'execution') $objectID = $case->execution; - /* Unset search field in single project. */ + /* Unset search field 'plan' in single project. */ + unset($this->config->bug->search['fields']['product']); if($case->project and ($this->app->tab == 'project' or $this->app->tab == 'execution')) { $project = $this->loadModel('project')->getById($case->project); - if(!$project->hasProduct) - { - unset($this->config->bug->search['fields']['product']); - if($project->model == 'waterfall') unset($this->config->bug->search['fields']['plan']); - } + if(!$project->hasProduct and $project->model == 'waterfall') unset($this->config->bug->search['fields']['plan']); } $this->bug->buildSearchForm($case->product, $this->products, $queryID, $actionURL, $objectID); @@ -1477,7 +1467,6 @@ class testcase extends control /* Assign. */ $this->view->position[] = $this->lang->testcase->linkBugs; $this->view->case = $case; - $this->view->product = $this->loadModel('product')->getByID($case->product); $this->view->bugs2Link = empty($bugs2Link) ? $bugs2Link : $bugs2Link[$pageID - 1]; $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->pager = $pager; diff --git a/module/testcase/view/linkbugs.html.php b/module/testcase/view/linkbugs.html.php index 2ccb193d87..a24789e745 100644 --- a/module/testcase/view/linkbugs.html.php +++ b/module/testcase/view/linkbugs.html.php @@ -33,9 +33,6 @@ idAB;?> pri;?>>priAB;?> - shadow):?> - bug->product;?> - bug->title;?> bug->type;?> openedByAB;?> @@ -54,9 +51,6 @@ id);?> bug->priList, $bug2Link->pri, $bug2Link->pri)?>'>bug->priList, $bug2Link->pri, $bug2Link->pri)?> - shadow):?> - createLink('product', 'browse', "productID={$bug2Link->product}&branch={$bug2Link->branch}"), $products[$bug2Link->product], '_blank');?> - createLink('bug', 'view', "bugID=$bug2Link->id"), $bug2Link->title, '_blank');?> bug->typeList, $bug2Link->type);?> openedBy);?> diff --git a/module/testcase/view/linkcases.html.php b/module/testcase/view/linkcases.html.php index 4d0ef2c496..475bb3073c 100644 --- a/module/testcase/view/linkcases.html.php +++ b/module/testcase/view/linkcases.html.php @@ -33,9 +33,6 @@ idAB;?> pri;?>>priAB;?> - shadow):?> - testcase->product;?> - testcase->title;?> testcase->type;?> openedByAB;?> @@ -54,9 +51,6 @@ id);?> testcase->priList, $case2Link->pri, $case2Link->pri)?>'>testcase->priList, $case2Link->pri, $case2Link->pri)?> - shadow):?> - createLink('product', 'browse', "productID={$case2Link->product}&branch={$case2Link->branch}"), $products[$case2Link->product], '_blank');?> - createLink('testcase', 'view', "caseID=$case2Link->id"), $case2Link->title, '_blank');?> testcase->typeList[$case2Link->type];?> openedBy);?> From 1670e654c97a3402c5d13e5aeb1eea23f1294352 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Sat, 8 Oct 2022 13:36:47 +0800 Subject: [PATCH 21/36] * Fix bug #28267. --- module/testcase/view/browse.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/testcase/view/browse.html.php b/module/testcase/view/browse.html.php index 3e58ba2e19..c044067278 100644 --- a/module/testcase/view/browse.html.php +++ b/module/testcase/view/browse.html.php @@ -182,7 +182,7 @@ js::set('suiteID', $suiteID); ?> - session->currentProductType != 'normal'):?> + session->currentProductType and $this->session->currentProductType != 'normal'):?>
6;?> From 65e0211cc865e4c6f9ca7748bbdcc13cd0bf8eec Mon Sep 17 00:00:00 2001 From: liugang Date: Sat, 8 Oct 2022 15:30:37 +0800 Subject: [PATCH 22/36] * Remove useless codes. --- module/product/model.php | 1 - 1 file changed, 1 deletion(-) diff --git a/module/product/model.php b/module/product/model.php index a93d1f0555..a87342024c 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -876,7 +876,6 @@ class productModel extends model public function close($productID) { $oldProduct = $this->getById($productID); - $now = helper::now(); $product = fixer::input('post') ->add('id', $productID) ->setDefault('status', 'closed') From f0aec63a7c206813c5e117107ef7a11ec7aede7b Mon Sep 17 00:00:00 2001 From: liugang Date: Sat, 8 Oct 2022 15:33:59 +0800 Subject: [PATCH 23/36] * Add a function to activate a product. --- module/product/model.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/module/product/model.php b/module/product/model.php index a87342024c..e20ae23e86 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -893,6 +893,25 @@ class productModel extends model if(!dao::isError()) return common::createChanges($oldProduct, $product); } + /** + * Activate a product. + * + * @param int $productID. + * @access public + * @return bool | array + */ + public function activate($productID) + { + $oldProduct = $this->getById($productID); + $product = (object)array('status' => 'normal'); + + $this->dao->update(TABLE_PRODUCT)->data($product)->where('id')->eq((int)$productID)->exec(); + + if(dao::isError()) return false; + + return common::createChanges($oldProduct, $product); + } + /** * Manage line. * From ce0b20e2ef19fa09d982158b2de835958800b716 Mon Sep 17 00:00:00 2001 From: liugang Date: Sat, 8 Oct 2022 15:45:31 +0800 Subject: [PATCH 24/36] * Fix bug 27892 - activate or close the shadow product of a project. --- module/project/model.php | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/module/project/model.php b/module/project/model.php index 12ad2d2260..15cc8b46e4 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1568,6 +1568,14 @@ class projectModel extends model $oldProject->linkedProducts = implode(',', $linkedProducts); $project->linkedProducts = implode(',', $_POST['products']); + /* Activate or close the shadow product of the project. */ + if(!$oldProject->hasProduct && $oldProject->status != $project->status && strpos('doing,closed', $project->status) !== false) + { + $productID = $this->loadModel('product')->getProductIDByProject($projectID); + if($project->status == 'doing') $this->product->activate($productID); + if($project->status == 'closed') $this->product->close($productID); + } + return common::createChanges($oldProject, $project); } } @@ -1803,6 +1811,8 @@ class projectModel extends model ->where('id')->eq((int)$projectID) ->exec(); + if(dao::isError()) return false; + /* Readjust task. */ if($this->post->readjustTime and $this->post->readjustTask) { @@ -1838,7 +1848,14 @@ class projectModel extends model } } - if(!dao::isError()) return common::createChanges($oldProject, $project); + /* Activate the shadow product of the project. */ + if(!$oldProject->hasProduct) + { + $productID = $this->loadModel('product')->getProductIDByProject($projectID); + $this->product->activate($productID); + } + + return common::createChanges($oldProject, $project); } /** @@ -1881,13 +1898,22 @@ class projectModel extends model ->exec(); /* When it has multiple errors, only the first one is prompted */ - if(dao::isError() and count(dao::$errors['realEnd']) > 1) dao::$errors['realEnd'] = dao::$errors['realEnd'][0]; - - if(!dao::isError()) + if(dao::isError()) { - $this->loadModel('score')->create('project', 'close', $oldProject); - return common::createChanges($oldProject, $project); + if(count(dao::$errors['realEnd']) > 1) dao::$errors['realEnd'] = dao::$errors['realEnd'][0]; + + return false; } + + /* Close the shadow product of the project. */ + if(!$oldProject->hasProduct) + { + $productID = $this->loadModel('product')->getProductIDByProject($projectID); + $this->product->close($productID); + } + + $this->loadModel('score')->create('project', 'close', $oldProject); + return common::createChanges($oldProject, $project); } /** From 9afece138520ac540dd653c98ddb4a501fd23be3 Mon Sep 17 00:00:00 2001 From: liugang Date: Sat, 8 Oct 2022 15:55:18 +0800 Subject: [PATCH 25/36] * Fix bug #27892. --- module/project/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/project/model.php b/module/project/model.php index 15cc8b46e4..8ae1fad44a 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1909,6 +1909,7 @@ class projectModel extends model if(!$oldProject->hasProduct) { $productID = $this->loadModel('product')->getProductIDByProject($projectID); + unset($_POST); $this->product->close($productID); } From 6a0665a1c4ba1ea61bb538c9b557eadc4a8f1e1f Mon Sep 17 00:00:00 2001 From: sunguangming Date: Sat, 8 Oct 2022 16:28:38 +0800 Subject: [PATCH 26/36] * Fix bug #28235. --- module/testcase/css/view.zh-cn.css | 2 +- module/testcase/view/view.html.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/module/testcase/css/view.zh-cn.css b/module/testcase/css/view.zh-cn.css index 571d81d1d5..036fbaa50e 100644 --- a/module/testcase/css/view.zh-cn.css +++ b/module/testcase/css/view.zh-cn.css @@ -1,2 +1,2 @@ -.thWidth {width: 86px !important;} +.thWidth {width: 94px !important;} .lifeThWidth {width: 70px !important;} diff --git a/module/testcase/view/view.html.php b/module/testcase/view/view.html.php index 767d927bbf..dd93ac2765 100644 --- a/module/testcase/view/view.html.php +++ b/module/testcase/view/view.html.php @@ -146,12 +146,10 @@ createLink('caselib', 'browse', "libID=$case->lib"), $libName) : $libName;?> - shadow):?> - + '> testcase->product;?> createLink('product', 'browse', "productID=$case->product"), $productName) : $productName;?> - type != 'normal'):?> product->branch, $lang->product->branchName[$product->type]);?> From 7efbb7d6cae5448760dabcdd726488d450aaef6a Mon Sep 17 00:00:00 2001 From: sunguangming Date: Sat, 8 Oct 2022 17:02:01 +0800 Subject: [PATCH 27/36] * Fix bug #28227. --- module/bug/model.php | 3 ++- module/execution/view/story.html.php | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index b37f2a7a51..63d08257d6 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -3609,7 +3609,8 @@ class bugModel extends model if($type == 'view') $menu .= $this->buildMenu('bug', 'activate', $params, $bug, $type, '', '', "text-success iframe showinonlybody", true); if($type == 'view' && $this->app->tab != 'product') { - $menu .= $this->buildMenu('bug', 'toStory', $toStoryParams, $bug, $type, $this->lang->icons['story'], '', '', '', "data-app='product' id='tostory'", $this->lang->bug->toStory); + $tab = $this->app->tab == 'qa' ? 'product' : $this->app->tab; + $menu .= $this->buildMenu('bug', 'toStory', $toStoryParams, $bug, $type, $this->lang->icons['story'], '', '', '', "data-app='$tab' id='tostory'", $this->lang->bug->toStory); if(common::hasPriv('task', 'create') and !isonlybody()) $menu .= html::a('#toTask', "{$this->lang->bug->toTask}", '', "data-app='qa' data-toggle='modal' class='btn btn-link'"); $menu .= $this->buildMenu('bug', 'createCase', $convertParams, $bug, $type, 'sitemap'); } diff --git a/module/execution/view/story.html.php b/module/execution/view/story.html.php index 0d177416b9..6de388afb2 100644 --- a/module/execution/view/story.html.php +++ b/module/execution/view/story.html.php @@ -96,14 +96,14 @@ $hidden = empty($buttonLink) ? 'hidden' : ''; echo "
- executions)):?> + executions) and $project->multiple):?>

block->last;?>

@@ -259,7 +259,7 @@ $(function()
cv;?>
- + From d65fb0321c200de18a33ad37315b8b4064770968 Mon Sep 17 00:00:00 2001 From: liugang Date: Sun, 9 Oct 2022 09:35:32 +0800 Subject: [PATCH 33/36] * Fix bug #28279. --- module/bug/control.php | 53 +++++++++++++-------------------- module/bug/view/create.html.php | 12 ++++---- 2 files changed, 27 insertions(+), 38 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 70b645b707..0980e3e697 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -320,10 +320,6 @@ class bug extends control parse_str($extras, $output); $from = isset($output['from']) ? $output['from'] : ''; - $project = new stdclass(); - - $productInfo = $this->product->getById($productID); - $hiddenProduct = false; if($this->app->tab == 'execution') { if(isset($output['executionID'])) $this->loadModel('execution')->setMenu($output['executionID']); @@ -342,30 +338,17 @@ class bug extends control $this->view->regionPairs = $regionPairs; $this->view->lanePairs = $lanePairs; } - - $projectID = $execution->project; - $project = $this->loadModel('project')->getByID($projectID); - $hiddenProduct = empty($project->hasProduct); } else if($this->app->tab == 'project') { if(isset($output['projectID'])) { $this->loadModel('project')->setMenu($output['projectID']); - - /* Replace language. */ - $project = $this->project->getByID($output['projectID']); - if(!empty($project->model) and $project->model == 'waterfall') - { - $this->lang->bug->execution = str_replace($this->lang->executionCommon, $this->lang->project->stage, $this->lang->bug->execution); - } - $hiddenProduct = empty($project->hasProduct); } } else { $this->qa->setMenu($this->products, $productID, $branch); - $hiddenProduct = $productInfo->shadow; } $this->view->users = $this->user->getPairs('devfirst|noclosed|nodeleted'); @@ -484,7 +467,8 @@ class bug extends control } /* Get product, then set menu. */ - $productID = $this->product->saveState($productID, $this->products); + $productID = $this->product->saveState($productID, $this->products); + $currentProduct = $this->product->getById($productID); if($branch === '') $branch = (int)$this->cookie->preBranch; @@ -561,13 +545,13 @@ class bug extends control if($this->app->tab == 'execution' or $this->app->tab == 'project') { $objectID = $this->app->tab == 'project' ? $projectID : $executionID; - $productBranches = $productInfo->type != 'normal' ? $this->loadModel('execution')->getBranchByProduct($productID, $objectID, 'noclosed|withMain') : array(); + $productBranches = $currentProduct->type != 'normal' ? $this->loadModel('execution')->getBranchByProduct($productID, $objectID, 'noclosed|withMain') : array(); $branches = isset($productBranches[$productID]) ? $productBranches[$productID] : array(); $branch = key($branches); } else { - $branches = $productInfo->type != 'normal' ? $this->loadModel('branch')->getPairs($productID, 'active') : array(); + $branches = $currentProduct->type != 'normal' ? $this->loadModel('branch')->getPairs($productID, 'active') : array(); } /* If executionID is setted, get builds and stories of this execution. */ @@ -601,12 +585,6 @@ class bug extends control $products = array(); $linkedProducts = $this->loadModel('product')->getProducts($executionID); foreach($linkedProducts as $product) $products[$product->id] = $product->name; - - if($projectID) - { - $project = $this->loadModel('project')->getByID($projectID); - if(empty($bugID) or $this->app->tab != 'qa') $projects += array($projectID => $project->name); - } } elseif($projectID) { @@ -614,9 +592,6 @@ class bug extends control $productList = $this->config->CRProduct ? $this->product->getOrderedProducts('all', 40, $projectID) : $this->product->getOrderedProducts('normal', 40, $projectID); foreach($productList as $product) $products[$product->id] = $product->name; - $project = $this->loadModel('project')->getByID($projectID); - if(empty($bugID) or $this->app->tab != 'qa') $projects += array($projectID => $project->name); - /* Set project menu. */ if($this->app->tab == 'project') $this->project->setMenu($projectID); } @@ -625,6 +600,21 @@ class bug extends control $projects += $this->product->getProjectPairsByProduct($productID, $branch); } + $projectModel = ''; + if($projectID) + { + $project = $this->loadModel('project')->getByID($projectID); + if($project) + { + if(empty($bugID) or $this->app->tab != 'qa') $projects += array($projectID => $project->name); + + /* Replace language. */ + if(!empty($project->model) and $project->model == 'waterfall') $this->lang->bug->execution = str_replace($this->lang->executionCommon, $this->lang->project->stage, $this->lang->bug->execution); + + $projectModel = $project->model; + } + } + /* Link all projects to product when copying bug under qa.*/ if(!empty($bugID) and $this->app->tab == 'qa') $projects += $this->product->getProjectPairsByProduct($productID, $branch); @@ -660,11 +650,11 @@ class bug extends control $this->view->moduleOptionMenu = $moduleOptionMenu; $this->view->stories = $stories; $this->view->projects = defined('TUTORIAL') ? $this->loadModel('tutorial')->getProjectPairs() : $projects; - $this->view->project = $project; $this->view->executions = defined('TUTORIAL') ? $this->loadModel('tutorial')->getExecutionPairs() : $executions; $this->view->builds = $builds; $this->view->moduleID = (int)$moduleID; $this->view->projectID = $projectID; + $this->view->projectModel = $projectModel; $this->view->executionID = $executionID; $this->view->taskID = $taskID; $this->view->storyID = $storyID; @@ -685,8 +675,7 @@ class bug extends control $this->view->keywords = $keywords; $this->view->severity = $severity; $this->view->type = $type; - $this->view->productInfo = $productInfo; - $this->view->hiddenProduct = $hiddenProduct; + $this->view->product = $currentProduct; $this->view->branch = $branch; $this->view->branches = $branches; $this->view->blockID = $blockID; diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index c7d22e54c7..b2117b02da 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -51,18 +51,18 @@ if($this->app->tab == 'project') js::set('objectID', $projectID); - - +
bug->module : $lang->bug->product;?> + shadow ? $lang->bug->module : $lang->bug->product;?>
- type != 'normal' and isset($products[$productID])):?> + type != 'normal' and isset($products[$productID])):?>
- + shadow):?> bug->module?> app->tab == 'project') js::set('objectID', $projectID);
- model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->execution;?> + bug->kanban : $lang->bug->execution;?>
@@ -384,7 +384,7 @@ if($this->app->tab == 'project') js::set('objectID', $projectID); bug->module);?> -model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->execution);?> +bug->kanban : $lang->bug->execution);?> systemMode);?>