From c512ab0d730c4ac016a538b803dd43fa193e9ec6 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Mon, 14 Nov 2022 17:06:33 +0800 Subject: [PATCH 01/10] * finish task #75912 --- module/execution/control.php | 18 ++++++++++++++++++ module/story/model.php | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 6d0e3736eb..9dbd9647bb 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1733,10 +1733,28 @@ class execution extends control $this->view->linkedBranches = $linkedBranches; } + if(!$project->hasProduct) + { + $shadowProduct = $this->loadModel('product')->getShadowProductByProject($project->id); + $productPlan = $this->loadModel('productplan')->getPairs($shadowProduct->id, '0,0', 'noclosed,unexpired', true); + } + if(!empty($_POST)) { if(isset($_POST['attribute']) and in_array($_POST['attribute'], array('request', 'design', 'review'))) unset($_POST['plans']); + /* No product execution link plans. */ + if(!$project->hasProduct and !empty($_POST['plans'])) + { + $plansItem = array(); + foreach($_POST['plans'] as $planItem) + { + if(empty($planItem[0][0])) continue; + $plansItem[] = $planItem[0][0]; + } + $_POST['plans'] = array($_POST['products'][0] => array(0 => $plansItem)); + } + $executionID = $this->execution->create($copyExecutionID); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); diff --git a/module/story/model.php b/module/story/model.php index ce627b9b37..c7769f426f 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -4218,7 +4218,7 @@ class storyModel extends model if($action == 'batchcreate' and $story->parent > 0) return false; if($action == 'batchcreate' and $story->type == 'requirement' and $story->status != 'closed') return strpos('draft,reviewing,changing', $story->status) === false; if($action == 'batchcreate' and $config->vision == 'lite' and ($story->status == 'active' and ($story->stage == 'wait' or $story->stage == 'projected'))) return true; - /* Adjust code, hide split entry, fix bug #29432. */ + /* Adjust code, hide split entry. */ if($action == 'batchcreate' and ($story->status != 'active' or (isset($shadowProducts[$story->product])) or (!isset($shadowProducts[$story->product]) && $story->stage != 'wait') or !empty($story->plan))) return false; return true; @@ -4489,7 +4489,7 @@ class storyModel extends model $executionID = empty($execution) ? 0 : $execution->id; - /* Adjust code, hide split entry, fix bug #29432. */ + /* Adjust code, hide split entry. */ if(common::hasPriv('story', 'batchCreate') and !$execution->multiple and !$execution->hasProduct and false) { $isClick = $this->isClickable($story, 'batchcreate'); From e37ee336f3b5e45bb9cf4014ec15cadc8f2c8253 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Tue, 15 Nov 2022 09:06:17 +0800 Subject: [PATCH 02/10] * finish task #75908 --- module/search/model.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/module/search/model.php b/module/search/model.php index fb686c62ae..fda31e9aac 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -973,10 +973,11 @@ class searchModel extends model if($this->app->user->admin) return $results; $this->loadModel('doc'); - $products = $this->app->user->view->products; - $programs = $this->app->user->view->programs; - $projects = $this->app->user->view->projects; - $executions = $this->app->user->view->sprints; + $products = $this->app->user->view->products; + $shadowProducts = $this->dao->select('id')->from(TABLE_PRODUCT)->where('shadow')->eq(1)->fetchPairs('id'); + $programs = $this->app->user->view->programs; + $projects = $this->app->user->view->projects; + $executions = $this->app->user->view->sprints; $objectPairs = array(); $total = count($results); @@ -1014,6 +1015,7 @@ class searchModel extends model foreach($objectIdList as $productID => $recordID) { if(strpos(",$products,", ",$productID,") === false) unset($results[$recordID]); + if(in_array($productID, $shadowProducts)) unset($results[$recordID]); } } elseif($objectType == 'program') From e86d77094d73d0564ea3d822965c8ae1ce52869e Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Tue, 15 Nov 2022 09:09:35 +0800 Subject: [PATCH 03/10] * finish task #75904 --- module/story/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/story/control.php b/module/story/control.php index 6cffa44848..ad3acb388b 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -1085,7 +1085,7 @@ class story extends control } /* Set ditto option for users. */ - $users = $this->loadModel('user')->getPairs('nodeleted'); + $users = $this->loadModel('user')->getPairs('nodeleted|noclosed'); $users = array('' => '', 'ditto' => $this->lang->story->ditto) + $users; /* Set Custom*/ From 9cc5139a080c19e76594012b1b3ff54d041c5427 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Tue, 15 Nov 2022 09:53:24 +0800 Subject: [PATCH 04/10] * finish task #75919 --- module/execution/view/story.html.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module/execution/view/story.html.php b/module/execution/view/story.html.php index 4d4d80de04..37efbfad94 100644 --- a/module/execution/view/story.html.php +++ b/module/execution/view/story.html.php @@ -253,6 +253,7 @@ foreach($setting as $key => $value) { if(!$execution->hasProduct and !$execution->multiple and $value->id == 'plan') continue; + if(!$execution->hasProduct and !$execution->multiple and $value->id == 'stage') continue; if($value->show) { $this->datatable->printHead($value, $orderBy, $vars, $canBatchAction); @@ -271,6 +272,7 @@ $value) { if(!$execution->hasProduct and !$execution->multiple and $value->id == 'plan') continue; + if(!$execution->hasProduct and !$execution->multiple and $value->id == 'stage') continue; $this->story->printCell($value, $story, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', $storyType, $execution, $showBranch); } ?> @@ -285,6 +287,7 @@ $value) { if(!$execution->hasProduct and !$execution->multiple and $value->id == 'plan') continue; + if(!$execution->hasProduct and !$execution->multiple and $value->id == 'stage') continue; $this->story->printCell($value, $child, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', $storyType, $execution); }?> From 4d4b1565f4102be79b417e0db9527989742dc721 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Tue, 15 Nov 2022 10:23:54 +0800 Subject: [PATCH 05/10] * finish task #75923#75924 --- module/execution/view/story.html.php | 2 +- module/story/control.php | 4 ++-- module/story/model.php | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/module/execution/view/story.html.php b/module/execution/view/story.html.php index 37efbfad94..cbab8e4866 100644 --- a/module/execution/view/story.html.php +++ b/module/execution/view/story.html.php @@ -79,7 +79,7 @@ id", '', 'button', 'bar-chart muted'); - common::printLink('story', 'export', "productID=$productID&orderBy=id_desc&executionID=$execution->id", " " . $lang->story->export, '', "class='btn btn-link export iframe'"); + common::printLink('story', 'export', "productID=$productID&orderBy=id_desc&executionID=$execution->id&browseType=$type&storyType=$storyType", " " . $lang->story->export, '', "class='btn btn-link export iframe'"); $canLinkStory = $execution->hasProduct or $execution->multiple; if(common::canModify('execution', $execution)) diff --git a/module/story/control.php b/module/story/control.php index ad3acb388b..0877c6779d 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -2777,7 +2777,7 @@ class story extends control $this->config->story->datatable->fieldList['plan']['dataSource'] = array('module' => 'productplan', 'method' => 'getPairs', 'params' => $productIdList); } - $this->post->set('rows', $this->story->getExportStorys($executionID, $orderBy)); + $this->post->set('rows', $this->story->getExportStorys($executionID, $orderBy, $storyType)); $this->fetch('transfer', 'export', 'model=story'); } @@ -2816,7 +2816,7 @@ class story extends control if(isset($project->hasProduct) && !$project->hasProduct) { $filterFields = array('product,', 'branch,'); - if($project->model != 'scrum') $filterFields[] = 'plan'; + if($project->model != 'scrum') $filterFields[] = 'plan,'; $this->config->story->exportFields = str_replace($filterFields, '', $this->config->story->exportFields); } diff --git a/module/story/model.php b/module/story/model.php index c7769f426f..0ed04d40b1 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -5881,10 +5881,12 @@ class storyModel extends model * @access public * @return void */ - public function getExportStorys($executionID, $orderBy = 'id_desc') + public function getExportStorys($executionID, $orderBy = 'id_desc', $storyType = 'story') { $this->loadModel('file'); $this->loadModel('branch'); + + $this->replaceURLang($storyType); $storyLang = $this->lang->story; $storyConfig = $this->config->story; From d3887137bcc74cefcdf0eb6ab683e56293e6d594 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Tue, 15 Nov 2022 11:16:11 +0800 Subject: [PATCH 06/10] * finish task #76338 --- module/bug/view/edit.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/bug/view/edit.html.php b/module/bug/view/edit.html.php index 24ccd1aa2e..f2411a486b 100644 --- a/module/bug/view/edit.html.php +++ b/module/bug/view/edit.html.php @@ -123,7 +123,7 @@ if($this->app->tab == 'project') js::set('objectID', $bug->project); - '> + multiple)) echo 'hide'?>'> bug->productplan;?> plan, "class='form-control chosen'");?> From 9835f45987f96ca91e5a09b5c3403f2ffd8545d9 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Tue, 15 Nov 2022 13:09:44 +0800 Subject: [PATCH 07/10] * Fix bug #29749. --- module/project/view/execution.html.php | 2 ++ module/transfer/control.php | 4 ++-- module/transfer/model.php | 10 +++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/module/project/view/execution.html.php b/module/project/view/execution.html.php index 1f95f153f7..3cc1368a99 100644 --- a/module/project/view/execution.html.php +++ b/module/project/view/execution.html.php @@ -42,10 +42,12 @@ $lang->programplan->stageCustom->task), '', $this->cookie->showTask ? 'checked=checked' : '');?>
+ model == 'waterfall'):?>
 ", '', "class='btn btn-icon text-primary switchBtn' title='{$lang->project->bylist}'");?> createLink('programplan', 'browse', "projectID=$projectID&productID=$productID&type=gantt"), "  ", '', "class='btn btn-icon switchBtn' title='{$lang->programplan->gantt}'");?>
