@@ -30,17 +31,7 @@ productplan->product;?> name;?> - type != 'normal' and $plan->parent != '-1'):?> - - product->branch;?> - branch, "onchange='getConflictStories($plan->id);' class='form-control chosen' multiple");?> - - - - productplan->title;?> - title, "class='form-control' required");?> - parent == '-1'):?> parent);?> @@ -49,6 +40,16 @@ '') + $parentPlanPairs, $plan->parent, "class='form-control chosen'");?> + shadow and $product->type != 'normal' and $plan->parent != '-1'):?> + + product->branch;?> + branch, "class='form-control chosen' multiple");?> + + + + productplan->title;?> + title, "class='form-control' required");?> + productplan->status;?> parent == -1 ? "disabled='disabled'" : '' ;?> From 796b695b219ebd704638fb86d45fbed1099a0c6a Mon Sep 17 00:00:00 2001 From: mayue Date: Tue, 6 Dec 2022 09:35:42 +0800 Subject: [PATCH 02/20] * Resolve feedback #1478. --- module/execution/model.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/execution/model.php b/module/execution/model.php index ac9033160a..d2d9a2001b 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1582,14 +1582,17 @@ class executionModel extends model ->andWhere('type')->eq('execution') ->fetchPairs(); } + $project = $this->loadModel('project')->getByID($projectID); $executions = $this->dao->select('t1.*,t2.name projectName, t2.model as projectModel')->from(TABLE_EXECUTION)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') - ->beginIF($productID)->leftJoin(TABLE_PROJECTPRODUCT)->alias('t3')->on('t1.id=t3.project')->fi() + ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t3')->on('t1.id=t3.project') + ->beginIF($project->division)->leftJoin(TABLE_PRODUCT)->alias('t4')->on('t4.id=t3.product')->fi() ->where('t1.type')->in('sprint,stage,kanban') ->andWhere('t1.deleted')->eq('0') ->andWhere('t1.vision')->eq($this->config->vision) ->andWhere('t1.multiple')->eq('1') + ->beginIF($project->division)->andWhere('t4.deleted')->eq('0')->fi() ->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->sprints)->fi() ->beginIF(!empty($executionQuery))->andWhere($executionQuery)->fi() ->beginIF($productID)->andWhere('t3.product')->eq($productID)->fi() From 6a29023b24090b53d1501f2eb49e5dcb53c583aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Tue, 6 Dec 2022 09:39:47 +0800 Subject: [PATCH 03/20] * Finish task #78675. --- module/productplan/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/productplan/config.php b/module/productplan/config.php index 4dddb53677..bd16b51610 100644 --- a/module/productplan/config.php +++ b/module/productplan/config.php @@ -30,7 +30,7 @@ $config->productplan->search['fields']['end'] = $lang->productplan->end; $config->productplan->search['params']['id'] = array('operator' => '=', 'control' => 'input', 'values' => ''); $config->productplan->search['params']['title'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); -$config->productplan->search['params']['branch'] = array('operator' => '=', 'control' => 'select', 'values' => ''); +$config->productplan->search['params']['branch'] = array('operator' => 'include', 'control' => 'select', 'values' => ''); $config->productplan->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => array('' => '') + $lang->productplan->statusList); $config->productplan->search['params']['begin'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); $config->productplan->search['params']['end'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); From c1257aac6b00892f84929daafcf727b3b95ec9c7 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Tue, 6 Dec 2022 09:57:03 +0800 Subject: [PATCH 04/20] * Code for task#78669. --- module/productplan/control.php | 2 -- module/productplan/js/create.js | 2 +- module/productplan/js/edit.js | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/module/productplan/control.php b/module/productplan/control.php index 389b366571..d2b1ff27b6 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -956,8 +956,6 @@ class productplan extends control */ public function ajaxGetConflict($planID, $newBranch) { - if($newBranch == '') return; - $plan = $this->productplan->getByID($planID); $oldBranch = $plan->branch; $planStories = $this->loadModel('story')->getPlanStories($planID, 'all'); diff --git a/module/productplan/js/create.js b/module/productplan/js/create.js index fdf7805e8f..6bfe71b4ba 100644 --- a/module/productplan/js/create.js +++ b/module/productplan/js/create.js @@ -74,7 +74,7 @@ $('#parent').change(function() }) }) -$('#branch').change(function() +$('#dataform').on('change', '#branch', function() { if(parentPlanID) return; diff --git a/module/productplan/js/edit.js b/module/productplan/js/edit.js index 6a6f6fd562..7e0541f621 100644 --- a/module/productplan/js/edit.js +++ b/module/productplan/js/edit.js @@ -13,7 +13,7 @@ function convertStringToDate(dateString) return Date.parse(dateString); } -$('#branch').change(function() +$('#dataform').on('change', '#branch', function() { var newBranch = $('#branch').val() ? $('#branch').val().toString() : ''; $.get(createLink('productplan', 'ajaxGetConflict', 'planID=' + planID + '&newBranch=' + newBranch), function(conflictStories) From c23d02ca73fd7459648d267798a40a99a187d054 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Tue, 6 Dec 2022 10:03:42 +0800 Subject: [PATCH 05/20] * Code for task#78669. --- module/productplan/control.php | 2 +- module/productplan/model.php | 17 +---------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/module/productplan/control.php b/module/productplan/control.php index d2b1ff27b6..8ef3268a79 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -117,7 +117,7 @@ class productplan extends control $this->view->branches = $branchPairs; $this->view->defaultBranch = $defaultBranch; $this->view->parent = $parent; - $this->view->parentPlanPairs = $this->productplan->getTopPlanPairs($productID, '', 'done,closed'); + $this->view->parentPlanPairs = $this->productplan->getTopPlanPairs($productID, 'done,closed'); $this->display(); } diff --git a/module/productplan/model.php b/module/productplan/model.php index d378d62382..a5604badb9 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -222,29 +222,14 @@ class productplanModel extends model * Get top plan pairs. * * @param int $productID - * @param int $branch * @param int $exclude * @access public * @return array */ - public function getTopPlanPairs($productID, $branch = '', $exclude = '') + public function getTopPlanPairs($productID, $exclude = '') { - $branchQuery = ''; - if($branch !== '') - { - $branchQuery .= '('; - $branchCount = count(explode(',', $branch)); - foreach(explode(',', $branch) as $index => $branchID) - { - $branchQuery .= "CONCAT(',', branch, ',') LIKE '%,$branchID,%'"; - if($index < $branchCount - 1) $branchQuery .= ' AND '; - } - $branchQuery .= ')'; - } - $planPairs = $this->dao->select("id,title")->from(TABLE_PRODUCTPLAN) ->where('product')->eq($productID) - ->beginIF($branch !== '' and !empty($branchQuery))->andWhere($branchQuery)->fi() ->andWhere('parent')->le(0) ->andWhere('deleted')->eq(0) ->beginIF($exclude)->andWhere('status')->notin($exclude) From 62157bf79e43c1e6a991fdb90b33081f1e24378a Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Tue, 6 Dec 2022 10:24:11 +0800 Subject: [PATCH 06/20] * Code for task#78669. --- module/productplan/control.php | 14 ++++++++++---- module/productplan/js/create.js | 6 ++++-- module/productplan/js/edit.js | 6 +++--- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/module/productplan/control.php b/module/productplan/control.php index 8ef3268a79..f2fad8c605 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -1008,20 +1008,26 @@ class productplan extends control /** * AJAX: Get parent branches. * - * @param int $parentID + * @param int $productID + * @param int $parentID + * @param string $currentBranches * @access public * @return void */ - public function ajaxGetParentBranches($productID = 0, $parentID = 0) + public function ajaxGetParentBranches($productID = 0, $parentID = 0, $currentBranches = '') { $branchPairs = $this->loadModel('branch')->getPairs($productID, 'active'); if(!empty($parentID)) { $parentBranches = array(); $parentPlan = $this->productplan->getByID($parentID); - foreach(explode(',', $parentPlan->branch) as $parentBranchID) $parentBranches[$parentBranchID] = $branchPairs[$parentBranchID]; + foreach(explode(',', $parentPlan->branch) as $parentBranchID) + { + $parentBranches[$parentBranchID] = $branchPairs[$parentBranchID]; + if(!empty($currentBranches) and strpos(",$currentBranches,", ",$parentBranchID,") === false) $currentBranches = str_replace(",$parentBranchID,", ',', $currentBranches); + } } - return print(html::select('branch[]', empty($parentID) ? $branchPairs : $parentBranches, '', "class='form-control chosen' multiple required")); + return print(html::select('branch[]', empty($parentID) ? $branchPairs : $parentBranches, trim($currentBranches, ','), "class='form-control chosen' multiple required")); } /** diff --git a/module/productplan/js/create.js b/module/productplan/js/create.js index 6bfe71b4ba..dc43f76277 100644 --- a/module/productplan/js/create.js +++ b/module/productplan/js/create.js @@ -65,12 +65,14 @@ $('#future').on('change', function() $('#parent').change(function() { - var parentID = $(this).val(); - $.post(createLink('productplan', 'ajaxGetParentBranches', "productID=" + productID + "&parentID=" + parentID), function(data) + var parentID = $(this).val(); + var currentBranches = $('#branch').val() ? $('#branch').val().toString() : ''; + $.post(createLink('productplan', 'ajaxGetParentBranches', "productID=" + productID + "&parentID=" + parentID + "¤tBranches=" + currentBranches), function(data) { $('#branch').replaceWith(data); $('#branch_chosen').remove(); $('#branch').chosen(); + $('#branch').change(); }) }) diff --git a/module/productplan/js/edit.js b/module/productplan/js/edit.js index 7e0541f621..9d3733f176 100644 --- a/module/productplan/js/edit.js +++ b/module/productplan/js/edit.js @@ -23,7 +23,6 @@ $('#dataform').on('change', '#branch', function() var result = confirm(conflictStories) ? true : false; if(!result) { - newBranch = oldBranch[planID]; $('#branch').val(oldBranch[planID].split(',')); $('#branch').trigger("chosen:updated"); } @@ -59,8 +58,9 @@ function computeEndDate(delta) $('#parent').change(function() { - var parentID = $(this).val(); - $.post(createLink('productplan', 'ajaxGetParentBranches', "productID=" + productID + "&parentID=" + parentID), function(data) + var parentID = $(this).val(); + var currentBranches = $('#branch').val() ? $('#branch').val().toString() : ''; + $.post(createLink('productplan', 'ajaxGetParentBranches', "productID=" + productID + "&parentID=" + parentID + "¤tBranches=" + currentBranches), function(data) { $('#branch').replaceWith(data); $('#branch_chosen').remove(); From 7c8f4674cf359a25d32a4ec82dfec5a7ce2f31f7 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 6 Dec 2022 10:37:24 +0800 Subject: [PATCH 07/20] * code for task #78909. --- db/update18.0.beta1.sql | 1 + db/zentao.sql | 1 + module/action/config.php | 2 +- module/action/model.php | 9 +++++++++ 4 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 db/update18.0.beta1.sql diff --git a/db/update18.0.beta1.sql b/db/update18.0.beta1.sql new file mode 100644 index 0000000000..e7e4c35cbd --- /dev/null +++ b/db/update18.0.beta1.sql @@ -0,0 +1 @@ +ALTER TABLE `zt_effort` ADD `extra` text COLLATE 'utf8_general_ci' NOT NULL AFTER `end`; diff --git a/db/zentao.sql b/db/zentao.sql index f17e27812a..5c27b3d7a6 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -6554,6 +6554,7 @@ ALTER TABLE `zt_effort` CHANGE `begin` `begin` smallint(4) unsigned zerofill NOT ALTER TABLE `zt_effort` CHANGE `end` `end` smallint(4) unsigned zerofill NOT NULL AFTER `begin`; ALTER TABLE `zt_effort` ADD `deleted` enum('0','1') NOT NULL DEFAULT '0' AFTER `end`; ALTER TABLE `zt_effort` ADD `order` tinyint unsigned NOT NULL DEFAULT '0' AFTER `end`; +ALTER TABLE `zt_effort` ADD `extra` text COLLATE 'utf8_general_ci' NULL AFTER `end`; ALTER TABLE `zt_effort` ADD INDEX `execution` (`execution`); ALTER TABLE `zt_effort` ADD INDEX `objectID` (`objectID`); ALTER TABLE `zt_effort` ADD INDEX `date` (`date`); diff --git a/module/action/config.php b/module/action/config.php index 053d148d83..8dce374066 100755 --- a/module/action/config.php +++ b/module/action/config.php @@ -62,7 +62,7 @@ $config->action->majorList['project'] = array('opened', 'edited'); $config->action->majorList['execution'] = array('opened', 'edited'); $config->action->needGetProjectType = 'build,task,bug,case,testcase,caselib,testtask,testsuite,testreport,doc,issue,release,risk,design,opportunity,trainplan,gapanalysis,researchplan,researchreport,'; -$config->action->needGetRelateField = ',story,productplan,release,task,build,bug,testcase,case,testtask,testreport,doc,doclib,issue,risk,opportunity,trainplan,gapanalysis,team,whitelist,researchplan,researchreport,meeting,kanbanlane,kanbancolumn,module,'; +$config->action->needGetRelateField = ',story,productplan,release,task,build,bug,testcase,case,testtask,testreport,doc,doclib,issue,risk,opportunity,trainplan,gapanalysis,team,whitelist,researchplan,researchreport,meeting,kanbanlane,kanbancolumn,module,review,'; $config->action->noLinkModules = ',doclib,module,webhook,gitlab,gitea,gogs,sonarqube,pipeline,jenkins,kanban,kanbanspace,kanbancolumn,kanbanlane,kanbanregion,kanbancard,execution,project,traincategory,apistruct,program,product,user,entry,repo,'; $config->action->ignoreObjectType4Dynamic = 'kanbanregion,kanbanlane,kanbancolumn'; diff --git a/module/action/model.php b/module/action/model.php index 17954cb970..7ee8ea4231 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -287,6 +287,15 @@ class actionModel extends model if(strpos(',deleted,', ",$actionType,") !== false) $module = $this->dao->select('*')->from(TABLE_MODULE)->where('id')->eq($objectID)->fetch(); if(!empty($module) and $module->type == 'story') $record['product'] = $module->root; break; + case 'review': + $result = $this->dao->select('*')->from($this->config->objectTables[$objectType])->where('id')->eq($objectID)->fetch(); + if($result) + { + $products = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($result->project)->fetchPairs('product'); + $record['product'] = join(',', array_keys($products)); + $record['project'] = zget($result, 'project', 0); + } + break; default: $result = $this->dao->select('*')->from($this->config->objectTables[$objectType])->where('id')->eq($objectID)->fetch(); $record['product'] = zget($result, 'product', '0'); From afbd5f1b0a3c8deee257f6d6820e1aca313439b8 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Tue, 6 Dec 2022 02:42:35 +0000 Subject: [PATCH 08/20] * Resolve feedback #83. --- module/transfer/config.php | 1 + module/transfer/model.php | 1 + 2 files changed, 2 insertions(+) diff --git a/module/transfer/config.php b/module/transfer/config.php index 35deafb6c1..c53f3b1d84 100644 --- a/module/transfer/config.php +++ b/module/transfer/config.php @@ -18,6 +18,7 @@ $config->transfer->listFields = ''; $config->transfer->sysLangFields = ',pri,status,type,mode,severity,os,browser,resolution,confirmed,source,reviewResult,stage,change,category'; $config->transfer->sysDataFields = 'execution,product,user'; $config->transfer->userFields = 'assignedTo,openedBy,finishedBy,canceledBy,closedBy,lastEditedBy,lastRunner,resolvedBy,reviewedBy,mailto'; +$config->transfer->textareaFields = 'spec,desc'; $config->transfer->defaultZeroField = 'severity,pri'; $config->transfer->defaultEmptyField = ''; diff --git a/module/transfer/model.php b/module/transfer/model.php index 1cee8c3173..0721b4d5af 100644 --- a/module/transfer/model.php +++ b/module/transfer/model.php @@ -1473,6 +1473,7 @@ class transferModel extends model } $html .= ''; } + elseif(strpos($this->transferConfig->textareaFields, $field) !== false) $html .= '' . html::textarea("$name", $selected, "class='form-control' style='overflow:hidden;'") . ''; else $html .= '' . html::input("$name", $selected, "class='form-control autocomplete='off'") . ''; } From 1bca37102ec0eb1903268531c4073b6e18347fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Tue, 6 Dec 2022 13:39:36 +0800 Subject: [PATCH 09/20] * Fix bug #30554. --- module/project/js/create.js | 7 +++---- module/project/js/edit.js | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/module/project/js/create.js b/module/project/js/create.js index 1d1cdb8c1e..92e09db510 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -162,17 +162,16 @@ function setParentProgram(parentProgram) var productSelectHtml = data.allProducts; var planSelectHtml = data.plans; - $('.productsBox .row .col-sm-4 .input-group').each(function(index) + $('.productsBox .row .col-sm-6 .input-group').each(function(index) { var selectedProduct = $(this).find('[name^=products]').val(); var selectedBranch = $(this).find('[name^=branch]').val(); var selectedPlan = $('#plan' + index ).find('[name^=plans]').val(); - $(this).html(productSelectHtml); + $(this).find('[name^=products]').html(productSelectHtml); $(this).find('[name^=products]').attr('name', 'products[' + index + ']').attr('id', 'products' + index).attr('data-branch', selectedBranch).attr('data-plan', selectedPlan); $(this).find('[name^=products]').val(selectedProduct).chosen().change(); }); - $('.productsBox .row .col-sm-4:last').find('.input-group').append($('.productsBox .addProduct .input-group:first .input-group-addon').prop('outerHTML')); } if(parentProgram != 0) @@ -245,7 +244,7 @@ function addNewProduct(obj) $('.newLine').removeClass('hidden'); $('.productsBox .row').removeClass('hidden'); $('.productsBox .row .input-group').find('select').removeAttr('disabled').trigger("chosen:updated"); - if($('#plansBox .col-sm-4').find('select').length > 1) $('.division').removeClass('hide'); + if($('.productsBox').find("select[name^=products]").length > 1) $('.division').removeClass('hide'); /* Hide the input box for creating a product. */ $(obj).closest('td').attr('colspan', 3); diff --git a/module/project/js/edit.js b/module/project/js/edit.js index e676a6a499..d9abb1e438 100644 --- a/module/project/js/edit.js +++ b/module/project/js/edit.js @@ -18,13 +18,13 @@ $(function() var productSelectHtml = data.allProducts; var planSelectHtml = data.plans; - $('#productsBox .row .col-sm-4 .input-group').each(function(index) + $('.productsBox .row .col-sm-6 .input-group').each(function(index) { var selectedProduct = $(this).find('[name^=products]').val(); var selectedBranch = $(this).find('[name^=branch]').val(); var selectedPlan = $('#plan' + index ).find('[name^=plans]').val(); - $(this).html(productSelectHtml); + $(this).find('[name^=products]').html(productSelectHtml); $(this).find('[name^=products]').attr('name', 'products[' + index + ']').attr('id', 'products' + index).attr('data-branch', selectedBranch).attr('data-plan', selectedPlan); $(this).find('[name^=products]').val(selectedProduct).chosen().change(); }); From 0f1de8b84f90d637e88efe8840e977b6117bbc47 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 6 Dec 2022 13:41:58 +0800 Subject: [PATCH 10/20] * code for task #78911 --- module/build/control.php | 1 + module/build/model.php | 4 +-- module/build/view/view.html.php | 46 ++++++++++++++++++++++++++++-- module/project/view/build.html.php | 6 ++-- 4 files changed, 49 insertions(+), 8 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index 767239b781..05cc1ffef2 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -322,6 +322,7 @@ class build extends control $this->view->type = $type; $this->view->bugPager = $bugPager; $this->view->branchName = $build->productType == 'normal' ? '' : $this->loadModel('branch')->getById($build->branch); + $this->view->childBuilds = empty($build->builds) ? array() : $this->dao->select('id,name,bugs,stories')->from(TABLE_BUILD)->where('id')->in($build->builds)->fetchAll(); if($this->app->getViewType() == 'json') { diff --git a/module/build/model.php b/module/build/model.php index baa9253ead..b53fd9507b 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -628,8 +628,8 @@ class buildModel extends model { $build->allBugs = $build->bugs; $build->allStories = $build->stories; - $childBuilds = $this->dao->select('bugs, stories')->from(TABLE_BUILD)->where('id')->in($build->builds)->fetchAll(); + $childBuilds = $this->dao->select('id,name,bugs,stories')->from(TABLE_BUILD)->where('id')->in($build->builds)->fetchAll(); foreach($childBuilds as $childBuild) { if($childBuild->bugs) $build->allBugs .= ",{$childBuild->bugs}"; @@ -687,7 +687,7 @@ class buildModel extends model { $executionID = $tab == 'execution' ? $extraParams['executionID'] : $build->execution; $execution = $this->loadModel('execution')->getByID($executionID); - $build->executionDeleted = $execution ? $execution->deleted : 0; + $build->executionDeleted = $execution ? $execution->deleted : 0; $testtaskApp = (!empty($execution->type) and $execution->type == 'kanban') ? 'data-app="qa"' : "data-app='{$tab}'"; diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index fe31522f6a..84bf088be2 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -88,8 +88,11 @@ tbody tr td:first-child input {display: none;} idAB);?> - pri;?>>priAB);?> + pri;?>>priAB);?> story->title);?> + + build->common;?> + openedByAB);?> story->estimateAB);?> statusAB);?> @@ -99,7 +102,21 @@ tbody tr td:first-child input {display: none;} $story):?> - stories,", ",$story->id,") !== false ? '' : "disabled";?> + stories,", ",$story->id,") !== false ? '' : "disabled"; + $buildName = $build->name; + if($unlinkClass == 'disabled') + { + foreach($childBuilds as $childBuild) + { + if(strpos(",$childBuild->stories,", ",$story->id,") !== false) + { + $buildName = $childBuild->name; + break; + } + } + } + ?> @@ -130,6 +147,9 @@ tbody tr td:first-child input {display: none;} } ?> + + + openedBy);?> estimate . $config->hourUnit;?> @@ -189,6 +209,9 @@ tbody tr td:first-child input {display: none;} idAB);?> bug->title);?> + + build->common?> + bug->status);?> openedByAB);?> bug->openedDateAB);?> @@ -200,7 +223,21 @@ tbody tr td:first-child input {display: none;} createLink('bug', 'view', "bugID=$bug->id", '', true);?> - bugs,", ",$bug->id,") !== false ? '' : "disabled";?> + bugs,", ",$bug->id,") !== false ? '' : "disabled"; + $buildName = $build->name; + if($unlinkClass == 'disabled') + { + foreach($childBuilds as $childBuild) + { + if(strpos(",$childBuild->bugs,", ",$bug->id,") !== false) + { + $buildName = $childBuild->name; + break; + } + } + } + ?> @@ -211,6 +248,9 @@ tbody tr td:first-child input {display: none;} title, '', isonlybody() ? "data-width='1000'" : "class='iframe' data-width='1000'");?> + + + processStatus('bug', $bug);?> diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index 67c4814aeb..124480f679 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -48,7 +48,7 @@ build->id;?> - build->name;?> + build->name;?> hasProduct):?> build->product;?> @@ -56,8 +56,8 @@ executionCommon;?> build->url;?> - build->date;?> - build->builder;?> + build->date;?> + build->builder;?> actions;?> From 10646f608b4472717c8c342b3eb8889aea3da72d Mon Sep 17 00:00:00 2001 From: zhouxin Date: Tue, 6 Dec 2022 05:47:19 +0000 Subject: [PATCH 11/20] * Fix bug #30548. --- module/transfer/control.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/transfer/control.php b/module/transfer/control.php index b9b7851107..65d13bbc52 100755 --- a/module/transfer/control.php +++ b/module/transfer/control.php @@ -163,13 +163,17 @@ class transfer extends control 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->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']); } + if($model == 'testcase') + { + $product = $this->loadModel('product')->getByID($this->session->testcaseTransferParams['productID']); + if($product->type == 'normal') unset($fields['branch']); + } if($model == 'task') $datas = $this->task->processDatas4Task($datas); $html = $this->transfer->buildNextList($datas->datas, $lastID, $fields, $pagerID, $model); die($html); From 45e8ff4f1a80dbdf3c4074d1121bef42390f4a9a Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 6 Dec 2022 13:53:49 +0800 Subject: [PATCH 12/20] * code for task #78912. --- module/build/view/view.html.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index 84bf088be2..f082d4894d 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -209,10 +209,10 @@ tbody tr td:first-child input {display: none;} idAB);?> bug->title);?> + bug->status);?> build->common?> - bug->status);?> openedByAB);?> bug->openedDateAB);?> bug->resolvedByAB);?> @@ -222,7 +222,7 @@ tbody tr td:first-child input {display: none;} - createLink('bug', 'view', "bugID=$bug->id", '', true);?> + createLink('bug', 'view', "bugID=$bug->id", '', true);?> bugs,", ",$bug->id,") !== false ? '' : "disabled"; $buildName = $build->name; @@ -248,14 +248,14 @@ tbody tr td:first-child input {display: none;} title, '', isonlybody() ? "data-width='1000'" : "class='iframe' data-width='1000'");?> - - - processStatus('bug', $bug);?> + + + openedBy);?> openedDate) ? '' : substr($bug->openedDate, 5, 11);?> resolvedBy);?> From 069a8d4a062ee4abda4b4f5f66bcbbeb10d58c6f Mon Sep 17 00:00:00 2001 From: liuyongkai Date: Tue, 6 Dec 2022 13:54:54 +0800 Subject: [PATCH 13/20] * Resolve feedback #1398. --- module/bug/control.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 438460af70..96ea49c4bf 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -488,7 +488,7 @@ class bug extends control $steps = $this->lang->bug->tplStep . $this->lang->bug->tplResult . $this->lang->bug->tplExpect; $os = ''; $browser = ''; - $assignedTo = ''; + $assignedTo = isset($currentProduct->QD) ? $currentProduct->QD : ''; $deadline = ''; $mailto = ''; $keywords = ''; @@ -2504,9 +2504,9 @@ class bug extends control /** * Ajax get released builds. - * - * @param int $productID - * @param int|string $branch + * + * @param int $productID + * @param int|string $branch * @access public * @return string */ From 2f4ad5c5566f05df749aa60e05ff9e4a36d2aeaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=81=E9=A3=9E?= Date: Tue, 6 Dec 2022 06:05:18 +0000 Subject: [PATCH 14/20] * Format code and fix return value. --- framework/base/control.class.php | 3 +-- framework/base/helper.class.php | 41 +++++++++++++++++++------------- framework/base/router.class.php | 13 +++++----- framework/router.class.php | 3 +-- 4 files changed, 33 insertions(+), 27 deletions(-) diff --git a/framework/base/control.class.php b/framework/base/control.class.php index cc4853fe49..ab6415af38 100644 --- a/framework/base/control.class.php +++ b/framework/base/control.class.php @@ -600,7 +600,6 @@ class baseControl if(!empty($jsExtPath)) { - $realModulePath = realPath($modulePath); foreach($jsExtPath as $jsPath) { if(empty($jsPath)) continue; @@ -730,7 +729,7 @@ class baseControl chdir(dirname($viewFile)); /** - * 使用extract安定ob方法渲染$viewFile里面的代码。 + * 使用extract和ob方法渲染$viewFile里面的代码。 * Use extract and ob functions to eval the codes in $viewFile. */ extract((array)$this->view); diff --git a/framework/base/helper.class.php b/framework/base/helper.class.php index 1089b8d145..acec227494 100644 --- a/framework/base/helper.class.php +++ b/framework/base/helper.class.php @@ -87,7 +87,7 @@ class baseHelper /* 生成url链接的开始部分。Set the begin parts of the link. */ if($config->requestType == 'PATH_INFO') $link = $config->webRoot . $appName; if($config->requestType != 'PATH_INFO') $link = $config->webRoot . $appName . basename($_SERVER['SCRIPT_NAME']); - if($config->requestType == 'PATH_INFO2') $link .= '/'; + if($config->requestType == 'PATH_INFO2') $link = '/'; /** * #1: RequestType为GET。When the requestType is GET. @@ -178,7 +178,7 @@ class baseHelper * Check in only body mode or not. * * @access public - * @return void + * @return bool */ public static function inOnlyBodyMode() { @@ -464,7 +464,7 @@ class baseHelper $agent = $_SERVER["HTTP_USER_AGENT"]; - /* Chrome should checked before safari.*/ + /* Chrome should check before safari.*/ if(strpos($agent, 'Firefox') !== false) $browser['name'] = "firefox"; if(strpos($agent, 'Opera') !== false) $browser['name'] = 'opera'; if(strpos($agent, 'Safari') !== false) $browser['name'] = 'safari'; @@ -853,7 +853,7 @@ function a($var) * Judge the server ip is local or not. * * @access public - * @return void + * @return bool */ function isLocalIP() { @@ -954,33 +954,42 @@ function htmlSpecialString($string, $flags = '', $encoding = 'UTF-8') return htmlspecialchars($string, $flags, $encoding); } -if (!function_exists('array_column')) +if(!function_exists('array_column')) { function array_column(array $input, $columnKey, $indexKey = null) { $output = array(); - foreach ($input as $row) { - $key = $value = null; + foreach($input as $row) + { + $key = $value = null; $keySet = $valueSet = false; - if (null !== $indexKey && array_key_exists($indexKey, $row)) { + if(null !== $indexKey && array_key_exists($indexKey, $row)) + { $keySet = true; - $key = (string) $row[$indexKey]; + $key = (string) $row[$indexKey]; } - if (null === $columnKey) { + if(null === $columnKey) + { $valueSet = true; - $value = $row; - } elseif (\is_array($row) && \array_key_exists($columnKey, $row)) { + $value = $row; + } + elseif(\is_array($row) && \array_key_exists($columnKey, $row)) + { $valueSet = true; - $value = $row[$columnKey]; + $value = $row[$columnKey]; } - if ($valueSet) { - if ($keySet) { + if($valueSet) + { + if($keySet) + { $output[$key] = $value; - } else { + } + else + { $output[] = $value; } } diff --git a/framework/base/router.class.php b/framework/base/router.class.php index de909ac83a..e1a87cf014 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -1719,7 +1719,7 @@ class baseRouter } /* 1. 如果extensionLevel == 2,且扩展文件存在,返回该站点扩展文件。 If extensionLevel == 2 and site extensionFile exists, return it. */ - if($this->config->framework->extensionLevel == 2 and !empty( $moduleExtPaths['site'])) + if($this->config->framework->extensionLevel == 2 and !empty($moduleExtPaths['site'])) { $this->extActionFile = $moduleExtPaths['site'] . $this->methodName . '.php'; if(file_exists($this->extActionFile)) return true; @@ -1757,7 +1757,7 @@ class baseRouter if(empty($moduleExtPaths)) return false; /* 如果extensionLevel == 2,且扩展文件存在,返回该站点扩展文件。If extensionLevel == 2 and site extensionFile exists, return it. */ - if($this->config->framework->extensionLevel == 2 and !empty( $moduleExtPaths['site'])) + if($this->config->framework->extensionLevel == 2 and !empty($moduleExtPaths['site'])) { $locateFile = $moduleExtPaths['site'] . $this->methodName . '.302'; if(file_exists($locateFile)) $this->sendAPI($locateFile); @@ -2497,9 +2497,8 @@ class baseRouter * * @param string $moduleName module name * @param string $appName app name - * @param bool $exitIfNone exit or not * @access public - * @return object|bool the config object or false. + * @return void */ public function loadModuleConfig($moduleName, $appName = '') { @@ -2525,7 +2524,7 @@ class baseRouter if(!empty($extConfigPath['saas'])) $commonExtConfigFiles = array_merge($commonExtConfigFiles, helper::ls($extConfigPath['saas'], '.php')); if(!empty($extConfigPath['custom'])) $commonExtConfigFiles = array_merge($commonExtConfigFiles, helper::ls($extConfigPath['custom'], '.php')); } - if($config->framework->extensionLevel == 2 and !empty($extConfigPath['site'])) $siteExtConfigFiles = helper::ls($extConfigPath['site'], '.php'); + if($config->framework->extensionLevel == 2 and !empty($extConfigPath['site'])) $siteExtConfigFiles = helper::ls($extConfigPath['site'], '.php'); $extConfigFiles = array_merge($commonExtConfigFiles, $siteExtConfigFiles); /* 将主配置文件和扩展配置文件合并在一起。Put the main config file and extension config files together. */ @@ -2690,12 +2689,12 @@ class baseRouter if($this->config->framework->extensionLevel >= 1) { if(!empty($extLangPath['common'])) $commonExtLangFiles = helper::ls($extLangPath['common'] . $this->clientLang, '.php'); - if(!empty($extLangPath['xuan'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['xuan'] . $this->clientLang, '.php')); + if(!empty($extLangPath['xuan'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['xuan'] . $this->clientLang, '.php')); if(!empty($extLangPath['vision'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['vision'] . $this->clientLang, '.php')); if(!empty($extLangPath['custom'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['custom'] . $this->clientLang, '.php')); if(!empty($extLangPath['saas'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['saas'] . $this->clientLang, '.php')); } - if($this->config->framework->extensionLevel == 2 and !empty($extLangPath['site'])) $siteExtLangFiles = helper::ls($extLangPath['site'] . $this->clientLang, '.php'); + if($this->config->framework->extensionLevel == 2 and !empty($extLangPath['site'])) $siteExtLangFiles = helper::ls($extLangPath['site'] . $this->clientLang, '.php'); $extLangFiles = array_merge($commonExtLangFiles, $siteExtLangFiles); } diff --git a/framework/router.class.php b/framework/router.class.php index dac06b4ac9..9be28106e7 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -315,9 +315,8 @@ class router extends baseRouter * * @param string $moduleName module name * @param string $appName app name - * @param bool $exitIfNone exit or not * @access public - * @return object|bool the config object or false. + * @return void */ public function loadModuleConfig($moduleName, $appName = '') { From d8e155a5ec6ad37a0a69dac4d4fcd2dc137c90a4 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Tue, 6 Dec 2022 06:16:05 +0000 Subject: [PATCH 15/20] * Add drop table sql. --- db/zentao.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db/zentao.sql b/db/zentao.sql index 5c27b3d7a6..0790cba43f 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -7179,6 +7179,7 @@ CREATE TABLE IF NOT EXISTS `zt_ticket` ( key `product` (`product`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- DROP TABLE IF EXISTS `zt_ticketsource`; CREATE TABLE IF NOT EXISTS `zt_ticketsource` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `ticketId` mediumint(8) unsigned NOT NULL, @@ -7190,6 +7191,7 @@ CREATE TABLE IF NOT EXISTS `zt_ticketsource` ( key `ticketId` (`ticketId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- DROP TABLE IF EXISTS `zt_ticketrelation`; CREATE TABLE IF NOT EXISTS `zt_ticketrelation` ( `id` mediumint unsigned NOT NULL AUTO_INCREMENT, `ticketId` mediumint unsigned NOT NULL, From 58596cacf1913bb816ca02f1b4bf372503c0c4f0 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 6 Dec 2022 14:16:54 +0800 Subject: [PATCH 16/20] * code task #78913. --- module/build/css/view.css | 2 +- module/build/view/view.html.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/module/build/css/view.css b/module/build/css/view.css index 7c6550c08f..3f124385b5 100644 --- a/module/build/css/view.css +++ b/module/build/css/view.css @@ -1,7 +1,7 @@ .linkBox #queryBox .search-form .form-actions {padding-bottom: 5px;} .linkBox .table-header {padding: 8px 15px; border-bottom: 1px solid #cbd0db;} #unlinkStoryList, #unlinkBugList {border-top: 1px solid #cbd0db;} -.page-title .dropdown-menu {top: 20px; left: 170px;} +.page-title .dropdown-menu {top: 20px; left: 170px; max-height:300px; overflow:auto;} .page-title .text>a {font-weight: 700;} .body-modal #mainContent {min-height: 200px;} diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index f082d4894d..abdf3700b4 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -301,6 +301,7 @@ tbody tr td:first-child input {display: none;} bug->severity;?>>bug->severityAB);?> bug->title);?> bug->status);?> + bug->openedBuild;?> openedByAB);?> bug->openedDateAB);?> bug->resolvedByAB);?> @@ -338,6 +339,11 @@ tbody tr td:first-child input {display: none;} processStatus('bug', $bug);?> + openedBuild) as $buildID) $openedBuilds .= ($buildID == 'trunk' ? 'Trunk' : zget($buildPairs, $buildID, '')) . ' '; + ?> + openedBy);?> openedDate) ? '' : substr($bug->openedDate, 5, 11);?> resolvedBy);?> From 6f8dd9e186dff47b951a0220ba34ddc59de30954 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Tue, 6 Dec 2022 14:27:17 +0800 Subject: [PATCH 17/20] * Code for task#78669. Add branch name in tips. --- module/productplan/control.php | 13 ++++++++++--- module/productplan/lang/de.php | 8 ++++---- module/productplan/lang/en.php | 8 ++++---- module/productplan/lang/fr.php | 8 ++++---- module/productplan/lang/zh-cn.php | 8 ++++---- 5 files changed, 26 insertions(+), 19 deletions(-) diff --git a/module/productplan/control.php b/module/productplan/control.php index f2fad8c605..3d34f90760 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -960,6 +960,13 @@ class productplan extends control $oldBranch = $plan->branch; $planStories = $this->loadModel('story')->getPlanStories($planID, 'all'); $planBugs = $this->loadModel('bug')->getPlanBugs($planID, 'all'); + $branchPairs = $this->loadModel('branch')->getPairs($plan->product); + + $removeBranches = ''; + foreach(explode(',', $oldBranch) as $oldBranchID) + { + if($oldBranchID and strpos(",$newBranch,", ",$oldBranchID,") === false) $removeBranches .= "{$branchPairs[$oldBranchID]},"; + } $conflictStoryCounts = 0; $conflictBugCounts = 0; @@ -978,15 +985,15 @@ class productplan extends control if($conflictStoryCounts and $conflictBugCounts) { - printf($this->lang->productplan->confirmChangePlan, $conflictStoryCounts, $conflictBugCounts); + printf($this->lang->productplan->confirmChangePlan, trim($removeBranches, ','), $conflictStoryCounts, $conflictBugCounts); } elseif($conflictStoryCounts) { - printf($this->lang->productplan->confirmRemoveStory, $conflictStoryCounts); + printf($this->lang->productplan->confirmRemoveStory, trim($removeBranches, ','), $conflictStoryCounts); } elseif($conflictBugCounts) { - printf($this->lang->productplan->confirmRemoveBug, $conflictBugCounts); + printf($this->lang->productplan->confirmRemoveBug, trim($removeBranches, ','), $conflictBugCounts); } } diff --git a/module/productplan/lang/de.php b/module/productplan/lang/de.php index c402dd43ff..ac56c0aeec 100644 --- a/module/productplan/lang/de.php +++ b/module/productplan/lang/de.php @@ -75,9 +75,9 @@ $lang->productplan->projectNotEmpty = 'Project cannot be empty.'; $lang->productplan->nextStep = "Next step"; $lang->productplan->summary = "Total: %s, Parents: %s, Children: %s,Independent: %s."; $lang->productplan->checkedSummary = "Seleted: %total%, Parents: %parent%, Children: %child%, Independent: %independent%."; -$lang->productplan->confirmChangePlan = "After the branch is unlinked, %s {$lang->SRCommon} and %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?"; -$lang->productplan->confirmRemoveStory = "After the branch is unlinked, %s {$lang->SRCommon} under the branch will be removed from the plan at the same time, so still want to unassociate?"; -$lang->productplan->confirmRemoveBug = "After the branch is unlinked, %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?"; +$lang->productplan->confirmChangePlan = "After the branch of『%s』is unlinked, %s {$lang->SRCommon} and %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?"; +$lang->productplan->confirmRemoveStory = "After the branch of『%s』is unlinked, %s {$lang->SRCommon} under the branch will be removed from the plan at the same time, so still want to unassociate?"; +$lang->productplan->confirmRemoveBug = "After the branch of『%s』is unlinked, %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?"; $lang->productplan->id = 'ID'; $lang->productplan->product = $lang->productCommon; @@ -139,7 +139,7 @@ $lang->productplan->beginGreaterChildTip = "The start date of the parent plan[%s $lang->productplan->endLetterChildTip = "The completion date of the parent plan[%s]: %s, cannot be less than the completion date of the child plan: %s."; $lang->productplan->beginLetterParentTip = "The start date of the child plan[%s]: %s, cannot be less than the start date of the parent plan: %s."; $lang->productplan->endGreaterParentTip = "The completion date of the child plan[%s]: %s, cannot be greater than the completion date of the parent plan: %s."; -$lang->productplan->diffBranchesTip = "The @branch@ %s of parent plan is not linked with the child plan. @branch@'s stories and bugs whill be removed from the plan. Do you want to save?"; +$lang->productplan->diffBranchesTip = "The @branch@『%s』 of parent plan is not linked with the child plan. @branch@'s stories and bugs whill be removed from the plan. Do you want to save?"; $lang->productplan->featureBar['browse']['all'] = 'Alle'; $lang->productplan->featureBar['browse']['undone'] = 'Undone'; diff --git a/module/productplan/lang/en.php b/module/productplan/lang/en.php index 3306bc5bdb..49a6bf5bd1 100644 --- a/module/productplan/lang/en.php +++ b/module/productplan/lang/en.php @@ -75,9 +75,9 @@ $lang->productplan->projectNotEmpty = 'Project cannot be empty.'; $lang->productplan->nextStep = "Next step"; $lang->productplan->summary = "Total: %s, Parents: %s, Children: %s,Independent: %s."; $lang->productplan->checkedSummary = "Seleted: %total%, Parents: %parent%, Children: %child%, Independent: %independent%."; -$lang->productplan->confirmChangePlan = "After the branch is unlinked, %s {$lang->SRCommon} and %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?"; -$lang->productplan->confirmRemoveStory = "After the branch is unlinked, %s {$lang->SRCommon} under the branch will be removed from the plan at the same time, so still want to unassociate?"; -$lang->productplan->confirmRemoveBug = "After the branch is unlinked, %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?"; +$lang->productplan->confirmChangePlan = "After the branch of『%s』is unlinked, %s {$lang->SRCommon} and %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?"; +$lang->productplan->confirmRemoveStory = "After the branch of『%s』is unlinked, %s {$lang->SRCommon} under the branch will be removed from the plan at the same time, so still want to unassociate?"; +$lang->productplan->confirmRemoveBug = "After the branch of『%s』is unlinked, %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?"; $lang->productplan->id = 'ID'; $lang->productplan->product = $lang->productCommon; @@ -139,7 +139,7 @@ $lang->productplan->beginGreaterChildTip = "The start date of the parent plan[%s $lang->productplan->endLetterChildTip = "The completion date of the parent plan[%s]: %s, cannot be less than the completion date of the child plan: %s."; $lang->productplan->beginLetterParentTip = "The start date of the child plan[%s]: %s, cannot be less than the start date of the parent plan: %s."; $lang->productplan->endGreaterParentTip = "The completion date of the child plan[%s]: %s, cannot be greater than the completion date of the parent plan: %s."; -$lang->productplan->diffBranchesTip = "The @branch@ %s of parent plan is not linked with the child plan. @branch@'s stories and bugs whill be removed from the plan. Do you want to save?"; +$lang->productplan->diffBranchesTip = "The @branch@『%s』of parent plan is not linked with the child plan. @branch@'s stories and bugs whill be removed from the plan. Do you want to save?"; $lang->productplan->featureBar['browse']['all'] = 'All'; $lang->productplan->featureBar['browse']['undone'] = 'Undone'; diff --git a/module/productplan/lang/fr.php b/module/productplan/lang/fr.php index 46bfcaf196..5fd88247f3 100644 --- a/module/productplan/lang/fr.php +++ b/module/productplan/lang/fr.php @@ -75,9 +75,9 @@ $lang->productplan->projectNotEmpty = 'Project cannot be empty.'; $lang->productplan->nextStep = "Next step"; $lang->productplan->summary = "Total: %s, Parents: %s, Children: %s,Independent: %s."; $lang->productplan->checkedSummary = "Seleted: %total%, Parents: %parent%, Children: %child%, Independent: %independent%."; -$lang->productplan->confirmChangePlan = "After the branch is unlinked, %s {$lang->SRCommon} and %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?"; -$lang->productplan->confirmRemoveStory = "After the branch is unlinked, %s {$lang->SRCommon} under the branch will be removed from the plan at the same time, so still want to unassociate?"; -$lang->productplan->confirmRemoveBug = "After the branch is unlinked, %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?"; +$lang->productplan->confirmChangePlan = "After the branch of『%s』is unlinked, %s {$lang->SRCommon} and %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?"; +$lang->productplan->confirmRemoveStory = "After the branch of『%s』is unlinked, %s {$lang->SRCommon} under the branch will be removed from the plan at the same time, so still want to unassociate?"; +$lang->productplan->confirmRemoveBug = "After the branch of『%s』is unlinked, %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?"; $lang->productplan->id = 'ID'; $lang->productplan->product = $lang->productCommon; @@ -139,7 +139,7 @@ $lang->productplan->beginGreaterChildTip = "The start date of the parent plan[%s $lang->productplan->endLetterChildTip = "The completion date of the parent plan[%s]: %s, cannot be less than the completion date of the child plan: %s."; $lang->productplan->beginLetterParentTip = "The start date of the child plan[%s]: %s, cannot be less than the start date of the parent plan: %s."; $lang->productplan->endGreaterParentTip = "The completion date of the child plan[%s]: %s, cannot be greater than the completion date of the parent plan: %s."; -$lang->productplan->diffBranchesTip = "The @branch@ %s of parent plan is not linked with the child plan. @branch@'s stories and bugs whill be removed from the plan. Do you want to save?"; +$lang->productplan->diffBranchesTip = "The @branch@『%s』of parent plan is not linked with the child plan. @branch@'s stories and bugs whill be removed from the plan. Do you want to save?"; $lang->productplan->featureBar['browse']['all'] = 'Tous'; $lang->productplan->featureBar['browse']['undone'] = 'Undone'; diff --git a/module/productplan/lang/zh-cn.php b/module/productplan/lang/zh-cn.php index b1765303ea..f756060d8e 100644 --- a/module/productplan/lang/zh-cn.php +++ b/module/productplan/lang/zh-cn.php @@ -75,9 +75,9 @@ $lang->productplan->projectNotEmpty = '所属项目不能为空。'; $lang->productplan->nextStep = "下一步"; $lang->productplan->summary = "本页共 %s 个计划,父计划 %s,子计划 %s,独立计划 %s。"; $lang->productplan->checkedSummary = "共选中 %total% 个计划,父计划 %parent%,子计划 %child%,独立计划 %independent%。"; -$lang->productplan->confirmChangePlan = "分支解除关联后,分支下的%s个{$lang->SRCommon}和%s个Bug将同步从计划中移除,是否解除?"; -$lang->productplan->confirmRemoveStory = "分支解除关联后,分支下的%s个{$lang->SRCommon}将同步从计划中移除,是否解除?"; -$lang->productplan->confirmRemoveBug = "分支解除关联后,分支下的%s个Bug将同步从计划中移除,是否解除?"; +$lang->productplan->confirmChangePlan = "分支『%s』解除关联后,分支下的%s个{$lang->SRCommon}和%s个Bug将同步从计划中移除,是否解除?"; +$lang->productplan->confirmRemoveStory = "分支『%s』解除关联后,分支下的%s个{$lang->SRCommon}将同步从计划中移除,是否解除?"; +$lang->productplan->confirmRemoveBug = "分支『%s』解除关联后,分支下的%s个Bug将同步从计划中移除,是否解除?"; $lang->productplan->id = '编号'; $lang->productplan->product = $lang->productCommon; @@ -139,7 +139,7 @@ $lang->productplan->beginGreaterChildTip = "父计划[%s]的开始日期:%s, $lang->productplan->endLetterChildTip = "父计划[%s]的完成日期:%s,不能小于子计划的完成日期: %s"; $lang->productplan->beginLetterParentTip = "子计划[%s]的开始日期:%s,不能小于父计划的开始日期: %s"; $lang->productplan->endGreaterParentTip = "子计划[%s]的完成日期:%s,不能大于父计划的完成日期: %s"; -$lang->productplan->diffBranchesTip = "父计划的@branch@ %s 未被子计划关联,对应@branch@的需求和bug将自动从计划中移除,是否保存?"; +$lang->productplan->diffBranchesTip = "父计划的@branch@『%s』未被子计划关联,对应@branch@的需求和bug将自动从计划中移除,是否保存?"; $lang->productplan->featureBar['browse']['all'] = '全部'; $lang->productplan->featureBar['browse']['undone'] = '未完成'; From 15d343704652765902ead0a2e4e918d4df59b9aa Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Tue, 6 Dec 2022 06:53:34 +0000 Subject: [PATCH 18/20] * Handle ticket #144. --- module/project/model.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/module/project/model.php b/module/project/model.php index b2ab359b66..21467dd1af 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1583,7 +1583,7 @@ class projectModel extends model ->exec(); if(dao::isError()) return false; - if(!$oldProject->hasProduct && $oldProject->name != $project->name) $this->updateProductName($project->name, $projectID); + if(!$oldProject->hasProduct and ($oldProject->name != $project->name or $oldProject->parent != $project->parent)) $this->updateShadowProduct($project); /* Get team and language item. */ $this->loadModel('user'); @@ -1744,7 +1744,7 @@ class projectModel extends model if(!dao::isError()) { - if(!$oldProject->hasProduct && $oldProject->name != $project->name) $this->updateProductName($project->name, $projectID); + if(!$oldProject->hasProduct and ($oldProject->name != $project->name or $oldProject->parent != $project->parent)) $this->updateShadowProduct($project); if(isset($project->parent)) { @@ -2038,17 +2038,18 @@ class projectModel extends model } /** - * Update a product's name as its project. + * Update shadow product for its project. * - * @param string $projectName - * @param int $projectID + * @param object $project * @access public * @return bool */ - public function updateProductName($projectName, $projectID) + public function updateShadowProduct($project) { - $product = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($projectID)->fetch('product'); - $this->dao->update(TABLE_PRODUCT)->set('name')->eq($projectName)->where('id')->eq($product)->exec(); + $product = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($project->id)->fetch('product'); + $topProgram = !empty($project->parent) ? $this->loadModel('program')->getTopByID($project->parent) : 0; + $this->dao->update(TABLE_PRODUCT)->set('name')->eq($project->name)->set('program')->eq($topProgram)->where('id')->eq($product)->exec(); + return !dao::isError(); } From f06d508e16e5617994dbc55a561bd834c8ca23df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Tue, 6 Dec 2022 15:47:52 +0800 Subject: [PATCH 19/20] * Finish task #78662. --- module/project/control.php | 1 + www/js/my.full.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/module/project/control.php b/module/project/control.php index 653339f752..76f901238a 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -1278,6 +1278,7 @@ class project extends control $this->view->branchOption = $branchOption; $this->view->branchTagOption = $branchTagOption; $this->view->executions = $executions; + $this->view->plans = $this->loadModel('productplan')->getPairs($productID ? $productID : array_keys($products)); $this->view->stories = $storyList; $this->view->tasks = $taskList; $this->view->projectPairs = $this->project->getPairsByProgram(); diff --git a/www/js/my.full.js b/www/js/my.full.js index 24a60642db..ca19375a73 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -1203,7 +1203,7 @@ function showCheckedFields(fields) else if(!$fieldBox.hasClass('hidden')) { $fieldBox.addClass('hidden'); - $field.attr('disabled', true); + if($(this).val() != 'branch') $field.attr('disabled', true); } if(config.currentModule == 'story' && $(this).val() == 'source') From d20421ad39353b38b8aaa2fa9611958d9cf29b5f Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Tue, 6 Dec 2022 16:06:28 +0800 Subject: [PATCH 20/20] * Code for task#78667. --- module/projectrelease/control.php | 5 ++-- module/projectrelease/js/create.js | 30 +--------------------- module/projectrelease/view/create.html.php | 7 +---- 3 files changed, 4 insertions(+), 38 deletions(-) diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index c1f353dd97..e69975257a 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -804,13 +804,12 @@ class projectrelease extends control * * @param int $projectID * @param int $productID - * @param int $branch * @access public * @return void */ - public function ajaxLoadBuilds($projectID, $productID, $branch = 0) + public function ajaxLoadBuilds($projectID, $productID) { - $builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'notrunk,withbranch,hasproject', $projectID, 'project', '', false); + $builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk,withbranch,hasproject', $projectID, 'project', '', false); $releasedBuilds = $this->projectrelease->getReleasedBuilds($projectID); foreach($releasedBuilds as $build) unset($builds[$build]); diff --git a/module/projectrelease/js/create.js b/module/projectrelease/js/create.js index 1cd106dcdb..21925ba77f 100644 --- a/module/projectrelease/js/create.js +++ b/module/projectrelease/js/create.js @@ -7,36 +7,8 @@ function loadBuilds() { var productID = $('#product').val(); - var branch = $('#branch').length == 0 ? 0 : $('#branch').val(); - $('#buildBox').load(createLink('projectrelease', 'ajaxLoadBuilds', "projectID=" + projectID + "&productID=" + productID + "&branch=" + branch), function() + $('#buildBox').load(createLink('projectrelease', 'ajaxLoadBuilds', "projectID=" + projectID + "&productID=" + productID), function() { $('#build').attr('data-placeholder', multipleSelect).chosen(); }); } - -/** - * Flush the branch when switching products. - * - * @param int $productID - * @access public - * @return void - */ -function loadBranches(productID) -{ - $('#branch').remove(); - $('#branch_chosen').remove(); - $.get(createLink('branch', 'ajaxGetBranches', "productID=" + productID + '&oldBranch=0¶ms=active&projectID=' + projectID), function(data) - { - var $product = $('#product'); - var $inputGroup = $product.closest('.input-group'); - $inputGroup.find('.input-group-addon').toggleClass('hidden', !data); - if(data) - { - $inputGroup.append(data); - $inputGroup.find('#branch').attr('onchange', 'loadBuilds()'); - $('#branch').css('width', '120px').chosen(); - } - loadBuilds(); - $inputGroup.fixInputGroup(); - }) -} diff --git a/module/projectrelease/view/create.html.php b/module/projectrelease/view/create.html.php index 7de52be52c..a06d0bb92d 100644 --- a/module/projectrelease/view/create.html.php +++ b/module/projectrelease/view/create.html.php @@ -39,12 +39,7 @@ release->product;?> - -
- id, "onchange='loadBranches(this.value)' class='form-control chosen'");?> - type != 'normal') echo html::select('branch', $branches, $branch, "onchange='loadBuilds()' class='form-control chosen control-branch'");?> -
- + id, "onchange='loadBuilds()' class='form-control chosen'");?>