From e9db77ef6c8b084eae333e768b24ad88a741d09f Mon Sep 17 00:00:00 2001 From: liumengyi Date: Mon, 6 Mar 2023 00:38:08 +0000 Subject: [PATCH 1/6] * Fix bug #32603. --- module/project/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/project/model.php b/module/project/model.php index cf45f47d8e..9e096977c7 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1527,6 +1527,7 @@ class projectModel extends model ->setDefault('team', $this->post->name) ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', helper::now()) + ->setDefault('days', '0') ->setIF($this->post->delta == 999, 'end', LONG_TIME) ->setIF($this->post->delta == 999, 'days', 0) ->setIF($this->post->begin == '0000-00-00', 'begin', '') From 436fc4a448fa135e13135c931b7885efe4cef952 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Mon, 6 Mar 2023 00:40:45 +0000 Subject: [PATCH 2/6] * Fix bug #32632. --- module/bug/view/view.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index 7f11fcfa4f..7cc63b0fa8 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -251,7 +251,7 @@

- " . zget($lang->bug->browserList, $browser) . "";?> + " . zget($lang->bug->browserList, $browser) . "";?>

From 47c874ae0c94854e4a141cbd32fac1e204471b12 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Mon, 6 Mar 2023 00:41:04 +0000 Subject: [PATCH 3/6] * Fix bug #32633. --- module/common/model.php | 8 ++++++++ module/execution/control.php | 2 ++ module/execution/model.php | 4 +++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/module/common/model.php b/module/common/model.php index ed45177d33..0263d31794 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -3041,6 +3041,14 @@ EOD; } if($productsStatus[$object->product] == 'closed') return false; } + elseif(!empty($object->product) and is_string($object->product) and empty($config->CRProduct)) + { + $products = array(0) + explode(',', $object->product); + $products = $app->control->loadModel('product')->getByIdList($products); + $productStatus = array(); + foreach($products as $product) $productStatus[$product->status] = 1; + if(!empty($productStatus['closed']) and count($productStatus) == 1) return false; + } /* Check the execution is closed. */ $productModuleList = array('story', 'bug', 'testtask'); diff --git a/module/execution/control.php b/module/execution/control.php index 0c473b3597..91312d698f 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1703,6 +1703,8 @@ class execution extends control global $lang; $lang->executionCommon = $lang->execution->stage; include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php'; + + $this->config->execution->create->requiredFields .= ',products0'; } $this->app->loadLang('program'); diff --git a/module/execution/model.php b/module/execution/model.php index be8ebe0187..4d76ef6a90 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -386,6 +386,8 @@ class executionModel extends model if($project->model == 'waterfall' or $project->model == 'waterfallplus') { + $_POST['products'] = array_filter($_POST['products']); + if(empty($_POST['products'])) dao::$errors['products0'] = $this->lang->project->errorNoProducts; $this->checkWorkload('create', $_POST['percent'], $project); if(dao::isError()) return false; } @@ -1883,7 +1885,7 @@ class executionModel extends model ->page($pager, 't1.id') ->fetchAll('id'); - if(empty($productID) and !empty($executions)) $projectProductIdList = $this->dao->select('project, product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($executions))->fetchPairs(); + if(empty($productID) and !empty($executions)) $projectProductIdList = $this->dao->select('project, GROUP_CONCAT(product) as product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($executions))->groupBy('project')->fetchPairs(); $hours = $this->loadModel('project')->computerProgress($executions); $burns = $this->getBurnData($executions); From 3326617ffd78da33962b12bcb5ec15841d4870c9 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Mon, 6 Mar 2023 03:45:49 +0000 Subject: [PATCH 4/6] * Finish task #85646. --- module/project/js/edit.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/module/project/js/edit.js b/module/project/js/edit.js index fdc708019d..cb2f850d72 100644 --- a/module/project/js/edit.js +++ b/module/project/js/edit.js @@ -205,7 +205,7 @@ function loadBranches(product) } }); - (chosenProducts.length > 1 && model == 'waterfall' && model == 'waterfallplus') ? $('.division').removeClass('hide') : $('.division').addClass('hide'); + (chosenProducts.length > 1 && (model == 'waterfall' || model == 'waterfallplus')) ? $('.division').removeClass('hide') : $('.division').addClass('hide'); var $tableRow = $(product).closest('.table-row'); var index = $tableRow.find('select:first').attr('id').replace('products' , ''); @@ -301,5 +301,12 @@ function removeLine(obj) { $(obj).closest('tr').remove(); disableSelectedProduct(); - if($("select[name^='products']").length < 2) $('.division').addClass('hide'); + + var chosenProducts = 0; + $(".productsBox select[name^='products']").each(function() + { + if($(this).val() > 0) chosenProducts ++; + }); + + (chosenProducts.length > 1 && (model == 'waterfall' || model == 'waterfallplus')) ? $('.division').removeClass('hide') : $('.division').addClass('hide'); } From fc83e59848505f13de039591645f7fda7e7fcb49 Mon Sep 17 00:00:00 2001 From: mayue Date: Mon, 6 Mar 2023 08:28:50 +0000 Subject: [PATCH 5/6] * Fix feedback #2393. --- module/search/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/search/model.php b/module/search/model.php index 69ac1589bb..695a4ab088 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -29,6 +29,7 @@ class searchModel extends model { $flowModule = $module; if($module == 'projectStory' || $module == 'executionStory') $flowModule = 'story'; + if($module == 'projectBuild' || $module == 'executionBuild') $flowModule = 'build'; if($module == 'projectBug') $flowModule = 'bug'; $buildin = false; From b25022e3b036bd57b214d0fb63bdde1bceee0646 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 7 Mar 2023 06:52:09 +0000 Subject: [PATCH 6/6] * Fix bug #31827. --- module/project/control.php | 4 ++-- module/project/model.php | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/module/project/control.php b/module/project/control.php index 260801420f..f6f57af86a 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -2190,7 +2190,7 @@ class project extends control } $oldProducts = $this->product->getProducts($projectID); - if($project->multiple and $project->model != 'waterfall') $oldExecutionProducts = $this->dao->select('project,product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($executions))->fetchGroup('project', 'product'); + if($project->multiple and $project->model != 'waterfall' and $project->model != 'waterfallplus') $oldExecutionProducts = $this->dao->select('project,product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($executions))->fetchGroup('project', 'product'); $this->project->updateProducts($projectID); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); @@ -2216,7 +2216,7 @@ class project extends control } } - if($project->multiple and $project->model != 'waterfall') + if($project->multiple and $project->model != 'waterfall' and $project->model != 'waterfallplus') { $unlinkedProducts = array_diff($oldProductIDs, $newProductIDs); if(!empty($unlinkedProducts)) diff --git a/module/project/model.php b/module/project/model.php index ce5b643326..eae3191b79 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2502,6 +2502,13 @@ class projectModel extends model $this->dao->update(TABLE_PROJECT)->set('division')->eq('1')->where('id')->eq((int)$projectID)->exec(); $this->dao->update(TABLE_EXECUTION)->set('division')->eq('1')->where('project')->eq((int)$projectID)->exec(); } + + $project = $this->getByID($projectID); + if(!empty($project) and ($project->model == 'waterfall' or $project->model == 'waterfallplus') and empty($project->division) and !empty($executions)) + { + $this->loadModel('execution'); + foreach($executions as $executionID) $this->execution->updateProducts($executionID); + } } $oldProductKeys = array_keys($oldProjectProducts);