+ " . $lang->export, '', "class='btn btn-link export'")?> createLink('programplan', 'create', "projectID=$projectID&productID=$productID"), " " . $lang->programplan->create, '', "class='btn btn-primary'");?> diff --git a/module/transfer/control.php b/module/transfer/control.php index 1f58dc5022..b9b7851107 100755 --- a/module/transfer/control.php +++ b/module/transfer/control.php @@ -159,14 +159,14 @@ class transfer extends control if($model == 'story') { - $product = $this->loadModel('product')->getByID($this->session->storyPortParams['productID']); + $product = $this->loadModel('product')->getByID($this->session->storyTransferParams['productID']); if($product->type == 'normal') unset($fields['branch']); if($this->session->storyType == 'requirement') unset($fields['plan']); } if($model == 'bug') { - $product = $this->loadModel('product')->getByID($this->session->bugPortParams['productID']); + $product = $this->loadModel('product')->getByID($this->session->bugTransferParams['productID']); if($product->type == 'normal') unset($fields['branch']); if($product->shadow and ($this->app->tab == 'execution' or $this->app->tab == 'project')) unset($fields['product']); } diff --git a/module/transfer/model.php b/module/transfer/model.php index 6ec348d984..0837f45652 100644 --- a/module/transfer/model.php +++ b/module/transfer/model.php @@ -56,16 +56,16 @@ class transferModel extends model } /** - * Check tmpFile. + * Check tmp file. * * @access public * @return void */ public function checkTmpFile() { - $file = $this->session->fileImportFileName; - $tmpPath = $this->loadModel('file')->getPathOfImportedFile(); - $tmpFile = $tmpPath . DS . md5(basename($file)); + $file = $this->session->fileImportFileName; + $tmpPath = $this->loadModel('file')->getPathOfImportedFile(); + $tmpFile = $tmpPath . DS . md5(basename($file)); if($this->maxImport and file_exists($tmpFile)) return $tmpFile; return false; @@ -196,7 +196,7 @@ class transferModel extends model $rows = $this->getRows($model, $fieldList); if($model == 'story') { - $product = $this->loadModel('product')->getByID((int)$this->session->storyPortParams['productID']); + $product = $this->loadModel('product')->getByID((int)$this->session->storyTransferParams['productID']); if($product and $product->shadow) { foreach($rows as $id => $row) From 11343aa6cc3ba9917c6cf0f603067401b617acee Mon Sep 17 00:00:00 2001 From: wangyuting <851424971@qq.com> Date: Tue, 15 Nov 2022 05:15:35 +0000 Subject: [PATCH 08/10] * Fix bug #29700. --- module/build/view/view.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index 9070a25ab4..9ca7217e2d 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -343,7 +343,7 @@ tbody tr td:first-child input {display: none;} builds) as $buildID):?> - createLink('build', 'view', "buildID=$buildID") . "#app={$app->tab}", zget($buildPairs, $buildID)) . $lang->comma;?> + createLink('build', 'view', "buildID=$buildID") . "#app={$app->tab}", zget($buildPairs, $buildID)) . $lang->comma;?> comma);?> From 7693217115b58b9bed26fd5c5577e292469fc842 Mon Sep 17 00:00:00 2001 From: daitingting Date: Tue, 15 Nov 2022 05:20:17 +0000 Subject: [PATCH 09/10] * Fix bug #29621. --- module/project/config.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/project/config.php b/module/project/config.php index afbb5e6010..d3149df35e 100644 --- a/module/project/config.php +++ b/module/project/config.php @@ -11,7 +11,8 @@ $config->project->editor->activate = array('id' => 'comment', 'tools' => 'simple $config->project->editor->view = array('id' => 'lastComment', 'tools' => 'simpleTools'); $config->project->list = new stdclass(); -$config->project->list->exportFields = 'id,parent,code,name,hasProduct,linkedProducts,status,begin,end,budget,PM,end,desc'; +$config->project->list->exportFields = 'id,code,name,hasProduct,linkedProducts,status,begin,end,budget,PM,end,desc'; +if($config->systemMode == 'ALM') $config->project->list->exportFields = substr_replace($config->project->list->exportFields, ',parent', 2, 0); $config->project->create = new stdclass(); $config->project->edit = new stdclass(); From 72c38e942ec41d29baf2fb95a776e7bee81b3ba8 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Tue, 15 Nov 2022 13:39:09 +0800 Subject: [PATCH 10/10] add param --- module/story/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/story/model.php b/module/story/model.php index 0ed04d40b1..e0f14160fc 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -5878,6 +5878,7 @@ class storyModel extends model * * @param int $executionID * @param string $orderBy + * @param string $storyType * @access public * @return void */