From b2b0beab357631ef4f22c0749e46bcb951b5580a Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Mon, 31 Oct 2022 03:01:53 +0000 Subject: [PATCH 001/267] * Add sibling field for story table. --- db/update18.0.sql | 1 + db/zentao.sql | 1 + 2 files changed, 2 insertions(+) create mode 100644 db/update18.0.sql diff --git a/db/update18.0.sql b/db/update18.0.sql new file mode 100644 index 0000000000..675bebaeec --- /dev/null +++ b/db/update18.0.sql @@ -0,0 +1 @@ +ALTER TABLE `zt_story` ADD COLUMN `sibling` text NOT NULL AFTER `linkRequirements`; diff --git a/db/zentao.sql b/db/zentao.sql index 5e2f79f431..7e1a93dd19 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -1473,6 +1473,7 @@ CREATE TABLE IF NOT EXISTS `zt_story` ( `childStories` varchar(255) NOT NULL, `linkStories` varchar(255) NOT NULL, `linkRequirements` varchar(255) NOT NULL, + `sibling` text NOT NULL, `duplicateStory` mediumint(8) unsigned NOT NULL, `version` smallint(6) NOT NULL default '1', `feedbackBy` varchar(100) NOT NULL, From 5b8f882608af0f84d9e7bf2ae67502f881aea812 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Mon, 31 Oct 2022 11:13:26 +0800 Subject: [PATCH 002/267] * finish task #74147 --- module/project/lang/zh-cn.php | 2 +- module/project/lang/zh-tw.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 1d0e642dd1..dc4f6dbdfa 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -211,7 +211,7 @@ $lang->project->hundredMillion = '亿'; $lang->project->unitList['CNY'] = '人民币'; $lang->project->unitList['USD'] = '美元'; $lang->project->unitList['HKD'] = '港元'; -$lang->project->unitList['NTD'] = '台元'; +$lang->project->unitList['NTD'] = '台币'; $lang->project->unitList['EUR'] = '欧元'; $lang->project->unitList['DEM'] = '马克'; $lang->project->unitList['CHF'] = '瑞士法郎'; diff --git a/module/project/lang/zh-tw.php b/module/project/lang/zh-tw.php index a99512886a..e813b75443 100644 --- a/module/project/lang/zh-tw.php +++ b/module/project/lang/zh-tw.php @@ -186,7 +186,7 @@ $lang->project->tenThousand = '萬'; $lang->project->unitList['CNY'] = '人民幣'; $lang->project->unitList['USD'] = '美元'; $lang->project->unitList['HKD'] = '港元'; -$lang->project->unitList['NTD'] = '台元'; +$lang->project->unitList['NTD'] = '台幣'; $lang->project->unitList['EUR'] = '歐元'; $lang->project->unitList['DEM'] = '馬克'; $lang->project->unitList['CHF'] = '瑞士法郎'; From 5a2bccfb7cfca315cb0e011378d6239b85777f98 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Mon, 31 Oct 2022 07:39:19 +0000 Subject: [PATCH 003/267] * Code for task#74146. --- module/story/control.php | 3 +++ module/story/css/change.css | 5 ++++- module/story/css/edit.css | 1 + module/story/js/change.js | 1 + module/story/js/edit.js | 1 + module/story/lang/de.php | 2 ++ module/story/lang/en.php | 2 ++ module/story/lang/fr.php | 2 ++ module/story/lang/vi.php | 2 ++ module/story/lang/zh-cn.php | 2 ++ module/story/view/change.html.php | 18 ++++++++++++++++++ module/story/view/edit.html.php | 18 ++++++++++++++++++ 12 files changed, 56 insertions(+), 1 deletion(-) diff --git a/module/story/control.php b/module/story/control.php index 1baefae6cd..efaf7626e3 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -856,6 +856,7 @@ class story extends control $this->view->title = $this->lang->story->edit . "STORY" . $this->lang->colon . $this->view->story->title; $this->view->position[] = $this->lang->story->edit; $this->view->story = $story; + $this->view->siblings = $this->story->getByList($story->sibling); $this->view->stories = $stories; $this->view->users = $users; $this->view->product = $product; @@ -1154,6 +1155,8 @@ class story extends control /* Assign. */ $this->view->title = $this->lang->story->change . "STORY" . $this->lang->colon . $this->view->story->title; + $this->view->siblings = $this->story->getByList($story->sibling); + $this->view->branches = $this->loadModel('branch')->getPairs($story->product); $this->view->users = $this->user->getPairs('pofirst|nodeleted|noclosed', $this->view->story->assignedTo); $this->view->position[] = $this->lang->story->change; $this->view->needReview = (($this->app->user->account == $this->view->product->PO or $this->config->story->needReview == 0 or !$this->story->checkForceReview()) and empty($reviewer)) ? "checked='checked'" : ""; diff --git a/module/story/css/change.css b/module/story/css/change.css index 3fec429184..dec7802904 100644 --- a/module/story/css/change.css +++ b/module/story/css/change.css @@ -2,4 +2,7 @@ #affectedProjects .table + h6 {border-top: 1px solid #ddd;} .nav-tabs>li>a {height: 36px;} .table-form>tbody>tr>th {width: 100px !important;} -.colorpicker {right: 7px; top: 7px; opacity: 1;} \ No newline at end of file +.colorpicker {right: 7px; top: 7px; opacity: 1;} +#siblingTd td, #siblingTh td {padding-left: 65px;} +#siblingTh td {font-weight: 700;} +#siblingTd ul li {padding-top: 5px;} diff --git a/module/story/css/edit.css b/module/story/css/edit.css index 7b2e3a76c3..58a8f9fb9d 100644 --- a/module/story/css/edit.css +++ b/module/story/css/edit.css @@ -5,3 +5,4 @@ .needNotReviewBox {width: 130px;} .needNotReviewBox span.input-group-addon {border: 1px solid #dcdcdc; border-left-width: 0px; width:130px;} #moduleIdBox .chosen-container, #planIdBox .chosen-container {min-width: unset;} +#siblingList ul li {padding-top:5px;} diff --git a/module/story/js/change.js b/module/story/js/change.js index 3d1d19c8f4..dd48d70c1f 100644 --- a/module/story/js/change.js +++ b/module/story/js/change.js @@ -1,5 +1,6 @@ $(function() { + $('[data-toggle="tooltip"]').tooltip(); $('#needNotReview').on('change', function() { $('#reviewer').val($(this).is(':checked') ? '' : lastReviewer).attr('disabled', $(this).is(':checked') ? 'disabled' : null).trigger('chosen:updated'); diff --git a/module/story/js/edit.js b/module/story/js/edit.js index 8358c2009e..21116b0f48 100644 --- a/module/story/js/edit.js +++ b/module/story/js/edit.js @@ -1,5 +1,6 @@ $(function() { + $('[data-toggle="tooltip"]').tooltip(); $('.main-side #branch').closest('td').find('#product_chosen .chosen-single').css('width', '153px'); if(storyStatus == 'reviewing') diff --git a/module/story/lang/de.php b/module/story/lang/de.php index 8209fbf211..5a28ddb553 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -95,6 +95,8 @@ $lang->story->successToTask = "Converted to task."; $lang->story->storyRound = '%s time estimation'; $lang->story->float = "『%s』should be positive number, decimals included."; $lang->story->saveDraftSuccess = 'Save as draft succeeded.'; +$lang->story->changeSyncTip = "The modification of this story will be synchronized to the following twin requirements"; +$lang->story->syncTip = "The twin story are synchronized except for product, branch, module, plan, and stage. After the twin relationship is dissolved, they are no longer synchronized."; $lang->story->id = 'ID'; $lang->story->parent = 'Parent'; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index dbb5d44d16..f65cb2f83b 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -95,6 +95,8 @@ $lang->story->successToTask = "Converted to task."; $lang->story->storyRound = '%s time estimation'; $lang->story->float = "『%s』should have positive number, or decimals."; $lang->story->saveDraftSuccess = 'Save as draft succeeded.'; +$lang->story->changeSyncTip = "The modification of this story will be synchronized to the following twin requirements"; +$lang->story->syncTip = "The twin story are synchronized except for product, branch, module, plan, and stage. After the twin relationship is dissolved, they are no longer synchronized."; $lang->story->id = 'ID'; $lang->story->parent = 'Parent'; diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index cf5f0c0ac0..7981c32ea0 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -95,6 +95,8 @@ $lang->story->successToTask = "Converted to task."; $lang->story->storyRound = '%s time estimation'; $lang->story->float = "『 %s 』doit avoir des nombres positifs ou décimaux."; $lang->story->saveDraftSuccess = 'Save as draft succeeded.'; +$lang->story->changeSyncTip = "The modification of this story will be synchronized to the following twin requirements"; +$lang->story->syncTip = "The twin story are synchronized except for product, branch, module, plan, and stage. After the twin relationship is dissolved, they are no longer synchronized."; $lang->story->id = 'ID'; $lang->story->parent = 'Parent'; diff --git a/module/story/lang/vi.php b/module/story/lang/vi.php index c0e7f138b4..ee7d4c7fe2 100644 --- a/module/story/lang/vi.php +++ b/module/story/lang/vi.php @@ -93,6 +93,8 @@ $lang->story->successToTask = "Converted to task."; $lang->story->storyRound = '%s time estimation'; $lang->story->float = "『%s』should be positive number, decimals included."; $lang->story->saveDraftSuccess = 'Save as draft succeeded.'; +$lang->story->changeSyncTip = "The modification of this story will be synchronized to the following twin requirements"; +$lang->story->syncTip = "The twin story are synchronized except for product, branch, module, plan, and stage. After the twin relationship is dissolved, they are no longer synchronized."; $lang->story->id = 'ID'; $lang->story->parent = 'Mẹ'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 0ec66c579d..952c89de11 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -95,6 +95,8 @@ $lang->story->successToTask = '批量转任务成功'; $lang->story->storyRound = '第 %s 轮估算'; $lang->story->float = "『%s』应当是正数,可以是小数。"; $lang->story->saveDraftSuccess = '存为草稿成功'; +$lang->story->changeSyncTip = "该需求的修改会同步到如下的孪生需求"; +$lang->story->syncTip = "孪生需求间除产品、分支 、模块、计划、阶段外均同步,孪生关系解除后不再同步"; $lang->story->id = '编号'; $lang->story->parent = '父需求'; diff --git a/module/story/view/change.html.php b/module/story/view/change.html.php index c4fc435056..7abc1b5972 100644 --- a/module/story/view/change.html.php +++ b/module/story/view/change.html.php @@ -73,6 +73,24 @@ fetch('file', 'buildform');?> + + + story->changeSyncTip;?> + + + + + +
    + $sibling):?> +
  • + branch];?> + title;?> +
  • + +
+ + story->checkAffection;?> diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php index 39540014aa..f3aaeccb48 100644 --- a/module/story/view/edit.html.php +++ b/module/story/view/edit.html.php @@ -98,6 +98,24 @@ printExtendFields($story, 'div', 'position=left');?> +
+
+ story->changeSyncTip;?> + +
+
+
+
    + $sibling):?> +
  • + branch];?> + title;?> +
  • + +
+
+
+
story->comment;?>
From cd51b97febf67d7f6ef28b1d79df75c2fd9c98fc Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Mon, 31 Oct 2022 07:46:52 +0000 Subject: [PATCH 004/267] * Code for task#74146. --- module/story/css/change.css | 2 +- module/story/css/edit.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/story/css/change.css b/module/story/css/change.css index dec7802904..0d28fa39db 100644 --- a/module/story/css/change.css +++ b/module/story/css/change.css @@ -5,4 +5,4 @@ .colorpicker {right: 7px; top: 7px; opacity: 1;} #siblingTd td, #siblingTh td {padding-left: 65px;} #siblingTh td {font-weight: 700;} -#siblingTd ul li {padding-top: 5px;} +#siblingTd ul li {padding-top: 5px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;} diff --git a/module/story/css/edit.css b/module/story/css/edit.css index 58a8f9fb9d..6d1215a2d6 100644 --- a/module/story/css/edit.css +++ b/module/story/css/edit.css @@ -5,4 +5,4 @@ .needNotReviewBox {width: 130px;} .needNotReviewBox span.input-group-addon {border: 1px solid #dcdcdc; border-left-width: 0px; width:130px;} #moduleIdBox .chosen-container, #planIdBox .chosen-container {min-width: unset;} -#siblingList ul li {padding-top:5px;} +#siblingList ul li {padding-top:5px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;} From bb390ecd9c219f0e028865fda2ee3d1d6660c29d Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Mon, 31 Oct 2022 07:56:49 +0000 Subject: [PATCH 005/267] * Code for task#74146. Add judgment conditions. --- module/story/control.php | 4 ++-- module/story/view/change.html.php | 2 ++ module/story/view/edit.html.php | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index efaf7626e3..050312a13b 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -856,7 +856,7 @@ class story extends control $this->view->title = $this->lang->story->edit . "STORY" . $this->lang->colon . $this->view->story->title; $this->view->position[] = $this->lang->story->edit; $this->view->story = $story; - $this->view->siblings = $this->story->getByList($story->sibling); + $this->view->siblings = empty($story->sibling) ? array() : $this->story->getByList($story->sibling); $this->view->stories = $stories; $this->view->users = $users; $this->view->product = $product; @@ -1155,7 +1155,7 @@ class story extends control /* Assign. */ $this->view->title = $this->lang->story->change . "STORY" . $this->lang->colon . $this->view->story->title; - $this->view->siblings = $this->story->getByList($story->sibling); + $this->view->siblings = empty($story->sibling) ? array() : $this->story->getByList($story->sibling); $this->view->branches = $this->loadModel('branch')->getPairs($story->product); $this->view->users = $this->user->getPairs('pofirst|nodeleted|noclosed', $this->view->story->assignedTo); $this->view->position[] = $this->lang->story->change; diff --git a/module/story/view/change.html.php b/module/story/view/change.html.php index 7abc1b5972..4104561a3a 100644 --- a/module/story/view/change.html.php +++ b/module/story/view/change.html.php @@ -73,6 +73,7 @@ fetch('file', 'buildform');?> + story->changeSyncTip;?> @@ -91,6 +92,7 @@ + story->checkAffection;?> diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php index f3aaeccb48..e4a7ce91ab 100644 --- a/module/story/view/edit.html.php +++ b/module/story/view/edit.html.php @@ -98,6 +98,7 @@
printExtendFields($story, 'div', 'position=left');?> +
story->changeSyncTip;?> @@ -116,6 +117,7 @@
+
story->comment;?>
From 9cfd8f0f8e395ec166f0f215e92330669f318503 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Mon, 31 Oct 2022 16:29:21 +0800 Subject: [PATCH 006/267] * task #74142 --- module/story/css/create.css | 2 + module/story/js/create.js | 33 +++++++ module/story/lang/de.php | 6 ++ module/story/lang/en.php | 6 ++ module/story/lang/fr.php | 6 ++ module/story/lang/zh-cn.php | 6 ++ module/story/view/create.html.php | 156 +++++++++++++++++++++++++++--- 7 files changed, 200 insertions(+), 15 deletions(-) diff --git a/module/story/css/create.css b/module/story/css/create.css index c9854e8d17..409b9492ec 100644 --- a/module/story/css/create.css +++ b/module/story/css/create.css @@ -16,3 +16,5 @@ .source .input-group-addon, .sourceNote .input-group-addon {padding-top: 9px;} #sourceNoteBox {width: 80px;} #moduleIdBox .input-group-addon {min-width: 77px;} + +.btn.btn-action, .c-actions .btn {color: grey} \ No newline at end of file diff --git a/module/story/js/create.js b/module/story/js/create.js index 868dfd6a20..98059117c3 100644 --- a/module/story/js/create.js +++ b/module/story/js/create.js @@ -108,3 +108,36 @@ function setLane(regionID) $(window).unload(function(){ if(blockID) window.parent.refreshBlock($('#block' + blockID)); }); + +/** + * Add item + * + * @param obj $obj + * @access public + * @return void + */ + function addItem(obj) + { + var item = $('#addItem').html().replace(/%i%/g, itemIndex); + $(obj).closest('tr').after('' + item + ''); + $('#branch_i__chosen').remove(); + $('#branch' + itemIndex).chosen(); + $('#module_i__chosen').remove(); + $('#module' + itemIndex).chosen(); + $('#plan_i__chosen').remove(); + $('#plan' + itemIndex).chosen(); + itemIndex ++; + $('.addedItem #planBox').css('flex', '0 0 ' + gap + 'px') + } + + /** + * Delete item. + * + * @param obj $obj + * @access public + * @return void + */ + function deleteItem(obj) + { + $(obj).closest('tr').remove(); + } diff --git a/module/story/lang/de.php b/module/story/lang/de.php index 8209fbf211..6257273ae5 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -466,6 +466,12 @@ $lang->story->featureBar['browse']['unclosed'] = $lang->story->unclosed; $lang->story->featureBar['browse']['draft'] = $lang->story->statusList['draft']; $lang->story->featureBar['browse']['reviewing'] = $lang->story->statusList['reviewing']; +$lang->story->branchBox = new stdClass(); +$lang->story->branchBox->branch = 'branch'; +$lang->story->branchBox->sourceBranch = 'branch'; +$lang->story->branchBox->sourceModule = 'module'; +$lang->story->branchBox->sourcePlan = 'plan'; + $lang->requirement->common = $lang->URCommon; $lang->requirement->create = 'Create Requirement'; $lang->requirement->batchCreate = "Batch Create"; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index dbb5d44d16..d68e4b688a 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -466,6 +466,12 @@ $lang->story->featureBar['browse']['unclosed'] = $lang->story->unclosed; $lang->story->featureBar['browse']['draft'] = $lang->story->statusList['draft']; $lang->story->featureBar['browse']['reviewing'] = $lang->story->statusList['reviewing']; +$lang->story->branchBox = new stdClass(); +$lang->story->branchBox->branch = 'branch'; +$lang->story->branchBox->sourceBranch = 'branch'; +$lang->story->branchBox->sourceModule = 'module'; +$lang->story->branchBox->sourcePlan = 'plan'; + $lang->requirement->common = $lang->URCommon; $lang->requirement->create = 'Create Requirement'; $lang->requirement->batchCreate = "Batch Create"; diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index cf5f0c0ac0..4ef9444e41 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -466,6 +466,12 @@ $lang->story->featureBar['browse']['unclosed'] = $lang->story->unclosed; $lang->story->featureBar['browse']['draft'] = $lang->story->statusList['draft']; $lang->story->featureBar['browse']['reviewing'] = $lang->story->statusList['reviewing']; +$lang->story->branchBox = new stdClass(); +$lang->story->branchBox->branch = 'branch'; +$lang->story->branchBox->sourceBranch = 'branch'; +$lang->story->branchBox->sourceModule = 'module'; +$lang->story->branchBox->sourcePlan = 'plan'; + $lang->requirement->common = $lang->URCommon; $lang->requirement->create = 'Create Requirement'; $lang->requirement->batchCreate = "Batch Create"; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 0ec66c579d..8a26690c57 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -466,6 +466,12 @@ $lang->story->featureBar['browse']['unclosed'] = $lang->story->unclosed; $lang->story->featureBar['browse']['draft'] = $lang->story->statusList['draft']; $lang->story->featureBar['browse']['reviewing'] = $lang->story->statusList['reviewing']; +$lang->story->branchBox = new stdClass(); +$lang->story->branchBox->branch = '分支'; +$lang->story->branchBox->sourceBranch = '所属分支'; +$lang->story->branchBox->sourceModule = '所属模块'; +$lang->story->branchBox->sourcePlan = '所属计划'; + $lang->requirement->common = $lang->URCommon; $lang->requirement->create = "提{$lang->URCommon}"; $lang->requirement->batchCreate = "批量创建"; diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index 856bc23ffe..81f098280e 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -51,30 +51,92 @@ foreach(explode(',', $config->story->create->requiredFields) as $field) story->product;?>
- + -
+ + ' id='assignedToBox'> +
+
story->assignedTo;?>
+ +
+ + + -
-
story->module;?>
- "; - echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=story¤tModuleID=0&branch=$branch", '', true), $lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='90%'"); - echo '  '; - echo html::a("javascript:void(0)", $lang->refreshIcon, '', "class='refresh' title='refresh' onclick='loadProductModules($productID)'"); - echo '
'; - } - ?> +
+
story->module;?>
+ "; + echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=story¤tModuleID=0&branch=$branch", '', true), $lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='90%'"); + echo '  '; + echo html::a("javascript:void(0)", $lang->refreshIcon, '', "class='refresh' title='refresh' onclick='loadProductModules($productID)'"); + echo '
'; + } + ?>
+ + + + story->branchBox->branch;?> + +
+
+
+ story->branchBox->sourceBranch?> + +
+
+
+
+ story->branchBox->sourceModule?> + "; + echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=story¤tModuleID=0&branch=$branch", '', true), $lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='90%'"); + echo '  '; + echo html::a("javascript:void(0)", $lang->refreshIcon, '', "class='refresh' title='refresh' onclick='loadProductModules($productID)'"); + echo '
'; + } + ?> +
+
+
+
+ story->branchBox->sourcePlan;?> + "; + echo html::a($this->createLink('productplan', 'create', "productID=$productID&branch=$branch", '', true), "", '', "class='btn btn-icon' data-toggle='modal' data-type='iframe' data-width='95%' title='{$lang->productplan->create}'"); + echo '
'; + echo "
"; + echo html::a("javascript:void(0)", "", '', "class='btn btn-icon refresh' data-toggle='tooltip' title='{$lang->refresh}' onclick='loadProductPlans($productID)'"); + echo '
'; + } + ?> +
+
+ + + +
+ +
+ + + story->planAB;?> @@ -100,6 +162,7 @@ foreach(explode(',', $config->story->create->requiredFields) as $field) + story->source;?> @@ -301,10 +364,73 @@ foreach(explode(',', $config->story->create->requiredFields) as $field) + + + + + + + + + story->module);?> From 22f0fce8d0bce7a0f0d5b8d335dc333bc87c3d46 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Mon, 31 Oct 2022 17:23:23 +0800 Subject: [PATCH 007/267] * task #74142 --- module/story/js/create.js | 10 ++--- module/story/lang/de.php | 6 --- module/story/lang/en.php | 6 --- module/story/lang/fr.php | 6 --- module/story/lang/zh-cn.php | 6 --- module/story/view/create.html.php | 73 +++++++------------------------ 6 files changed, 20 insertions(+), 87 deletions(-) diff --git a/module/story/js/create.js b/module/story/js/create.js index 98059117c3..a5b95f195e 100644 --- a/module/story/js/create.js +++ b/module/story/js/create.js @@ -110,15 +110,15 @@ $(window).unload(function(){ }); /** - * Add item + * Add branch box. * * @param obj $obj * @access public * @return void */ - function addItem(obj) + function addBranchesBox(obj) { - var item = $('#addItem').html().replace(/%i%/g, itemIndex); + var item = $('#addBranchesBox').html().replace(/%i%/g, itemIndex); $(obj).closest('tr').after('' + item + ''); $('#branch_i__chosen').remove(); $('#branch' + itemIndex).chosen(); @@ -131,13 +131,13 @@ $(window).unload(function(){ } /** - * Delete item. + * Delete branch box. * * @param obj $obj * @access public * @return void */ - function deleteItem(obj) + function deleteBranchesBox(obj) { $(obj).closest('tr').remove(); } diff --git a/module/story/lang/de.php b/module/story/lang/de.php index 6257273ae5..8209fbf211 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -466,12 +466,6 @@ $lang->story->featureBar['browse']['unclosed'] = $lang->story->unclosed; $lang->story->featureBar['browse']['draft'] = $lang->story->statusList['draft']; $lang->story->featureBar['browse']['reviewing'] = $lang->story->statusList['reviewing']; -$lang->story->branchBox = new stdClass(); -$lang->story->branchBox->branch = 'branch'; -$lang->story->branchBox->sourceBranch = 'branch'; -$lang->story->branchBox->sourceModule = 'module'; -$lang->story->branchBox->sourcePlan = 'plan'; - $lang->requirement->common = $lang->URCommon; $lang->requirement->create = 'Create Requirement'; $lang->requirement->batchCreate = "Batch Create"; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index d68e4b688a..dbb5d44d16 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -466,12 +466,6 @@ $lang->story->featureBar['browse']['unclosed'] = $lang->story->unclosed; $lang->story->featureBar['browse']['draft'] = $lang->story->statusList['draft']; $lang->story->featureBar['browse']['reviewing'] = $lang->story->statusList['reviewing']; -$lang->story->branchBox = new stdClass(); -$lang->story->branchBox->branch = 'branch'; -$lang->story->branchBox->sourceBranch = 'branch'; -$lang->story->branchBox->sourceModule = 'module'; -$lang->story->branchBox->sourcePlan = 'plan'; - $lang->requirement->common = $lang->URCommon; $lang->requirement->create = 'Create Requirement'; $lang->requirement->batchCreate = "Batch Create"; diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index 4ef9444e41..cf5f0c0ac0 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -466,12 +466,6 @@ $lang->story->featureBar['browse']['unclosed'] = $lang->story->unclosed; $lang->story->featureBar['browse']['draft'] = $lang->story->statusList['draft']; $lang->story->featureBar['browse']['reviewing'] = $lang->story->statusList['reviewing']; -$lang->story->branchBox = new stdClass(); -$lang->story->branchBox->branch = 'branch'; -$lang->story->branchBox->sourceBranch = 'branch'; -$lang->story->branchBox->sourceModule = 'module'; -$lang->story->branchBox->sourcePlan = 'plan'; - $lang->requirement->common = $lang->URCommon; $lang->requirement->create = 'Create Requirement'; $lang->requirement->batchCreate = "Batch Create"; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 8a26690c57..0ec66c579d 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -466,12 +466,6 @@ $lang->story->featureBar['browse']['unclosed'] = $lang->story->unclosed; $lang->story->featureBar['browse']['draft'] = $lang->story->statusList['draft']; $lang->story->featureBar['browse']['reviewing'] = $lang->story->statusList['reviewing']; -$lang->story->branchBox = new stdClass(); -$lang->story->branchBox->branch = '分支'; -$lang->story->branchBox->sourceBranch = '所属分支'; -$lang->story->branchBox->sourceModule = '所属模块'; -$lang->story->branchBox->sourcePlan = '所属计划'; - $lang->requirement->common = $lang->URCommon; $lang->requirement->create = "提{$lang->URCommon}"; $lang->requirement->batchCreate = "批量创建"; diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index 81f098280e..861e4b17f7 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -86,53 +86,32 @@ foreach(explode(',', $config->story->create->requiredFields) as $field) - story->branchBox->branch;?> + product->branchName[$product->type];?>
- story->branchBox->sourceBranch?> + product->branch, $lang->product->branchName[$product->type])?>
- story->branchBox->sourceModule?> - "; - echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=story¤tModuleID=0&branch=$branch", '', true), $lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='90%'"); - echo '  '; - echo html::a("javascript:void(0)", $lang->refreshIcon, '', "class='refresh' title='refresh' onclick='loadProductModules($productID)'"); - echo '
'; - } - ?> + story->module?> +
- story->branchBox->sourcePlan;?> - "; - echo html::a($this->createLink('productplan', 'create', "productID=$productID&branch=$branch", '', true), "", '', "class='btn btn-icon' data-toggle='modal' data-type='iframe' data-width='95%' title='{$lang->productplan->create}'"); - echo '
'; - echo "
"; - echo html::a("javascript:void(0)", "", '', "class='btn btn-icon refresh' data-toggle='tooltip' title='{$lang->refresh}' onclick='loadProductPlans($productID)'"); - echo '
'; - } - ?> + story->plan;?> +
- +
@@ -367,55 +346,34 @@ foreach(explode(',', $config->story->create->requiredFields) as $field) - + @@ -428,7 +386,6 @@ $(function(){parent.$('body.hide-modal-close').removeClass('hide-modal-close');} var gap = $('#assignedTo').parent().parent().width(); $('#planBox').css('flex', '0 0 ' + gap + 'px') -// $('.c-actions').css('flex', '0 0 60px') $("#branches0").parent().parent().css('flex', '1 0 160px') $("#modules0").parent().parent().css('flex', '1 0 160px') From cdc9bdcf2df70d6493f38711aa49fb0b79e3e86a Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Mon, 31 Oct 2022 17:23:33 +0800 Subject: [PATCH 008/267] * Code for task#74145. --- module/story/control.php | 66 +++++++++++++++---------- module/story/css/common.css | 10 ++++ module/story/js/common.js | 28 +++++++++++ module/story/view/blocksibling.html.php | 13 +++++ module/story/view/view.html.php | 13 ++++- 5 files changed, 102 insertions(+), 28 deletions(-) create mode 100644 module/story/view/blocksibling.html.php diff --git a/module/story/control.php b/module/story/control.php index 050312a13b..a5d4018aab 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1296,32 +1296,33 @@ class story extends control $position[] = $this->lang->story->common; $position[] = $this->lang->story->view; - $this->view->title = $title; - $this->view->position = $position; - $this->view->product = $product; - $this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($product->id); - $this->view->plan = $plan; - $this->view->bugs = $bugs; - $this->view->fromBug = $fromBug; - $this->view->cases = $cases; - $this->view->story = $story; - $this->view->linkedMRs = $linkedMRs; - $this->view->track = $this->story->getTrackByID($story->id); - $this->view->users = $this->user->getPairs('noletter'); - $this->view->reviewers = $reviewers; - $this->view->relations = $this->story->getStoryRelation($story->id, $story->type); - $this->view->executions = $this->execution->getPairs(0, 'all', 'nocode'); - $this->view->execution = empty($story->execution) ? array() : $this->dao->findById($story->execution)->from(TABLE_EXECUTION)->fetch(); - $this->view->actions = $this->action->getList('story', $storyID); - $this->view->storyModule = $storyModule; - $this->view->modulePath = $modulePath; - $this->view->storyProducts = $storyProducts; - $this->view->version = $version; - $this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('story', $storyID); - $this->view->from = $from; - $this->view->param = $param; - $this->view->builds = $this->loadModel('build')->getStoryBuilds($storyID); - $this->view->releases = $this->loadModel('release')->getStoryReleases($storyID); + $this->view->title = $title; + $this->view->position = $position; + $this->view->product = $product; + $this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($product->id); + $this->view->siblings = !empty($story->sibling) ? $this->story->getByList($story->sibling) : array(); + $this->view->plan = $plan; + $this->view->bugs = $bugs; + $this->view->fromBug = $fromBug; + $this->view->cases = $cases; + $this->view->story = $story; + $this->view->linkedMRs = $linkedMRs; + $this->view->track = $this->story->getTrackByID($story->id); + $this->view->users = $this->user->getPairs('noletter'); + $this->view->reviewers = $reviewers; + $this->view->relations = $this->story->getStoryRelation($story->id, $story->type); + $this->view->executions = $this->execution->getPairs(0, 'all', 'nocode'); + $this->view->execution = empty($story->execution) ? array() : $this->dao->findById($story->execution)->from(TABLE_EXECUTION)->fetch(); + $this->view->actions = $this->action->getList('story', $storyID); + $this->view->storyModule = $storyModule; + $this->view->modulePath = $modulePath; + $this->view->storyProducts = $storyProducts; + $this->view->version = $version; + $this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('story', $storyID); + $this->view->from = $from; + $this->view->param = $param; + $this->view->builds = $this->loadModel('build')->getStoryBuilds($storyID); + $this->view->releases = $this->loadModel('release')->getStoryReleases($storyID); $this->display(); } @@ -2741,4 +2742,17 @@ class story extends control return print(html::select('URS[]', $URS, $requirementList, "class='form-control chosen' multiple")); } + + /** + * AJAX: Deleted story sibling. + * + * @access public + * @return void + */ + public function ajaxRelieveSibling() + { + $storyID = !empty($_POST['storyID']) ? $_POST['storyID'] : 0; + $this->dao->update(TABLE_STORY)->set('SIBLING')->eq('')->where('id')->eq($_POST['storyID'])->exec(); + return print('success'); + } } diff --git a/module/story/css/common.css b/module/story/css/common.css index 3baf85cc15..1eb34136d8 100644 --- a/module/story/css/common.css +++ b/module/story/css/common.css @@ -17,3 +17,13 @@ .c-source {width: 130px} .c-note {width: 100px} .c-category {width: 90px} + +.icon-info {color: #ff9800; border-color: #ff9800;} +.text-active {text-decoration: underline;} +.text-cancel {text-decoration: underline;color:#838a9d;margin-left:10px;} +.popover {border:unset;} +.popover.bottom .arrow{border-bottom-color:#ffffff;} +.popover-icon {float:left;} +.popover .content {margin-left:20px;overflow: overlay;} +.hide {display:none !important;} +.sibling {padding:6px;} diff --git a/module/story/js/common.js b/module/story/js/common.js index 5e6525c4eb..9b595ec82b 100644 --- a/module/story/js/common.js +++ b/module/story/js/common.js @@ -86,3 +86,31 @@ function loadURS() $('#URS').chosen(); }); } + +$('.sibling').mouseover(function() { + $(this).find('.unlink').removeClass('hide'); +}); +$('.sibling').mouseout(function() { + $(this).find('.unlink').addClass('hide'); +}); + +$('[data-toggle="popover"]').each(function(item) { + $index = $(this).attr('data-id'); + $(this).popover({ + placement: 'bottom', + html: true, + content: '
孪生关系解除后无法恢复,需求的内容不再同步,是否解除?
' + }); +}) + +function relieve(index) +{ + $.post(relieveURL, {storyID:index}, function(data){ + if(data == 'success') $('[data-id="' + index + '"]').popover('hide').parent('li').remove(); + }); +} + +function popoverCancel(index) +{ + $('[data-id="' + index + '"]').popover('hide').addClass('hide'); +} diff --git a/module/story/view/blocksibling.html.php b/module/story/view/blocksibling.html.php new file mode 100644 index 0000000000..47b3e85fd7 --- /dev/null +++ b/module/story/view/blocksibling.html.php @@ -0,0 +1,13 @@ + $story) +{ + $title = $id . ' '. $story->title; + echo "
  • "; + echo "{$branches[$story->branch]} "; + echo ($canViewLinkStory ? html::a($this->createLink('story', 'view', "id=$id", '', true), "$title", '', "class='iframe' data-width='80%'") : "$id $title"); + echo ""; + echo "
  • "; +} +?> diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index a4d3d9b26f..c53a567f8f 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -401,6 +401,9 @@
    + type != 'normal'):?> +
    +
      + +
    +
    + config->URAndSR):?>
      @@ -639,7 +649,6 @@ js::set('unlink', $lang->story->unlink); js::set('cancel', $lang->cancel); js::set('rawModule', $this->app->rawModule); ?> - + From 1327b611b239e066b26a7e9bcce46a7e6e04f414 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Tue, 1 Nov 2022 00:45:02 +0000 Subject: [PATCH 009/267] * Modify code review issues. --- db/update18.0.sql | 2 +- db/zentao.sql | 2 +- module/story/css/change.css | 6 +++--- module/story/view/change.html.php | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/db/update18.0.sql b/db/update18.0.sql index 675bebaeec..ac0d4a5e1d 100644 --- a/db/update18.0.sql +++ b/db/update18.0.sql @@ -1 +1 @@ -ALTER TABLE `zt_story` ADD COLUMN `sibling` text NOT NULL AFTER `linkRequirements`; +ALTER TABLE `zt_story` ADD COLUMN `siblings` text NOT NULL AFTER `linkRequirements`; diff --git a/db/zentao.sql b/db/zentao.sql index 7e1a93dd19..ebb17b239c 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -1473,7 +1473,7 @@ CREATE TABLE IF NOT EXISTS `zt_story` ( `childStories` varchar(255) NOT NULL, `linkStories` varchar(255) NOT NULL, `linkRequirements` varchar(255) NOT NULL, - `sibling` text NOT NULL, + `siblings` text NOT NULL, `duplicateStory` mediumint(8) unsigned NOT NULL, `version` smallint(6) NOT NULL default '1', `feedbackBy` varchar(100) NOT NULL, diff --git a/module/story/css/change.css b/module/story/css/change.css index 0d28fa39db..e65f78dce1 100644 --- a/module/story/css/change.css +++ b/module/story/css/change.css @@ -3,6 +3,6 @@ .nav-tabs>li>a {height: 36px;} .table-form>tbody>tr>th {width: 100px !important;} .colorpicker {right: 7px; top: 7px; opacity: 1;} -#siblingTd td, #siblingTh td {padding-left: 65px;} -#siblingTh td {font-weight: 700;} -#siblingTd ul li {padding-top: 5px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;} +#siblingList td, #siblingTitle td {padding-left: 65px;} +#siblingTitle td {font-weight: 700;} +#siblingList ul li {padding-top: 5px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;} diff --git a/module/story/view/change.html.php b/module/story/view/change.html.php index 4104561a3a..d2c7e623f9 100644 --- a/module/story/view/change.html.php +++ b/module/story/view/change.html.php @@ -74,13 +74,13 @@ -
    + - + ' + item + ''); - $('#branch_i__chosen').remove(); - $('#branch' + itemIndex).chosen(); - $('#module_i__chosen').remove(); - $('#module' + itemIndex).chosen(); - $('#plan_i__chosen').remove(); - $('#plan' + itemIndex).chosen(); + $(obj).closest('tr').after('' + item + ''); + $('#branches_i__chosen').remove(); + $('#branches' + itemIndex).chosen(); + $('#modules_i__chosen').remove(); + $('#modules' + itemIndex).chosen(); + $('#plans_i__chosen').remove(); + $('#plans' + itemIndex).chosen(); + $('.addBranchesBox' + itemIndex + ' #planIdBox').css('flex', '0 0 ' + gap + 'px'); itemIndex ++; - $('.addedItem #planBox').css('flex', '0 0 ' + gap + 'px') } /** diff --git a/module/story/lang/de.php b/module/story/lang/de.php index 8209fbf211..576042dfe2 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -490,3 +490,7 @@ $lang->requirement->batchAssignTo = "Batch Assign"; $lang->requirement->batchChangeModule = "Batch Change Modules"; $lang->requirement->submitReview = $lang->story->submitReview; $lang->requirement->linkStory = 'Link Story'; + +$lang->story->addBranch = 'Add branch'; +$lang->story->deleteBranch = 'Delete branch'; +$lang->story->notice->branch = 'Each branch will establish a requirement, and the requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later'; \ No newline at end of file diff --git a/module/story/lang/en.php b/module/story/lang/en.php index dbb5d44d16..729b78bdfb 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -490,3 +490,7 @@ $lang->requirement->batchAssignTo = "Batch Assign"; $lang->requirement->batchChangeModule = "Batch Change Modules"; $lang->requirement->submitReview = $lang->story->submitReview; $lang->requirement->linkStory = 'Link Story'; + +$lang->story->addBranch = 'Add branch'; +$lang->story->deleteBranch = 'Delete branch'; +$lang->story->notice->branch = 'Each branch will establish a requirement, and the requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later'; \ No newline at end of file diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index cf5f0c0ac0..36c0b82cc9 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -490,3 +490,7 @@ $lang->requirement->batchAssignTo = "Batch Assign"; $lang->requirement->batchChangeModule = "Batch Change Modules"; $lang->requirement->submitReview = $lang->story->submitReview; $lang->requirement->linkStory = 'Lier Story'; + +$lang->story->addBranch = 'Add branch'; +$lang->story->deleteBranch = 'Delete branch'; +$lang->story->notice->branch = 'Each branch will establish a requirement, and the requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later'; \ No newline at end of file diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 0ec66c579d..2774b6189a 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -490,3 +490,7 @@ $lang->requirement->batchAssignTo = "批量指派"; $lang->requirement->batchChangeModule = "批量修改模块"; $lang->requirement->submitReview = $lang->story->submitReview; $lang->requirement->linkStory = "关联{$lang->SRCommon}"; + +$lang->story->addBranch = '添加分支'; +$lang->story->deleteBranch = '删除分支'; +$lang->story->notice->branch = '每个分支会建立一个需求,需求间互为孪生关系,孪生需求间除产品、分支、模块、计划、阶段字段外均同步,后期您可以手动解除孪生关系'; \ No newline at end of file diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index 861e4b17f7..d00d1dbff0 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -92,16 +92,16 @@ foreach(explode(',', $config->story->create->requiredFields) as $field)
    product->branch, $lang->product->branchName[$product->type])?> - +
    -
    +
    story->module?>
    -
    +
    story->plan;?> @@ -111,10 +111,16 @@ foreach(explode(',', $config->story->create->requiredFields) as $field)
    + + + + @@ -353,16 +359,16 @@ foreach(explode(',', $config->story->create->requiredFields) as $field)
    product->branch, $lang->product->branchName[$product->type])?> - +
    -
    +
    story->module?>
    -
    +
    story->plan;?> @@ -372,20 +378,21 @@ foreach(explode(',', $config->story->create->requiredFields) as $field)
    story->module);?> +story->plan);?> + \ No newline at end of file From 6c1e8ac355eae6b97bfc1fb9e7a283babf009024 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Wed, 2 Nov 2022 17:20:02 +0800 Subject: [PATCH 032/267] dynamic fix width --- module/story/view/header.html.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/story/view/header.html.php b/module/story/view/header.html.php index 31b5bd2cfd..5e72a353b0 100644 --- a/module/story/view/header.html.php +++ b/module/story/view/header.html.php @@ -93,6 +93,8 @@ function loadProductBranches(productID) if(data) { + gap = $('#product').closest('td').next().width(); + $('#planIdBox').css('flex', '0 0 ' + gap + 'px') $.get(createLink('product', 'ajaxGetProductById', "productID=" + productID), function(data) { $('.switchBranch #branchBox .input-group .input-group-addon').html(data.branchSourceName) From 204f22bdab7bc08116217a1a4e3ebccf4cd386cc Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 3 Nov 2022 09:05:48 +0800 Subject: [PATCH 033/267] add check module --- module/story/js/create.js | 2 +- module/story/model.php | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/module/story/js/create.js b/module/story/js/create.js index 23b7231072..ff6808a457 100644 --- a/module/story/js/create.js +++ b/module/story/js/create.js @@ -217,7 +217,7 @@ function loadModuleForSiblings(productID, branch, branchIndex) $moduleIDBox.find('#modules' + branchIndex).chosen(); if(branchIndex == 0) { - $('.switchBranch #moduleIdBox span:first-child').remove() + $('.switchBranch #moduleIdBox > span:first-child').remove() } $moduleIDBox.prepend("" + storyModule + "" ); diff --git a/module/story/model.php b/module/story/model.php index fdc5365fd9..a5a65b8744 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -243,6 +243,16 @@ class storyModel extends model $this->post->plans = isset($story->plan) ? array($story->plan) : array(0 => 0); } + /* check module */ + foreach($this->post->modules as $module) + { + if(empty($module)) + { + dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->story->module); + return false; + } + } + $storyIds = array(); $mainStoryID = 0; foreach($this->post->branches as $key => $branch) From c525d43c1f25e956b2f3a8cff2a900692fe03098 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 3 Nov 2022 09:29:50 +0800 Subject: [PATCH 034/267] fix ajax needCreate param --- module/story/js/create.js | 4 ++-- module/tree/control.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/story/js/create.js b/module/story/js/create.js index ff6808a457..8f28ec71ab 100644 --- a/module/story/js/create.js +++ b/module/story/js/create.js @@ -203,7 +203,7 @@ function loadModuleForSiblings(productID, branch, branchIndex) { /* Load module */ var currentModule = 0; - var moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=' + branchIndex + '&needManage=true&extra=¤tModuleID=' + currentModule); + var moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=' + branchIndex + '&needManage=false&extra=¤tModuleID=' + currentModule); if(branchIndex > 0) { var $moduleIDBox = $('.addBranchesBox'+ branchIndex +' #moduleIdBox'); @@ -240,7 +240,7 @@ function loadPlanForSiblings(productID, branch, branchIndex) if(typeof(branch) == 'undefined') branch = 0; if(!branch) branch = 0; var expired = config.currentMethod == 'create' ? 'unexpired' : ''; - planLink = createLink('product', 'ajaxGetPlans', 'productID=' + productID + '&branch=' + branch + '&planID=' + $('#plan').val() + '&fieldID=' + branchIndex + '&needCreate=true&expired='+ expired +'¶m=skipParent,' + config.currentMethod); + planLink = createLink('product', 'ajaxGetPlans', 'productID=' + productID + '&branch=' + branch + '&planID=' + $('#plan').val() + '&fieldID=' + branchIndex + '&needCreate=false&expired='+ expired +'¶m=skipParent,' + config.currentMethod); if(branchIndex > 0) { var $planIdBox = $('.addBranchesBox'+ branchIndex +' #planIdBox'); diff --git a/module/tree/control.php b/module/tree/control.php index f245d371b6..a4c8277215 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -544,7 +544,7 @@ class tree extends control $currentModuleID = (isset($currentModule->branch) and $currentModule->branch == 0) ? $currentModuleID : 0; $output = html::select("$field", $optionMenu, $currentModuleID, "class='form-control' $changeFunc"); - if(count($optionMenu) == 1 and $needManage) + if(count($optionMenu) == 1 and $needManage !== 'false') { $output .= ""; $output .= html::a($this->createLink('tree', 'browse', "rootID=$rootID&view=$viewType¤tModuleID=0&branch=$branch", '', true), $this->lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'"); From b3f14e9906daafa801262d3dd47a3bfc877c16ce Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 3 Nov 2022 09:35:03 +0800 Subject: [PATCH 035/267] module requirement check --- module/story/model.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/module/story/model.php b/module/story/model.php index a5a65b8744..f4a01b5191 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -244,12 +244,16 @@ class storyModel extends model } /* check module */ - foreach($this->post->modules as $module) + $requiredFields = "," . $this->config->story->create->requiredFields . ","; + if(strpos($requiredFields, ',module,') !== false) { - if(empty($module)) + foreach($this->post->modules as $module) { - dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->story->module); - return false; + if(empty($module)) + { + dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->story->module); + return false; + } } } @@ -262,9 +266,6 @@ class storyModel extends model $story->plan = $this->post->plans[$key]; if(strpos('draft,reviewing', $story->status) !== false) $story->stage = $this->post->plan > 0 ? 'planned' : 'wait'; - - $requiredFields = "," . $this->config->story->create->requiredFields . ","; - if($story->type == 'requirement') $requiredFields = str_replace(',plan,', ',', $requiredFields); if(strpos($requiredFields, ',estimate,') !== false) { From d5f1e2a74110ea1039a1176b4eec26d367526ca8 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 3 Nov 2022 02:02:38 +0000 Subject: [PATCH 036/267] * Code for task#74151,#74155. --- module/story/js/common.js | 3 +- module/story/lang/de.php | 15 +++++--- module/story/lang/en.php | 15 +++++--- module/story/lang/fr.php | 15 +++++--- module/story/lang/vi.php | 13 ++++--- module/story/lang/zh-cn.php | 15 +++++--- module/story/model.php | 63 ++++++++++++++++++++++++++++++- module/story/view/edit.html.php | 2 + module/story/view/header.html.php | 11 ++++++ 9 files changed, 120 insertions(+), 32 deletions(-) diff --git a/module/story/js/common.js b/module/story/js/common.js index f0481757a9..de732986ab 100644 --- a/module/story/js/common.js +++ b/module/story/js/common.js @@ -109,7 +109,8 @@ $('[data-toggle="popover"]').each(function(item) { function relieve(index) { - $.post(relieveURL, {storyID:storyID, siblingID:index}, function(data){ + $.post(relieveURL, {siblingID: index}, function(data) + { $('[data-id="' + index + '"]').popover('hide'); if(data.result == 'success') diff --git a/module/story/lang/de.php b/module/story/lang/de.php index 14c4e80eb5..503a183021 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -99,12 +99,14 @@ $lang->story->successToTask = "Converted to task."; $lang->story->storyRound = '%s time estimation'; $lang->story->float = "『%s』should be positive number, decimals included."; $lang->story->saveDraftSuccess = 'Save as draft succeeded.'; -$lang->story->changeSyncTip = "The modification of this story will be synchronized to the following twin requirements"; -$lang->story->syncTip = "The twin story are synchronized except for product, branch, module, plan, and stage. After the twin relationship is dissolved, they are no longer synchronized."; -$lang->story->relievedTip = "The twin relationship cannot be restored after dissolving, the content of the demand is no longer synchronized, whether to dissolving?"; -$lang->story->assignSyncTip = "Both twin stories modify the assignor synchronously"; -$lang->story->closeSyncTip = "Twin stories are closed synchronously"; -$lang->story->activateSyncTip = "Twin stories are activated synchronously"; + +$lang->story->changeSyncTip = "The modification of this story will be synchronized to the following twin requirements"; +$lang->story->syncTip = "The twin story are synchronized except for product, branch, module, plan, and stage. After the twin relationship is dissolved, they are no longer synchronized."; +$lang->story->relievedTip = "The twin relationship cannot be restored after dissolving, the content of the demand is no longer synchronized, whether to dissolving?"; +$lang->story->assignSyncTip = "Both twin stories modify the assignor synchronously"; +$lang->story->closeSyncTip = "Twin stories are closed synchronously"; +$lang->story->activateSyncTip = "Twin stories are activated synchronously"; +$lang->story->relievedSiblingsTip = "After product adjustment, the twin relationship of this story will be automatically removed, and the story will no longer be synchronized. Do you want to save?"; $lang->story->id = 'ID'; $lang->story->parent = 'Parent'; @@ -483,6 +485,7 @@ $lang->story->operateList['closed'] = 'closed'; $lang->story->operateList['activated'] = 'activated'; $lang->story->operateList['changed'] = 'changed'; $lang->story->operateList['reviewed'] = 'reviewed'; +$lang->story->operateList['edited'] = 'edited'; $lang->requirement->common = $lang->URCommon; $lang->requirement->create = 'Create Requirement'; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 4de2c96313..7c16cd5314 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -99,12 +99,14 @@ $lang->story->successToTask = "Converted to task."; $lang->story->storyRound = '%s time estimation'; $lang->story->float = "『%s』should have positive number, or decimals."; $lang->story->saveDraftSuccess = 'Save as draft succeeded.'; -$lang->story->changeSyncTip = "The modification of this story will be synchronized to the following twin requirements"; -$lang->story->syncTip = "The twin story are synchronized except for product, branch, module, plan, and stage. After the twin relationship is dissolved, they are no longer synchronized."; -$lang->story->relievedTip = "The twin relationship cannot be restored after dissolving, the content of the demand is no longer synchronized, whether to dissolving?"; -$lang->story->assignSyncTip = "Both twin stories modify the assignor synchronously"; -$lang->story->closeSyncTip = "Twin stories are closed synchronously"; -$lang->story->activateSyncTip = "Twin stories are activated synchronously"; + +$lang->story->changeSyncTip = "The modification of this story will be synchronized to the following twin requirements"; +$lang->story->syncTip = "The twin story are synchronized except for product, branch, module, plan, and stage. After the twin relationship is dissolved, they are no longer synchronized."; +$lang->story->relievedTip = "The twin relationship cannot be restored after dissolving, the content of the demand is no longer synchronized, whether to dissolving?"; +$lang->story->assignSyncTip = "Both twin stories modify the assignor synchronously"; +$lang->story->closeSyncTip = "Twin stories are closed synchronously"; +$lang->story->activateSyncTip = "Twin stories are activated synchronously"; +$lang->story->relievedSiblingsTip = "After product adjustment, the twin relationship of this story will be automatically removed, and the story will no longer be synchronized. Do you want to save?"; $lang->story->id = 'ID'; $lang->story->parent = 'Parent'; @@ -483,6 +485,7 @@ $lang->story->operateList['closed'] = 'closed'; $lang->story->operateList['activated'] = 'activated'; $lang->story->operateList['changed'] = 'changed'; $lang->story->operateList['reviewed'] = 'reviewed'; +$lang->story->operateList['edited'] = 'edited'; $lang->requirement->common = $lang->URCommon; $lang->requirement->create = 'Create Requirement'; diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index df1111501f..2d8ef45343 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -99,12 +99,14 @@ $lang->story->successToTask = "Converted to task."; $lang->story->storyRound = '%s time estimation'; $lang->story->float = "『 %s 』doit avoir des nombres positifs ou décimaux."; $lang->story->saveDraftSuccess = 'Save as draft succeeded.'; -$lang->story->changeSyncTip = "The modification of this story will be synchronized to the following twin requirements"; -$lang->story->syncTip = "The twin story are synchronized except for product, branch, module, plan, and stage. After the twin relationship is dissolved, they are no longer synchronized."; -$lang->story->relievedTip = "The twin relationship cannot be restored after dissolving, the content of the demand is no longer synchronized, whether to dissolving?"; -$lang->story->assignSyncTip = "Both twin stories modify the assignor synchronously"; -$lang->story->closeSyncTip = "Twin stories are closed synchronously"; -$lang->story->activateSyncTip = "Twin stories are activated synchronously"; + +$lang->story->changeSyncTip = "The modification of this story will be synchronized to the following twin requirements"; +$lang->story->syncTip = "The twin story are synchronized except for product, branch, module, plan, and stage. After the twin relationship is dissolved, they are no longer synchronized."; +$lang->story->relievedTip = "The twin relationship cannot be restored after dissolving, the content of the demand is no longer synchronized, whether to dissolving?"; +$lang->story->assignSyncTip = "Both twin stories modify the assignor synchronously"; +$lang->story->closeSyncTip = "Twin stories are closed synchronously"; +$lang->story->activateSyncTip = "Twin stories are activated synchronously"; +$lang->story->relievedSiblingsTip = "After product adjustment, the twin relationship of this story will be automatically removed, and the story will no longer be synchronized. Do you want to save?"; $lang->story->id = 'ID'; $lang->story->parent = 'Parent'; @@ -483,6 +485,7 @@ $lang->story->operateList['closed'] = 'closed'; $lang->story->operateList['activated'] = 'activated'; $lang->story->operateList['changed'] = 'changed'; $lang->story->operateList['reviewed'] = 'reviewed'; +$lang->story->operateList['edited'] = 'edited'; $lang->requirement->common = $lang->URCommon; $lang->requirement->create = 'Create Requirement'; diff --git a/module/story/lang/vi.php b/module/story/lang/vi.php index cd8ced45fd..591d98b0ae 100644 --- a/module/story/lang/vi.php +++ b/module/story/lang/vi.php @@ -93,11 +93,13 @@ $lang->story->successToTask = "Converted to task."; $lang->story->storyRound = '%s time estimation'; $lang->story->float = "『%s』should be positive number, decimals included."; $lang->story->saveDraftSuccess = 'Save as draft succeeded.'; -$lang->story->changeSyncTip = "The modification of this story will be synchronized to the following twin requirements"; -$lang->story->syncTip = "The twin story are synchronized except for product, branch, module, plan, and stage. After the twin relationship is dissolved, they are no longer synchronized."; -$lang->story->assignSyncTip = "Both twin stories modify the assignor synchronously"; -$lang->story->closeSyncTip = "Twin stories are closed synchronously"; -$lang->story->activateSyncTip = "Twin stories are activated synchronously"; + +$lang->story->changeSyncTip = "The modification of this story will be synchronized to the following twin requirements"; +$lang->story->syncTip = "The twin story are synchronized except for product, branch, module, plan, and stage. After the twin relationship is dissolved, they are no longer synchronized."; +$lang->story->assignSyncTip = "Both twin stories modify the assignor synchronously"; +$lang->story->closeSyncTip = "Twin stories are closed synchronously"; +$lang->story->activateSyncTip = "Twin stories are activated synchronously"; +$lang->story->relievedSiblingsTip = "After product adjustment, the twin relationship of this story will be automatically removed, and the story will no longer be synchronized. Do you want to save?"; $lang->story->id = 'ID'; $lang->story->parent = 'Mẹ'; @@ -470,3 +472,4 @@ $lang->story->operateList['closed'] = 'closed'; $lang->story->operateList['activated'] = 'activated'; $lang->story->operateList['changed'] = 'changed'; $lang->story->operateList['reviewed'] = 'reviewed'; +$lang->story->operateList['edited'] = 'edited'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 4d522d9645..4380f85915 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -99,12 +99,14 @@ $lang->story->successToTask = '批量转任务成功'; $lang->story->storyRound = '第 %s 轮估算'; $lang->story->float = "『%s』应当是正数,可以是小数。"; $lang->story->saveDraftSuccess = '存为草稿成功'; -$lang->story->changeSyncTip = "该需求的修改会同步到如下的孪生需求"; -$lang->story->syncTip = "孪生需求间除产品、分支 、模块、计划、阶段外均同步,孪生关系解除后不再同步"; -$lang->story->relievedTip = "孪生关系解除后无法恢复,需求的内容不再同步,是否解除?"; -$lang->story->assignSyncTip = "孪生需求均同步修改指派人"; -$lang->story->closeSyncTip = "孪生需求均同步关闭"; -$lang->story->activateSyncTip = "孪生需求均同步激活"; + +$lang->story->changeSyncTip = "该需求的修改会同步到如下的孪生需求"; +$lang->story->syncTip = "孪生需求间除产品、分支 、模块、计划、阶段外均同步,孪生关系解除后不再同步"; +$lang->story->relievedTip = "孪生关系解除后无法恢复,需求的内容不再同步,是否解除?"; +$lang->story->assignSyncTip = "孪生需求均同步修改指派人"; +$lang->story->closeSyncTip = "孪生需求均同步关闭"; +$lang->story->activateSyncTip = "孪生需求均同步激活"; +$lang->story->relievedSiblingsTip = '产品调整后,本需求自动解除孪生关系,需求不再同步,是否保存?'; $lang->story->id = '编号'; $lang->story->parent = '父需求'; @@ -483,6 +485,7 @@ $lang->story->operateList['closed'] = '关闭'; $lang->story->operateList['activated'] = '激活'; $lang->story->operateList['changed'] = '变更'; $lang->story->operateList['reviewed'] = '评审'; +$lang->story->operateList['edited'] = '编辑'; $lang->requirement->common = $lang->URCommon; $lang->requirement->create = "提{$lang->URCommon}"; diff --git a/module/story/model.php b/module/story/model.php index 9e4f359820..5cf8b3f3e1 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -910,6 +910,14 @@ class storyModel extends model ->remove('files,labels,comment,contactListMenu,stages,reviewer,needNotReview') ->get(); + /* Relieve siblings when change product. */ + if(!empty($oldStory->siblings) and $story->product != $oldStory->product) + { + $this->dbh->exec("UPDATE " . TABLE_STORY . " SET siblings = REPLACE(siblings, ',$storyID,', ',') WHERE `product` = $oldStory->product"); + $this->dao->update(TABLE_STORY)->set('siblings')->eq('')->where('id')->eq($storyID)->orWhere('siblings')->eq(',')->exec(); + $oldStory->siblings = ''; + } + if($oldStory->type == 'story' and !isset($story->linkStories)) $story->linkStories = ''; if($oldStory->type == 'requirement' and !isset($story->linkRequirements)) $story->linkRequirements = ''; if($oldStory->status == 'changing' and $story->status == 'draft') $story->status = 'changing'; @@ -961,6 +969,19 @@ class storyModel extends model ->beginIF($oldStory->status == 'reviewing')->andWhere('reviewer')->notin(implode(',', $_POST['reviewer'])) ->exec(); + /* Sync siblings. */ + if(!empty($oldStory->siblings)) + { + foreach(explode(',', trim($oldStory->siblings, ',')) as $siblingID) + { + $this->dao->delete()->from(TABLE_STORYREVIEW) + ->where('story')->eq($siblingID) + ->andWhere('version')->eq($oldStory->version) + ->beginIF($oldStory->status == 'reviewing')->andWhere('reviewer')->notin(implode(',', $_POST['reviewer'])) + ->exec(); + } + } + foreach($_POST['reviewer'] as $reviewer) { if($oldStory->status == 'reviewing' and in_array($reviewer, array_keys($oldReviewer))) continue; @@ -970,6 +991,16 @@ class storyModel extends model $reviewData->version = $oldStory->version; $reviewData->reviewer = $reviewer; $this->dao->insert(TABLE_STORYREVIEW)->data($reviewData)->exec(); + + /* Sync siblings. */ + if(!empty($oldStory->siblings)) + { + foreach(explode(',', trim($oldStory->siblings, ',')) as $siblingID) + { + $reviewData->story = $siblingID; + $this->dao->insert(TABLE_STORYREVIEW)->data($reviewData)->exec(); + } + } } if($oldStory->status == 'reviewing') $story = $this->updateStoryByReview($storyID, $oldStory, $story); @@ -1007,6 +1038,18 @@ class storyModel extends model $data->verify = $story->verify; $data->files = $story->files = $addedFiles . trim($storyFiles, ','); $this->dao->update(TABLE_STORYSPEC)->data($data)->where('story')->eq((int)$storyID)->andWhere('version')->eq($oldStory->version)->exec(); + + /* Sync siblings. */ + if(!empty($oldStory->siblings)) + { + foreach(explode(',', trim($oldStory->siblings, ',')) as $siblingID) + { + $this->dao->update(TABLE_STORYSPEC)->data($data) + ->where('story')->eq((int)$siblingID) + ->andWhere('version')->eq($oldStory->version) + ->exec(); + } + } } if($story->product != $oldStory->product) @@ -1136,6 +1179,8 @@ class storyModel extends model if(isset($story->finalResult)) $this->recordReviewAction($story); } + if(!empty($oldStory->siblings)) $this->syncSiblings($oldStory->id, $oldStory->siblings, $changes, 'Edited'); + return true; } } @@ -1549,14 +1594,26 @@ class storyModel extends model /* Fix bug #671. */ $this->lang->story->closedReason = $this->lang->story->rejectedReason; - $this->dao->update(TABLE_STORYREVIEW)->set('result')->eq($this->post->result)->set('reviewDate')->eq($now)->where('story')->eq($storyID)->andWhere('version')->eq($oldStory->version)->andWhere('reviewer')->eq($this->app->user->account)->exec(); + $this->dao->update(TABLE_STORYREVIEW) + ->set('result')->eq($this->post->result) + ->set('reviewDate')->eq($now) + ->where('story')->eq($storyID) + ->andWhere('version')->eq($oldStory->version) + ->andWhere('reviewer')->eq($this->app->user->account) + ->exec(); /* Sync siblings. */ if(!empty($oldStory->siblings)) { foreach(explode(',', trim($oldStory->siblings, ',')) as $siblingID) { - $this->dao->update(TABLE_STORYREVIEW)->set('result')->eq($this->post->result)->set('reviewDate')->eq($now)->where('story')->eq($siblingID)->andWhere('version')->eq($oldStory->version)->andWhere('reviewer')->eq($this->app->user->account)->exec(); + $this->dao->update(TABLE_STORYREVIEW) + ->set('result')->eq($this->post->result) + ->set('reviewDate')->eq($now) + ->where('story')->eq($siblingID) + ->andWhere('version')->eq($oldStory->version) + ->andWhere('reviewer')->eq($this->app->user->account) + ->exec(); } } @@ -6211,6 +6268,8 @@ class storyModel extends model $syncFieldList[$fieldName] = $fieldValue; } + if(empty($syncFieldList)) return; + /* Synchronize and record dynamics. */ $this->loadModel('action'); $siblings = explode(',', trim($siblings, ',')); diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php index b2065d0f61..f0affe9be5 100644 --- a/module/story/view/edit.html.php +++ b/module/story/view/edit.html.php @@ -24,6 +24,8 @@ story->feedbackSource); ?> status);?> +siblings)?> +story->relievedSiblingsTip)?>
    diff --git a/module/story/view/header.html.php b/module/story/view/header.html.php index 5e72a353b0..769e6aec09 100644 --- a/module/story/view/header.html.php +++ b/module/story/view/header.html.php @@ -11,6 +11,17 @@ */ function loadProduct(productID) { + if(siblings && productID != oldProductID) + { + confirmRelievedSiblings = confirm(relievedSiblingsTip); + if(!confirmRelievedSiblings) + { + $('#product').val(oldProductID); + $('#product').trigger("chosen:updated"); + return false; + } + } + if(typeof parentStory != 'undefined' && parentStory) { confirmLoadProduct = confirm(moveChildrenTips); From 646b34a04e1adb30e22331e8cae8766ec01865e0 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Thu, 3 Nov 2022 10:09:35 +0800 Subject: [PATCH 037/267] * Fix ajaxRelieved for story. --- module/story/control.php | 5 ++--- module/story/js/common.js | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index eb9b306212..1e9545dee3 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -2753,11 +2753,10 @@ class story extends control { $siblingID = !empty($_POST['siblingID']) ? $_POST['siblingID'] : 0; $story = $this->story->getByID($siblingID); + $siblings = explode(',', trim($story->siblings, ',')); if(empty($story->siblings)) return $this->send(array('result' => 'fail')); - $siblings = str_replace(",$siblingID", '', $story->siblings); - /* batchUnset siblingID from siblings.*/ $replaceSql = "UPDATE " . TABLE_STORY . " SET siblings = REPLACE(siblings,',$siblingID,', ',') WHERE `product` = $story->product"; $this->dbh->exec($replaceSql); @@ -2766,6 +2765,6 @@ class story extends control $this->dao->update(TABLE_STORY)->set('siblings')->eq('')->where('id')->eq($siblingID)->orWhere('siblings')->eq(',')->exec(); if(!dao::isError()) $this->loadModel('action')->create('story', $siblingID, 'relieved'); - return $this->send(array('result' => 'success', 'data' => $siblings)); + return $this->send(array('result' => 'success', 'silbingsCount' => count($siblings)-1)); } } diff --git a/module/story/js/common.js b/module/story/js/common.js index f0481757a9..51c47c3603 100644 --- a/module/story/js/common.js +++ b/module/story/js/common.js @@ -109,13 +109,13 @@ $('[data-toggle="popover"]').each(function(item) { function relieve(index) { - $.post(relieveURL, {storyID:storyID, siblingID:index}, function(data){ + $.post(relieveURL, {siblingID:index}, function(data){ $('[data-id="' + index + '"]').popover('hide'); if(data.result == 'success') { - if(data.data.length !== 0) $('[data-id="' + index + '"]').parent('li').remove(); - if(data.data.length == 0 || index == storyID) + if(data.silbingsCount != 0) $('[data-id="' + index + '"]').parent('li').remove(); + if(data.silbingsCount == 0 || index == storyID) { $('[href="#legendSiblings"]').parent('li').next('li').addClass('active');; $('[href="#legendSiblings"]').parent('li').remove(); From 0b25f8972503539a3f44e11597885fa5603fa909 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 3 Nov 2022 02:29:36 +0000 Subject: [PATCH 038/267] * Add condition of edit page. --- module/story/view/header.html.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/story/view/header.html.php b/module/story/view/header.html.php index 769e6aec09..d323bf8bcd 100644 --- a/module/story/view/header.html.php +++ b/module/story/view/header.html.php @@ -11,7 +11,7 @@ */ function loadProduct(productID) { - if(siblings && productID != oldProductID) + if(page == 'edit' && siblings && productID != oldProductID) { confirmRelievedSiblings = confirm(relievedSiblingsTip); if(!confirmRelievedSiblings) @@ -248,4 +248,4 @@ function loadProductReviewers(productID) } }); } - \ No newline at end of file + From 9f93db829ab36cbfcf0b14d2ad6221a1eb336c4d Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 3 Nov 2022 10:41:21 +0800 Subject: [PATCH 039/267] switch product fix --- module/story/view/create.html.php | 1 + module/story/view/header.html.php | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index b04c50041e..6e3f024204 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -383,6 +383,7 @@ foreach(explode(',', $config->story->create->requiredFields) as $field) story->module);?> story->plan);?> + + From 6aafddee2969bca3f0a755d2fb7c663737ddd646 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 30 Nov 2022 14:44:28 +0800 Subject: [PATCH 122/267] * Fix bug of change branch at edit plan page. --- module/productplan/js/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/productplan/js/edit.js b/module/productplan/js/edit.js index ea7b6c9c42..0de68fe3d0 100644 --- a/module/productplan/js/edit.js +++ b/module/productplan/js/edit.js @@ -31,7 +31,7 @@ function getConflictStories(planID) if(!result) { newBranch = oldBranch[planID]; - $('#branch').val(oldBranch[planID]); + $('#branch').val(oldBranch[planID].split(',')); $('#branch').trigger("chosen:updated"); } } From eda06bcdc442c195a5d49b4c24eaf544183778a8 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 30 Nov 2022 14:55:45 +0800 Subject: [PATCH 123/267] * fix bug #29680. --- module/block/view/printassigntomeblock.html.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/block/view/printassigntomeblock.html.php b/module/block/view/printassigntomeblock.html.php index 9293eb4686..fa81e17117 100644 --- a/module/block/view/printassigntomeblock.html.php +++ b/module/block/view/printassigntomeblock.html.php @@ -19,8 +19,9 @@ + $bool):?> - + > my->audit : $lang->block->availableBlocks->$type;?> @@ -36,7 +37,7 @@ > - block->availableBlocks->$type;?> + my->audit : $lang->block->availableBlocks->$type;?> '> From b1831623e5116e563b1ff6862fe23884afa8059a Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Wed, 30 Nov 2022 15:16:44 +0800 Subject: [PATCH 124/267] * Finish Task #77806 --- module/productplan/model.php | 22 ++-------------------- module/story/lang/de.php | 1 + module/story/lang/en.php | 1 + module/story/lang/fr.php | 1 + module/story/lang/zh-cn.php | 1 + module/story/model.php | 11 +++++++++++ module/story/view/edit.html.php | 2 +- 7 files changed, 18 insertions(+), 21 deletions(-) diff --git a/module/productplan/model.php b/module/productplan/model.php index 4f97735c41..bf7c2870a9 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -991,27 +991,9 @@ class productplanModel extends model if(strpos(",$story->plan,", ",{$planID},") !== false) continue; /* Update the plan linked with the story and the order of the story in the plan. */ - if($this->session->currentProductType == 'normal' or $story->branch != 0 or empty($story->plan)) - { - $this->dao->update(TABLE_STORY)->set("plan")->eq($planID)->where('id')->eq((int)$storyID)->exec(); + $this->dao->update(TABLE_STORY)->set("plan")->eq($planID)->where('id')->eq((int)$storyID)->exec(); - $this->story->updateStoryOrderOfPlan($storyID, $planID, $story->plan); - } - else - { - $branchPlanPairs = $this->dao->select('branch, id as plan')->from(TABLE_PRODUCTPLAN) - ->where('product')->eq($story->product) - ->andWhere('id')->in($story->plan) - ->fetchPairs(); - if(isset($branchPlanPairs[$plan->branch])) $branchPlanPairs[$plan->branch] = $planID; - - $plansOfStory = implode(',', $branchPlanPairs); - $plansOfStory = trim($plansOfStory, ','); - - $this->dao->update(TABLE_STORY)->set("plan")->eq($plansOfStory)->where('id')->eq((int)$storyID)->exec(); - - $this->story->updateStoryOrderOfPlan($storyID, $planID); - } + $this->story->updateStoryOrderOfPlan($storyID, $planID, $story->plan); $this->action->create('story', $storyID, 'linked2plan', '', $planID); $this->story->setStage($storyID); diff --git a/module/story/lang/de.php b/module/story/lang/de.php index c696c9d780..a102071878 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -444,6 +444,7 @@ $lang->story->chosen->reviewedBy = 'Prüfer wählen'; $lang->story->notice = new stdClass(); $lang->story->notice->closed = 'Die ausgewählten Storys wurden bereits geschlossen!'; $lang->story->notice->reviewerNotEmpty = 'This requirement needs to be reviewed, and the reviewedby is required.'; +$lang->story->notice->changePlan = 'The plan can be changed to only one item.'; $lang->story->convertToTask = new stdClass(); $lang->story->convertToTask->fieldList = array(); diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 5096794e76..17ae16c93a 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -444,6 +444,7 @@ $lang->story->chosen->reviewedBy = 'Choose ReviewedBy'; $lang->story->notice = new stdClass(); $lang->story->notice->closed = 'Story that you select is closed!'; $lang->story->notice->reviewerNotEmpty = 'This requirement needs to be reviewed, and the reviewedby is required.'; +$lang->story->notice->changePlan = 'The plan can be changed to only one item.'; $lang->story->convertToTask = new stdClass(); $lang->story->convertToTask->fieldList = array(); diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index 095fdb30d6..b05c47cf17 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -444,6 +444,7 @@ $lang->story->chosen->reviewedBy = 'Choisir valideur'; $lang->story->notice = new stdClass(); $lang->story->notice->closed = 'La Story que vous avez sélectionnée est malheureusement fermée !'; $lang->story->notice->reviewerNotEmpty = 'This requirement needs to be reviewed, and the reviewedby is required.'; +$lang->story->notice->changePlan = 'The plan can be changed to only one item.'; $lang->story->convertToTask = new stdClass(); $lang->story->convertToTask->fieldList = array(); diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 3d1fca479b..048756a3f8 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -444,6 +444,7 @@ $lang->story->chosen->reviewedBy = '选择评审人...'; $lang->story->notice = new stdClass(); $lang->story->notice->closed = "您选择的{$lang->SRCommon}已经被关闭了!"; $lang->story->notice->reviewerNotEmpty = '该需求需要评审,评审人员不能为空。'; +$lang->story->notice->changePlan = '所属计划只能改为一条,修改后才能保存成功。'; $lang->story->convertToTask = new stdClass(); $lang->story->convertToTask->fieldList = array(); diff --git a/module/story/model.php b/module/story/model.php index 34f9be200a..bb95eea787 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -889,6 +889,17 @@ class storyModel extends model return false; } + $storyPlan = !empty($_POST['plan']) ? $_POST['plan'] : array(); + if(count($storyPlan) > 1) + { + $oldStoryPlan = !empty($oldStory->planTitle) ? array_keys($oldStory->planTitle) : array(); + if(!empty(array_diff($storyPlan,$oldStoryPlan)) or !empty(array_diff($oldStoryPlan,$storyPlan))) + { + dao::$errors[] = $this->lang->story->notice->changePlan; + return false; + } + } + $story = fixer::input('post') ->cleanInt('product,module,pri,duplicateStory') ->cleanFloat('estimate') diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php index 1cb174f32d..2d511c25cf 100644 --- a/module/story/view/edit.html.php +++ b/module/story/view/edit.html.php @@ -192,7 +192,7 @@ story->plan;?>
    - session->currentProductType != 'normal' and empty($story->branch)) ? true : false;?> + session->currentProductType != 'normal' and empty($story->branch) and count($story->planTitle) > 1) ? true : false;?> plan, "class='form-control chosen'" . ($multiple ? ' multiple' : '')); if(count($plans) == 1) { From a125f33c4d1a8eb5562616cba97ef1a531234ccc Mon Sep 17 00:00:00 2001 From: wangyuting <851424971@qq.com> Date: Wed, 30 Nov 2022 07:27:01 +0000 Subject: [PATCH 125/267] * Fix bug #30368. --- module/testtask/js/common.js | 3 +-- module/testtask/js/create.js | 2 ++ module/testtask/view/create.html.php | 4 +--- module/testtask/view/edit.html.php | 12 +++++++----- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/module/testtask/js/common.js b/module/testtask/js/common.js index 9f090c7157..e6875782e6 100644 --- a/module/testtask/js/common.js +++ b/module/testtask/js/common.js @@ -94,7 +94,7 @@ function loadExecutionRelated(executionID) * @access public * @return void */ -function loadExecutionBuilds(executionID, selected) +function loadExecutionBuilds(executionID) { var selectedBuild = $('#build').val(); @@ -103,7 +103,6 @@ function loadExecutionBuilds(executionID, selected) if(executionID == 0) link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + $('#product').val() + '&varName=build&build=' + selectedBuild + '&branch=&index=&needCreate=&type=noempty,notrunk,withexecution'); $('#buildBox').load(link, function() { - if(selected) $('#build').val(selected); $('#build').chosen(); }); } diff --git a/module/testtask/js/create.js b/module/testtask/js/create.js index ed479be08c..80909db538 100755 --- a/module/testtask/js/create.js +++ b/module/testtask/js/create.js @@ -20,12 +20,14 @@ function loadProductRelated() */ function loadExecutions(productID) { + var executionID = $('#execution').val(); link = createLink('product', 'ajaxGetExecutions', 'productID=' + productID + '&projectID=' + projectID + '&branch='); $.get(link, function(data) { if(!data) data = ''; $('#execution').replaceWith(data); $('#execution_chosen').remove(); + $("#execution").val(executionID); $("#execution").chosen(); }); } diff --git a/module/testtask/view/create.html.php b/module/testtask/view/create.html.php index 6b8cf3424a..b48dfc2a27 100644 --- a/module/testtask/view/create.html.php +++ b/module/testtask/view/create.html.php @@ -38,12 +38,11 @@ - + '> testtask->execution;?> - testtask->build;?> @@ -58,7 +57,6 @@ - testtask->type;?> testtask->typeList, '', "class='form-control picker-select' multiple");?> diff --git a/module/testtask/view/edit.html.php b/module/testtask/view/edit.html.php index 20101655c8..8115b3a12d 100644 --- a/module/testtask/view/edit.html.php +++ b/module/testtask/view/edit.html.php @@ -25,16 +25,18 @@
    - + product);?> + multiple):?> + execution);?> + + execution) ? 'hide' : '';?>'> + From 069565c265e408205b654f08d5a8f38ec974972a Mon Sep 17 00:00:00 2001 From: wangyuting <851424971@qq.com> Date: Wed, 30 Nov 2022 07:37:21 +0000 Subject: [PATCH 126/267] * Fix bug. --- module/build/control.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index a479bdba7e..761006e707 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -385,10 +385,11 @@ class build extends control * @param string|int $branch * @param int $index the index of batch create bug. * @param string $type get all builds or some builds belong to normal releases and executions are not done. + * @param string $extra * @access public * @return string */ - public function ajaxGetProductBuilds($productID, $varName, $build = '', $branch = 'all', $index = 0, $type = 'normal') + public function ajaxGetProductBuilds($productID, $varName, $build = '', $branch = 'all', $index = 0, $type = 'normal', $extra = '') { $isJsonView = $this->app->getViewType() == 'json'; if($varName == 'openedBuild' ) @@ -411,6 +412,11 @@ class build extends control if($isJsonView) return print(json_encode($builds)); return print(html::select($varName, $builds, $build, "class='form-control'")); } + + $builds = $this->build->getBuildPairs($productID, $branch, $type, 0, 'project', $build); + if(strpos($extra, 'multiple') !== false) $varName .= '[]'; + if($isJsonView) return print(json_encode($builds)); + return print(html::select($varName, $builds, $build, "class='form-control chosen' $extra")); } /** @@ -449,7 +455,7 @@ class build extends control return print(html::select($varName, $builds, $build, "class='form-control'")); } - if(empty($projectID)) return $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type); + if(empty($projectID)) return $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type, $extra); $builds = $this->build->getBuildPairs($productID, $branch, $type, $projectID, 'project', $build, false); if(strpos($extra, 'multiple') !== false) $varName .= '[]'; if($isJsonView) return print(json_encode($builds)); From 2a75393953dc3a27695c34872ed641dab739e9ae Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Wed, 30 Nov 2022 15:57:08 +0800 Subject: [PATCH 127/267] * Finish Task #77806 --- module/product/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/product/control.php b/module/product/control.php index 547b659b54..0529cfcd88 100755 --- a/module/product/control.php +++ b/module/product/control.php @@ -1048,7 +1048,7 @@ class product extends control $multiple = strpos($param, 'multiple') === false ? '' : 'multiple'; $output = html::select($field, $plans, $planID, "class='form-control chosen' $multiple"); - if($branch == 0 and strpos($param, 'edit')) $output = html::select($field, $plans, $planID, "class='form-control chosen' multiple"); + if($branch == 0 and strpos($param, 'edit') and !strpos($param, 'forstory')) $output = html::select($field, $plans, $planID, "class='form-control chosen' multiple"); if(count($plans) == 1 and $needCreate and $needCreate !== 'false') { From b2f9f3460b3f023a71573f6b77af4f0f386e6d72 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 30 Nov 2022 16:19:15 +0800 Subject: [PATCH 128/267] * fix bug #29637. --- module/execution/view/create.html.php | 3 ++- module/task/lang/de.php | 1 + module/task/lang/en.php | 1 + module/task/lang/fr.php | 1 + module/task/lang/zh-cn.php | 1 + module/task/view/create.html.php | 8 +++++++- 6 files changed, 13 insertions(+), 2 deletions(-) diff --git a/module/execution/view/create.html.php b/module/execution/view/create.html.php index 8868df5b4d..902cd65b1d 100644 --- a/module/execution/view/create.html.php +++ b/module/execution/view/create.html.php @@ -161,7 +161,8 @@ - model) and $project->model == 'scrum') $hidden = '';?> + + model) and !empty($project->hasProduct) and $project->model == 'scrum') $hidden = '';?> diff --git a/module/productplan/view/browsebylist.html.php b/module/productplan/view/browsebylist.html.php index b5a0bf9f68..7eabe9d192 100644 --- a/module/productplan/view/browsebylist.html.php +++ b/module/productplan/view/browsebylist.html.php @@ -163,7 +163,7 @@ session->currentProductType != 'normal'):?> branch) as $branchID) $planBranches .= $branchOption[$branchID] . ',';?> - + diff --git a/module/productplan/view/create.html.php b/module/productplan/view/create.html.php index e5180a7d3d..01a0a00b82 100644 --- a/module/productplan/view/create.html.php +++ b/module/productplan/view/create.html.php @@ -15,6 +15,7 @@ execution->weekend);?> productplan->last);?> +
    @@ -35,13 +36,22 @@
    + type != 'normal'):?> + $branchName) + { + if(strpos(",$parentPlan->branch,", ",$branchID,") === false) unset($branches[$branchID]); + } + } + ?> - @@ -79,7 +89,6 @@ id);?> - branch);?> From c9bcbe74ae13b7640d7512b45bb786e5baacd5f8 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 30 Nov 2022 22:29:51 +0800 Subject: [PATCH 134/267] * Code for task#78030. --- module/kanban/model.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/module/kanban/model.php b/module/kanban/model.php index a4a02a08c0..d9177af9e5 100755 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -818,8 +818,11 @@ class kanbanModel extends model } elseif($branchID) { - $branchName = $this->branch->getById($branchID); - $branches = array($branchID => $branchName); + foreach(explode(',', $branchID) as $id) + { + $branchName = $this->branch->getById($id); + $branches[$id] = $branchName; + } } foreach($branches as $id => $name) From 65fe5985a253483d34e3dffe35b67ba72539a49e Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 1 Dec 2022 08:29:35 +0800 Subject: [PATCH 135/267] code meeting fix --- module/execution/control.php | 16 ++++++++-------- module/execution/model.php | 4 ++-- module/productplan/model.php | 4 ++-- module/story/view/edit.html.php | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 388e4ede85..62de145e05 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1646,17 +1646,17 @@ class execution extends control else { $executionProductList = $this->loadModel('product')->getProducts($executionID); - $hasMultiBranchProduct = false; + $multiBranchProduct = false; foreach($executionProductList as $executionProduct) { if($executionProduct->type != 'normal') { - $hasMultiBranchProduct = true; + $multiBranchProduct = true; break; } } - $importPlanStoryTips = $hasMultiBranchProduct ? $this->lang->execution->importBranchPlanStory : $this->lang->execution->importPlanStory; + $importPlanStoryTips = $multiBranchProduct ? $this->lang->execution->importBranchPlanStory : $this->lang->execution->importPlanStory; return print(js::confirm($importPlanStoryTips, inlink('create', "projectID=$projectID&executionID=$executionID©ExecutionID=&planID=$planID&confirm=yes"), inlink('create', "projectID=$projectID&executionID=$executionID"))); } @@ -1918,17 +1918,17 @@ class execution extends control elseif(!empty($newPlans)) { $executionProductList = $this->loadModel('product')->getProducts($executionID); - $hasMultiBranchProduct = false; + $multiBranchProduct = false; foreach($executionProductList as $executionProduct) { if($executionProduct->type != 'normal') { - $hasMultiBranchProduct = true; + $multiBranchProduct = true; break; } } - $importEditPlanStoryTips = $hasMultiBranchProduct ? $this->lang->execution->importBranchEditPlanStory : $this->lang->execution->importEditPlanStory; + $importEditPlanStoryTips = $multiBranchProduct ? $this->lang->execution->importBranchEditPlanStory : $this->lang->execution->importEditPlanStory; return print(js::confirm($importEditPlanStoryTips, inlink('edit', "executionID=$executionID&action=edit&extra=&newPlans=$newPlans&confirm=yes"), inlink('view', "executionID=$executionID"))); } @@ -4151,8 +4151,8 @@ class execution extends control foreach($planStory as $id => $story) { - $projectProducts = zget($projectProducts, $story->product, array()); - if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($projectProducts) and !isset($projectProducts[$story->branch]))) + $projectBranches = zget($projectProducts, $story->product, array()); + if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($projectBranches) and !isset($projectBranches[$story->branch]))) { $count++; unset($planStory[$id]); diff --git a/module/execution/model.php b/module/execution/model.php index 171b9b1700..8aecc43b56 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -2896,7 +2896,7 @@ class executionModel extends model { if(empty($planIdList)) continue; $planIdList = explode(',', $planIdList); - $executionProducts = zget($executionProducts, $productID, array()); + $executionBranches = zget($executionProducts, $productID, array()); foreach($planIdList as $planID) { $planStory = $this->story->getPlanStories($planID); @@ -2904,7 +2904,7 @@ class executionModel extends model { foreach($planStory as $id => $story) { - if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($executionProducts) and !isset($executionProducts[$story->branch]))) + if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($executionBranches) and !isset($executionBranches[$story->branch]))) { unset($planStory[$id]); continue; diff --git a/module/productplan/model.php b/module/productplan/model.php index bf7c2870a9..477441d052 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -1085,8 +1085,8 @@ class productplanModel extends model foreach($planStory as $id => $story) { - $projectProducts = zget($projectProducts, $story->product, array()); - if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($projectProducts) and !isset($projectProducts[$story->branch]))) + $projectBranches = zget($projectProducts, $story->product, array()); + if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($projectBranches) and !isset($projectBranches[$story->branch]))) { unset($planStory[$id]); continue; diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php index 2d511c25cf..3c32c76524 100644 --- a/module/story/view/edit.html.php +++ b/module/story/view/edit.html.php @@ -192,8 +192,8 @@ type != 'normal'):?> From 6c3e107f781b2b2dd8553bb5974fc4aaf51a5417 Mon Sep 17 00:00:00 2001 From: chaideqing Date: Thu, 1 Dec 2022 10:16:26 +0800 Subject: [PATCH 139/267] * Refactor code. --- module/execution/js/taskkanban.js | 2 +- module/execution/lang/de.php | 2 +- module/execution/lang/en.php | 2 +- module/execution/lang/fr.php | 2 +- module/execution/lang/zh-cn.php | 2 +- module/execution/lang/zh-tw.php | 2 +- module/execution/view/taskkanban.html.php | 2 +- module/kanban/model.php | 2 +- module/task/model.php | 4 ++-- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/module/execution/js/taskkanban.js b/module/execution/js/taskkanban.js index e7192cbed5..43b458c1eb 100644 --- a/module/execution/js/taskkanban.js +++ b/module/execution/js/taskkanban.js @@ -288,7 +288,7 @@ function renderTaskItem(item, $item, col) var priHtml = '' + item.pri + ''; var hoursHtml = scaleSize <= 1 && item.status != 'wait' ? ('' + taskLang.leftAB + ' ' + item.left + 'h') : ('' + taskLang.estimateAB + ' ' + item.estimate + 'h'); var avatarHtml = ''; - if(item.assignedTo == '' && item.mode == 'multi') avatarHtml = renderUserAvatar({title: item.assignedMembers, realname: iconTeam}, 'task', item.id, '', col.type); + if(item.assignedTo == '' && item.mode == 'multi') avatarHtml = renderUserAvatar({title: item.teamMembers, realname: teamWords}, 'task', item.id, '', col.type); else avatarHtml = renderUserAvatar(item.assignedTo, 'task', item.id, '', col.type); var $infos = $item.find('.infos'); if(!$infos.length) $infos = $('
    '); diff --git a/module/execution/lang/de.php b/module/execution/lang/de.php index 0d0f5fbd7e..48973a57cf 100644 --- a/module/execution/lang/de.php +++ b/module/execution/lang/de.php @@ -478,7 +478,7 @@ $lang->execution->kanbanViewList['story'] = "{$lang->SRCommon}"; $lang->execution->kanbanViewList['bug'] = 'Bug'; $lang->execution->kanbanViewList['task'] = 'Task'; -$lang->execution->iconTeam = 'Team'; +$lang->execution->teamWords = 'Team'; $lang->kanbanSetting = new stdclass(); $lang->kanbanSetting->noticeReset = 'Möchten Sie die Einstellungen des Kanbans zurücksetzen?'; diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index 220e646a7d..45d52cf3bc 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -478,7 +478,7 @@ $lang->execution->kanbanViewList['story'] = "{$lang->SRCommon}"; $lang->execution->kanbanViewList['bug'] = 'Bug'; $lang->execution->kanbanViewList['task'] = 'Task'; -$lang->execution->iconTeam = 'Team'; +$lang->execution->teamWords = 'Team'; $lang->kanbanSetting = new stdclass(); $lang->kanbanSetting->noticeReset = 'Do you want to reset Kanban?'; diff --git a/module/execution/lang/fr.php b/module/execution/lang/fr.php index 550fa7556d..5b39ac9731 100644 --- a/module/execution/lang/fr.php +++ b/module/execution/lang/fr.php @@ -478,7 +478,7 @@ $lang->execution->kanbanViewList['story'] = "{$lang->SRCommon}"; $lang->execution->kanbanViewList['bug'] = 'Bug'; $lang->execution->kanbanViewList['task'] = 'Task'; -$lang->execution->iconTeam = 'Team'; +$lang->execution->teamWords = 'Team'; $lang->kanbanSetting = new stdclass(); $lang->kanbanSetting->noticeReset = 'Voulez-vous réinitialiser le tableau Kanban ?'; diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index 09f48080d5..3ff779523e 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -478,7 +478,7 @@ $lang->execution->kanbanViewList['story'] = "{$lang->SRCommon}看板"; $lang->execution->kanbanViewList['bug'] = 'Bug看板'; $lang->execution->kanbanViewList['task'] = '任务看板'; -$lang->execution->iconTeam = '团队'; +$lang->execution->teamWords = '团队'; $lang->kanbanSetting = new stdclass(); $lang->kanbanSetting->noticeReset = '是否恢复看板默认设置?'; diff --git a/module/execution/lang/zh-tw.php b/module/execution/lang/zh-tw.php index 05ba21bbf9..7f5baf81ea 100644 --- a/module/execution/lang/zh-tw.php +++ b/module/execution/lang/zh-tw.php @@ -453,6 +453,6 @@ $lang->execution->statusColorList['doing'] = '#0BD986'; $lang->execution->statusColorList['suspended'] = '#fdc137'; $lang->execution->statusColorList['closed'] = '#838A9D'; -$lang->execution->iconTeam = '團隊'; +$lang->execution->teamWords = '團隊'; $lang->execution->boardColorList = array('#32C5FF', '#006AF1', '#9D28B2', '#FF8F26', '#7FBB00', '#424BAC', '#66c5f8', '#EC2761'); diff --git a/module/execution/view/taskkanban.html.php b/module/execution/view/taskkanban.html.php index 82f91e7280..847dee3671 100644 --- a/module/execution/view/taskkanban.html.php +++ b/module/execution/view/taskkanban.html.php @@ -231,5 +231,5 @@ js::set('priv', config->minColWidth);?> config->maxColWidth);?> -execution->iconTeam);?> +execution->teamWords);?> diff --git a/module/kanban/model.php b/module/kanban/model.php index 4e8773e766..a36be67f92 100755 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -1514,7 +1514,7 @@ class kanbanModel extends model $cardData['mode'] = $object->mode; if($object->mode == 'multi') { - $cardData['assignedMembers'] = $object->assignedMembers; + $cardData['teamMembers'] = $object->teamMembers; } } else diff --git a/module/task/model.php b/module/task/model.php index 13b9baf141..960a8cd295 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -3208,12 +3208,12 @@ class taskModel extends model if($task->mode == 'multi') { - $assignedMembers = $this->dao->select('t1.realname')->from(TABLE_USER)->alias('t1') + $teamMembers = $this->dao->select('t1.realname')->from(TABLE_USER)->alias('t1') ->leftJoin(TABLE_TASKTEAM)->alias('t2') ->on('t1.account = t2.account') ->where('t2.task')->eq($task->id) ->fetchPairs(); - $task->assignedMembers= join(',', array_keys($assignedMembers)); + $task->teamMembers= join(',', array_keys($teamMembers)); } return $task; From 756a9dc5a5c551b399ad9eb2aa1a186eb551fa52 Mon Sep 17 00:00:00 2001 From: chaideqing Date: Thu, 1 Dec 2022 10:25:28 +0800 Subject: [PATCH 140/267] * Add vi lang. --- module/execution/lang/vi.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/execution/lang/vi.php b/module/execution/lang/vi.php index bd77c671f5..a36a7e6119 100644 --- a/module/execution/lang/vi.php +++ b/module/execution/lang/vi.php @@ -436,4 +436,6 @@ $lang->execution->statusColorList['doing'] = '#0BD986'; $lang->execution->statusColorList['suspended'] = '#fdc137'; $lang->execution->statusColorList['closed'] = '#838A9D'; +$lang->execution->teamWords = 'đội'; + $lang->execution->boardColorList = array('#32C5FF', '#006AF1', '#9D28B2', '#FF8F26', '#7FBB00', '#424BAC', '#66c5f8', '#EC2761'); From 283b37b65e96e94c8be582dc20bbc6b2052d1620 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 1 Dec 2022 10:26:12 +0800 Subject: [PATCH 141/267] * adjust for task #77615,77616. --- module/bug/control.php | 9 +++++---- module/bug/js/create.js | 3 ++- module/bug/model.php | 2 +- module/bug/view/activate.html.php | 6 +++++- module/build/control.php | 2 +- module/build/model.php | 3 ++- module/mr/control.php | 4 ++-- module/my/model.php | 4 ++-- module/productplan/control.php | 4 ++-- module/release/control.php | 2 +- module/release/model.php | 2 +- 11 files changed, 24 insertions(+), 17 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 96e5c208ca..26ca24c706 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -1936,10 +1936,11 @@ class bug extends control $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); $this->view->position[] = $this->lang->bug->activate; - $this->view->bug = $bug; - $this->view->users = $this->user->getPairs('noclosed', $bug->resolvedBy); - $this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $bug->branch, 'noempty,noreleased', 0, 'execution', $bug->openedBuild); - $this->view->actions = $this->action->getList('bug', $bugID); + $this->view->bug = $bug; + $this->view->users = $this->user->getPairs('noclosed', $bug->resolvedBy); + $this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $bug->branch, 'noempty,noreleased', 0, 'execution', $bug->openedBuild); + $this->view->actions = $this->action->getList('bug', $bugID); + $this->view->releasedBuilds = $this->loadModel('release')->getReleasedBuilds($productID); $this->display(); } diff --git a/module/bug/js/create.js b/module/bug/js/create.js index dd9892d975..6590029f6e 100644 --- a/module/bug/js/create.js +++ b/module/bug/js/create.js @@ -124,6 +124,7 @@ $(function() }); }); -$(window).unload(function(){ +$(window).unload(function() +{ if(blockID) window.parent.refreshBlock($('#block' + blockID)); }); diff --git a/module/bug/model.php b/module/bug/model.php index be1187583c..0bcbe446fd 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1619,7 +1619,7 @@ class bugModel extends model $this->config->bug->search['params']['module']['values'] = $modules; $this->config->bug->search['params']['execution']['values'] = $this->loadModel('product')->getExecutionPairsByProduct($productID, 0, 'id_desc', $projectID); $this->config->bug->search['params']['severity']['values'] = array(0 => '') + $this->lang->bug->severityList; //Fix bug #939. - $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($productID, 'all', 'withbranch'); + $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($productID, 'all', 'withbranch|releasetag'); $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values']; if($this->session->currentProductType == 'normal') { diff --git a/module/bug/view/activate.html.php b/module/bug/view/activate.html.php index e2f5fce4da..a8b7517a92 100644 --- a/module/bug/view/activate.html.php +++ b/module/bug/view/activate.html.php @@ -37,7 +37,7 @@ printExtendFields($bug, 'table');?>
    - + @@ -56,4 +56,8 @@
    +build->releasedBuild); +?> diff --git a/module/build/control.php b/module/build/control.php index b77f4aa391..f2772a442f 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -720,7 +720,7 @@ class build extends control $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairsForStory($build->product, $build->branch, 'skipParent'); $this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($build->product, 'bug', 0, $build->branch); $this->config->bug->search['params']['execution']['values'] = $this->loadModel('product')->getExecutionPairsByProduct($build->product, $build->branch, 'id_desc', $this->session->project); - $this->config->bug->search['params']['openedBuild']['values'] = $this->build->getBuildPairs($build->product, $branch = 'all', $params = ''); + $this->config->bug->search['params']['openedBuild']['values'] = $this->build->getBuildPairs($build->product, $branch = 'all', $params = 'releasetag'); $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values']; unset($this->config->bug->search['fields']['product']); diff --git a/module/build/model.php b/module/build/model.php index 2225863208..192d70cb83 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -234,7 +234,7 @@ class buildModel extends model * * @param int|array $products * @param string|int $branch - * @param string $params noempty|notrunk|noterminate|withbranch|hasproject|noDeleted|singled|noreleased, can be a set of them + * @param string $params noempty|notrunk|noterminate|withbranch|hasproject|noDeleted|singled|noreleased|releasedtag, can be a set of them * @param string|int $objectID * @param string $objectType * @param int|array $buildIdList @@ -327,6 +327,7 @@ class buildModel extends model $releaseName = $release->name; $branchName = $release->branchName ? $release->branchName : $this->lang->branch->main; if($release->productType != 'normal') $releaseName = (strpos($params, 'withbranch') !== false ? $branchName . '/' : '') . $releaseName; + if(strpos($params, 'releasetag') !== false) $releaseName = "[{$this->lang->build->releasedBuild}] " . $releaseName; $builds[$release->date][$release->shadow] = $releaseName; foreach(explode(',', trim($release->build, ',')) as $buildID) { diff --git a/module/mr/control.php b/module/mr/control.php index 310c1990fa..29e52b43a5 100644 --- a/module/mr/control.php +++ b/module/mr/control.php @@ -697,8 +697,8 @@ class mr extends control $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($productID => $productID)); $this->config->bug->search['params']['module']['values'] = $modules; $this->config->bug->search['params']['execution']['values'] = $this->product->getExecutionPairsByProduct($productID); - $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($productID, $branch = 'all', $params = ''); - $this->config->bug->search['params']['resolvedBuild']['values'] = $this->loadModel('build')->getBuildPairs($productID, $branch = 'all', $params = ''); + $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($productID, $branch = 'all', $params = 'releasetag'); + $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values']; unset($this->config->bug->search['fields']['product']); if($product->type == 'normal') diff --git a/module/my/model.php b/module/my/model.php index 996f2c9137..7cb33794fd 100644 --- a/module/my/model.php +++ b/module/my/model.php @@ -640,7 +640,7 @@ class myModel extends model $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs(); $this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getAllModulePairs(); $this->config->bug->search['params']['severity']['values'] = array(0 => '') + $this->lang->bug->severityList; - $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($products); + $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($products, 'all', 'releasetag'); $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values']; $this->loadModel('search')->setSearchParams($this->config->bug->search); @@ -911,7 +911,7 @@ class myModel extends model $this->config->ticket->search['params']['module']['values'] = array('' => '') + $this->loadModel('tree')->getAllModulePairs(); $grantProducts = $this->loadModel('feedback')->getGrantProducts(); $productIDlist = array_keys($grantProducts); - $this->config->ticket->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($productIDlist); + $this->config->ticket->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($productIDlist, 'all', 'releasetag'); $this->loadModel('search')->setSearchParams($this->config->ticket->search); } diff --git a/module/productplan/control.php b/module/productplan/control.php index 780601d007..cce8f8b09d 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -809,8 +809,8 @@ class productplan extends control $this->config->bug->search['style'] = 'simple'; $this->config->bug->search['params']['plan']['values'] = $this->productplan->getPairsForStory($productID, $plan->branch, 'skipParent|withMainPlan'); $this->config->bug->search['params']['execution']['values'] = $this->loadModel('product')->getExecutionPairsByProduct($plan->product, $plan->branch); - $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($productID, $branch = 'all', $params = ''); - $this->config->bug->search['params']['resolvedBuild']['values'] = $this->build->getBuildPairs($productID, $branch = 'all', $params = ''); + $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($productID, $branch = 'all', $params = 'releasetag'); + $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values']; $this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($plan->product, 'bug', 0, $plan->branch); $this->config->bug->search['params']['project']['values'] = $this->product->getProjectPairsByProduct($productID, $plan->branch); diff --git a/module/release/control.php b/module/release/control.php index dae973d2ca..360cad5302 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -623,7 +623,7 @@ class release extends control $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairsForStory($release->product, $release->branch, 'skipParent|withMainPlan'); $this->config->bug->search['params']['execution']['values'] = $this->loadModel('product')->getExecutionPairsByProduct($release->product, $release->branch); - $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($release->product, $branch = 'all'); + $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($release->product, $branch = 'all', 'releasetag'); $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values']; $searchModules = array(); diff --git a/module/release/model.php b/module/release/model.php index 753ecde136..4b8930bcc1 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -123,7 +123,7 @@ class releaseModel extends model $buildIdList = array(); foreach($releases as $release) { - if($branch != 'all') + if($branch != 'all' and $branch !== '') { $inBranch = false; foreach(explode(',', trim($release->branch, ',')) as $branchID) From a6c81712860c0c2c62ba1daa87285e48277d6497 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 1 Dec 2022 10:33:59 +0800 Subject: [PATCH 142/267] * Fix bug #30278. --- module/execution/control.php | 4 ++-- module/tree/model.php | 15 +++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 60812612b8..6ea8d61fc6 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1097,7 +1097,7 @@ class execution extends control $modules = $this->tree->getAllModulePairs('bug'); /* Get module tree.*/ - $extra = array('executionID' => $executionID, 'orderBy' => $orderBy, 'type' => $type, 'build' => $build, 'branchID' => $branch); + $extra = array('projectID' => $executionID, 'orderBy' => $orderBy, 'type' => $type, 'build' => $build, 'branchID' => $branch); if($executionID and empty($productID) and count($products) > 1) { $moduleTree = $this->tree->getBugTreeMenu($executionID, $productID, 0, array('treeModel', 'createBugLink'), $extra); @@ -1205,7 +1205,7 @@ class execution extends control } else { - $moduleTree = $this->tree->getTreeMenu($productID, 'case', 0, array('treeModel', 'createCaseLink'), array('executionID' => $executionID, 'productID' => $productID), $branchID); + $moduleTree = $this->tree->getTreeMenu($productID, 'case', 0, array('treeModel', 'createCaseLink'), array('projectID' => $executionID, 'productID' => $productID), $branchID); } $tree = $moduleID ? $this->tree->getByID($moduleID) : ''; diff --git a/module/tree/model.php b/module/tree/model.php index 3a11582c03..c84f818e66 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -425,10 +425,9 @@ class treeModel extends model $this->loadModel('branch'); $projectID = zget($extra, 'projectID', 0); - $executionID = zget($extra, 'executionID', 0); $branches = array($branch => ''); $executionModules = array(); - if($branch and empty($projectID) and empty($executionID)) + if($branch and empty($projectID)) { $branchName = $this->branch->getById($branch); $branches = array($branch => $branchName); @@ -438,15 +437,15 @@ class treeModel extends model $manage = $userFunc[1] == 'createManageLink' ? true : false; $product = $this->loadModel('product')->getById($rootID); - $onlyGetLinked = (($projectID or $executionID) and $this->config->vision != 'lite'); - if(strpos('story|bug|case', $type) !== false and $branch === 'all' and empty($projectID) and empty($executionID)) + $onlyGetLinked = ($projectID and $this->config->vision != 'lite'); + if(strpos('story|bug|case', $type) !== false and $branch === 'all' and empty($projectID)) { if($product->type != 'normal') $branches = array(BRANCH_MAIN => $this->lang->branch->main) + $this->loadModel('branch')->getPairs($rootID, 'noempty'); } elseif(strpos(',case,bug,', ",$type,") !== false and $this->app->tab == 'execution') { - if($product->type != 'normal' and $executionID) $branches += $this->branch->getPairs($product->id, 'noempty', $executionID); - if($onlyGetLinked) $executionModules = $this->getTaskTreeModules($executionID, true, $type, array('branchID' => $branch)); + if($product->type != 'normal' and $projectID) $branches += $this->branch->getPairs($product->id, 'noempty', $projectID); + if($onlyGetLinked) $executionModules = $this->getTaskTreeModules($projectID, true, $type, array('branchID' => $branch)); } elseif(($type == 'story' and $this->app->rawModule == 'projectstory') or (strpos(',case,bug,', ",$type,") !== false and $this->app->tab == 'project')) { @@ -1259,7 +1258,7 @@ class treeModel extends model $param = "root={$module->root}&branch=&type=byModule¶m={$module->id}"; $extra['type'] = (isset($extra['type']) and $extra['type'] != 'bysearch') ? $extra['type'] : 'all'; - if($this->app->tab == 'execution') $param = "execuitonID={$extra['executionID']}&productID={$module->root}&branch={$extra['branchID']}&orderBy={$extra['orderBy']}&build={$extra['build']}&type={$extra['type']}¶m={$module->id}"; + if($this->app->tab == 'execution') $param = "execuitonID={$extra['projectID']}&productID={$module->root}&branch={$extra['branchID']}&orderBy={$extra['orderBy']}&build={$extra['build']}&type={$extra['type']}¶m={$module->id}"; if($this->app->tab == 'project') $param = "projectID={$extra['projectID']}&productID={$module->root}&branch={$extra['branchID']}&orderBy={$extra['orderBy']}&build={$extra['build']}&type={$extra['type']}¶m={$module->id}"; return html::a(helper::createLink($moduleName, $methodName, $param), $module->name, '_self', "id='module{$module->id}' title='{$module->name}'"); } @@ -1278,7 +1277,7 @@ class treeModel extends model $moduleName = strpos(',project,execution,', ",{$this->app->tab},") !== false ? $this->app->tab : 'testcase'; $methodName = strpos(',project,execution,', ",{$this->app->tab},") !== false ? 'testcase' : 'browse'; $param = $this->app->tab == 'project' ? "projectID={$this->session->project}&" : ""; - $param = $this->app->tab == 'execution' ? "executionID={$extra['executionID']}&" : $param; + $param = $this->app->tab == 'execution' ? "executionID={$extra['projectID']}&" : $param; return html::a(helper::createLink($moduleName, $methodName, $param . "root={$module->root}&branch={$extra['branchID']}&type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}' data-app='{$this->app->tab}' title='{$module->name}'"); } From 6263ee7a5c19cb776a6a03154cec0ebeacef4739 Mon Sep 17 00:00:00 2001 From: Yagami Date: Thu, 1 Dec 2022 10:34:23 +0800 Subject: [PATCH 143/267] * Code for task #77801. --- module/project/css/create.css | 16 +-- module/project/js/create.js | 187 +++++++++++++++------------- module/project/model.php | 35 +++--- module/project/view/create.html.php | 45 ++++++- www/js/my.full.js | 7 +- 5 files changed, 172 insertions(+), 118 deletions(-) diff --git a/module/project/css/create.css b/module/project/css/create.css index 444ddd1b34..3036ebd760 100755 --- a/module/project/css/create.css +++ b/module/project/css/create.css @@ -15,14 +15,14 @@ #budget {border-right: 0px;} #budgetUnit {border-left: 0px;} #projectName {display: inline-block; width: 32%;} -#productsBox a {border-radius: 2px !important;} -#productsBox .col-sm-4 {padding-right: 5px;} -#productsBox .required:after {right: -9.5px !important;} -#productsBox .addProduct {padding-left: 0px !important; padding-right: 10px;} -#productsBox .addProduct.required:after {right: -1px !important;} -#productsBox .input-group-addon > div {display: inline-block !important;} -#productsBox .required + .text-danger.help-text {position: relative; left: 10px;} -#productsBox > #productNameLabel {padding-top: 8px;} +.productsBox a {border-radius: 2px !important;} +.productsBox .col-sm-4 {padding-right: 5px;} +.productsBox .required:after {right: -9.5px !important;} +.productsBox .addProduct {padding-left: 0px !important;} +.productsBox .addProduct.required:after {right: -1px !important;} +.productsBox .input-group-addon > div {display: inline-block !important;} +.productsBox .required + .text-danger.help-text {position: relative; left: 10px;} +.productsBox > #productNameLabel {padding-top: 8px;} #plansBox .col-sm-4 {float: none; display: inline-block; padding-right: 5px;} .futureBox {vertical-align: top !important; padding-top: 13px !important;} #projectType {padding-top: 7px !important;} diff --git a/module/project/js/create.js b/module/project/js/create.js index 64daca13ba..7bce25f5f7 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -11,7 +11,7 @@ $(function() if(hasProduct == 1) { var chosenProducts = 0; - $("#productsBox select[name^='products']").each(function() + $(".productsBox select[name^='products']").each(function() { if($(this).val() > 0) chosenProducts ++; }); @@ -31,14 +31,14 @@ $(function() if(typeof(currentPlanID) == 'undefined') { - $('#productsBox select[id^="products"]').each(function() + $('.productsBox select[id^="products"]').each(function() { - var branchID = 0; - if($(this).closest('.input-group').find('select[id^="branch"]').size() > 0) + var branch = 0; + if($(this).closest('.table-row').find('select[name^="branch"]').size() > 0) { - var branchID = $(this).closest('.input-group').find('select[id^="branch"]').val(); + var branch = $(this).closest('.table-row').find('select[name^="branch"]'); } - loadPlans($(this), branchID); + loadPlans($(this), branch); }); } @@ -63,7 +63,7 @@ $(function() $('#daysLabelInfo').remove(); /* Determine whether the products of the same branch are linked. */ - $("#productsBox select[name^='products']").each(function() + $(".productsBox select[name^='products']").each(function() { var productID = $(this).val(); if(typeof(products[productID]) == 'undefined') products[productID] = new Array(); @@ -98,7 +98,6 @@ $(function() } /* Init for copy execution. */ - $("select[id^=branch]").each(disableSelectedBranch); disableSelectedProduct(); /* Check the all products and branches control when uncheck the product. */ @@ -106,14 +105,10 @@ $(function() { if($(this).val() == 0) { - $("select[id^='branch']").each(disableSelectedBranch); - disableSelectedProduct(); } }); - $(document).on('change', "select[id^='branch']", disableSelectedBranch); - if(copyProjectID > 0 && copyType != 'previous') { $('#name').addClass('has-info') @@ -167,7 +162,7 @@ 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-4 .input-group').each(function(index) { var selectedProduct = $(this).find('[name^=products]').val(); var selectedBranch = $(this).find('[name^=branch]').val(); @@ -177,7 +172,7 @@ function setParentProgram(parentProgram) $(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')); + $('.productsBox .row .col-sm-4:last').find('.input-group').append($('.productsBox .addProduct .input-group:first .input-group-addon').prop('outerHTML')); } if(parentProgram != 0) @@ -198,13 +193,13 @@ function setParentProgram(parentProgram) if(parentProgram != '0') { - $('#productsBox .addProduct .input-group:first').addClass('required'); - $('#productsBox .row .input-group:first').addClass('required'); + $('.productsBox .addProduct .input-group:first').addClass('required'); + $('.productsBox .row .input-group:first').addClass('required'); } else { - $('#productsBox .addProduct .input-group').removeClass('required'); - $('#productsBox .row .input-group').removeClass('required'); + $('.productsBox .addProduct .input-group').removeClass('required'); + $('.productsBox .row .input-group').removeClass('required'); } } @@ -232,35 +227,35 @@ function addNewProduct(obj) if($(obj).attr('checked')) { /* Hide product and plan dropdown controls. */ - $('#productsBox .row .col-sm-4').addClass('hidden'); - $('#productsBox .row .col-sm-4 .input-group').find('select').attr('disabled', true).trigger("chosen:updated"); - $('#plansBox').closest('tr').addClass('hidden'); - $('#plansBox .col-sm-4').find('select').attr('disabled', true).trigger("chosen:updated"); + $('.newLine').addClass('hidden'); + $('.productsBox .row').addClass('hidden'); + $('.productsBox .row .input-group').find('select').attr('disabled', true).trigger("chosen:updated"); $('.division').addClass('hide'); /* Displays the input box for creating a product. */ + $(obj).closest('td').attr('colspan', 1); $("[name^='newProduct']").prop('checked', true); $('#productName').removeAttr('disabled', true); - $('#productsBox .addProduct').removeClass('hidden'); + $('.productsBox .addProduct').removeClass('hidden'); $('#productTitle').html(productName); } else { /* Show product and product dropdown controls. */ - $('#productsBox .row .col-sm-4').removeClass('hidden'); - $('#productsBox .row .col-sm-4 .input-group').find('select').removeAttr('disabled').trigger("chosen:updated"); - $('#plansBox').closest('tr').removeClass('hidden'); - $('#plansBox .col-sm-4').find('select').removeAttr('disabled', true).trigger("chosen:updated"); + $('.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'); /* Hide the input box for creating a product. */ + $(obj).closest('td').attr('colspan', 3); $("[name^='newProduct']").prop('checked', false); $('#productName').attr('disabled', true); - $('#productsBox .addProduct').addClass('hidden'); + $('.productsBox .addProduct').addClass('hidden'); $('#productTitle').html(manageProducts); } - $('#productsBox div + .text-danger.help-text').remove(); + $('.productsBox div + .text-danger.help-text').remove(); } /** @@ -295,7 +290,7 @@ function loadBranches(product) $("#planDefault").remove(); var chosenProducts = []; - $("#productsBox select[name^='products']").each(function() + $(".productsBox select[name^='products']").each(function() { var $product = $(product); var productID = $(this).val(); @@ -311,111 +306,127 @@ function loadBranches(product) (chosenProducts.length > 1 && model == 'waterfall') ? $('.division').removeClass('hide') : $('.division').addClass('hide'); - if($('#productsBox .row .input-group:last select:first').val() != 0) + /* + if($('.productsBox .row .input-group:last select:first').val() != 0) { - var length = $('#productsBox .row .input-group').size(); - var $html = $('#productsBox .row .col-sm-4:last').html().replace('required', ''); - $('#productsBox .row .col-sm-4:last').find('.input-group-addon').remove(); - $('#productsBox .row').append('
    ' + $html + '
    '); - if($('#productsBox .row .input-group:last select').size() >= 2) $('#productsBox .row .input-group:last select:last').remove(); - $('#productsBox .row .input-group:last .chosen-container').remove(); - $('#productsBox .row .input-group:last select:first').attr('name', 'products[' + length + ']').attr('id', 'products' + length); - $('#productsBox .row .input-group:last .chosen').chosen(); + var length = $('.productsBox .row .input-group').size(); + var $html = $('.productsBox .row .col-sm-4:last').html().replace('required', ''); + $('.productsBox .row .col-sm-4:last').find('.input-group-addon').remove(); + $('.productsBox .row').append('
    ' + $html + '
    '); + if($('.productsBox .row .input-group:last select').size() >= 2) $('.productsBox .row .input-group:last select:last').remove(); + $('.productsBox .row .input-group:last .chosen-container').remove(); + $('.productsBox .row .input-group:last select:first').attr('name', 'products[' + length + ']').attr('id', 'products' + length); + $('.productsBox .row .input-group:last .chosen').chosen(); $('[data-toggle="popover"]').popover(); adjustProductBoxMargin(); } + */ - var $inputgroup = $(product).closest('.input-group'); - if($inputgroup.find('select').size() >= 2) $inputgroup.removeClass('has-branch').find('select:last').remove(); - if($inputgroup.find('.chosen-container').size() >= 2) $inputgroup.find('.chosen-container:last').remove(); - - var index = $inputgroup.find('select:first').attr('id').replace('products' , ''); + var $tableRow = $(product).closest('.table-row'); + var index = $tableRow.find('select:first').attr('id').replace('products' , ''); var oldBranch = $(product).attr('data-branch') !== undefined ? $(product).attr('data-branch') : 0; + if($(product).val() != 0) + { + $(product).closest('tr').find('.newProduct').addClass('hidden') + } + else + { + $(product).closest('tr').find('.newProduct').removeClass('hidden') + } + + if(!multiBranchProducts[$(product).val()]) + { + $tableRow.find('.table-col:last select').val('').trigger('chosen:updated'); + $tableRow.find('.table-col:last').addClass('hidden'); + } + $.get(createLink('branch', 'ajaxGetBranches', "productID=" + $(product).val() + "&oldBranch=" + oldBranch + "¶m=active"), function(data) { if(data) { - $inputgroup.addClass('has-branch').append(data); - $inputgroup.find('select:last').attr('name', 'branch[' + index + ']').attr('id', 'branch' + index).attr('onchange', "loadPlans('#products" + index + "', this.value)").chosen(); + $tableRow.find("select[name^='branch']").replaceWith(data); + $tableRow.find('.table-col:last .chosen-container').remove(); + $tableRow.find('.table-col:last').removeClass('hidden'); + $tableRow.find("select[name^='branch']").attr('multiple', '').attr('name', 'branch[' + index + '][]').attr('id', 'branch' + index).attr('onchange', "loadPlans('#products" + index + "', this)").chosen(); - $inputgroup.find('select:last').each(disableSelectedBranch); disableSelectedProduct(); } - var branchID = $('#branch' + index).val(); - loadPlans(product, branchID); + var branch = $('#branch' + index); + loadPlans(product, branch); }); - - if(!multiBranchProducts[$(product).val()]) disableSelectedProduct(); } /** * Load plans. * * @param obj $product - * @param int $branchID + * @param obj $branchID * @access public * @return void */ -function loadPlans(product, branchID) +function loadPlans(product, branch) { - if($('#plansBox').size() == 0) return false; - var productID = $(product).val(); - var branchID = typeof(branchID) == 'undefined' ? 0 : branchID; + var branchID = $(branch).val() == null ? 0 : $(branch).val(); var planID = $(product).attr('data-plan') !== undefined ? $(product).attr('data-plan') : 0; var index = $(product).attr('id').replace('products', ''); - $.get(createLink('product', 'ajaxGetPlans', "productID=" + productID + '&branch=0,' + branchID + '&planID=' + planID + '&fieldID&needCreate=&expired=unexpired,noclosed¶m=skipParent,multiple'), function(data) + $.get(createLink('product', 'ajaxGetPlans', "productID=" + productID + '&branch=' + branchID + '&planID=' + planID + '&fieldID&needCreate=&expired=unexpired,noclosed¶m=skipParent,multiple'), function(data) { if(data) { - if($("div#plan" + index).size() == 0) $("#plansBox .row").append('
    '); - $("div#plan" + index).html(data).find('select').attr('name', 'plans[' + productID + '][' + branchID + '][]').attr('id', 'plans' + productID).chosen(); - - adjustPlanBoxMargin(); + $("div#plan" + index).find("select[name^='plans']").replaceWith(data); + $("div#plan" + index).find('.chosen-container').remove(); + $("div#plan" + index).find('select').attr('name', 'plans[' + productID + '][' + branchID + '][]').attr('id', 'plans' + productID).chosen(); } }); } /** - * Adjust product box margin. - * + * Add new line for link product. + * + * @param obj $obj * @access public * @return void */ -function adjustProductBoxMargin() +function addNewLine(obj) { - var productRows = Math.ceil($('#productsBox > .row > .col-sm-4').length / 3); - if(productRows > 1) + var newLine = $(obj).closest('tr').clone(); + var index = 0; + $(".productsBox select[name^='products']").each(function() { - for(i = 1; i <= productRows - 1; i++) - { - $('#productsBox .row .col-sm-4:lt(' + (i * 3) + ')').css('margin-bottom', '10px'); - $('#productsBox .row .col-sm-4').eq(i * 3).css('padding-right', '6px'); - } - } + var id = $(this).attr('id').replace('products' , ''); + + id = parseInt(id); + id ++; + + index = id > index ? id : index; + }) + + newLine.find('.newProduct').remove(); + newLine.find('.addProduct').remove(); + newLine.addClass('newLine'); + newLine.find('th').html(''); + newLine.find('.removeLine').css('visibility', 'visible'); + newLine.find('.chosen-container').remove(); + newLine.find('.productsBox .table-col:last').addClass('hidden'); + newLine.find("select[name^='products']").attr('name', 'products[' + index + ']').attr('id', 'products' + index).chosen(); + newLine.find("select[name^='plans']").attr('name', 'plans[' + index + '][' + 0 + '][]').chosen(); + newLine.find("div[id^='plan']").attr('id', 'plan' + index); + + $(obj).closest('tr').after(newLine); + var product = newLine.find("select[name^='products']"); + var branch = newLine.find("select[name^='branch']"); + loadPlans(product, branch); + disableSelectedProduct(); } -/** - * Adjust plan box margin. - * - * @access public - * @return void - */ -function adjustPlanBoxMargin() +function removeLine(obj) { - var planRows = Math.ceil($('#plansBox > .row > .col-sm-4').length / 3); - if(planRows > 1) - { - for(j = 1; j <= planRows - 1; j++) - { - $('#plansBox .col-sm-4:lt(' + (j * 3) + ')').css('margin-bottom', '10px'); - $('#plansBox .col-sm-4').eq(j * 3).css('padding-right', '6px'); - } - } + $(obj).closest('tr').remove(); } /** diff --git a/module/project/model.php b/module/project/model.php index 5804db56cb..81b3bc3dd9 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2404,24 +2404,29 @@ class projectModel extends model $oldPlan = 0; $branch = isset($branches[$i]) ? $branches[$i] : 0; - if(isset($existedProducts[$productID][$branch])) continue; + if(!is_array($branch)) $branch = array($branch => $branch); - if(isset($oldProjectProducts[$productID][$branch])) + foreach($branch as $branchID) { - $oldProjectProduct = $oldProjectProducts[$productID][$branch]; - if($this->app->rawMethod != 'edit') $oldPlan = $oldProjectProduct->plan; + if(isset($existedProducts[$productID][$branchID])) continue; + + if(isset($oldProjectProducts[$productID][$branchID])) + { + $oldProjectProduct = $oldProjectProducts[$productID][$branchID]; + if($this->app->rawMethod != 'edit') $oldPlan = $oldProjectProduct->plan; + } + + $data = new stdclass(); + $data->project = $projectID; + $data->product = $productID; + $data->branch = $branchID; + $data->plan = isset($plans[$productID][$branchID]) ? implode(',', $plans[$productID][$branchID]) : $oldPlan; + $data->plan = trim($data->plan, ','); + $data->plan = empty($data->plan) ? 0 : ",$data->plan,"; + + $this->dao->insert(TABLE_PROJECTPRODUCT)->data($data)->exec(); + $existedProducts[$productID][$branchID] = true; } - - $data = new stdclass(); - $data->project = $projectID; - $data->product = $productID; - $data->branch = $branch; - $data->plan = isset($plans[$productID][$branch]) ? implode(',', $plans[$productID][$branch]) : $oldPlan; - $data->plan = trim($data->plan, ','); - $data->plan = empty($data->plan) ? 0 : ",$data->plan,"; - - $this->dao->insert(TABLE_PROJECTPRODUCT)->data($data)->exec(); - $existedProducts[$productID][$branch] = true; } /* Delete the execution linked products that is not linked with the execution. */ diff --git a/module/project/view/create.html.php b/module/project/view/create.html.php index f80f3bea14..5c1b77ab19 100755 --- a/module/project/view/create.html.php +++ b/module/project/view/create.html.php @@ -139,6 +139,49 @@
    + + + + diff --git a/www/js/my.full.js b/www/js/my.full.js index 30bf823463..24a60642db 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -1044,12 +1044,7 @@ function disableSelectedProduct() $("select[id^='products']").each(function() { var selectedProduct = $(this).val(); - if(selectedProduct != 0 && $.inArray(selectedProduct, selectedVal) < 0 && !multiBranchProducts[selectedProduct]) selectedVal.push(selectedProduct); - if(multiBranchProducts[selectedProduct]) - { - var isDisabled = checkMultiProducts(this); - if(isDisabled) selectedVal.push(selectedProduct); - } + if(selectedProduct != 0 && $.inArray(selectedProduct, selectedVal) < 0) selectedVal.push(selectedProduct); }) $("select[id^='products']").each(function() From d5b322bc05aae7d87cd5a51f25fc31af23feb6b3 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 1 Dec 2022 10:41:27 +0800 Subject: [PATCH 144/267] * Code for task#77802. Add tips when branch empty at batch edit plan. --- module/productplan/model.php | 21 ++++++++++++++------- module/productplan/view/batchedit.html.php | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/module/productplan/model.php b/module/productplan/model.php index a53c1301b6..c8fe0c013e 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -748,8 +748,15 @@ class productplanModel extends model $plans = array(); $extendFields = $this->getFlowExtendFields(); + $product = $this->loadModel('product')->getByID($productID); foreach($data->id as $planID) { + if($product->type != 'normal' and $oldPlans[$planID]->parent != '-1' and !isset($data->branch[$planID])) + { + $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); + return helper::end(js::error(sprintf($this->lang->error->notempty, $this->lang->product->branch))); + } + $isFuture = isset($data->future[$planID]) ? true : false; if(isset($data->status[$planID]) and $data->status[$planID] != 'wait') $isFuture = false; @@ -762,8 +769,8 @@ class productplanModel extends model $plan->parent = $oldPlans[$planID]->parent; $plan->id = $planID; - if(empty($plan->title)) return print(js::alert(sprintf($this->lang->productplan->errorNoTitle, $planID))); - if($plan->begin > $plan->end and !empty($plan->end)) return print(js::alert(sprintf($this->lang->productplan->beginGeEnd, $planID))); + if(empty($plan->title)) return helper::end(js::alert(sprintf($this->lang->productplan->errorNoTitle, $planID))); + if($plan->begin > $plan->end and !empty($plan->end)) return helper::end(js::alert(sprintf($this->lang->productplan->beginGeEnd, $planID))); if($plan->begin == '') $plan->begin = $this->config->productplan->future; if($plan->end == '') $plan->end = $this->config->productplan->future; @@ -790,11 +797,11 @@ class productplanModel extends model $parent = isset($plans[$parentID]) ? $plans[$parentID] : $this->getByID($parentID); if($parent->begin != $this->config->productplan->future and $plan->begin != $this->config->productplan->future and $plan->begin < $parent->begin) { - return print(js::alert(sprintf($this->lang->productplan->beginLetterParentTip, $planID, $plan->begin, $parent->begin))); + return helper::end(js::alert(sprintf($this->lang->productplan->beginLetterParentTip, $planID, $plan->begin, $parent->begin))); } elseif($parent->end != $this->config->productplan->future and $plan->end != $this->config->productplan->future and $plan->end > $parent->end) { - return print(js::alert(sprintf($this->lang->productplan->endGreaterParentTip, $planID, $plan->end, $parent->end))); + return helper::end(js::alert(sprintf($this->lang->productplan->endGreaterParentTip, $planID, $plan->end, $parent->end))); } } elseif($parentID == -1 and $plan->begin != $this->config->productplan->future) @@ -808,8 +815,8 @@ class productplanModel extends model if($childPlan->begin < $minBegin and $minBegin != $this->config->productplan->future) $minBegin = $childPlan->begin; if($childPlan->end > $maxEnd and $maxEnd != $this->config->productplan->future) $maxEnd = $childPlan->end; } - if($minBegin < $plan->begin and $minBegin != $this->config->productplan->future) return print(js::alert(sprintf($this->lang->productplan->beginGreaterChildTip, $planID, $plan->begin, $minBegin))); - if($maxEnd > $plan->end and $maxEnd != $this->config->productplan->future) return print(js::alert(sprintf($this->lang->productplan->endLetterChildTip, $planID, $plan->end, $maxEnd))); + if($minBegin < $plan->begin and $minBegin != $this->config->productplan->future) return helper::end(js::alert(sprintf($this->lang->productplan->beginGreaterChildTip, $planID, $plan->begin, $minBegin))); + if($maxEnd > $plan->end and $maxEnd != $this->config->productplan->future) return helper::end(js::alert(sprintf($this->lang->productplan->endLetterChildTip, $planID, $plan->end, $maxEnd))); } $change = common::createChanges($oldPlans[$planID], $plan); @@ -817,7 +824,7 @@ class productplanModel extends model { if($parentID > 0 and !isset($parents[$parentID])) $parents[$parentID] = $parentID; $this->dao->update(TABLE_PRODUCTPLAN)->data($plan)->autoCheck()->checkFlow()->where('id')->eq($planID)->exec(); - if(dao::isError()) return print(js::error(dao::getError())); + if(dao::isError()) return helper::end(js::error(dao::getError())); $changes[$planID] = $change; } } diff --git a/module/productplan/view/batchedit.html.php b/module/productplan/view/batchedit.html.php index d3099683f3..c9823725b0 100644 --- a/module/productplan/view/batchedit.html.php +++ b/module/productplan/view/batchedit.html.php @@ -23,7 +23,7 @@ type != 'normal'):?> - + From ca3adef629965e5d205c981f70d1b01253ed966f Mon Sep 17 00:00:00 2001 From: chaideqing Date: Thu, 1 Dec 2022 11:15:52 +0800 Subject: [PATCH 145/267] * Refactor code. --- module/kanban/model.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/module/kanban/model.php b/module/kanban/model.php index a36be67f92..046a94de6e 100755 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -1512,10 +1512,7 @@ class kanbanModel extends model $cardData['left'] = $object->left; $cardData['estStarted'] = $object->estStarted; $cardData['mode'] = $object->mode; - if($object->mode == 'multi') - { - $cardData['teamMembers'] = $object->teamMembers; - } + if($object->mode == 'multi') $cardData['teamMembers'] = $object->teamMembers; } else { From bffe373548b6402c76c8354a1c9fd1c071941076 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 1 Dec 2022 11:17:05 +0800 Subject: [PATCH 146/267] * fix bug #30405 --- module/productplan/model.php | 54 +++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/module/productplan/model.php b/module/productplan/model.php index a53c1301b6..20cd1449ac 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -266,6 +266,8 @@ class productplanModel extends model */ public function getPairs($product = 0, $branch = '', $param = '', $skipParent = false) { + $this->app->loadLang('branch'); + $date = date('Y-m-d'); $branchQuery = ''; @@ -281,8 +283,7 @@ class productplanModel extends model $branchQuery .= ')'; } - $plans = $this->dao->select('t1.id,t1.title,t1.parent,t1.begin,t1.end,t2.name as branchName,t3.type as productType')->from(TABLE_PRODUCTPLAN)->alias('t1') - ->leftJoin(TABLE_BRANCH)->alias('t2')->on('t2.id=t1.branch') + $plans = $this->dao->select('t1.id,t1.title,t1.parent,t1.begin,t1.end,t3.type as productType,t1.branch')->from(TABLE_PRODUCTPLAN)->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t3.id=t1.product') ->where('t1.product')->in($product) ->andWhere('t1.deleted')->eq(0) @@ -292,16 +293,22 @@ class productplanModel extends model ->orderBy('t1.begin desc') ->fetchAll('id'); + $branchMap = $this->dao->select('id, name')->from(TABLE_BRANCH) + ->where('status')->eq('active') + ->andWhere('deleted')->eq('0') + ->fetchPairs('id', 'name'); + $branchMap[BRANCH_MAIN] = $this->lang->branch->main; + $plans = $this->reorder4Children($plans); + $plans = $this->relationBranch($plans); $planPairs = array(); - $this->app->loadLang('branch'); foreach($plans as $plan) { if($skipParent and $plan->parent == '-1') continue; if($plan->parent > 0 and isset($plans[$plan->parent])) $plan->title = $plans[$plan->parent]->title . ' /' . $plan->title; $planPairs[$plan->id] = $plan->title . " [{$plan->begin} ~ {$plan->end}]"; if($plan->begin == $this->config->productplan->future and $plan->end == $this->config->productplan->future) $planPairs[$plan->id] = $plan->title . ' ' . $this->lang->productplan->future; - if($plan->productType != 'normal') $planPairs[$plan->id] = ($plan->branchName ? $plan->branchName : $this->lang->branch->main) . ' / ' . $planPairs[$plan->id]; + if($plan->productType != 'normal') $planPairs[$plan->id] = $planPairs[$plan->id] . ' / ' . ($plan->branchName ? $plan->branchName : $this->lang->branch->main); } return array('' => '') + $planPairs; } @@ -1106,6 +1113,45 @@ class productplanModel extends model return $plans; } + /** + * Get relation branch for plans. + * + * @param array $plans + * @access public + * @return array + */ + public function relationBranch($plans) + { + if(empty($plans)) return $plans; + + $branchMap = $this->dao->select('id, name')->from(TABLE_BRANCH) + ->where('status')->eq('active') + ->andWhere('deleted')->eq('0') + ->fetchPairs('id', 'name'); + $branchMap[BRANCH_MAIN] = $this->lang->branch->main; + + foreach($plans as &$plan) + { + if($plan->branch) + { + $branchName = ''; + foreach(explode(',', $plan->branch) as $planBranch) + { + $branchName .= isset($branchMap[$planBranch]) ? $branchMap[$planBranch] : ''; + $branchName .= ','; + } + + $plan->branchName = trim($branchName, ','); + } + else + { + $plan->branchName = $this->lang->branch->main; + } + } + + return $plans; + } + /** * Judge an action is clickable or not. * From 6548926a919950d7a10acc0b38a7c123b27797a1 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 1 Dec 2022 11:18:53 +0800 Subject: [PATCH 147/267] * fix bug #30405 --- module/productplan/model.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/module/productplan/model.php b/module/productplan/model.php index 20cd1449ac..14c4a392b6 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -293,12 +293,6 @@ class productplanModel extends model ->orderBy('t1.begin desc') ->fetchAll('id'); - $branchMap = $this->dao->select('id, name')->from(TABLE_BRANCH) - ->where('status')->eq('active') - ->andWhere('deleted')->eq('0') - ->fetchPairs('id', 'name'); - $branchMap[BRANCH_MAIN] = $this->lang->branch->main; - $plans = $this->reorder4Children($plans); $plans = $this->relationBranch($plans); $planPairs = array(); From 80d2e0f6c0afc95a6a9a935e7cad5246eb8a6fec Mon Sep 17 00:00:00 2001 From: Lufei Date: Thu, 1 Dec 2022 12:16:57 +0800 Subject: [PATCH 148/267] * Add check ext-gd extension. --- module/admin/lang/de.php | 1 + module/admin/lang/en.php | 1 + module/admin/lang/fr.php | 1 + module/admin/lang/vi.php | 1 + module/admin/lang/zh-cn.php | 1 + module/admin/lang/zh-tw.php | 6 ++++-- module/admin/view/safe.html.php | 5 ++++- 7 files changed, 13 insertions(+), 3 deletions(-) diff --git a/module/admin/lang/de.php b/module/admin/lang/de.php index fd3014cc10..47418888f7 100644 --- a/module/admin/lang/de.php +++ b/module/admin/lang/de.php @@ -141,3 +141,4 @@ $lang->admin->safe->resetPWDList[0] = 'Off'; $lang->admin->safe->noticeMode = 'The password will be checked when creating and modifying user information, and changing passwords.'; $lang->admin->safe->noticeWeakMode = 'The password will be checked when logging into the system, creating and modifying user information, and changing passwords.'; $lang->admin->safe->noticeStrong = 'The longer the password, the more letters, numbers, or special characters it contains, and the less repetitive the password, the more secure it is!'; +$lang->admin->safe->noticeGd = 'Your server does not have GD module installed, you cannot use the Captcha function, Please use it after installation.'; diff --git a/module/admin/lang/en.php b/module/admin/lang/en.php index b7fcb08a16..914214cb1a 100644 --- a/module/admin/lang/en.php +++ b/module/admin/lang/en.php @@ -141,3 +141,4 @@ $lang->admin->safe->resetPWDList[0] = 'Off'; $lang->admin->safe->noticeMode = 'The password will be checked when creating and modifying user information, and changing passwords.'; $lang->admin->safe->noticeWeakMode = 'The password will be checked when logging into the system, creating and modifying user information, and changing passwords.'; $lang->admin->safe->noticeStrong = 'The longer the password, the more letters, numbers, or special characters it contains, and the less repetitive the password, the more secure it is!'; +$lang->admin->safe->noticeGd = 'Your server does not have GD module installed, you cannot use the Captcha function, Please use it after installation.'; \ No newline at end of file diff --git a/module/admin/lang/fr.php b/module/admin/lang/fr.php index efe3d511e6..745c72f69b 100644 --- a/module/admin/lang/fr.php +++ b/module/admin/lang/fr.php @@ -141,3 +141,4 @@ $lang->admin->safe->resetPWDList[0] = 'Off'; $lang->admin->safe->noticeMode = "Le mot de passe sera vérifié lors de la création et de la modification des coordonnées de l'utilisateur, et du changement de mot de passe."; $lang->admin->safe->noticeWeakMode = "Le mot de passe sera vérifié lors de la connexion au système, de la création et de la modification des coordonnées de l'utilisateur, et du changement de mot de passe."; $lang->admin->safe->noticeStrong = "Le mot de passe est d'autant plus sécurisé qu'il est long, qu'il contient plus de lettres, de chiffres ou de caractères spéciaux, et que les lettres du mot de passe sont peu répétitives !"; +$lang->admin->safe->noticeGd = 'Your server does not have GD module installed, you cannot use the Captcha function, Please use it after installation.'; diff --git a/module/admin/lang/vi.php b/module/admin/lang/vi.php index 47deb84d6b..4b6e64b021 100644 --- a/module/admin/lang/vi.php +++ b/module/admin/lang/vi.php @@ -84,3 +84,4 @@ $lang->admin->safe->loginCaptchaList[0] = 'No'; $lang->admin->safe->noticeMode = 'Mật khẩu sẽ được kiểm tra khi người dùng đăng nhập hoặc người dùng thêm hoặc sửa.'; $lang->admin->safe->noticeStrong = ''; +$lang->admin->safe->noticeGd = 'Your server does not have GD module installed, you cannot use the Captcha function, Please use it after installation.'; \ No newline at end of file diff --git a/module/admin/lang/zh-cn.php b/module/admin/lang/zh-cn.php index c573762af5..33831b046d 100644 --- a/module/admin/lang/zh-cn.php +++ b/module/admin/lang/zh-cn.php @@ -141,3 +141,4 @@ $lang->admin->safe->resetPWDList[0] = '关闭'; $lang->admin->safe->noticeMode = '系统会在创建和修改用户、修改密码的时候检查用户口令。'; $lang->admin->safe->noticeWeakMode = '系统会在登录、创建和修改用户、修改密码的时候检查用户口令。'; $lang->admin->safe->noticeStrong = '密码长度越长,含有大写字母或数字或特殊符号越多,密码字母越不重复,安全度越强!'; +$lang->admin->safe->noticeGd = '系统检测到您的服务器未安装GD模块,无法使用验证码功能,请安装后使用。'; diff --git a/module/admin/lang/zh-tw.php b/module/admin/lang/zh-tw.php index 457818eefd..6f6c404364 100644 --- a/module/admin/lang/zh-tw.php +++ b/module/admin/lang/zh-tw.php @@ -82,5 +82,7 @@ $lang->admin->safe->modifyPasswordList[0] = '不強制'; $lang->admin->safe->loginCaptchaList[1] = '是'; $lang->admin->safe->loginCaptchaList[0] = '否'; -$lang->admin->safe->noticeMode = '系統會在登錄、創建和修改用戶、修改密碼的時候檢查用戶口令。'; -$lang->admin->safe->noticeStrong = '密碼長度越長,含有大寫字母或數字或特殊符號越多,密碼字母越不重複,安全度越強!'; +$lang->admin->safe->noticeMode = '系統會在創建和修改用戶、修改密碼的時候檢查用戶口令。'; +$lang->admin->safe->noticeWeakMode = '系統會在登錄、創建和修改用戶、修改密碼的時候檢查用戶口令。'; +$lang->admin->safe->noticeStrong = '密碼長度越長,含有大寫字母或數字或特殊符號越多,密碼字母越不重複,安全度越強!'; +$lang->admin->safe->noticeGd = '系統檢測到您的伺服器未安裝GD模組,無法使用驗證碼功能,請安裝後使用。'; diff --git a/module/admin/view/safe.html.php b/module/admin/view/safe.html.php index 1524656a60..716b9cbd35 100644 --- a/module/admin/view/safe.html.php +++ b/module/admin/view/safe.html.php @@ -16,6 +16,7 @@ .notice {color:#2667E3; margin-left: 12px;} admin);?> + - + + - + hasProduct and $this->config->vision != 'lite'):?> + + - - + - - - - + + model == 'waterfall'):?> division and count($linkedProducts) < 2) ? 'hide' : '';?> From 315dc169804e4a63f3e6897cadd6b53056ff6f09 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 1 Dec 2022 14:04:26 +0800 Subject: [PATCH 151/267] master branch only relation master plan --- module/product/control.php | 2 +- module/story/control.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/module/product/control.php b/module/product/control.php index 0529cfcd88..eeb0a20594 100755 --- a/module/product/control.php +++ b/module/product/control.php @@ -1048,7 +1048,7 @@ class product extends control $multiple = strpos($param, 'multiple') === false ? '' : 'multiple'; $output = html::select($field, $plans, $planID, "class='form-control chosen' $multiple"); - if($branch == 0 and strpos($param, 'edit') and !strpos($param, 'forstory')) $output = html::select($field, $plans, $planID, "class='form-control chosen' multiple"); + if($branch == 0 and strpos($param, 'edit') and (strpos($param, 'forstory') === false)) $output = html::select($field, $plans, $planID, "class='form-control chosen' multiple"); if(count($plans) == 1 and $needCreate and $needCreate !== 'false') { diff --git a/module/story/control.php b/module/story/control.php index 72670a7d46..9ceddf2c19 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -440,7 +440,8 @@ class story extends control $this->view->users = $users; $this->view->moduleID = $moduleID; $this->view->moduleOptionMenu = $moduleOptionMenu; - $this->view->plans = str_replace('2030-01-01', $this->lang->story->undetermined, $this->loadModel('productplan')->getPairsForStory($productID, $branch == 0 ? '' : $branch, 'skipParent|unexpired|noclosed')); + $this->view->plans = str_replace('2030-01-01', $this->lang->story->undetermined, $this->loadModel('productplan')->getPairsForStory($productID, $branch == 0 ? '0' : $branch, 'skipParent|unexpired|noclosed')); + a($this->view->plans);exit; $this->view->planID = $planID; $this->view->source = $source; $this->view->sourceNote = $sourceNote; From 658144ab3a3336e01fe2f5bdef5f953cdd27e28e Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 1 Dec 2022 14:04:55 +0800 Subject: [PATCH 152/267] master branch only relation master plan --- module/story/control.php | 1 - 1 file changed, 1 deletion(-) diff --git a/module/story/control.php b/module/story/control.php index 9ceddf2c19..90a612488d 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -441,7 +441,6 @@ class story extends control $this->view->moduleID = $moduleID; $this->view->moduleOptionMenu = $moduleOptionMenu; $this->view->plans = str_replace('2030-01-01', $this->lang->story->undetermined, $this->loadModel('productplan')->getPairsForStory($productID, $branch == 0 ? '0' : $branch, 'skipParent|unexpired|noclosed')); - a($this->view->plans);exit; $this->view->planID = $planID; $this->view->source = $source; $this->view->sourceNote = $sourceNote; From 7535a681280cdf15d10ebf124fd64ec32b2903fe Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 1 Dec 2022 14:07:43 +0800 Subject: [PATCH 153/267] rollback code --- module/story/control.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index 90a612488d..f2e1fa60fa 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -440,8 +440,7 @@ class story extends control $this->view->users = $users; $this->view->moduleID = $moduleID; $this->view->moduleOptionMenu = $moduleOptionMenu; - $this->view->plans = str_replace('2030-01-01', $this->lang->story->undetermined, $this->loadModel('productplan')->getPairsForStory($productID, $branch == 0 ? '0' : $branch, 'skipParent|unexpired|noclosed')); - $this->view->planID = $planID; + $this->view->plans = str_replace('2030-01-01', $this->lang->story->undetermined, $this->loadModel('productplan')->getPairsForStory($productID, $branch == 0 ? '' : $branch, 'skipParent|unexpired|noclosed')); $this->view->planID = $planID; $this->view->source = $source; $this->view->sourceNote = $sourceNote; $this->view->color = $color; From 22081a43ded2a4f2227b00a4a1c9ed898b02e34d Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 1 Dec 2022 14:15:35 +0800 Subject: [PATCH 154/267] * fix bug #30425. --- module/bug/js/common.js | 14 ++++++++------ module/bug/view/create.html.php | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/module/bug/js/common.js b/module/bug/js/common.js index 80029c42eb..3a8e68c617 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -203,8 +203,8 @@ function loadAllExecutionBuilds(executionID, productID, buildBox) $('#openedBuild').replaceWith(data); $('#pickerDropMenu-pk_openedBuild').remove(); $('#openedBuild').next('.picker').remove(); - $("#openedBuild").picker({optionRender: markReleasedBuilds}); notice(); + $("#openedBuild").picker({optionRender: markReleasedBuilds}); }) } if(page == 'edit') @@ -243,8 +243,8 @@ function loadAllProductBuilds(productID, buildBox) $('#openedBuild').replaceWith(data); $('#pickerDropMenu-pk_openedBuild').remove(); $('#openedBuild').next('.picker').remove(); - $("#openedBuild").picker({optionRender: markReleasedBuilds}); notice(); + $("#openedBuild").picker({optionRender: markReleasedBuilds}); }) } if(page == 'edit') @@ -460,8 +460,8 @@ function loadProductBuilds(productID) $('#openedBuild').replaceWith(data); $('#pickerDropMenu-pk_openedBuild').remove(); $('#openedBuild').next('.picker').remove(); - $("#openedBuild").picker({optionRender: markReleasedBuilds}); notice(); + $("#openedBuild").picker({optionRender: markReleasedBuilds}); }) } else @@ -616,8 +616,8 @@ function loadProjectBuilds(projectID) $('#openedBuild').val(oldOpenedBuild); $('#pickerDropMenu-pk_openedBuild').remove(); $('#openedBuild').next('.picker').remove(); - $("#openedBuild").picker({optionRender: markReleasedBuilds}); notice(); + $("#openedBuild").picker({optionRender: markReleasedBuilds}); }) } else @@ -659,8 +659,8 @@ function loadExecutionBuilds(executionID, num) $('#openedBuild').val(oldOpenedBuild); $('#pickerDropMenu-pk_openedBuild').remove(); $('#openedBuild').next('.picker').remove(); - $("#openedBuild").picker({optionRender: markReleasedBuilds}); notice(); + $("#openedBuild").picker({optionRender: markReleasedBuilds}); }) } else @@ -830,7 +830,9 @@ function notice() if(page == 'edit') return; $('#buildBoxActions').empty().hide(); - if($('#openedBuild').find('option').length <= 1) + var itemCount = $('#openedBuild').find('option').length; + if($('#openedBuild').attr('data-items') != undefined) var itemCount = $('#openedBuild').attr('data-items'); + if(itemCount <= 1) { var html = ''; if($('#execution').length == 0 || $('#execution').val() == 0) diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 66f7f07cf1..2b6776c540 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -130,7 +130,7 @@ if($this->app->tab == 'project') js::set('objectID', $projectID); diff --git a/module/testtask/js/common.js b/module/testtask/js/common.js index e6875782e6..218dc5fae2 100644 --- a/module/testtask/js/common.js +++ b/module/testtask/js/common.js @@ -90,7 +90,6 @@ function loadExecutionRelated(executionID) * Load execution builds. * * @param int $executionID - * @param int $selected * @access public * @return void */ From c866a1ab41ac6ba5b0d652d96daf8022bcb1ead7 Mon Sep 17 00:00:00 2001 From: mayue Date: Thu, 1 Dec 2022 14:27:07 +0800 Subject: [PATCH 160/267] * Fix bug #30422. --- module/productplan/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/productplan/control.php b/module/productplan/control.php index d8d8f76643..85098312ca 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -947,7 +947,7 @@ class productplan extends control */ public function ajaxGetConflict($planID, $newBranch) { - if(empty($newBranch)) return; + if($newBranch == '') return; $plan = $this->productplan->getByID($planID); $oldBranch = $plan->branch; From cfc70e817669dcff48517672ca220430daa012db Mon Sep 17 00:00:00 2001 From: Yagami Date: Thu, 1 Dec 2022 15:15:07 +0800 Subject: [PATCH 161/267] * Code for task #77800. --- module/project/control.php | 6 ++--- module/project/js/create.js | 20 +------------- module/project/lang/de.php | 1 + module/project/lang/en.php | 1 + module/project/lang/fr.php | 1 + module/project/lang/vi.php | 1 + module/project/lang/zh-cn.php | 1 + module/project/model.php | 29 ++++++++++++++++++++ module/project/view/create.html.php | 42 +++++++++++++++++++++++++++++ 9 files changed, 79 insertions(+), 23 deletions(-) diff --git a/module/project/control.php b/module/project/control.php index df07cc71d1..a31b368c58 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -587,10 +587,8 @@ class project extends control if(!$copyProject->hasProduct) $shadow = 1; foreach($products as $product) { - foreach($product->branches as $branch) - { - $productPlans[$product->id][$branch] = $this->loadModel('productplan')->getPairs($product->id, $branch, 'noclosed', true); - } + $branches = implode(',', $product->branches); + $productPlans[$product->id] = $this->loadModel('productplan')->getPairs($product->id, $branches, 'noclosed', true); } } diff --git a/module/project/js/create.js b/module/project/js/create.js index ee7393ff6e..58dbbe7235 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -29,7 +29,7 @@ $(function() setAclList($("#parent").val()); - if(typeof(currentPlanID) == 'undefined') + if(typeof(currentPlanID) == 'undefined' && copyProjectID == 0) { $('.productsBox select[id^="products"]').each(function() { @@ -306,24 +306,6 @@ function loadBranches(product) (chosenProducts.length > 1 && model == 'waterfall') ? $('.division').removeClass('hide') : $('.division').addClass('hide'); - /* - if($('.productsBox .row .input-group:last select:first').val() != 0) - { - var length = $('.productsBox .row .input-group').size(); - var $html = $('.productsBox .row .col-sm-4:last').html().replace('required', ''); - $('.productsBox .row .col-sm-4:last').find('.input-group-addon').remove(); - $('.productsBox .row').append('
    ' + $html + '
    '); - if($('.productsBox .row .input-group:last select').size() >= 2) $('.productsBox .row .input-group:last select:last').remove(); - $('.productsBox .row .input-group:last .chosen-container').remove(); - $('.productsBox .row .input-group:last select:first').attr('name', 'products[' + length + ']').attr('id', 'products' + length); - $('.productsBox .row .input-group:last .chosen').chosen(); - - $('[data-toggle="popover"]').popover(); - - adjustProductBoxMargin(); - } - */ - var $tableRow = $(product).closest('.table-row'); var index = $tableRow.find('select:first').attr('id').replace('products' , ''); var oldBranch = $(product).attr('data-branch') !== undefined ? $(product).attr('data-branch') : 0; diff --git a/module/project/lang/de.php b/module/project/lang/de.php index 00cdcccc94..2b5843e509 100644 --- a/module/project/lang/de.php +++ b/module/project/lang/de.php @@ -339,6 +339,7 @@ $lang->project->scrum = 'Scrum'; $lang->project->waterfall = 'CMMI'; $lang->project->cannotCreateChild = 'It is not empty, so you cannot add a child. You can add a parent for it, and then create a child.'; $lang->project->emptyPM = 'No manager'; +$lang->project->emptyBranch = 'Branch can not be empty!'; $lang->project->cannotChangeToCat = "It is not empty, so you cannot change it to a parent."; $lang->project->cannotCancelCat = "It has child projects, so you cannot unmark the parent."; $lang->project->parentBeginEnd = "Parent begin&end date: %s ~ %s"; diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 378f35cebc..844de092a7 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -339,6 +339,7 @@ $lang->project->scrum = 'Scrum'; $lang->project->waterfall = 'Waterfall'; $lang->project->cannotCreateChild = 'It is not empty, so you cannot add a child. You can add a parent for it, and then create a child.'; $lang->project->emptyPM = 'No manager'; +$lang->project->emptyBranch = 'Branch can not be empty!'; $lang->project->cannotChangeToCat = "It is not empty, so you cannot change it to a parent."; $lang->project->cannotCancelCat = "It has child projects, so you cannot unmark the parent."; $lang->project->parentBeginEnd = "Parent begin&end date: %s ~ %s"; diff --git a/module/project/lang/fr.php b/module/project/lang/fr.php index 114555b75d..cd51d24993 100644 --- a/module/project/lang/fr.php +++ b/module/project/lang/fr.php @@ -339,6 +339,7 @@ $lang->project->scrum = 'Scrum'; $lang->project->waterfall = 'CMMI'; $lang->project->cannotCreateChild = 'It is not empty, so you cannot add a child. You can add a parent for it, and then create a child.'; $lang->project->emptyPM = 'No manager'; +$lang->project->emptyBranch = 'Branch can not be empty!'; $lang->project->cannotChangeToCat = "It is not empty, so you cannot change it to a parent."; $lang->project->cannotCancelCat = "It has child projects, so you cannot unmark the parent."; $lang->project->parentBeginEnd = "Parent begin&end date: %s ~ %s"; diff --git a/module/project/lang/vi.php b/module/project/lang/vi.php index f2284e3c3f..46a718201c 100644 --- a/module/project/lang/vi.php +++ b/module/project/lang/vi.php @@ -336,6 +336,7 @@ $lang->project->scrum = 'Scrum'; $lang->project->waterfall = 'Waterfall'; $lang->project->cannotCreateChild = 'It is not empty, so you cannot add a child. You can add a parent for it, and then create a child.'; $lang->project->emptyPM = 'No manager'; +$lang->project->emptyBranch = 'Branch can not be empty!'; $lang->project->cannotChangeToCat = "It is not empty, so you cannot change it to a parent."; $lang->project->cannotCancelCat = "It has child projects, so you cannot unmark the parent."; $lang->project->parentBeginEnd = "Parent begin&end date: %s ~ %s"; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 9a9cc0e98c..2d411b634e 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -339,6 +339,7 @@ $lang->project->scrum = 'Scrum'; $lang->project->waterfall = '瀑布'; $lang->project->cannotCreateChild = '该项目已经有实际的内容,无法直接添加子项目。您可以为当前项目创建一个父项目,然后在新的父项目下面添加子项目。'; $lang->project->emptyPM = '暂无'; +$lang->project->emptyBranch = '分支不能为空!'; $lang->project->cannotChangeToCat = "该项目已经有实际的内容,无法修改为父项目"; $lang->project->cannotCancelCat = "该项目下已经有子项目,无法取消父项目标记"; $lang->project->parentBeginEnd = "父项目起止时间:%s ~ %s"; diff --git a/module/project/model.php b/module/project/model.php index 4dfe09b2b3..8a7d1e4178 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1243,6 +1243,20 @@ class projectModel extends model } } + if($_POST['products']) + { + $topProgramID = $this->loadModel('program')->getTopByID($project->parent); + $multipleProducts = $this->loadModel('product')->getMultiBranchPairs($topProgramID); + foreach($_POST['products'] as $index => $productID) + { + if(isset($multipleProducts[$productID]) and empty($_POST['branch'][$index])) + { + dao::$errors[] = $this->lang->project->emptyBranch; + return false; + } + } + } + $program = new stdClass(); if($project->parent) { @@ -1509,12 +1523,27 @@ class projectModel extends model if(dao::isError()) return false; } + if($_POST['products']) + { + $topProgramID = $this->loadModel('program')->getTopByID($project->parent); + $multipleProducts = $this->loadModel('product')->getMultiBranchPairs($topProgramID); + foreach($_POST['products'] as $index => $productID) + { + if(isset($multipleProducts[$productID]) and empty($_POST['branch'][$index])) + { + dao::$errors[] = $this->lang->project->emptyBranch; + return false; + } + } + } + /* Judge products not empty. */ $linkedProductsCount = 0; foreach($_POST['products'] as $product) { if(!empty($product)) $linkedProductsCount++; } + if(empty($linkedProductsCount)) { dao::$errors[] = $this->lang->project->errorNoProducts; diff --git a/module/project/view/create.html.php b/module/project/view/create.html.php index d7cde1dc6c..e1a56351b3 100755 --- a/module/project/view/create.html.php +++ b/module/project/view/create.html.php @@ -138,6 +138,47 @@
    + + + + + + + + + + + From 0a5e89dd34521255708b5353c03946bd2f179548 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 2 Dec 2022 10:59:34 +0800 Subject: [PATCH 173/267] * fix bug #30482 --- module/productplan/model.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/module/productplan/model.php b/module/productplan/model.php index 4326f6a0a2..734ebc9995 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -365,7 +365,7 @@ class productplanModel extends model /** * Get plans for products * - * @param int $products + * @param array $products * @access public * @return void */ @@ -487,10 +487,13 @@ class productplanModel extends model $planPairs = array(); foreach($plans as $planID => $plan) { - if($skipParent and $plan->parent == '-1') continue; + foreach(explode(',', $plan->branch) as $branch) + { + if($skipParent and $plan->parent == '-1') continue 2; - if($plan->parent > 0 and isset($plans[$plan->parent])) $plan->title = $plans[$plan->parent]->title . ' /' . $plan->title; - $planPairs[$plan->branch][$planID] = $plan->title . ' [' . $plan->begin . '~' . $plan->end . ']'; + if($plan->parent > 0 and isset($plans[$plan->parent])) $plan->title = $plans[$plan->parent]->title . ' /' . $plan->title; + $planPairs[$branch][$planID] = $plan->title . ' [' . $plan->begin . '~' . $plan->end . ']'; + } } return $planPairs; } From aa96dfc3a99d1b1f71b1678e423eb3caee339453 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 2 Dec 2022 13:28:08 +0800 Subject: [PATCH 174/267] * fix bug #30447 --- module/productplan/model.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/module/productplan/model.php b/module/productplan/model.php index 734ebc9995..e10cebd119 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -403,15 +403,18 @@ class productplanModel extends model { $date = date('Y-m-d'); $param = strtolower($param); - $plans = $this->dao->select('*')->from(TABLE_PRODUCTPLAN) - ->where('deleted')->eq(0) - ->beginIF($products)->andWhere('product')->in($products)->fi() - ->beginIF(strpos($param, 'unexpired') !== false)->andWhere('end')->ge($date)->fi() - ->orderBy($orderBy) + $plans = $this->dao->select('*,t2.type as productType')->from(TABLE_PRODUCTPLAN)->alias('t1') + ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t2.id=t1.product') + ->where('t1.deleted')->eq(0) + ->beginIF($products)->andWhere('t1.product')->in($products)->fi() + ->beginIF(strpos($param, 'unexpired') !== false)->andWhere('t1.end')->ge($date)->fi() + ->orderBy('t1.' . $orderBy) ->fetchAll('id'); if(!empty($plans) and $field == 'name') $plans = $this->reorder4Children($plans); + $plans = $this->relationBranch($plans); + $parentTitle = array(); $planGroup = array(); foreach($plans as $plan) @@ -427,6 +430,7 @@ class productplanModel extends model if($plan->parent > 0 and isset($plans[$plan->parent])) $plan->title = $plans[$plan->parent]->title . ' /' . $plan->title; $planGroup[$plan->product][$branch][$plan->id] = $plan->title . " [{$plan->begin} ~ {$plan->end}]"; if($plan->begin == $this->config->productplan->future and $plan->end == $this->config->productplan->future) $planGroup[$plan->product][$branch][$plan->id] = $plan->title . ' ' . $this->lang->productplan->future; + if($plan->productType != 'normal') $planGroup[$plan->product][$branch][$plan->id] = $planGroup[$plan->product][$branch][$plan->id] . ' / ' . ($plan->branchName ? $plan->branchName : $this->lang->branch->main); } else { @@ -1128,6 +1132,7 @@ class productplanModel extends model { if(empty($plans)) return $plans; + $this->app->loadLang('branch'); $branchMap = $this->dao->select('id, name')->from(TABLE_BRANCH) ->where('status')->eq('active') ->andWhere('deleted')->eq('0') From 2b66d5d5ca121d17189a8a2dab0c0faff195d41d Mon Sep 17 00:00:00 2001 From: zenggang Date: Fri, 2 Dec 2022 05:32:33 +0000 Subject: [PATCH 175/267] * Fix bug#30470 --- module/execution/model.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 1e83956238..ed66a03b88 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -5189,6 +5189,7 @@ class executionModel extends model $_POST = array(); $_POST['project'] = $projectID; $_POST['name'] = $project->name; + $_POST['code'] = $project->code; $_POST['begin'] = $project->begin; $_POST['end'] = $project->end; $_POST['realBegan'] = $project->realBegan; @@ -5202,8 +5203,6 @@ class executionModel extends model $_POST['status'] = $project->status; $_POST['acl'] = 'open'; - if(!empty($_POST['code'])) $_POST['code'] = $project->code; - $projectProducts = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($projectID)->fetchAll(); foreach($projectProducts as $projectProduct) { From dbc00993c625c8fe48a93a3d1edb48e38bd23460 Mon Sep 17 00:00:00 2001 From: Yagami Date: Fri, 2 Dec 2022 13:42:09 +0800 Subject: [PATCH 176/267] * Fix execution manage products bug. --- module/execution/control.php | 11 ++++++--- module/execution/view/edit.html.php | 36 +++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 43df398d16..5fbc2746aa 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1702,10 +1702,11 @@ class execution extends control $linkedBranches = array(); foreach($products as $productIndex => $product) { + $productPlans[$productIndex] = array(); foreach($branches[$productIndex] as $branchID => $branch) { $linkedBranches[$productIndex][$branchID] = $branchID; - $productPlans[$productIndex] = isset($plans[$productIndex][$branchID]) ? $plans[$productIndex][$branchID] : array(); + $productPlans[$productIndex] += isset($plans[$productIndex][$branchID]) ? $plans[$productIndex][$branchID] : array(); } } @@ -1737,10 +1738,11 @@ class execution extends control $linkedBranches = array(); foreach($products as $productIndex => $product) { + $productPlans[$productIndex] = array(); foreach($branches[$productIndex] as $branchID => $branch) { $linkedBranches[$productIndex][$branchID] = $branchID; - $productPlans[$productIndex] = isset($plans[$productIndex][$branchID]) ? $plans[$productIndex][$branchID] : array(); + $productPlans[$productIndex] += isset($plans[$productIndex][$branchID]) ? $plans[$productIndex][$branchID] : array(); } } @@ -2029,11 +2031,14 @@ class execution extends control foreach($linkedProducts as $productID => $linkedProduct) { if(!isset($allProducts[$productID])) $allProducts[$productID] = $linkedProduct->name; + $productPlans[$productID] = array(); + foreach($branches[$productID] as $branchID => $branch) { + $productPlans[$productID] += isset($plans[$productID][$branchID]) ? $plans[$productID][$branchID] : array(); + $linkedBranchList[$branchID] = $branchID; $linkedBranches[$productID][$branchID] = $branchID; - $productPlans[$productID] = isset($plans[$productID][$branchID]) ? $plans[$productID][$branchID] : array(); if($branchID != BRANCH_MAIN and isset($plans[$productID][BRANCH_MAIN])) $productPlans[$productID] += $plans[$productID][BRANCH_MAIN]; if(!empty($executionStories[$productID][$branchID])) { diff --git a/module/execution/view/edit.html.php b/module/execution/view/edit.html.php index 5ef11f6ee6..f2eaf83b23 100644 --- a/module/execution/view/edit.html.php +++ b/module/execution/view/edit.html.php @@ -141,6 +141,7 @@ attribute, array('request', 'design', 'review'))): ?> hasProduct)) $hidden = ''?> + @@ -180,6 +181,41 @@ + + + + + + From 19db2248d9c15db00147b7ef50f015765f669441 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 2 Dec 2022 13:57:34 +0800 Subject: [PATCH 177/267] * fix bug #30480 --- module/productplan/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/productplan/model.php b/module/productplan/model.php index e10cebd119..3a3aa649b8 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -403,7 +403,7 @@ class productplanModel extends model { $date = date('Y-m-d'); $param = strtolower($param); - $plans = $this->dao->select('*,t2.type as productType')->from(TABLE_PRODUCTPLAN)->alias('t1') + $plans = $this->dao->select('t1.*,t2.type as productType')->from(TABLE_PRODUCTPLAN)->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t2.id=t1.product') ->where('t1.deleted')->eq(0) ->beginIF($products)->andWhere('t1.product')->in($products)->fi() From dda0446e570171543b586fb4eba528d34262f397 Mon Sep 17 00:00:00 2001 From: Yagami Date: Fri, 2 Dec 2022 14:34:34 +0800 Subject: [PATCH 178/267] * Fix bug #30436. --- module/execution/model.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/module/execution/model.php b/module/execution/model.php index cc2033499b..1ad969db4a 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -332,6 +332,20 @@ class executionModel extends model $this->checkBeginAndEndDate($_POST['project'], $_POST['begin'], $_POST['end']); if(dao::isError()) return false; + if($_POST['products']) + { + $this->app->loadLang('project'); + $multipleProducts = $this->loadModel('product')->getMultiBranchPairs(); + foreach($_POST['products'] as $index => $productID) + { + if(isset($multipleProducts[$productID]) and empty($_POST['branch'][$index])) + { + dao::$errors[] = $this->lang->project->emptyBranch; + return false; + } + } + } + /* Determine whether to add a sprint or a stage according to the model of the execution. */ $project = $this->loadModel('project')->getByID($_POST['project']); $type = 'sprint'; @@ -514,6 +528,20 @@ class executionModel extends model return false; } + if($_POST['products']) + { + $this->app->loadLang('project'); + $multipleProducts = $this->loadModel('product')->getMultiBranchPairs(); + foreach($_POST['products'] as $index => $productID) + { + if(isset($multipleProducts[$productID]) and empty($_POST['branch'][$index])) + { + dao::$errors[] = $this->lang->project->emptyBranch; + return false; + } + } + } + /* Get the data from the post. */ $execution = fixer::input('post') ->add('id', $executionID) From 8a81c215b5a5e0d6fc340528ef3d95c17fc65614 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 2 Dec 2022 14:41:49 +0800 Subject: [PATCH 179/267] * fix bug #30472 --- module/execution/model.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index cc2033499b..8e0ee9dfab 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -4650,14 +4650,16 @@ class executionModel extends model $branchQuery .= ')'; - $plans = $this->dao->select('id,title,product,parent,begin,end')->from(TABLE_PRODUCTPLAN) - ->where('product')->in(array_keys($products)) - ->andWhere('deleted')->eq(0) + $plans = $this->dao->select('t1.id,t1.title,t1.product,t1.parent,t1.begin,t1.end,t1.branch,t2.type as productType')->from(TABLE_PRODUCTPLAN)->alias('t1') + ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t2.id=t1.product') + ->where('t1.product')->in(array_keys($products)) + ->andWhere('t1.deleted')->eq(0) ->andWhere($branchQuery) - ->orderBy('begin desc') + ->orderBy('t1.begin desc') ->fetchAll('id'); $plans = $this->productplan->reorder4Children($plans); + $plans = $this->productplan->relationBranch($plans); $productPlans = array(); foreach($plans as $plan) { @@ -4665,6 +4667,7 @@ class executionModel extends model if($plan->parent > 0 and isset($plans[$plan->parent])) $plan->title = $plans[$plan->parent]->title . ' /' . $plan->title; $productPlans[$plan->product][$plan->id] = $plan->title . " [{$plan->begin} ~ {$plan->end}]"; if($plan->begin == '2030-01-01' and $plan->end == '2030-01-01') $productPlans[$plan->product][$plan->id] = $plan->title . ' ' . $this->lang->productplan->future; + if($plan->productType != 'normal') $productPlans[$plan->product][$plan->id] = $productPlans[$plan->product][$plan->id] . ' / ' . ($plan->branchName ? $plan->branchName : $this->lang->branch->main); } return $productPlans; From 15aecd0bf9ddb4cb05eec656c2869c0bf059f550 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 2 Dec 2022 14:54:59 +0800 Subject: [PATCH 180/267] * fix bug #30506. --- module/report/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/report/model.php b/module/report/model.php index 7d4f9d220c..d25d4b0978 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -698,6 +698,7 @@ class reportModel extends model { $effort = $this->dao->select('count(*) as count, sum(consumed) as consumed')->from(TABLE_EFFORT) ->where('LEFT(date, 4)')->eq($year) + ->andWhere('deleted')->eq(0) ->beginIF($accounts)->andWhere('account')->in($accounts)->fi() ->fetch(); From b181c11e374ea06b94e03af4b29a16094f968877 Mon Sep 17 00:00:00 2001 From: Yagami Date: Fri, 2 Dec 2022 15:00:12 +0800 Subject: [PATCH 181/267] * Fix bug #30476. --- module/project/js/create.js | 2 +- module/project/view/create.html.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/project/js/create.js b/module/project/js/create.js index ff42309610..1d1cdb8c1e 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -253,7 +253,7 @@ function addNewProduct(obj) $('#productName').attr('disabled', true); $('.productsBox .addProduct').addClass('hidden'); - $('#productTitle').html(manageProducts); + $('#productTitle').html(manageProductPlan); } $('.productsBox div + .text-danger.help-text').remove(); diff --git a/module/project/view/create.html.php b/module/project/view/create.html.php index 119cbeee7b..22221761dd 100755 --- a/module/project/view/create.html.php +++ b/module/project/view/create.html.php @@ -26,7 +26,7 @@ product->name);?> -project->manageProducts);?> +project->manageProductPlan);?> project->budgetOverrun);?> project->currencySymbol)?> project->parentBudget);?> From 90c061cb40df4cab7a56c3f8a335eb8f5ab8b180 Mon Sep 17 00:00:00 2001 From: Lufei Date: Fri, 2 Dec 2022 15:07:22 +0800 Subject: [PATCH 182/267] * Change report bug lang. --- module/misc/lang/de.php | 2 +- module/misc/lang/en.php | 2 +- module/misc/lang/fr.php | 2 +- module/misc/lang/zh-cn.php | 2 +- module/misc/lang/zh-tw.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/module/misc/lang/de.php b/module/misc/lang/de.php index 620c0d9f9d..15242cc32a 100644 --- a/module/misc/lang/de.php +++ b/module/misc/lang/de.php @@ -42,7 +42,7 @@ $lang->misc->zentao->support['ask'] = "Official Answer"; $lang->misc->zentao->support['video'] = "Use Video"; $lang->misc->zentao->support['qqgroup'] = "Official QQ Group"; -$lang->misc->zentao->cowin['reportbug'] = "Bug melden "; +$lang->misc->zentao->cowin['reportbug'] = "Report Bug"; $lang->misc->zentao->cowin['feedback'] = "Feedback"; $lang->misc->zentao->cowin['recommend'] = "More"; diff --git a/module/misc/lang/en.php b/module/misc/lang/en.php index 98b516bad7..9ace3c33ea 100644 --- a/module/misc/lang/en.php +++ b/module/misc/lang/en.php @@ -42,7 +42,7 @@ $lang->misc->zentao->support['ask'] = "Official Answer"; $lang->misc->zentao->support['video'] = "Use Video"; $lang->misc->zentao->support['qqgroup'] = "Official QQ Group"; -$lang->misc->zentao->cowin['reportbug'] = "Report Bug "; +$lang->misc->zentao->cowin['reportbug'] = "Report Bug"; $lang->misc->zentao->cowin['feedback'] = "Feedback"; $lang->misc->zentao->cowin['recommend'] = "More"; diff --git a/module/misc/lang/fr.php b/module/misc/lang/fr.php index 6ad3cd0fa1..2792a3ce78 100644 --- a/module/misc/lang/fr.php +++ b/module/misc/lang/fr.php @@ -42,7 +42,7 @@ $lang->misc->zentao->support['ask'] = "Official Answer"; $lang->misc->zentao->support['video'] = "Use Video"; $lang->misc->zentao->support['qqgroup'] = "Official QQ Group"; -$lang->misc->zentao->cowin['reportbug'] = "Signaler un Bug"; +$lang->misc->zentao->cowin['reportbug'] = "Report Bug"; $lang->misc->zentao->cowin['feedback'] = "Feedback"; $lang->misc->zentao->cowin['recommend'] = "Plus..."; diff --git a/module/misc/lang/zh-cn.php b/module/misc/lang/zh-cn.php index 45a270c7ea..c235c42d89 100644 --- a/module/misc/lang/zh-cn.php +++ b/module/misc/lang/zh-cn.php @@ -42,7 +42,7 @@ $lang->misc->zentao->support['ask'] = "官方问答"; $lang->misc->zentao->support['video'] = "使用视频"; $lang->misc->zentao->support['qqgroup'] = "官方QQ群"; -$lang->misc->zentao->cowin['reportbug'] = "汇报Bug"; +$lang->misc->zentao->cowin['reportbug'] = "反馈Bug"; $lang->misc->zentao->cowin['feedback'] = "反馈需求"; $lang->misc->zentao->cowin['recommend'] = "推荐给朋友"; diff --git a/module/misc/lang/zh-tw.php b/module/misc/lang/zh-tw.php index 3daf3d5f61..2d9a8e5707 100644 --- a/module/misc/lang/zh-tw.php +++ b/module/misc/lang/zh-tw.php @@ -40,7 +40,7 @@ $lang->misc->zentao->support['ask'] = "官方問答"; $lang->misc->zentao->support['video'] = "使用視頻"; $lang->misc->zentao->support['qqgroup'] = "官方QQ群"; -$lang->misc->zentao->cowin['reportbug'] = "彙報Bug"; +$lang->misc->zentao->cowin['reportbug'] = "反饋Bug"; $lang->misc->zentao->cowin['feedback'] = "反饋需求"; $lang->misc->zentao->cowin['translate'] = "參與翻譯"; $lang->misc->zentao->cowin['recommend'] = "推薦給朋友"; From 82948abf2b1002a97364f7b994630ed102b688d3 Mon Sep 17 00:00:00 2001 From: zenggang Date: Fri, 2 Dec 2022 07:20:59 +0000 Subject: [PATCH 183/267] * Fix bug#25845 --- module/doc/view/browse.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/doc/view/browse.html.php b/module/doc/view/browse.html.php index 0a22344249..16d5112f47 100644 --- a/module/doc/view/browse.html.php +++ b/module/doc/view/browse.html.php @@ -84,7 +84,7 @@ id&objectType=doc");?>" title="" class='btn btn-link ajaxCollect'> - id&comment=false", "", '', "title='{$lang->edit}' class='btn btn-link iframe'", true, true)?> + id&comment=false", "", '', "title='{$lang->edit}' class='btn btn-link'", true, false)?> id&confirm=no", "", 'hiddenwin', "title='{$lang->delete}' class='btn btn-link'")?> From a1bd34b3cedafe2fd304e3fa2f387ada45d6fba3 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 2 Dec 2022 15:32:36 +0800 Subject: [PATCH 184/267] * fix bug #30496 --- module/execution/control.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 5fbc2746aa..74404a338b 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -4153,11 +4153,10 @@ class execution extends control if(!empty($planStory)) { $projectProducts = $this->loadModel('project')->getBranchesByProject($executionID); - foreach($planStory as $id => $story) { $projectBranches = zget($projectProducts, $story->product, array()); - if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($projectBranches) and !isset($projectBranches[$story->branch]))) + if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($projectBranches) and !isset($projectBranches[$story->branch]) and !empty($story->branch))) { $count++; unset($planStory[$id]); From 3b09109e21d331e992bd4f841fe515884058b2cc Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 2 Dec 2022 15:34:11 +0800 Subject: [PATCH 185/267] * fix bug #30496 --- module/execution/model.php | 2 +- module/productplan/model.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index e8a1dbae68..a96595570d 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -2937,7 +2937,7 @@ class executionModel extends model { foreach($planStory as $id => $story) { - if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($executionBranches) and !isset($executionBranches[$story->branch]))) + if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($executionBranches) and !isset($executionBranches[$story->branch]) and !empty($story->branch))) { unset($planStory[$id]); continue; diff --git a/module/productplan/model.php b/module/productplan/model.php index 3a3aa649b8..713c09b105 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -1069,7 +1069,7 @@ class productplanModel extends model foreach($planStory as $id => $story) { $projectBranches = zget($projectProducts, $story->product, array()); - if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($projectBranches) and !isset($projectBranches[$story->branch]))) + if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($projectBranches) and !isset($projectBranches[$story->branch]) and !empty($story->branch))) { unset($planStory[$id]); continue; From 099eaa8a5ec57576827ac22975ad68e027367e65 Mon Sep 17 00:00:00 2001 From: wangyuting <851424971@qq.com> Date: Fri, 2 Dec 2022 07:43:05 +0000 Subject: [PATCH 186/267] * Finish task #78357. --- module/project/view/build.html.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index e38be60903..5aba3338ab 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -48,7 +48,7 @@ - + hasProduct):?> @@ -69,11 +69,11 @@ hasProduct):?> From a0c214eacee3fca4072d15a3c3db064c52767b42 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 2 Dec 2022 15:54:05 +0800 Subject: [PATCH 187/267] * fix bug #30475 --- module/execution/control.php | 4 ++-- module/execution/model.php | 2 +- module/productplan/model.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 74404a338b..e4cbc86352 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -4156,7 +4156,7 @@ class execution extends control foreach($planStory as $id => $story) { $projectBranches = zget($projectProducts, $story->product, array()); - if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($projectBranches) and !isset($projectBranches[$story->branch]) and !empty($story->branch))) + if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($story->branch) and !empty($projectBranches) and !isset($projectBranches[$story->branch]))) { $count++; unset($planStory[$id]); @@ -4189,7 +4189,7 @@ class execution extends control } $haveDraft = sprintf($this->lang->execution->haveDraft, $count); - if(!$execution->multiple) $haveDraft = str_replace($this->lang->executionCommon, $this->lang->projectCommon, $haveDraft); + if(!$execution->multiple or $moduleName == 'projectstory') $haveDraft = str_replace($this->lang->executionCommon, $this->lang->projectCommon, $haveDraft); if($count != 0) echo js::alert($haveDraft) . js::locate($this->createLink($moduleName, $fromMethod, $param)); return print(js::locate(helper::createLink($moduleName, $fromMethod, $param))); } diff --git a/module/execution/model.php b/module/execution/model.php index a96595570d..7420d45898 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -2937,7 +2937,7 @@ class executionModel extends model { foreach($planStory as $id => $story) { - if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($executionBranches) and !isset($executionBranches[$story->branch]) and !empty($story->branch))) + if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($story->branch) and !empty($executionBranches) and !isset($executionBranches[$story->branch]))) { unset($planStory[$id]); continue; diff --git a/module/productplan/model.php b/module/productplan/model.php index 713c09b105..d378d62382 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -1069,7 +1069,7 @@ class productplanModel extends model foreach($planStory as $id => $story) { $projectBranches = zget($projectProducts, $story->product, array()); - if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($projectBranches) and !isset($projectBranches[$story->branch]) and !empty($story->branch))) + if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($story->branch) and !empty($projectBranches) and !isset($projectBranches[$story->branch]))) { unset($planStory[$id]); continue; From d7d897a8f76415666acf416a4d4c8c0fd0e6cfec Mon Sep 17 00:00:00 2001 From: Yagami Date: Fri, 2 Dec 2022 15:58:52 +0800 Subject: [PATCH 188/267] * Fix code error. --- module/execution/control.php | 16 ++-------------- module/project/control.php | 7 ++----- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 5fbc2746aa..aa40827601 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1791,27 +1791,15 @@ class execution extends control return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('doc', 'objectLibs', "type=execution"))); } - $planID = ''; - if(isset($_POST['plans'])) - { - foreach($_POST['plans'] as $plans) - { - foreach($plans as $planID) - { - if(!empty($planID)) break; - } - } - } - if(!empty($projectID) and $project->model == 'kanban') { $execution = $this->execution->getById($executionID); $this->loadModel('kanban')->createRDKanban($execution); } - if(!empty($planID)) + if(!empty($_POST['plans'])) { - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('create', "projectID=$projectID&executionID=$executionID©ExecutionID=&planID=$planID&confirm=no"))); + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('create', "projectID=$projectID&executionID=$executionID©ExecutionID=&planID=1&confirm=no"))); } else { diff --git a/module/project/control.php b/module/project/control.php index 14c371fd8c..16dd1e8eaf 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -492,12 +492,9 @@ class project extends control $planIdList = array(); foreach($_POST['plans'] as $plans) { - foreach($plans as $planList) + foreach($plans as $planID) { - foreach($planList as $planID) - { - $planIdList[$planID] = $planID; - } + $planIdList[$planID] = $planID; } } From 14ea643f619d78e9594e4d670a03d989e4081312 Mon Sep 17 00:00:00 2001 From: daitingting Date: Fri, 2 Dec 2022 08:03:37 +0000 Subject: [PATCH 189/267] * Finish task #78361,#78362. --- module/bug/js/common.js | 2 +- module/bug/view/activate.html.php | 2 +- module/bug/view/batchcreate.html.php | 2 +- module/bug/view/browse.html.php | 2 +- module/bug/view/create.html.php | 2 +- module/bug/view/edit.html.php | 2 +- module/bug/view/resolve.html.php | 2 +- module/build/lang/de.php | 2 +- module/build/lang/en.php | 2 +- module/build/lang/fr.php | 2 +- module/build/lang/zh-cn.php | 2 +- module/build/model.php | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/module/bug/js/common.js b/module/bug/js/common.js index 0c74f79a6f..3cf0a2ac8b 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -35,7 +35,7 @@ function markReleasedBuilds($option) if(!$option.find('.label-released').length) { var optionText = $option.find('.picker-option-text').html(); - $option.find('.picker-option-text').replaceWith("

    " + releasedBuild + " " + optionText + "

    "); + $option.find('.picker-option-text').replaceWith("

    " + optionText + " " + released + "

    "); } } } diff --git a/module/bug/view/activate.html.php b/module/bug/view/activate.html.php index 37cc6027b6..4ea8e2bab9 100644 --- a/module/bug/view/activate.html.php +++ b/module/bug/view/activate.html.php @@ -58,6 +58,6 @@ product); -js::set('releasedBuild', $lang->build->releasedBuild); +js::set('released', $lang->build->released); ?> diff --git a/module/bug/view/batchcreate.html.php b/module/bug/view/batchcreate.html.php index eb34d2370a..6e62fc7d47 100755 --- a/module/bug/view/batchcreate.html.php +++ b/module/bug/view/batchcreate.html.php @@ -14,7 +14,7 @@ include '../../common/view/header.html.php'; js::set('requiredFields', $config->bug->create->requiredFields); js::set('productID', $productID); -js::set('releasedBuild', $lang->build->releasedBuild); +js::set('released', $lang->build->released); ?> bug->mySelects[$browseType]) && in_array($brow { $actionLink = $this->createLink('bug', 'batchResolve', "resolution=fixed&resolvedBuild=$key"); echo "
  • "; - echo html::a('javascript:;', (in_array($key, $releasedBuilds) ? "{$lang->build->releasedBuild} " : '') . $build, '', "onclick=\"setFormAction('$actionLink', 'hiddenwin', '#bugList')\""); + echo html::a('javascript:;', $build . (in_array($key, $releasedBuilds) ? " {$lang->build->released} " : ''), '', "onclick=\"setFormAction('$actionLink', 'hiddenwin', '#bugList')\""); echo "
  • "; } echo ""; diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 3cb9f567a2..27819e3c62 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -31,7 +31,7 @@ js::set('requiredFields', $config->bug->create->requiredFields); js::set('showFields', $showFields); js::set('projectExecutionPairs', $projectExecutionPairs); js::set('productID', $productID); -js::set('releasedBuild', $lang->build->releasedBuild); +js::set('released', $lang->build->released); if($this->app->tab == 'execution') js::set('objectID', zget($execution, 'id', '')); if($this->app->tab == 'project') js::set('objectID', $projectID); ?> diff --git a/module/bug/view/edit.html.php b/module/bug/view/edit.html.php index 5abdec20a3..10ad3fdc16 100644 --- a/module/bug/view/edit.html.php +++ b/module/bug/view/edit.html.php @@ -31,7 +31,7 @@ js::set('bugBranch' , $bug->branch); js::set('isClosedBug' , $bug->status == 'closed'); js::set('projectExecutionPairs' , $projectExecutionPairs); js::set('productID' , $product->id); -js::set('releasedBuild' , $lang->build->releasedBuild); +js::set('released' , $lang->build->released); if($this->app->tab == 'execution') js::set('objectID', $bug->execution); if($this->app->tab == 'project') js::set('objectID', $bug->project); ?> diff --git a/module/bug/view/resolve.html.php b/module/bug/view/resolve.html.php index b284f83a5c..78ed516c22 100644 --- a/module/bug/view/resolve.html.php +++ b/module/bug/view/resolve.html.php @@ -16,7 +16,7 @@ product); -js::set('releasedBuild', $lang->build->releasedBuild); +js::set('released', $lang->build->released); ?>
    diff --git a/module/build/lang/de.php b/module/build/lang/de.php index 0164196034..f229af3274 100644 --- a/module/build/lang/de.php +++ b/module/build/lang/de.php @@ -36,7 +36,7 @@ $lang->build->execution = $lang->executionCommon; $lang->build->integrated = 'Integrated'; $lang->build->singled = 'Singled'; $lang->build->builds = 'Included Builds'; -$lang->build->releasedBuild = 'Released Build'; +$lang->build->released = 'Released'; $lang->build->name = 'Name'; $lang->build->date = 'Datum'; $lang->build->builder = 'Builder'; diff --git a/module/build/lang/en.php b/module/build/lang/en.php index 75343df3d0..55fa55eaa3 100644 --- a/module/build/lang/en.php +++ b/module/build/lang/en.php @@ -36,7 +36,7 @@ $lang->build->execution = $lang->executionCommon; $lang->build->integrated = 'Integrated'; $lang->build->singled = 'Singled'; $lang->build->builds = 'Included Builds'; -$lang->build->releasedBuild = 'Released Build'; +$lang->build->released = 'Released'; $lang->build->name = 'Name'; $lang->build->date = 'Date'; $lang->build->builder = 'Builder'; diff --git a/module/build/lang/fr.php b/module/build/lang/fr.php index e6500fd173..c81c80ed03 100644 --- a/module/build/lang/fr.php +++ b/module/build/lang/fr.php @@ -36,7 +36,7 @@ $lang->build->execution = $lang->executionCommon; $lang->build->integrated = 'Integrated'; $lang->build->singled = 'Singled'; $lang->build->builds = 'Included Builds'; -$lang->build->releasedBuild = 'Released Build'; +$lang->build->released = 'Released'; $lang->build->name = 'Nom'; $lang->build->date = 'Date'; $lang->build->builder = 'Builder'; diff --git a/module/build/lang/zh-cn.php b/module/build/lang/zh-cn.php index fe804daf9c..59f8a6e824 100644 --- a/module/build/lang/zh-cn.php +++ b/module/build/lang/zh-cn.php @@ -36,7 +36,7 @@ $lang->build->execution = '所属' . $lang->executionCommon; $lang->build->integrated = '集成版本'; $lang->build->singled = '单一版本'; $lang->build->builds = '包含版本'; -$lang->build->releasedBuild = '发布版本'; +$lang->build->released = '发布'; $lang->build->name = '名称编号'; $lang->build->date = '打包日期'; $lang->build->builder = '构建者'; diff --git a/module/build/model.php b/module/build/model.php index fd739b41a0..baa9253ead 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -327,7 +327,7 @@ class buildModel extends model $releaseName = $release->name; $branchName = $release->branchName ? $release->branchName : $this->lang->branch->main; if($release->productType != 'normal') $releaseName = (strpos($params, 'withbranch') !== false ? $branchName . '/' : '') . $releaseName; - if(strpos($params, 'releasetag') !== false) $releaseName = "[{$this->lang->build->releasedBuild}] " . $releaseName; + if(strpos($params, 'releasetag') !== false) $releaseName = $releaseName . " [{$this->lang->build->released}]"; $builds[$release->date][$release->shadow] = $releaseName; foreach(explode(',', trim($release->build, ',')) as $buildID) { From 2fd85774c144871d560684502b571b3d0fe6c6cd Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 5 Dec 2022 08:49:00 +0800 Subject: [PATCH 190/267] * code for task #78383. --- module/projectrelease/control.php | 7 +-- module/projectrelease/js/create.js | 28 --------- module/projectrelease/view/create.html.php | 10 ++-- module/release/control.php | 1 - module/release/js/create.js | 23 ------- module/release/lang/de.php | 2 +- module/release/lang/en.php | 2 +- module/release/lang/fr.php | 2 +- module/release/lang/zh-cn.php | 2 +- module/release/model.php | 4 +- module/release/view/create.html.php | 10 ++-- test/class/build.class.php | 14 ----- test/model/build/filterlinked.php | 70 ---------------------- 13 files changed, 19 insertions(+), 156 deletions(-) delete mode 100644 test/model/build/filterlinked.php diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index f06687f7b4..c1f353dd97 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -142,8 +142,6 @@ class projectrelease extends control $this->view->builds = $builds; $this->view->lastRelease = $this->projectrelease->getLast($projectID); $this->view->users = $this->loadModel('user')->getPairs('noclosed'); - $this->view->confirmLink = $this->lang->release->confirmLink; - $this->view->notEmptyBuilds = $this->build->filterLinked(array_keys($builds)); $this->display(); } @@ -816,9 +814,6 @@ class projectrelease extends control $releasedBuilds = $this->projectrelease->getReleasedBuilds($projectID); foreach($releasedBuilds as $build) unset($builds[$build]); - /* Get the builds of the linked stories or bugs. */ - $notEmptyBuilds = $this->build->filterLinked(array_keys($builds)); - - return print(html::select('build[]', $builds, '', "class='form-control chosen' multiple data-notemptybuilds='" . join(',', $notEmptyBuilds) . "'")); + return print(html::select('build[]', $builds, '', "class='form-control chosen' multiple")); } } diff --git a/module/projectrelease/js/create.js b/module/projectrelease/js/create.js index 43c1298bac..1cd106dcdb 100644 --- a/module/projectrelease/js/create.js +++ b/module/projectrelease/js/create.js @@ -1,27 +1,3 @@ -$('#submit').click(function() -{ - var dateFormat = new RegExp(/^\d{4}\-\d{2}\-\d{2}$/); - var name = $('#name').val(); - var date = $('#date').val(); - var build = $('#build').val(); - var notEmptyBuild = false; - - $.each(build, function(index, value) - { - if(typeof(notEmptyBuilds[value]) != 'undefined') - { - notEmptyBuild = true; - return false; - } - }) - - if(name && build && notEmptyBuild && dateFormat.test(date)) - { - var result = confirm(confirmLink) ? true : false; - $('#sync').val(result); - } -}); - /** * Ajax load unlinked builds with project and product. * @@ -35,10 +11,6 @@ function loadBuilds() $('#buildBox').load(createLink('projectrelease', 'ajaxLoadBuilds', "projectID=" + projectID + "&productID=" + productID + "&branch=" + branch), function() { $('#build').attr('data-placeholder', multipleSelect).chosen(); - $.each($('#build').attr('data-notemptybuilds').split(','), function(index, value) - { - notEmptyBuilds[value] = value; - }); }); } diff --git a/module/projectrelease/view/create.html.php b/module/projectrelease/view/create.html.php index fa3671ae44..7de52be52c 100644 --- a/module/projectrelease/view/create.html.php +++ b/module/projectrelease/view/create.html.php @@ -12,8 +12,6 @@ ?> - -
    @@ -53,7 +51,12 @@
    - + @@ -84,7 +87,6 @@ diff --git a/module/release/control.php b/module/release/control.php index 360cad5302..1fedaf1531 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -96,7 +96,6 @@ class release extends control $this->view->builds = $builds; $this->view->users = $this->loadModel('user')->getPairs('noclosed'); $this->view->lastRelease = $this->release->getLast($productID, $branch); - $this->view->notEmptyBuilds = $this->build->filterLinked(array_keys($builds)); $this->display(); } diff --git a/module/release/js/create.js b/module/release/js/create.js index 87a9d72468..e69de29bb2 100644 --- a/module/release/js/create.js +++ b/module/release/js/create.js @@ -1,23 +0,0 @@ -$('#submit').click(function() -{ - var dateFormat = new RegExp(/^\d{4}\-\d{2}\-\d{2}$/); - var name = $('#name').val(); - var date = $('#date').val(); - var build = $('#build').val(); - var notEmptyBuild = false; - - $.each(build, function(index, value) - { - if(typeof(notEmptyBuilds[value]) != 'undefined') - { - notEmptyBuild = true; - return false; - } - }) - - if(name && build && notEmptyBuild && dateFormat.test(date)) - { - var result = confirm(confirmLink) ? true : false; - $('#sync').val(result); - } -}); diff --git a/module/release/lang/de.php b/module/release/lang/de.php index dfd0244395..0772adf5d3 100644 --- a/module/release/lang/de.php +++ b/module/release/lang/de.php @@ -24,7 +24,7 @@ $lang->release->batchUnlinkStory = "Mehrere Storys entfernen"; $lang->release->batchUnlinkBug = "Mehrere Bugs entfernen"; $lang->release->confirmDelete = "Möchten Sie dieses Releas löschen?"; -$lang->release->confirmLink = "Whether to link the stories completed in the version and the bugs solved to the release?"; +$lang->release->syncFromBuilds = "Link the stories completed in the version and the bugs solved to the release"; $lang->release->confirmUnlinkStory = "Möchten Sie diese Story löschen?"; $lang->release->confirmUnlinkBug = "Möchten Sie diesen Bug löschen?"; $lang->release->existBuild = '『Build』『%s』 existiert bereits. Sie können den 『name』 ändern oder ein anderes 『build』 wählen.'; diff --git a/module/release/lang/en.php b/module/release/lang/en.php index 7b6be960a0..ecdcfab2b6 100644 --- a/module/release/lang/en.php +++ b/module/release/lang/en.php @@ -24,7 +24,7 @@ $lang->release->batchUnlinkStory = "Batch Unlink Stories"; $lang->release->batchUnlinkBug = "Batch Unlink Bugs"; $lang->release->confirmDelete = "Do you want to delete this release?"; -$lang->release->confirmLink = "Whether to link the stories completed in the version and the bugs solved to the release?"; +$lang->release->syncFromBuilds = "Link the stories completed in the version and the bugs solved to the release"; $lang->release->confirmUnlinkStory = "Do you want to remove this story?"; $lang->release->confirmUnlinkBug = "Do you want to remove this bug?"; $lang->release->existBuild = '『Build』『%s』existed. You could change『name』or choose a『build』.'; diff --git a/module/release/lang/fr.php b/module/release/lang/fr.php index 3a7bdc1b1e..e4b46198d1 100644 --- a/module/release/lang/fr.php +++ b/module/release/lang/fr.php @@ -24,7 +24,7 @@ $lang->release->batchUnlinkStory = "Retirer Stories par Lot"; $lang->release->batchUnlinkBug = "Retirer Bugs par Lot"; $lang->release->confirmDelete = "Voulez-vous réellement supprimer cette release ?"; -$lang->release->confirmLink = "Whether to link the stories completed in the version and the bugs solved to the release?"; +$lang->release->syncFromBuilds = "Link the stories completed in the version and the bugs solved to the release"; $lang->release->confirmUnlinkStory = "Voulez-vous retirer cette story de la release ?"; $lang->release->confirmUnlinkBug = "Voulez-vous retirer ce bug de la release ?"; $lang->release->existBuild = '『Build』『%s』existant. Vous pouvez changer『name』ou choisir un『build』.'; diff --git a/module/release/lang/zh-cn.php b/module/release/lang/zh-cn.php index 3e48d6e1b8..9f3af90ca8 100644 --- a/module/release/lang/zh-cn.php +++ b/module/release/lang/zh-cn.php @@ -24,7 +24,7 @@ $lang->release->batchUnlinkStory = "批量移除{$lang->SRCommon}"; $lang->release->batchUnlinkBug = "批量移除Bug"; $lang->release->confirmDelete = "您确认删除该发布吗?"; -$lang->release->confirmLink = "是否将版本中完成的{$lang->SRCommon}和已解决的Bug关联到发布下?"; +$lang->release->syncFromBuilds = "将版本中完成的{$lang->SRCommon}和已解决的Bug关联到发布下"; $lang->release->confirmUnlinkStory = "您确认移除该{$lang->SRCommon}吗?"; $lang->release->confirmUnlinkBug = "您确认移除该Bug吗?"; $lang->release->existBuild = '『版本』已经有『%s』这条记录了。您可以更改『发布名称』或者选择一个『版本』。'; diff --git a/module/release/model.php b/module/release/model.php index 4b8930bcc1..5b94a157b0 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -225,7 +225,7 @@ class releaseModel extends model $branches[$build->branch] = $build->branch; $projects[$build->project] = $build->project; - if($this->post->sync == 'true') + if($this->post->sync) { $build->stories = trim($build->stories, ','); $build->bugs = trim($build->bugs, ','); @@ -233,7 +233,7 @@ class releaseModel extends model if($build->bugs) $release->bugs .= ',' . $build->bugs; } } - if($this->post->sync == 'true' and $release->bugs) + if($this->post->sync and $release->bugs) { $releaseBugs = $this->loadModel('bug')->getReleaseBugs(array_keys($builds), $release->product, $release->branch); $release->bugs = join(',', array_intersect(explode(',', $release->bugs), array_keys($releaseBugs))); diff --git a/module/release/view/create.html.php b/module/release/view/create.html.php index 1c41c1a01f..5bc476e931 100644 --- a/module/release/view/create.html.php +++ b/module/release/view/create.html.php @@ -12,8 +12,6 @@ ?> -release->confirmLink);?> -
    @@ -36,7 +34,12 @@
    - + @@ -67,7 +70,6 @@ diff --git a/test/class/build.class.php b/test/class/build.class.php index 26532d486c..a51cd8ba1f 100644 --- a/test/class/build.class.php +++ b/test/class/build.class.php @@ -149,20 +149,6 @@ class buildTest return $objects; } - /** - * Test for filterLinked method - * - * @param array $buildIdList - * @access public - * @return string - */ - public function filterLinkedTest($buildIdList) - { - $notEmptyBuilds = $this->objectModel->filterLinked($buildIdList); - sort($notEmptyBuilds); - return empty($notEmptyBuilds) ? 'null' : join(',', $notEmptyBuilds); - } - /** * Function getLast test by build * diff --git a/test/model/build/filterlinked.php b/test/model/build/filterlinked.php deleted file mode 100644 index 4a53458aed..0000000000 --- a/test/model/build/filterlinked.php +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env php -filterLinked(); -cid=1 -pid=1 - -不传任何数据 >> null -迭代版本未关联需求和Bug >> null -迭代版本关联需求和Bug >> 101 -项目版本关联版本关联需求和Bug >> 102 -项目版本关联版本未关联需求和Bug >> null -版本列表中关联需求和Bug >> 101 -版本列表中混合项目版本和迭代版本 >> 101,102 - -*/ - -$build = new buildTest(); - -$buildData = new stdclass(); -$buildData->id = 100; -$buildData->product = 1; -$buildData->project = 1; -$buildData->execution = 2; -$buildData->name = 'test1'; -$buildData->date = date('Y-m-d'); -$build->objectModel->dao->replace(TABLE_BUILD)->data($buildData)->exec(); -$buildId1 = $buildData->id; - -$buildData->id = 101; -$buildData->name = 'test2'; -$buildData->stories = '1,2,3'; -$build->objectModel->dao->replace(TABLE_BUILD)->data($buildData)->exec(); -$buildId2 = $buildData->id; - -$buildData = new stdclass(); -$buildData->id = 102; -$buildData->product = 1; -$buildData->project = 1; -$buildData->execution = 0; -$buildData->builds = ",$buildId2,"; -$buildData->name = 'test3'; -$buildData->date = date('Y-m-d'); -$build->objectModel->dao->replace(TABLE_BUILD)->data($buildData)->exec(); -$buildId3 = $buildData->id; - -$buildData = new stdclass(); -$buildData->id = 103; -$buildData->product = 1; -$buildData->project = 1; -$buildData->execution = 0; -$buildData->builds = ",$buildId1,"; -$buildData->name = 'test4'; -$buildData->date = date('Y-m-d'); -$build->objectModel->dao->replace(TABLE_BUILD)->data($buildData)->exec(); -$buildId4 = $buildData->id; - - -r($build->filterLinkedTest(array())) && p() && e('null'); //不传任何数据 -r($build->filterLinkedTest(array($buildId1))) && p() && e('null'); //迭代版本未关联需求和Bug -r($build->filterLinkedTest(array($buildId2))) && p() && e('101'); //迭代版本关联需求和Bug -r($build->filterLinkedTest(array($buildId3))) && p() && e('102'); //项目版本关联版本关联需求和Bug -r($build->filterLinkedTest(array($buildId4))) && p() && e('null'); //项目版本关联版本未关联需求和Bug -r($build->filterLinkedTest(array($buildId1, $buildId2))) && p() && e('101'); //版本列表中关联需求和Bug -r($build->filterLinkedTest(array($buildId3, $buildId2))) && p() && e('101,102'); //版本列表中混合项目版本和迭代版本 From 9fc3e25635beb24d38ff12ca8d5c032f097725c6 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Mon, 5 Dec 2022 09:23:01 +0800 Subject: [PATCH 191/267] * fix execution plans --- module/execution/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/model.php b/module/execution/model.php index 7420d45898..ae2dd53ee2 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -4673,7 +4673,7 @@ class executionModel extends model } else { - $branchQuery .= "FIND_IN_SET('', branch)"; + $branchQuery .= "FIND_IN_SET('0', branch)"; } $branchQuery .= ')'; From 5fc4eeb5dd9350c22b8aea50a72ebe047af7514b Mon Sep 17 00:00:00 2001 From: dingguodong Date: Mon, 5 Dec 2022 10:00:37 +0800 Subject: [PATCH 192/267] * Adjust extension loading priority for saas. --- framework/base/model.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/base/model.class.php b/framework/base/model.class.php index bf4a0136ab..3c734d0071 100644 --- a/framework/base/model.class.php +++ b/framework/base/model.class.php @@ -281,8 +281,8 @@ class baseModel /* 设置扩展的名字和相应的文件。Set extenson name and extension file. */ $moduleExtPath = $this->app->getModuleExtPath($this->appName, $moduleName, $type); if(!empty($moduleExtPath['site'])) $extensionFile = $moduleExtPath['site'] . 'class/' . $extensionName . '.class.php'; - if(!isset($extensionFile) or !file_exists($extensionFile)) $extensionFile = $moduleExtPath['custom'] . 'class/' . $extensionName . '.class.php'; if(!isset($extensionFile) or !file_exists($extensionFile)) $extensionFile = $moduleExtPath['saas'] . 'class/' . $extensionName . '.class.php'; + if(!isset($extensionFile) or !file_exists($extensionFile)) $extensionFile = $moduleExtPath['custom'] . 'class/' . $extensionName . '.class.php'; if(!isset($extensionFile) or !file_exists($extensionFile)) $extensionFile = $moduleExtPath['vision'] . 'class/' . $extensionName . '.class.php'; if(!isset($extensionFile) or !file_exists($extensionFile)) $extensionFile = $moduleExtPath['xuan'] . 'class/' . $extensionName . '.class.php'; if(!isset($extensionFile) or !file_exists($extensionFile)) $extensionFile = $moduleExtPath['common'] . 'class/' . $extensionName . '.class.php'; From 42e85ebbb8a4a089b5ccffd4474117f695a7ae6f Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 5 Dec 2022 10:10:59 +0800 Subject: [PATCH 193/267] * code for task #78384. --- module/build/control.php | 1 + module/build/lang/de.php | 1 + module/build/lang/en.php | 1 + module/build/lang/fr.php | 1 + module/build/lang/zh-cn.php | 1 + module/execution/view/build.html.php | 11 +++++++---- module/project/view/build.html.php | 15 +++++++++------ 7 files changed, 21 insertions(+), 10 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index f2772a442f..767239b781 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -181,6 +181,7 @@ class build extends control } $executions = $this->product->getExecutionPairsByProduct($build->product, $build->branch, 'id_desc', $this->session->project, 'stagefilter'); + if($build->execution and !isset($executions[$build->execution])) $executions[$build->execution] = $this->loadModel('execution')->getById($build->execution)->name; /* Get stories and bugs. */ $orderBy = 'status_asc, stage_asc, id_desc'; diff --git a/module/build/lang/de.php b/module/build/lang/de.php index 0164196034..385db70d1c 100644 --- a/module/build/lang/de.php +++ b/module/build/lang/de.php @@ -40,6 +40,7 @@ $lang->build->releasedBuild = 'Released Build'; $lang->build->name = 'Name'; $lang->build->date = 'Datum'; $lang->build->builder = 'Builder'; +$lang->build->url = 'URL'; $lang->build->scmPath = 'SCM Pfad'; $lang->build->filePath = 'Dateipfad'; $lang->build->desc = 'Beschreibung'; diff --git a/module/build/lang/en.php b/module/build/lang/en.php index 75343df3d0..0b64199217 100644 --- a/module/build/lang/en.php +++ b/module/build/lang/en.php @@ -40,6 +40,7 @@ $lang->build->releasedBuild = 'Released Build'; $lang->build->name = 'Name'; $lang->build->date = 'Date'; $lang->build->builder = 'Builder'; +$lang->build->url = 'URL'; $lang->build->scmPath = 'SCM Path'; $lang->build->filePath = 'File Path'; $lang->build->desc = 'Description'; diff --git a/module/build/lang/fr.php b/module/build/lang/fr.php index e6500fd173..7633876217 100644 --- a/module/build/lang/fr.php +++ b/module/build/lang/fr.php @@ -40,6 +40,7 @@ $lang->build->releasedBuild = 'Released Build'; $lang->build->name = 'Nom'; $lang->build->date = 'Date'; $lang->build->builder = 'Builder'; +$lang->build->url = 'URL'; $lang->build->scmPath = 'Chemin SCM'; $lang->build->filePath = 'Chemin Fichier'; $lang->build->desc = 'Description'; diff --git a/module/build/lang/zh-cn.php b/module/build/lang/zh-cn.php index fe804daf9c..f24b21bb26 100644 --- a/module/build/lang/zh-cn.php +++ b/module/build/lang/zh-cn.php @@ -40,6 +40,7 @@ $lang->build->releasedBuild = '发布版本'; $lang->build->name = '名称编号'; $lang->build->date = '打包日期'; $lang->build->builder = '构建者'; +$lang->build->url = '地址'; $lang->build->scmPath = '源代码地址'; $lang->build->filePath = '下载地址'; $lang->build->desc = '描述'; diff --git a/module/execution/view/build.html.php b/module/execution/view/build.html.php index c1610c1616..4a8faa823a 100644 --- a/module/execution/view/build.html.php +++ b/module/execution/view/build.html.php @@ -51,8 +51,7 @@ - - + @@ -68,8 +67,12 @@ branchName) echo "{$build->branchName}"?> createLink('build', 'view', "build=$build->id"), $build->name);?> - - + diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index e38be60903..7fe72a1081 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -50,13 +50,12 @@ hasProduct):?> - + multiple):?> - + - - + @@ -97,8 +96,12 @@ - - + From fdc4c4159f950a937f7a3e3ff14a30c2382850c2 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 5 Dec 2022 10:29:48 +0800 Subject: [PATCH 194/267] * adjust for icon. --- module/execution/view/build.html.php | 2 +- module/project/view/build.html.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/execution/view/build.html.php b/module/execution/view/build.html.php index 4a8faa823a..41f1b2b7d0 100644 --- a/module/execution/view/build.html.php +++ b/module/execution/view/build.html.php @@ -69,7 +69,7 @@ diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index c56abcee1d..67c4814aeb 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -98,7 +98,7 @@ From 7bef1eaf2890fb367c8ba5c2ddd6bc36c51ec052 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Mon, 5 Dec 2022 11:22:24 +0800 Subject: [PATCH 195/267] * Finish Task #78670 --- module/execution/control.php | 14 +++++++++++++- module/execution/lang/de.php | 3 ++- module/execution/lang/en.php | 3 ++- module/execution/lang/fr.php | 3 ++- module/execution/lang/zh-cn.php | 3 ++- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index de72a5abee..d768d36b23 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -4176,7 +4176,19 @@ class execution extends control include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php'; } - $haveDraft = sprintf($this->lang->execution->haveDraft, $count); + $executionProductList = $this->loadModel('product')->getProducts($executionID); + $multiBranchProduct = false; + foreach($executionProductList as $executionProduct) + { + if($executionProduct->type != 'normal') + { + $multiBranchProduct = true; + break; + } + } + $importPlanStoryTips = $multiBranchProduct ? $this->lang->execution->haveBranchDraft : $this->lang->execution->haveDraft; + + $haveDraft = sprintf($importPlanStoryTips, $count); if(!$execution->multiple or $moduleName == 'projectstory') $haveDraft = str_replace($this->lang->executionCommon, $this->lang->projectCommon, $haveDraft); if($count != 0) echo js::alert($haveDraft) . js::locate($this->createLink($moduleName, $fromMethod, $param)); return print(js::locate(helper::createLink($moduleName, $fromMethod, $param))); diff --git a/module/execution/lang/de.php b/module/execution/lang/de.php index c5527bf317..e325edbcdc 100644 --- a/module/execution/lang/de.php +++ b/module/execution/lang/de.php @@ -351,7 +351,8 @@ $lang->execution->howToUpdateBurn = " Story verknüpfen。"; -$lang->execution->haveDraft = "There are %s draft stories or not associated with this {$lang->executionCommon} can't be linked."; +$lang->execution->haveBranchDraft = "There are %s draft stories or not associated with this {$lang->executionCommon} can't be linked."; +$lang->execution->haveDraft = "There are %s draft stories with this {$lang->executionCommon} can't be linked."; $lang->execution->doneExecutions = 'Erledigt'; $lang->execution->selectDept = 'Abteilung wählen'; $lang->execution->selectDeptTitle = 'Abteilung wählen'; diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index 62c06847a5..d273799d4b 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -351,7 +351,8 @@ $lang->execution->howToUpdateBurn = " Link Stories now."; -$lang->execution->haveDraft = "There are %s draft stories or not associated with this {$lang->executionCommon} can't be linked."; +$lang->execution->haveBranchDraft = "There are %s draft stories or not associated with this {$lang->executionCommon} can't be linked."; +$lang->execution->haveDraft = "There are %s draft stories with this {$lang->executionCommon} can't be linked."; $lang->execution->doneExecutions = 'Finished'; $lang->execution->selectDept = 'Select Department'; $lang->execution->selectDeptTitle = 'Select User'; diff --git a/module/execution/lang/fr.php b/module/execution/lang/fr.php index 434e14a929..a107beff48 100644 --- a/module/execution/lang/fr.php +++ b/module/execution/lang/fr.php @@ -351,7 +351,8 @@ $lang->execution->howToUpdateBurn = "executionCommon} qui sont associées à {$lang->productCommon} et vérifiez qu'elles ont bien été validées."; $lang->execution->projectNoStories = "No story can be linked. Please check whether there is any story in project and make sure it has been reviewed."; $lang->execution->productStories = "Les stories associées au {$lang->executionCommon} sont une portion des stories associées au {$lang->productCommon}. Les stories ne peuvent être associées à un {$lang->executionCommon} qu'après avoir été validées. Associer Stories maintenant."; -$lang->execution->haveDraft = "There are %s draft stories or not associated with this {$lang->executionCommon} can't be linked."; +$lang->execution->haveBranchDraft = "There are %s draft stories or not associated with this {$lang->executionCommon} can't be linked."; +$lang->execution->haveDraft = "There are %s draft stories with this {$lang->executionCommon} can't be linked."; $lang->execution->doneExecutions = 'Terminé'; $lang->execution->selectDept = 'Sélection Compartiment'; $lang->execution->selectDeptTitle = 'Sélection Utilisateur'; diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index d512818ee7..ce258165b5 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -351,7 +351,8 @@ $lang->execution->howToUpdateBurn = "关联{$lang->SRCommon}。"; -$lang->execution->haveDraft = "有%s条草稿状态或非本{$lang->executionCommon}关联分支的{$lang->SRCommon}无法关联到该{$lang->executionCommon}"; +$lang->execution->haveBranchDraft = "有%s条草稿状态或非本{$lang->executionCommon}关联分支的{$lang->SRCommon}无法关联到该{$lang->executionCommon}"; +$lang->execution->haveDraft = "有%s条草稿状态的{$lang->SRCommon}无法关联到该{$lang->executionCommon}"; $lang->execution->doneExecutions = '已结束'; $lang->execution->selectDept = '选择部门'; $lang->execution->selectDeptTitle = '选择一个部门的成员'; From 346173fcd9580f9e83a8b5dc256f4d8d15127985 Mon Sep 17 00:00:00 2001 From: liuhong Date: Mon, 5 Dec 2022 05:57:08 +0000 Subject: [PATCH 196/267] * Fix task #78696. --- module/bug/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/bug/model.php b/module/bug/model.php index 0bcbe446fd..b34a6bc952 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -3023,6 +3023,7 @@ class bugModel extends model } $allBranch = "`branch` = 'all'"; + if(strpos($branch, '0,') !== false) $branch = str_replace('0,', '', $branch); if($branch !== 'all' and strpos($bugQuery, '`branch` =') === false) $bugQuery .= " AND `branch` in('0','$branch')"; if(strpos($bugQuery, $allBranch) !== false) $bugQuery = str_replace($allBranch, '1', $bugQuery); From 3c60e62afaeb37e6387939f997b5e017aadacd37 Mon Sep 17 00:00:00 2001 From: Yagami Date: Mon, 5 Dec 2022 14:03:26 +0800 Subject: [PATCH 197/267] * Finish task #78692. --- module/story/control.php | 2 +- module/story/js/view.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/module/story/control.php b/module/story/control.php index f2e1fa60fa..3ac09a9c79 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -2381,7 +2381,7 @@ class story extends control if($type == 'remove') { $result = $this->story->unlinkStory($storyID, $linkedStoryID); - return print(js::reload('parent')); + helprt::end(); } if($_POST) diff --git a/module/story/js/view.js b/module/story/js/view.js index b40eee1b83..94a0ce9abb 100644 --- a/module/story/js/view.js +++ b/module/story/js/view.js @@ -19,4 +19,9 @@ $(function() { $(this).find('.removeButton').addClass('hide'); }); + + $('#legendStories').find('.removeButton').click(function() + { + $(this).closest('li').remove(); + }) }); From ac2a7986613871f137fe55f4e2dcc84cdd4822a4 Mon Sep 17 00:00:00 2001 From: Yagami Date: Mon, 5 Dec 2022 14:16:02 +0800 Subject: [PATCH 198/267] * Finish task #78689. --- module/product/control.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/product/control.php b/module/product/control.php index a691565285..c1d0f08da2 100755 --- a/module/product/control.php +++ b/module/product/control.php @@ -274,6 +274,7 @@ class product extends control if(!$product and $isProjectStory) { /* Get branch display under multiple products. */ + $branchOptions = array(); foreach($projectProducts as $projectProduct) { if($projectProduct and $projectProduct->type != 'normal') From 03d9357d487657af2198f38c0df479296cd901b3 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Mon, 5 Dec 2022 08:08:28 +0000 Subject: [PATCH 199/267] * Resolve feedback #909. --- module/transfer/model.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/transfer/model.php b/module/transfer/model.php index 8da0aea25f..1cee8c3173 100644 --- a/module/transfer/model.php +++ b/module/transfer/model.php @@ -1447,7 +1447,7 @@ class transferModel extends model if($model == 'bug' and $field == 'steps') $selected = str_replace("\n\n\n\n\n\n", '', $selected); $html .= ''; } - elseif($field == 'stepDesc' or $field == 'stepExpect') + elseif($field == 'stepDesc' or $field == 'stepExpect' or $field == 'precondition') { $stepDesc = $this->process4Testcase($field, $tmpList, $row); if($stepDesc) $html .= ''; @@ -1484,7 +1484,7 @@ class transferModel extends model } /** - * Process stepExpect and stepDesc for testcase. + * Process stepExpect、stepDesc and precondition for testcase. * * @param int $field * @param int $datas @@ -1497,6 +1497,7 @@ class transferModel extends model $stepData = $this->testcase->processDatas($datas); $html = ''; + if($field == 'precondition' and isset($datas[$key])) return html::textarea("precondition[$key]", htmlSpecialString($datas[$key]->precondition), "class='form-control' style='overflow:hidden'"); if($field == 'stepExpect') return $html; if(isset($stepData[$key]['desc'])) { From 9746936437a2f892f6886bd8c8d58cc671f5bc61 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Mon, 5 Dec 2022 16:22:32 +0800 Subject: [PATCH 200/267] * Finish Task #78664 --- db/update18.0.sql | 2 ++ db/zentao.sql | 2 +- module/branch/control.php | 11 +++++++---- module/build/js/common.js | 14 ++++++++++++-- module/build/model.php | 16 +++++++++++++--- module/build/view/create.html.php | 16 ++++++++++------ 6 files changed, 45 insertions(+), 16 deletions(-) diff --git a/db/update18.0.sql b/db/update18.0.sql index ecdd8e79a2..926795ad20 100644 --- a/db/update18.0.sql +++ b/db/update18.0.sql @@ -1,3 +1,5 @@ ALTER TABLE `zt_story` ADD COLUMN `siblings` varchar(255) NOT NULL AFTER `linkRequirements`; ALTER TABLE `zt_productplan` MODIFY COLUMN `branch` varchar(255) NOT NULL DEFAULT '0'; + +ALTER TABLE `zt_build` MODIFY COLUMN `branch` varchar(255) NOT NULL DEFAULT '0'; \ No newline at end of file diff --git a/db/zentao.sql b/db/zentao.sql index f17e27812a..f6bc348d57 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -321,7 +321,7 @@ CREATE TABLE IF NOT EXISTS `zt_build` ( `id` mediumint(8) unsigned NOT NULL auto_increment, `project` mediumint(8) unsigned NOT NULL, `product` mediumint(8) unsigned NOT NULL default '0', - `branch` mediumint(8) unsigned NOT NULL default '0', + `branch` varchar(255) NOT NULL DEFAULT '0', `execution` mediumint(8) unsigned NOT NULL default '0', `builds` varchar(255) NOT NULL, `name` char(150) NOT NULL, diff --git a/module/branch/control.php b/module/branch/control.php index f362b79248..93009d3205 100644 --- a/module/branch/control.php +++ b/module/branch/control.php @@ -257,20 +257,21 @@ class branch extends control * * @param int $productID * @param int $oldBranch - * @param string $param + * @param string $browseType * @param int $projectID * @param bool $withMainBranch * @param string $isSiblings * @param string $fieldID + * @param string $multiple * @access public * @return void */ - public function ajaxGetBranches($productID, $oldBranch = 0, $param = 'all', $projectID = 0, $withMainBranch = true, $isSiblings = 'no', $fieldID = '0') + public function ajaxGetBranches($productID, $oldBranch = 0, $browseType = 'all', $projectID = 0, $withMainBranch = true, $isSiblings = 'no', $fieldID = '0', $multiple = '') { $product = $this->loadModel('product')->getById($productID); if(empty($product) or $product->type == 'normal') return; - $branches = $this->loadModel('branch')->getList($productID, $projectID, $param, 'order', null, $withMainBranch); + $branches = $this->loadModel('branch')->getList($productID, $projectID, $browseType, 'order', null, $withMainBranch); $branchTagOption = array(); foreach($branches as $branchInfo) { @@ -282,8 +283,10 @@ class branch extends control $branchTagOption[$oldBranch] = $oldBranch == BRANCH_MAIN ? $branch : ($branch->name . ($branch->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '')); } + $name = $multiple == 'multiple' ? 'branch[]' : 'branch'; + if($isSiblings == 'yes') return print(html::select("branches[$fieldID]", $branchTagOption, $oldBranch, "onchange='loadBranchRelation(this.value, $fieldID);' class='form-control chosen control-branch'")); - return print(html::select('branch', $branchTagOption, $oldBranch, "class='form-control' onchange='loadBranch(this)' data-last='{$oldBranch}'")); + return print(html::select($name, $branchTagOption, $oldBranch, "class='form-control' $multiple onchange='loadBranch(this)' data-last='{$oldBranch}'")); } /** diff --git a/module/build/js/common.js b/module/build/js/common.js index 4dbf5d9cec..8f0538b32f 100644 --- a/module/build/js/common.js +++ b/module/build/js/common.js @@ -7,6 +7,11 @@ */ function loadBranches(productID) { + if($('input[name=isIntegrated]:checked').val() == 'yes') + { + $('#branchBox').closest('tr').addClass('hidden'); + return false; + } $('#branch').remove(); $('#branch_chosen').remove(); var oldBranch = 0; @@ -16,12 +21,17 @@ function loadBranches(productID) } projectID = currentTab == 'execution' ? executionID : projectID; - $.get(createLink('branch', 'ajaxGetBranches', 'productID=' + productID + '&oldBranch=0¶m=active&projectID=' + projectID), function(data) + $.get(createLink('branch', 'ajaxGetBranches', 'productID=' + productID + '&oldBranch=0¶m=active&projectID=' + projectID + '&withMainBranch=true&isSiblings=no&fieldID=0&multiple=multiple'), function(data) { if(data) { - $('#product').closest('.input-group').append(data); + $('#branchBox').append(data); $('#branch').chosen(); + $('#branchBox').closest('tr').removeClass('hidden'); + } + else + { + $('#branchBox').closest('tr').addClass('hidden'); } }); } diff --git a/module/build/model.php b/module/build/model.php index baa9253ead..d1d7caa077 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -382,21 +382,31 @@ class buildModel extends model ->setDefault('product', 0) ->setDefault('branch', 0) ->setDefault('builds', '') - ->cleanInt('product,branch') + ->cleanInt('product') ->add('createdBy', $this->app->user->account) ->add('createdDate', helper::now()) ->stripTags($this->config->build->editor->create['id'], $this->config->allowedTags) - ->join('builds', ',') + ->join('builds,', ',') + ->join('branch', ',') ->remove('resolvedBy,allchecker,files,labels,isIntegrated,uid') ->get(); if($this->post->isIntegrated == 'yes') $build->execution = 0; + $product = $this->loadModel('product')->getByID($build->product); + if($product->type != 'normal' and !isset($_POST['branch'])) + { + $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); + dao::$errors['branch'] = sprintf($this->lang->error->notempty, $this->lang->product->branch); + } + + if(dao::isError()) return false; + $build = $this->loadModel('file')->processImgURL($build, $this->config->build->editor->create['id'], $this->post->uid); $this->dao->insert(TABLE_BUILD)->data($build) ->autoCheck() ->batchCheck($this->config->build->create->requiredFields, 'notempty') - ->check('name', 'unique', "product = {$build->product} AND branch = {$build->branch} AND deleted = '0'") + ->check('name', 'unique', "product = {$build->product} AND branch = '{$build->branch}' AND deleted = '0'") ->checkFlow() ->exec(); diff --git a/module/build/view/create.html.php b/module/build/view/create.html.php index 543af32def..7dfb47c48a 100644 --- a/module/build/view/create.html.php +++ b/module/build/view/create.html.php @@ -33,12 +33,6 @@ @@ -50,6 +44,16 @@ + type != 'normal'): ?> + + + + + From 0c42a46b93362ed0b12c6de49354d030ad0b739f Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Tue, 6 Dec 2022 09:16:54 +0800 Subject: [PATCH 201/267] * Code for task#78669. --- module/productplan/control.php | 31 +++++++++++++++++-------- module/productplan/js/create.js | 20 +++++++++------- module/productplan/js/edit.js | 30 +++++++++++------------- module/productplan/view/create.html.php | 12 +++++----- module/productplan/view/edit.html.php | 21 +++++++++-------- 5 files changed, 62 insertions(+), 52 deletions(-) diff --git a/module/productplan/control.php b/module/productplan/control.php index 91e31a77e2..389b366571 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -151,11 +151,19 @@ class productplan extends control $oldBranch = array($planID => $plan->branch); /* Get the parent plan pair exclusion itself. */ - $parentPlanPairs = $this->productplan->getTopPlanPairs($plan->product, $plan->branch); + $parentPlanPairs = $this->productplan->getTopPlanPairs($plan->product); unset($parentPlanPairs[$planID]); $this->view->parentPlanPairs = $parentPlanPairs; $this->commonAction($plan->product, $plan->branch); + + if($plan->parent) + { + $parentPlan = $this->productplan->getByID($plan->parent); + $branchPairs = array(); + foreach(explode(',', $parentPlan->branch) as $parentBranchID) $branchPairs[$parentBranchID] = $this->view->branchTagOption[$parentBranchID]; + $this->view->branchTagOption = $branchPairs; + } $this->view->title = $this->view->product->name . $this->lang->colon . $this->lang->productplan->edit; $this->view->position[] = $this->lang->productplan->edit; $this->view->productID = $plan->product; @@ -1000,19 +1008,22 @@ class productplan extends control } /** - * AJAX: Get top plan. + * AJAX: Get parent branches. * - * @param int $productID - * @param int $branch - * @param int $planID + * @param int $parentID * @access public - * @return object + * @return void */ - public function ajaxGetTopPlan($productID, $branch = 0, $planID = 0) + public function ajaxGetParentBranches($productID = 0, $parentID = 0) { - $parentPlanPairs = $this->productplan->getTopPlanPairs($productID, $branch); - if(isset($parentPlanPairs[$planID])) unset($parentPlanPairs[$planID]); - return print(html::select('parent', array(0 => '') + $parentPlanPairs, 0, 'class="form-control"')); + $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]; + } + return print(html::select('branch[]', empty($parentID) ? $branchPairs : $parentBranches, '', "class='form-control chosen' multiple required")); } /** diff --git a/module/productplan/js/create.js b/module/productplan/js/create.js index 4c4be3f040..fdf7805e8f 100644 --- a/module/productplan/js/create.js +++ b/module/productplan/js/create.js @@ -63,6 +63,17 @@ $('#future').on('change', function() } }); +$('#parent').change(function() +{ + var parentID = $(this).val(); + $.post(createLink('productplan', 'ajaxGetParentBranches', "productID=" + productID + "&parentID=" + parentID), function(data) + { + $('#branch').replaceWith(data); + $('#branch_chosen').remove(); + $('#branch').chosen(); + }) +}) + $('#branch').change(function() { if(parentPlanID) return; @@ -72,21 +83,12 @@ $('#branch').change(function() var branchIdList = branchIdList.toString(); var lastPlanLink = createLink('productplan', 'ajaxGetLast', "productID=" + productID + "&branch=" + branchIdList); - var topPlanLink = createLink('productplan', 'ajaxGetTopPlan', "productID=" + productID + "&branch=" + branchIdList); - $.post(lastPlanLink, function(data) { data = JSON.parse(data); var planTitle = data ? '(' + lastLang + ': ' + data.title + ')' : ''; $('#title').parent().next('td').html(planTitle); }) - - $.post(topPlanLink, function(data) - { - $('#parent').replaceWith(data); - $('#parent_chosen').remove(); - $('#parent').chosen(); - }) }); $('#submit').click(function() diff --git a/module/productplan/js/edit.js b/module/productplan/js/edit.js index 402f42c589..6a6f6fd562 100644 --- a/module/productplan/js/edit.js +++ b/module/productplan/js/edit.js @@ -13,14 +13,7 @@ function convertStringToDate(dateString) return Date.parse(dateString); } -/** - * Get conflict stories. - * - * @param int $planID - * @access public - * @return void - */ -function getConflictStories(planID) +$('#branch').change(function() { var newBranch = $('#branch').val() ? $('#branch').val().toString() : ''; $.get(createLink('productplan', 'ajaxGetConflict', 'planID=' + planID + '&newBranch=' + newBranch), function(conflictStories) @@ -35,16 +28,8 @@ function getConflictStories(planID) $('#branch').trigger("chosen:updated"); } } - - var link = createLink('productplan', 'ajaxGetTopPlan', "productID=" + productID + "&branch=" + newBranch + "&planID=" + planID); - $.post(link, function(data) - { - $('#parent').replaceWith(data); - $('#parent_chosen').remove(); - $('#parent').chosen(); - }) }); -} +}); /** * Compute the end date for productplan. @@ -72,6 +57,17 @@ function computeEndDate(delta) $('#end').val(endDate).datetimepicker('update'); } +$('#parent').change(function() +{ + var parentID = $(this).val(); + $.post(createLink('productplan', 'ajaxGetParentBranches', "productID=" + productID + "&parentID=" + parentID), function(data) + { + $('#branch').replaceWith(data); + $('#branch_chosen').remove(); + $('#branch').chosen(); + }) +}) + $('#future').on('change', function() { if($(this).prop('checked')) diff --git a/module/productplan/view/create.html.php b/module/productplan/view/create.html.php index 01a0a00b82..c0534d69fc 100644 --- a/module/productplan/view/create.html.php +++ b/module/productplan/view/create.html.php @@ -37,6 +37,12 @@ + + + + + type != 'normal'):?> @@ -57,12 +63,6 @@ - - - - - diff --git a/module/productplan/view/edit.html.php b/module/productplan/view/edit.html.php index 469eb90018..cf8f677dc1 100644 --- a/module/productplan/view/edit.html.php +++ b/module/productplan/view/edit.html.php @@ -17,6 +17,7 @@ +id);?>
    @@ -30,17 +31,7 @@
    - type != 'normal' and $plan->parent != '-1'):?> - - - - - - - - - parent == '-1'):?> parent);?> @@ -49,6 +40,16 @@ + shadow and $product->type != 'normal' and $plan->parent != '-1'):?> + + + + + + + + + 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 202/267] * 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 bc2bceb7a7567a740c8b4b4a513da86138abf01a Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Tue, 6 Dec 2022 09:36:36 +0800 Subject: [PATCH 203/267] * Finish Bug #30543 --- module/story/control.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index 3ac09a9c79..ec4cbed451 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -298,7 +298,14 @@ class story extends control } $users = $this->user->getPairs('pdfirst|noclosed|nodeleted'); - $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch === 'all' ? 0 : $branch); + + $branchData = explode(',', $branch); + foreach($branchData as $branchItem) + { + $branch = $branchItem; + $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch === 'all' ? 0 : $branch); + break; + } if(empty($moduleOptionMenu)) return print(js::locate(helper::createLink('tree', 'browse', "productID=$productID&view=story"))); /* Init vars. */ @@ -440,7 +447,8 @@ class story extends control $this->view->users = $users; $this->view->moduleID = $moduleID; $this->view->moduleOptionMenu = $moduleOptionMenu; - $this->view->plans = str_replace('2030-01-01', $this->lang->story->undetermined, $this->loadModel('productplan')->getPairsForStory($productID, $branch == 0 ? '' : $branch, 'skipParent|unexpired|noclosed')); $this->view->planID = $planID; + $this->view->plans = str_replace('2030-01-01', $this->lang->story->undetermined, $this->loadModel('productplan')->getPairsForStory($productID, $branch == 0 ? '' : $branch, 'skipParent|unexpired|noclosed')); + $this->view->planID = $planID; $this->view->source = $source; $this->view->sourceNote = $sourceNote; $this->view->color = $color; @@ -658,8 +666,14 @@ class story extends control $branches = $product->type != 'normal' ? $this->loadModel('branch')->getPairs($productID, 'active') : array(); } - $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch === 'all' ? 0 : $branch); - $moduleOptionMenu['ditto'] = $this->lang->story->ditto; + $branchData = explode(',', $branch); + foreach($branchData as $branchItem) + { + $branch = $branchItem; + $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch === 'all' ? 0 : $branch); + $moduleOptionMenu['ditto'] = $this->lang->story->ditto; + break; + } /* Get reviewers. */ $reviewers = $product->reviewer; 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 204/267] * 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 205/267] * 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 206/267] * 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 925367c9cafa9e04c9c1c1d5bc4b59733f79268c Mon Sep 17 00:00:00 2001 From: liuhong Date: Tue, 6 Dec 2022 02:04:47 +0000 Subject: [PATCH 207/267] * Adjust code for task #78696. --- module/bug/model.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/bug/model.php b/module/bug/model.php index b34a6bc952..abd418ad7b 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -3023,7 +3023,10 @@ class bugModel extends model } $allBranch = "`branch` = 'all'"; - if(strpos($branch, '0,') !== false) $branch = str_replace('0,', '', $branch); + $branchAB = array(); + $branchAB = explode(',', $branch); + unset($branchAB[0]); + $branch = implode($branchAB, "','"); if($branch !== 'all' and strpos($bugQuery, '`branch` =') === false) $bugQuery .= " AND `branch` in('0','$branch')"; if(strpos($bugQuery, $allBranch) !== false) $bugQuery = str_replace($allBranch, '1', $bugQuery); From 0adbd8e27af2c7cdda802102df903693e3faf0b6 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Tue, 6 Dec 2022 10:16:34 +0800 Subject: [PATCH 208/267] * Finish Bug #30541 --- module/productplan/model.php | 2 +- module/story/model.php | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/module/productplan/model.php b/module/productplan/model.php index d378d62382..dcd64d775d 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -340,7 +340,7 @@ class productplanModel extends model ->andWhere('deleted')->eq(0) ->beginIF(strpos($param, 'unexpired') !== false)->andWhere('end')->ge($date)->fi() ->beginIF(strpos($param, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi() - ->beginIF($branch !== 'all' and $branch !== '')->andWhere($branchQuery)->fi() + ->beginIF($branch !== 'all' and $branch !== '' and !empty($branchQuery))->andWhere($branchQuery)->fi() ->orderBy('begin desc') ->fetchAll('id'); diff --git a/module/story/model.php b/module/story/model.php index 05472837b3..69e29a5af4 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2229,14 +2229,17 @@ class storyModel extends model if($oldStory->stage == 'wait') $story->stage = 'planned'; if($this->session->currentProductType and $this->session->currentProductType != 'normal' and $oldStory->branch == 0) { - if(!isset($oldStoryStages[$storyID][$plan->branch])) + foreach(explode(',', $plan->branch) as $planBranch) { - $story->stage = 'planned'; - $newStoryStage = new stdclass(); - $newStoryStage->story = $storyID; - $newStoryStage->branch = $plan->branch; - $newStoryStage->stage = $story->stage; - $this->dao->insert(TABLE_STORYSTAGE)->data($newStoryStage)->autoCheck()->exec(); + if(!isset($oldStoryStages[$storyID][$planBranch])) + { + $story->stage = 'planned'; + $newStoryStage = new stdclass(); + $newStoryStage->story = $storyID; + $newStoryStage->branch = $planBranch; + $newStoryStage->stage = $story->stage; + $this->dao->insert(TABLE_STORYSTAGE)->data($newStoryStage)->autoCheck()->exec(); + } } } } From 62157bf79e43c1e6a991fdb90b33081f1e24378a Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Tue, 6 Dec 2022 10:24:11 +0800 Subject: [PATCH 209/267] * 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 210/267] * 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 211/267] * 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 .= ''; else $html .= ''; } From 377ba07d06ead93eb45586fa0653318b0e453e77 Mon Sep 17 00:00:00 2001 From: liuhong Date: Tue, 6 Dec 2022 03:28:33 +0000 Subject: [PATCH 212/267] * Fix task code for #78696. --- module/bug/model.php | 1 - 1 file changed, 1 deletion(-) diff --git a/module/bug/model.php b/module/bug/model.php index abd418ad7b..69e0f12bdc 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -3025,7 +3025,6 @@ class bugModel extends model $allBranch = "`branch` = 'all'"; $branchAB = array(); $branchAB = explode(',', $branch); - unset($branchAB[0]); $branch = implode($branchAB, "','"); if($branch !== 'all' and strpos($bugQuery, '`branch` =') === false) $bugQuery .= " AND `branch` in('0','$branch')"; if(strpos($bugQuery, $allBranch) !== false) $bugQuery = str_replace($allBranch, '1', $bugQuery); From 86e46d3e3eb100804ac8eed520b23204989ca778 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 6 Dec 2022 11:48:04 +0800 Subject: [PATCH 213/267] * Modify bug create page style. --- module/bug/css/create.css | 2 +- www/theme/default/style.css | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module/bug/css/create.css b/module/bug/css/create.css index 746ea7a8b8..f7b68c49fb 100644 --- a/module/bug/css/create.css +++ b/module/bug/css/create.css @@ -57,4 +57,4 @@ html[lang='de'] #keywordsAddonLabel, .task {width: 73px;} #openedBuildLabel {display: inline; position: relative; width: 50%; left: 14%;} #bugTypeInputGroup > .table-col {width: 40% !important;} -.pri-text > .label-pri {padding: 1px 5px;} +.pri-text > .label-pri {padding: 2px 6px;} diff --git a/www/theme/default/style.css b/www/theme/default/style.css index 39a049cd7c..d878316af2 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -219,11 +219,11 @@ tbody tr td.c-actions .dividing-line {width: 1px; height: 16px; display: inline- .pri-text > .label-pri {padding: 1px 5px;} .pri-text > .label-pri, .pri-text > .label-severity {height: 20px;} -.pri-text > .label-severity {background-size: 80%; background-position: 2px -130px;} -.pri-text > .label-severity[data-severity="1"] {color: #FB2B2B; background-position: 2px 1px;} -.pri-text > .label-severity[data-severity="2"] {color: #FF8058; background-position: 2px -31px;} -.pri-text > .label-severity[data-severity="3"] {color: #FAAE1A; background-position: 2px -64px;} -.pri-text > .label-severity[data-severity="4"] {color: #B89664; background-position: 2px -97px;} +.pri-text > .label-severity {background-size: 85%; background-position: 1px -139px;} +.pri-text > .label-severity[data-severity="1"] {color: #FB2B2B; background-position: 2px 0px;} +.pri-text > .label-severity[data-severity="2"] {color: #FF8058; background-position: 2px -34px;} +.pri-text > .label-severity[data-severity="3"] {color: #FAAE1A; background-position: 1px -69px;} +.pri-text > .label-severity[data-severity="4"] {color: #B89664; background-position: 1px -104px;} .flow-block .footerbar span.label-success {background-color: #0DBB7D;} .flow-block .footerbar span.label-default {background-color: #9EA3B0;} From a3893c90462fe85a600932a3372fa45228385878 Mon Sep 17 00:00:00 2001 From: liuhong Date: Tue, 6 Dec 2022 05:11:07 +0000 Subject: [PATCH 214/267] *Adjuct code for task #78696. --- module/bug/model.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index 69e0f12bdc..e15a7fc9b9 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -3023,9 +3023,8 @@ class bugModel extends model } $allBranch = "`branch` = 'all'"; - $branchAB = array(); - $branchAB = explode(',', $branch); - $branch = implode($branchAB, "','"); + $branch = trim($branch, ','); + if(strpos($branch, ',') !== false) $branch = str_replace(',', "','", $branch); if($branch !== 'all' and strpos($bugQuery, '`branch` =') === false) $bugQuery .= " AND `branch` in('0','$branch')"; if(strpos($bugQuery, $allBranch) !== false) $bugQuery = str_replace($allBranch, '1', $bugQuery); 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 215/267] * 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 216/267] * 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);?> - + + + + @@ -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; + } + } + } + ?> + + + + + + @@ -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; + } + } + } + ?> + + + - + hasProduct):?> @@ -56,8 +56,8 @@ - - + + From 10646f608b4472717c8c342b3eb8889aea3da72d Mon Sep 17 00:00:00 2001 From: zhouxin Date: Tue, 6 Dec 2022 05:47:19 +0000 Subject: [PATCH 217/267] * 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 218/267] * 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);?> + - @@ -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;} - - - + + + From 069a8d4a062ee4abda4b4f5f66bcbbeb10d58c6f Mon Sep 17 00:00:00 2001 From: liuyongkai Date: Tue, 6 Dec 2022 13:54:54 +0800 Subject: [PATCH 219/267] * 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 220/267] * 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 221/267] * 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 222/267] * 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;} + @@ -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, '')) . ' '; + ?> + From 6f8dd9e186dff47b951a0220ba34ddc59de30954 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Tue, 6 Dec 2022 14:27:17 +0800 Subject: [PATCH 223/267] * 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 224/267] * 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 225/267] * 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 226/267] * 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 @@ - + From a4ae40d43b813a03657f22b00bd086e0d2e9c66b Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Tue, 6 Dec 2022 16:22:36 +0800 Subject: [PATCH 227/267] * Code for task#78669. Fix bug of edit parent plan. --- module/productplan/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/productplan/control.php b/module/productplan/control.php index 3d34f90760..486c675848 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -157,7 +157,7 @@ class productplan extends control $this->commonAction($plan->product, $plan->branch); - if($plan->parent) + if($plan->parent > 0) { $parentPlan = $this->productplan->getByID($plan->parent); $branchPairs = array(); From 70cc4cda660c530ab45141b88605a474128b6a85 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Tue, 6 Dec 2022 08:30:30 +0000 Subject: [PATCH 228/267] * Handle feedback #1666. --- module/testsuite/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/testsuite/control.php b/module/testsuite/control.php index 98b4023dc1..87254e67b7 100644 --- a/module/testsuite/control.php +++ b/module/testsuite/control.php @@ -89,7 +89,7 @@ class testsuite extends control $privateNum++; } } - $suitesNum = !empty(count($suites, 0)) ? count($suites, 0) : 0; + $suitesNum = !empty($suites) ? count($suites) : 0; $publicNum = $suitesNum - $privateNum; $summary = str_replace(array('%total%', '%public%', '%private%'), array($suitesNum, $publicNum, $privateNum), $this->lang->testsuite->summary); From 55aac8c426c33876e68ff630a59c69f4fc711b72 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Tue, 6 Dec 2022 16:51:58 +0800 Subject: [PATCH 229/267] * Finish Task #78664 --- module/build/control.php | 17 +++++++++++++++-- module/build/js/create.js | 3 +-- module/build/js/edit.js | 3 +-- module/build/model.php | 33 ++++++++++++++++++++++++++++----- module/build/view/edit.html.php | 16 ++++++++++------ module/execution/control.php | 2 +- module/execution/model.php | 2 +- module/productplan/model.php | 2 +- module/story/control.php | 22 ++++++++-------------- 9 files changed, 66 insertions(+), 34 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index 767239b781..bae863860c 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -199,7 +199,10 @@ class build extends control { $branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : ''); } - if(!isset($branchTagOption[$build->branch])) $branchTagOption[$build->branch] = $this->branch->getById($build->branch, 0, 'name'); + foreach(explode(',', $build->branch) as $buildBranch) + { + if(!isset($branchTagOption[$buildBranch])) $branchTagOption[$buildBranch] = $this->branch->getById($buildBranch, 0, 'name'); + } foreach($productGroups as $product) $products[$product->id] = $product->name; @@ -306,6 +309,16 @@ class build extends control $this->view->generatedBugPager = $generatedBugPager; $this->executeHooks($buildID); + $branchName = ''; + if($build->productType != 'normal') + { + foreach(explode(',', $build->branch) as $buildBranch) + { + $branchName .= $this->loadModel('branch')->getById($buildBranch); + $branchName .= ','; + } + $branchName = trim($branchName, ','); + } /* Assign. */ $this->view->canBeChanged = common::canBeChanged('build', $build); // Determines whether an object is editable. @@ -321,7 +334,7 @@ class build extends control $this->view->bugs = $bugs; $this->view->type = $type; $this->view->bugPager = $bugPager; - $this->view->branchName = $build->productType == 'normal' ? '' : $this->loadModel('branch')->getById($build->branch); + $this->view->branchName = $branchName; if($this->app->getViewType() == 'json') { diff --git a/module/build/js/create.js b/module/build/js/create.js index b84d711c00..f74d9ca74e 100644 --- a/module/build/js/create.js +++ b/module/build/js/create.js @@ -9,8 +9,7 @@ $().ready(function() { var projectID = $('#project').val(); var productID = $('#product').val(); - var branch = $('#branch').length > 0 ? $('#branch').val() : ''; - $.get(createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=builds&build=&branch=' + branch + '&index=&needCreate=&type=noempty,notrunk,separate,singled&extra=multiple'), function(data) + $.get(createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=builds&build=&branch=all&index=&needCreate=&type=noempty,notrunk,separate,singled&extra=multiple'), function(data) { if(data) $('#buildBox').html(data); $('#builds').attr('data-placeholder', multipleSelect).chosen(); diff --git a/module/build/js/edit.js b/module/build/js/edit.js index 7088791ec2..f5a81757a8 100644 --- a/module/build/js/edit.js +++ b/module/build/js/edit.js @@ -10,8 +10,7 @@ $().ready(function() else { var productID = $('#product').val(); - var branch = $('#branch').val(); - $.get(createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=builds&build=&branch=' + branch + '&index=&needCreate=&type=noempty,notrunk,separate,singled&extra=multiple'), function(data) + $.get(createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=builds&build=&branch=all&index=&needCreate=&type=noempty,notrunk,separate,singled&extra=multiple'), function(data) { if(data) $('#buildBox').html(data); $('#builds').attr('data-placeholder', multipleSelect).chosen(); diff --git a/module/build/model.php b/module/build/model.php index d1d7caa077..090beb297e 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -386,15 +386,28 @@ class buildModel extends model ->add('createdBy', $this->app->user->account) ->add('createdDate', helper::now()) ->stripTags($this->config->build->editor->create['id'], $this->config->allowedTags) - ->join('builds,', ',') + ->join('builds', ',') ->join('branch', ',') ->remove('resolvedBy,allchecker,files,labels,isIntegrated,uid') ->get(); - if($this->post->isIntegrated == 'yes') $build->execution = 0; + if($this->post->isIntegrated == 'yes') + { + $build->execution = 0; + $branchPairs = $this->dao->select('branch')->from(TABLE_BUILD)->where('id')->in($build->builds)->fetchPairs(); + $relationBranch = array(); + foreach($branchPairs as $branches) + { + foreach(explode(',', $branches) as $branch) + { + if(!isset($relationBranch[$branch])) $relationBranch[$branch] = $branch; + } + } + $build->branch = implode(',', $relationBranch); + } $product = $this->loadModel('product')->getByID($build->product); - if($product->type != 'normal' and !isset($_POST['branch'])) + if($product->type != 'normal' and $this->post->isIntegrated == 'no' and !isset($_POST['branch'])) { $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); dao::$errors['branch'] = sprintf($this->lang->error->notempty, $this->lang->product->branch); @@ -436,17 +449,27 @@ class buildModel extends model ->setIF(!isset($_POST['branch']), 'branch', $oldBuild->branch) ->setDefault('product', $oldBuild->product) ->setDefault('builds', '') - ->cleanInt('product,branch,execution') + ->cleanInt('product,execution') ->join('builds', ',') + ->join('branch', ',') ->remove('allchecker,resolvedBy,files,labels,uid') ->get(); + $product = $this->loadModel('product')->getByID($build->product); + if($product->type != 'normal' and $this->post->isIntegrated == 'no' and !isset($_POST['branch'])) + { + $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); + dao::$errors['branch'] = sprintf($this->lang->error->notempty, $this->lang->product->branch); + } + + if(dao::isError()) return false; + $build = $this->loadModel('file')->processImgURL($build, $this->config->build->editor->edit['id'], $this->post->uid); $this->dao->update(TABLE_BUILD)->data($build) ->autoCheck() ->batchCheck($this->config->build->edit->requiredFields, 'notempty') ->where('id')->eq($buildID) - ->check('name', 'unique', "id != $buildID AND product = {$build->product} AND branch = {$build->branch} AND deleted = '0'") + ->check('name', 'unique', "id != $buildID AND product = {$build->product} AND branch = '{$build->branch}' AND deleted = '0'") ->checkFlow() ->exec(); if(isset($build->branch) and $oldBuild->branch != $build->branch) $this->dao->update(TABLE_RELEASE)->set('branch')->eq($build->branch)->where('build')->eq($buildID)->exec(); diff --git a/module/build/view/edit.html.php b/module/build/view/edit.html.php index 21e386d8d3..aa2912279f 100644 --- a/module/build/view/edit.html.php +++ b/module/build/view/edit.html.php @@ -32,16 +32,20 @@ ?>
    product, "onchange='loadBranches(this.value);' class='form-control chosen' $disabled required");?> - productType != 'normal') - { - echo "" . html::select('branch', $branchTagOption, $build->branch, "class='form-control chosen' $disabled"); - } - ?>
    + type != 'normal'): ?> + + + + + execution):?> diff --git a/module/execution/control.php b/module/execution/control.php index d768d36b23..acce62c2ea 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -4144,7 +4144,7 @@ class execution extends control foreach($planStory as $id => $story) { $projectBranches = zget($projectProducts, $story->product, array()); - if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($story->branch) and !empty($projectBranches) and !isset($projectBranches[$story->branch]))) + if($story->status != 'active' or (!empty($story->branch) and !empty($projectBranches) and !isset($projectBranches[$story->branch]))) { $count++; unset($planStory[$id]); diff --git a/module/execution/model.php b/module/execution/model.php index ac9033160a..a272b7b283 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -2937,7 +2937,7 @@ class executionModel extends model { foreach($planStory as $id => $story) { - if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($story->branch) and !empty($executionBranches) and !isset($executionBranches[$story->branch]))) + if($story->status != 'active' or (!empty($story->branch) and !empty($executionBranches) and !isset($executionBranches[$story->branch]))) { unset($planStory[$id]); continue; diff --git a/module/productplan/model.php b/module/productplan/model.php index dcd64d775d..7f1273fb81 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -1069,7 +1069,7 @@ class productplanModel extends model foreach($planStory as $id => $story) { $projectBranches = zget($projectProducts, $story->product, array()); - if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($story->branch) and !empty($projectBranches) and !isset($projectBranches[$story->branch]))) + if($story->status == 'active' or (!empty($story->branch) and !empty($projectBranches) and !isset($projectBranches[$story->branch]))) { unset($planStory[$id]); continue; diff --git a/module/story/control.php b/module/story/control.php index ec4cbed451..1c02ef532c 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -298,14 +298,11 @@ class story extends control } $users = $this->user->getPairs('pdfirst|noclosed|nodeleted'); - + $branchData = explode(',', $branch); - foreach($branchData as $branchItem) - { - $branch = $branchItem; - $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch === 'all' ? 0 : $branch); - break; - } + $branch = current($branchData); + $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch === 'all' ? 0 : $branch); + if(empty($moduleOptionMenu)) return print(js::locate(helper::createLink('tree', 'browse', "productID=$productID&view=story"))); /* Init vars. */ @@ -667,13 +664,10 @@ class story extends control } $branchData = explode(',', $branch); - foreach($branchData as $branchItem) - { - $branch = $branchItem; - $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch === 'all' ? 0 : $branch); - $moduleOptionMenu['ditto'] = $this->lang->story->ditto; - break; - } + $branch = current($branchData); + + $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch === 'all' ? 0 : $branch); + $moduleOptionMenu['ditto'] = $this->lang->story->ditto; /* Get reviewers. */ $reviewers = $product->reviewer; From f1b869d003effd2d00eb19377937d8e2142d802b Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Tue, 6 Dec 2022 16:59:47 +0800 Subject: [PATCH 230/267] * Merge SQL. --- db/update18.0.beta1.sql | 2 ++ db/update18.0.sql | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 db/update18.0.sql diff --git a/db/update18.0.beta1.sql b/db/update18.0.beta1.sql index e7e4c35cbd..d9197b8193 100644 --- a/db/update18.0.beta1.sql +++ b/db/update18.0.beta1.sql @@ -1 +1,3 @@ +ALTER TABLE `zt_story` ADD COLUMN `siblings` varchar(255) NOT NULL AFTER `linkRequirements`; +ALTER TABLE `zt_productplan` MODIFY COLUMN `branch` varchar(255) NOT NULL DEFAULT '0'; ALTER TABLE `zt_effort` ADD `extra` text COLLATE 'utf8_general_ci' NOT NULL AFTER `end`; diff --git a/db/update18.0.sql b/db/update18.0.sql deleted file mode 100644 index ecdd8e79a2..0000000000 --- a/db/update18.0.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE `zt_story` ADD COLUMN `siblings` varchar(255) NOT NULL AFTER `linkRequirements`; - -ALTER TABLE `zt_productplan` MODIFY COLUMN `branch` varchar(255) NOT NULL DEFAULT '0'; From 4cbf1397b89a0d3bc24acf4d39442e7d93d06b41 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Tue, 6 Dec 2022 17:18:57 +0800 Subject: [PATCH 231/267] * Finish Task #78671 --- module/build/view/create.html.php | 4 +--- module/build/view/edit.html.php | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/module/build/view/create.html.php b/module/build/view/create.html.php index 7dfb47c48a..d2b96aadc9 100644 --- a/module/build/view/create.html.php +++ b/module/build/view/create.html.php @@ -44,8 +44,7 @@ - type != 'normal'): ?> - + '> - diff --git a/module/build/view/edit.html.php b/module/build/view/edit.html.php index aa2912279f..31dfe9dcaf 100644 --- a/module/build/view/edit.html.php +++ b/module/build/view/edit.html.php @@ -36,8 +36,8 @@ - type != 'normal'): ?> + '> - execution):?> From 871eb1c0a3b51f39b2c5b40f2024d87c3d32a263 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Tue, 6 Dec 2022 09:20:32 +0000 Subject: [PATCH 232/267] * Fix bug #30500. --- module/execution/control.php | 3 ++- module/project/control.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index d768d36b23..52711b216d 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1579,6 +1579,7 @@ class execution extends control $execution = $this->commonAction($executionID); $executionID = $execution->id; + $deptID = $this->app->user->admin ? 0 : $this->app->user->dept; $title = $execution->name . $this->lang->colon . $this->lang->execution->team; $position[] = html::a($this->createLink('execution', 'browse', "executionID=$executionID"), $execution->name); @@ -1586,7 +1587,7 @@ class execution extends control $this->view->title = $title; $this->view->position = $position; - $this->view->deptUsers = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'id'); + $this->view->deptUsers = $this->loadModel('dept')->getDeptUserPairs($deptID, 'id'); $this->view->canBeChanged = common::canModify('execution', $execution); // Determines whether an object is editable. $this->display(); diff --git a/module/project/control.php b/module/project/control.php index 76f901238a..6a5787404b 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -1610,11 +1610,12 @@ class project extends control $this->project->setMenu($projectID); $project = $this->project->getById($projectID); + $deptID = $this->app->user->admin ? 0 : $this->app->user->dept; $this->view->title = $project->name . $this->lang->colon . $this->lang->project->team; $this->view->projectID = $projectID; $this->view->teamMembers = $this->project->getTeamMembers($projectID); - $this->view->deptUsers = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'id'); + $this->view->deptUsers = $this->loadModel('dept')->getDeptUserPairs($deptID, 'id'); $this->view->canBeChanged = common::canModify('project', $project); $this->display(); From cb5af075f0362c2ff9bce13f9e0389b490a1eaf0 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 6 Dec 2022 17:27:53 +0800 Subject: [PATCH 233/267] * adjust for upgrade. --- module/upgrade/model.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 8edafef735..f3262ff000 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -756,6 +756,9 @@ class upgradeModel extends model case 'max3_3': $this->addReviewIssusApprovalData(); break; + case 'max4_0_beta1': + $this->initReviewEfforts(); + break; } } @@ -7969,4 +7972,31 @@ class upgradeModel extends model } return true; } + + /** + * Init review efforts. + * + * @access public + * @return void + */ + public function initReviewEfforts() + { + $nodes = $this->dao->select('t1.id,t3.id as reviewID,t3.title,t2.id as approvalID,t1.extra as consumed')->from(TABLE_APPROVALNODE)->alias('t1') + ->leftJoin(TABLE_APPROVAL)->alias('t2')->on("t1.approval=t2.id") + ->leftJoin(TABLE_REVIEW)->alias('t3')->on("t2.objectID=t3.id") + ->where('t3.deleted')->eq('0') + ->andWhere('t2.deleted')->eq('0') + ->andWhere('t2.objectType')->eq('review') + ->andWhere('t1.extra')->ne('') + ->andWhere('t1.extra')->ne(0) + ->orderBy('t1.approval,t1.id') + ->fetchAll('id'); + $this->loadModel('effort'); + foreach($nodes as $node) + { + $this->dao->delete()->from(TABLE_EFFORT)->where('objectType')->eq('review')->andWhere('objectID')->eq($node->reviewID)->exec(); + $this->effort->create('review', $node->reviewID, (int)$node->consumed, $node->title, $node->approvalID); + } + return true; + } } From 4239813b6beab6bf4a91150c6fbab9bd7eb8b034 Mon Sep 17 00:00:00 2001 From: zenggang Date: Tue, 6 Dec 2022 09:30:48 +0000 Subject: [PATCH 234/267] * Resolve feedback#1661 --- module/project/model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/project/model.php b/module/project/model.php index 21467dd1af..8d4afe8a87 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 and ($oldProject->name != $project->name or $oldProject->parent != $project->parent)) $this->updateShadowProduct($project); + if(!$oldProject->hasProduct and ($oldProject->name != $project->name or $oldProject->parent != $project->parent or $oldProject->acl != $project->acl)) $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 and ($oldProject->name != $project->name or $oldProject->parent != $project->parent)) $this->updateShadowProduct($project); + if(!$oldProject->hasProduct and ($oldProject->name != $project->name or $oldProject->parent != $project->parent or $oldProject->acl != $project->acl)) $this->updateShadowProduct($project); if(isset($project->parent)) { @@ -2048,7 +2048,7 @@ class projectModel extends model { $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(); + $this->dao->update(TABLE_PRODUCT)->set('name')->eq($project->name)->set('program')->eq($topProgram)->set('acl')->eq($project->acl)->where('id')->eq($product)->exec(); return !dao::isError(); } From 90120bd37fc44331087d7b068969a5e7a759e1fb Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 6 Dec 2022 17:42:33 +0800 Subject: [PATCH 235/267] * code for task #78914. --- module/projectrelease/control.php | 9 +++++---- module/projectrelease/view/view.html.php | 2 ++ module/release/control.php | 9 +++++---- module/release/view/view.html.php | 2 ++ 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index e69975257a..64efe20e94 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -249,13 +249,14 @@ class projectrelease extends control if(strpos($sort, 'pri_') !== false) $sort = str_replace('pri_', 'priOrder_', $sort); $storyPager = new pager($type == 'story' ? $recTotal : 0, $recPerPage, $type == 'story' ? $pageID : 1); - $stories = $this->dao->select("*, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder")->from(TABLE_STORY) - ->where('id')->in($release->stories) - ->andWhere('deleted')->eq(0) + $stories = $this->dao->select("t1.*,t2.id as buildID, t2.name as buildName,IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder")->from(TABLE_STORY)->alias('t1') + ->leftJoin(TABLE_BUILD)->alias('t2')->on("FIND_IN_SET(t1.id, t2.stories)") + ->where('t1.id')->in($release->stories) + ->andWhere('t1.deleted')->eq(0) ->beginIF($type == 'story')->orderBy($sort)->fi() ->page($storyPager) ->fetchAll('id'); - $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story'); + $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story' false); $stages = $this->dao->select('*')->from(TABLE_STORYSTAGE)->where('story')->in(array_keys($stories))->andWhere('branch')->eq($release->branch)->fetchPairs('story', 'stage'); foreach($stages as $storyID => $stage) $stories[$storyID]->stage = $stage; diff --git a/module/projectrelease/view/view.html.php b/module/projectrelease/view/view.html.php index b3ef89b38b..c7fee7a44d 100644 --- a/module/projectrelease/view/view.html.php +++ b/module/projectrelease/view/view.html.php @@ -71,6 +71,7 @@ + @@ -98,6 +99,7 @@ echo html::a($storyLink,$story->title, '', "class='preview'"); ?> + + @@ -100,6 +101,7 @@ echo html::a($storyLink,$story->title, '', "class='preview'"); ?> + + @@ -193,6 +194,8 @@ + resolvedBuild, '');?> + @@ -259,6 +262,7 @@ + @@ -297,6 +301,11 @@ + openedBuild) as $buildID) $openedBuildName .= zget($builds, $buildID, '') . ' '; + ?> + + @@ -195,6 +196,8 @@ + resolvedBuild, '');?> + @@ -261,6 +264,7 @@ + @@ -299,6 +303,11 @@ + openedBuild) as $buildID) $openedBuildName .= zget($builds, $buildID, '') . ' '; + ?> + '> - + diff --git a/module/programplan/model.php b/module/programplan/model.php index c68c38571f..2428208663 100755 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -243,11 +243,11 @@ class programplanModel extends model $oldTasks = $oldData->task; foreach($oldTasks as $id => $oldTask) { - if(!isset($tasks->$id)) continue; - $tasks->$id->version = $oldTask->version; - $tasks->$id->name = $oldTask->name; - $tasks->$id->estStarted = $oldTask->estStarted; - $tasks->$id->deadline = $oldTask->deadline; + if(!isset($tasks[$id])) continue; + $tasks[$id]->version = $oldTask->version; + $tasks[$id]->name = $oldTask->name; + $tasks[$id]->estStarted = $oldTask->estStarted; + $tasks[$id]->deadline = $oldTask->deadline; } } diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index 124480f679..6370b2f408 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -98,8 +98,8 @@ From 88b7894a3f1fd42ad7b9ab2f4d1a44fac846a81a Mon Sep 17 00:00:00 2001 From: zenggang Date: Wed, 7 Dec 2022 02:44:14 +0000 Subject: [PATCH 243/267] * Fix bug#30581 --- module/execution/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/execution/model.php b/module/execution/model.php index b1ac471826..5778c712f3 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -5247,7 +5247,6 @@ class executionModel extends model $_POST = array(); $_POST['project'] = $projectID; $_POST['name'] = $project->name; - $_POST['code'] = $project->code; $_POST['begin'] = $project->begin; $_POST['end'] = $project->end; $_POST['realBegan'] = $project->realBegan; @@ -5261,6 +5260,8 @@ class executionModel extends model $_POST['status'] = $project->status; $_POST['acl'] = 'open'; + if(!isset($this->config->setCode) or $this->config->setCode == 1) $_POST['code'] = $project->code; + $projectProducts = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($projectID)->fetchAll(); foreach($projectProducts as $projectProduct) { From 1119afb709974bb14cf2c256dc40823daeddcea6 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 7 Dec 2022 10:58:26 +0800 Subject: [PATCH 244/267] * code for task #78910. --- module/block/view/waterfallganttblock.html.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/module/block/view/waterfallganttblock.html.php b/module/block/view/waterfallganttblock.html.php index 68b5c3132e..a63f49f165 100644 --- a/module/block/view/waterfallganttblock.html.php +++ b/module/block/view/waterfallganttblock.html.php @@ -86,12 +86,12 @@ minTimeGap = Math.min(minTimeGap, endDatetime - startDatetime); item.tasks = []; item.completeTasks = []; - item.progress = 0; + item.progress = Number.parseFloat(item.taskProgress.replace('%', ''), 10); plans.push(item); } else if(item.type === 'task') { - item.progress = Number.parseInt(item.taskProgress.replace('%', ''), 10); + item.progress = Number.parseFloat(item.taskProgress.replace('%', ''), 10); tasks.push(item); } }); @@ -105,7 +105,6 @@ plan = plansMap[plan.parent]; if(typeof(plan) != 'object') return; } - plan.progress += task.progress; if(task.progress === 100) plan.completeTasks.push(task); plan.tasks.push(task); }); @@ -122,7 +121,6 @@ /* Update gantt plans and bars */ $.each(plans, function(index, plan) { - plan.progress = !plan.tasks.length ? 0 : plan.progress / plan.tasks.length; var $plan = $('
    '); $plan.append('
    ' + plan.text + '
    '); $plans.append($plan); From afe9d4902453184aead5af0ab2c1e9f5810f0771 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 7 Dec 2022 11:16:55 +0800 Subject: [PATCH 245/267] * Finish task#78668. --- module/build/model.php | 6 ++---- module/execution/control.php | 21 ++++++++++++--------- module/execution/view/build.html.php | 15 +++++++++------ module/project/control.php | 27 ++++++++++++++++----------- module/project/view/build.html.php | 9 +++++++-- 5 files changed, 46 insertions(+), 32 deletions(-) diff --git a/module/build/model.php b/module/build/model.php index 45d13f4296..6f2f11d422 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -63,11 +63,10 @@ class buildModel extends model */ public function getProjectBuilds($projectID = 0, $type = 'all', $param = 0, $orderBy = 't1.date_desc,t1.id_desc', $pager = null) { - return $this->dao->select('t1.*, t2.name as executionName, t2.id as executionID, t3.name as productName, t4.name as branchName') + return $this->dao->select('t1.*, t2.name as executionName, t2.id as executionID, t3.name as productName') ->from(TABLE_BUILD)->alias('t1') ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id') ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id') - ->leftJoin(TABLE_BRANCH)->alias('t4')->on('t1.branch = t4.id') ->where('t1.deleted')->eq(0) ->andWhere('t1.project')->ne(0) ->beginIF($projectID)->andWhere('t1.project')->eq((int)$projectID)->fi() @@ -129,11 +128,10 @@ class buildModel extends model */ public function getExecutionBuilds($executionID, $type = '', $param = '', $orderBy = 't1.date_desc,t1.id_desc', $pager = null) { - return $this->dao->select('t1.*, t2.name as executionName, t3.name as productName, t4.name as branchName') + return $this->dao->select('t1.*, t2.name as executionName, t3.name as productName') ->from(TABLE_BUILD)->alias('t1') ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id') ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id') - ->leftJoin(TABLE_BRANCH)->alias('t4')->on('t1.branch = t4.id') ->where('t1.deleted')->eq(0) ->beginIF($executionID)->andWhere('t1.execution')->eq((int)$executionID)->fi() ->beginIF($type == 'product' and $param)->andWhere('t1.product')->eq($param)->fi() diff --git a/module/execution/control.php b/module/execution/control.php index e3d6492020..e0441803e8 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1298,21 +1298,23 @@ class execution extends control /* Set execution builds. */ $executionBuilds = array(); $productList = $this->product->getProducts($executionID); - $this->app->loadLang('branch'); + $showBranch = false; if(!empty($builds)) { + foreach($builds as $build) $executionBuilds[$build->product][] = $build; + + /* Get branch name. */ + $branchGroups = $this->loadModel('branch')->getByProducts(array_keys($executionBuilds)); foreach($builds as $build) { - /* If product is normal, unset branch name. */ - if(isset($productList[$build->product]) and $productList[$build->product]->type == 'normal') + $build->branchName = ''; + if(isset($branchGroups[$build->product])) { - $build->branchName = ''; + $showBranch = true; + $branchPairs = $branchGroups[$build->product]; + foreach(explode(',', $build->branch) as $branchID) $build->branchName .= "{$branchPairs[$branchID]},"; + $build->branchName = trim($build->branchName, ','); } - else - { - $build->branchName = isset($build->branchName) ? $build->branchName : $this->lang->branch->main; - } - $executionBuilds[$build->product][] = $build; } } @@ -1328,6 +1330,7 @@ class execution extends control $this->view->product = $type == 'product' ? $param : 'all'; $this->view->products = $products; $this->view->type = $type; + $this->view->showBranch = $showBranch; $this->display(); } diff --git a/module/execution/view/build.html.php b/module/execution/view/build.html.php index 41f1b2b7d0..51da5feb00 100644 --- a/module/execution/view/build.html.php +++ b/module/execution/view/build.html.php @@ -49,9 +49,12 @@
    - + + + + - + @@ -63,10 +66,10 @@ - + + + + hasProduct):?> + + + multiple):?> - + @@ -68,7 +71,6 @@ hasProduct):?> + + + multiple):?> execution):?> From 8a2cb317c5523cb1d991eaf42d230b0466f4479e Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 7 Dec 2022 11:17:00 +0800 Subject: [PATCH 246/267] * adjust for release story build. --- module/projectrelease/control.php | 9 +++++++++ module/release/control.php | 1 + 2 files changed, 10 insertions(+) diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index abcca88bf6..e937c2b2f0 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -247,6 +247,7 @@ class projectrelease extends control $sort = common::appendOrder($orderBy); if(strpos($sort, 'pri_') !== false) $sort = str_replace('pri_', 'priOrder_', $sort); + $sort .= ',buildID_asc'; $storyPager = new pager($type == 'story' ? $recTotal : 0, $recPerPage, $type == 'story' ? $pageID : 1); $stories = $this->dao->select("t1.*,t2.id as buildID, t2.name as buildName,IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder")->from(TABLE_STORY)->alias('t1') @@ -306,6 +307,14 @@ class projectrelease extends control $this->view->bugPager = $bugPager; $this->view->leftBugPager = $leftBugPager; $this->view->builds = $this->loadModel('build')->getBuildPairs($release->product, 'all', 'withbranch|hasproject', 0, 'execution', '', false); + + if($this->app->getViewType() == 'json') + { + unset($this->view->storyPager); + unset($this->view->bugPager); + unset($this->view->leftBugPager); + } + $this->display(); } diff --git a/module/release/control.php b/module/release/control.php index 5e2b5508f0..46712fb037 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -183,6 +183,7 @@ class release extends control $sort = common::appendOrder($orderBy); if(strpos($sort, 'pri_') !== false) $sort = str_replace('pri_', 'priOrder_', $sort); + $sort .= ',buildID_asc'; $storyPager = new pager($type == 'story' ? $recTotal : 0, $recPerPage, $type == 'story' ? $pageID : 1); $stories = $this->dao->select("t1.*,t2.id as buildID, t2.name as buildName, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder")->from(TABLE_STORY)->alias('t1') From 125610f6c5e7cff6aba11b8b9e00b2e512b3fbe0 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Wed, 7 Dec 2022 11:23:57 +0800 Subject: [PATCH 247/267] * Finish Task #78673 --- module/projectrelease/css/browse.css | 3 ++- module/projectrelease/model.php | 15 ++++++++++++++- module/projectrelease/view/browse.html.php | 2 ++ module/release/model.php | 6 +++++- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/module/projectrelease/css/browse.css b/module/projectrelease/css/browse.css index 8f2f032ebf..f9c5e49f9e 100644 --- a/module/projectrelease/css/browse.css +++ b/module/projectrelease/css/browse.css @@ -2,6 +2,7 @@ #releaseList tr:hover {background-color:unset;} td {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;} -.c-build {width: 250px;} +.c-build {width: 300px;} +.c-branch {width: 200px;} td.c-build {padding-left:8px !important;} .c-product, .c-execution {width: 120px;} diff --git a/module/projectrelease/model.php b/module/projectrelease/model.php index 9311581055..ddb459c82a 100644 --- a/module/projectrelease/model.php +++ b/module/projectrelease/model.php @@ -70,7 +70,20 @@ class projectreleaseModel extends model { $release->project = trim($release->project, ','); $release->branch = trim($release->branch, ','); - $release->build = trim($release->build, ','); + + $branchName = ''; + if($release->branch != 'normal') + { + foreach(explode(',', $release->branch) as $releaseBranch) + { + $branchName .= $this->loadModel('branch')->getById($releaseBranch); + $branchName .= ','; + } + $branchName = trim($branchName, ','); + } + $release->branchName = empty($branchName) ? $this->lang->branch->main : $branchName; + $release->build = trim($release->build, ','); + $buildIdList = array_merge($buildIdList, explode(',', $release->build)); } diff --git a/module/projectrelease/view/browse.html.php b/module/projectrelease/view/browse.html.php index befa815247..a45658db49 100644 --- a/module/projectrelease/view/browse.html.php +++ b/module/projectrelease/view/browse.html.php @@ -53,6 +53,7 @@ + createLink($build->execution ? 'build' : 'projectbuild', 'view', "buildID=$buildID"), $build->name, '', "data-app='project' title='name;?>'");?>processStatus('release', $release);?> + diff --git a/module/release/model.php b/module/release/model.php index 5b94a157b0..a765ad3f25 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -222,7 +222,11 @@ class releaseModel extends model if($linkedBuilds) $builds += $this->dao->select('id,project,branch,builds,stories,bugs')->from(TABLE_BUILD)->where('id')->in($linkedBuilds)->fetchAll('id'); foreach($builds as $build) { - $branches[$build->branch] = $build->branch; + foreach(explode(',', $build->branch) as $buildBranch) + { + if(!isset($branches[$buildBranch])) $branches[$buildBranch] = $buildBranch; + } + $projects[$build->project] = $build->project; if($this->post->sync) From a2d2c55e945db859f91a8b403093db221e703682 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 7 Dec 2022 11:25:41 +0800 Subject: [PATCH 248/267] * Code for task#78668. Add trim. --- module/execution/control.php | 2 +- module/project/control.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index e0441803e8..852ff8a755 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1312,7 +1312,7 @@ class execution extends control { $showBranch = true; $branchPairs = $branchGroups[$build->product]; - foreach(explode(',', $build->branch) as $branchID) $build->branchName .= "{$branchPairs[$branchID]},"; + foreach(explode(',', trim($build->branch, ',')) as $branchID) $build->branchName .= "{$branchPairs[$branchID]},"; $build->branchName = trim($build->branchName, ','); } } diff --git a/module/project/control.php b/module/project/control.php index e9bd7a942d..11669e7579 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -1466,7 +1466,7 @@ class project extends control { $showBranch = true; $branchPairs = $branchGroups[$build->product]; - foreach(explode(',', $build->branch) as $branchID) $build->branchName .= "{$branchPairs[$branchID]},"; + foreach(explode(',', trim($build->branch, ',')) as $branchID) $build->branchName .= "{$branchPairs[$branchID]},"; $build->branchName = trim($build->branchName, ','); } } From 6ce912837074bba20a5ad25f77b7ce39db593e5d Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 7 Dec 2022 11:50:17 +0800 Subject: [PATCH 249/267] * fix bug #30589. --- module/projectrelease/view/browse.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/projectrelease/view/browse.html.php b/module/projectrelease/view/browse.html.php index befa815247..e33a987c22 100644 --- a/module/projectrelease/view/browse.html.php +++ b/module/projectrelease/view/browse.html.php @@ -84,7 +84,7 @@ - + processStatus('release', $release);?> + type != 'normal'):?> + + + + + From cea279faf14fd3e333610122a72356ca043306cb Mon Sep 17 00:00:00 2001 From: Yagami Date: Wed, 7 Dec 2022 14:49:29 +0800 Subject: [PATCH 253/267] * Code for task #78672. --- module/projectrelease/model.php | 15 +++++++++++++++ module/projectrelease/view/view.html.php | 8 ++++++++ 2 files changed, 23 insertions(+) diff --git a/module/projectrelease/model.php b/module/projectrelease/model.php index 9311581055..ee948df18b 100644 --- a/module/projectrelease/model.php +++ b/module/projectrelease/model.php @@ -35,6 +35,21 @@ class projectreleaseModel extends model $release->branch = trim($release->branch, ','); $release->build = trim($release->build, ','); + $builds = $this->dao->select('id, branch, filePath, scmPath, name, execution, project')->from(TABLE_BUILD)->where('id')->in($release->build)->fetchAll(); + + /* Get release's branches by build. */ + $branches = array(); + if($release->productType != 'normal') + { + foreach($builds as $build) + { + $branch = explode(',', $build->branch); + if(is_array($branch)) $branches += $branch; + } + } + + $release->branches = $branches; + $this->loadModel('file'); $release = $this->file->replaceImgURL($release, 'desc'); $release->files = $this->file->getByObject('release', $releaseID); diff --git a/module/projectrelease/view/view.html.php b/module/projectrelease/view/view.html.php index 19ed80d00d..12b816fe23 100644 --- a/module/projectrelease/view/view.html.php +++ b/module/projectrelease/view/view.html.php @@ -373,6 +373,14 @@ ?> + type != 'normal'):?> + + + + + From f41dc323bfc43ab23a43e4828f8ff596248c971d Mon Sep 17 00:00:00 2001 From: zhouxin Date: Wed, 7 Dec 2022 06:58:26 +0000 Subject: [PATCH 254/267] * Fix filter of base64. --- config/filter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/filter.php b/config/filter.php index d12e06a8b2..75094f3dc9 100755 --- a/config/filter.php +++ b/config/filter.php @@ -2,7 +2,7 @@ $filter = new stdclass(); $filter->rules = new stdclass(); $filter->rules->md5 = '/^[a-z0-9]{32}$/'; -$filter->rules->base64 = '/^[a-zA-Z0-9\+\/\=]+$/'; +$filter->rules->base64 = '/^[a-zA-Z0-9\+\/\=\.]+$/'; $filter->rules->checked = '/^[0-9,\-]+$/'; $filter->rules->idList = '/^[0-9\|]+$/'; $filter->rules->lang = '/^[a-zA-Z_\-]+$/'; From 29d8ff292ad598c868852141c0d344545839aba7 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Wed, 7 Dec 2022 15:17:35 +0800 Subject: [PATCH 255/267] * Finish Task #78697 --- module/story/control.php | 1 + module/story/view/blocksibling.html.php | 2 +- module/story/view/edit.html.php | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index 1c02ef532c..2bc3434095 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -950,6 +950,7 @@ class story extends control $this->view->productStories = $productStories; $this->view->branchOption = $branchOption; $this->view->branchTagOption = $branchTagOption; + $this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($product->id); $this->view->reviewers = array_keys($reviewerList); $this->view->reviewedReviewer = $reviewedReviewer; $this->view->lastReviewer = $this->story->getLastReviewer($story->id); diff --git a/module/story/view/blocksibling.html.php b/module/story/view/blocksibling.html.php index 7b7152b54e..b5fdc07456 100644 --- a/module/story/view/blocksibling.html.php +++ b/module/story/view/blocksibling.html.php @@ -14,7 +14,7 @@ foreach($siblings as $sibling) { $id = $sibling->id; $title = '#' . $id . ' '. $sibling->title; - $branch = $branches[$sibling->branch]; + $branch = isset($branches[$sibling->branch]) ? $branches[$sibling->branch] : ''; $stage = $lang->story->stageList[$sibling->stage]; $labelClass = $story->branch == $sibling->branch ? 'label-primary' : ''; diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php index 2cd17c4cf0..cb81070841 100644 --- a/module/story/view/edit.html.php +++ b/module/story/view/edit.html.php @@ -109,7 +109,6 @@
      -
    From d2044980df5de3786a6fdcf817e660aa9876de06 Mon Sep 17 00:00:00 2001 From: Yagami Date: Wed, 7 Dec 2022 15:29:15 +0800 Subject: [PATCH 256/267] * Code for release's branch. --- module/projectrelease/model.php | 4 ++-- module/release/model.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/projectrelease/model.php b/module/projectrelease/model.php index 57dc9aed5d..0b164aac46 100644 --- a/module/projectrelease/model.php +++ b/module/projectrelease/model.php @@ -43,8 +43,8 @@ class projectreleaseModel extends model { foreach($builds as $build) { - $branch = explode(',', $build->branch); - if(is_array($branch)) $branches += $branch; + $branchIdList = explode(',', $build->branch); + foreach($branchIdList as $branchID) $branches[$branchID] = $branchID; } } diff --git a/module/release/model.php b/module/release/model.php index ad4bd7fa29..a9b075ac89 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -39,8 +39,8 @@ class releaseModel extends model { foreach($builds as $build) { - $branch = explode(',', $build->branch); - if(is_array($branch)) $branches += $branch; + $branchIdList = explode(',', $build->branch); + foreach($branchIdList as $branchID) $branches[$branchID] = $branchID; } } From 04cb6a9cac39c333d12b196f2a6a56aa1274e543 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Wed, 7 Dec 2022 15:53:10 +0800 Subject: [PATCH 257/267] * Finish Bug #30616 --- module/build/js/create.js | 2 +- module/build/js/edit.js | 8 +++++++- module/build/view/edit.html.php | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/module/build/js/create.js b/module/build/js/create.js index 96516eb760..35625a6d40 100644 --- a/module/build/js/create.js +++ b/module/build/js/create.js @@ -17,7 +17,6 @@ $().ready(function() $.get(createLink('product', 'ajaxGetProductById', 'produtID=' + productID), function(data) { - console.log(data.branchName) $('#branchBox').closest('tr').find('th').text(data.branchName); }, 'json'); }); @@ -80,6 +79,7 @@ function loadProducts(executionID) { $('#branchBox').closest('tr').find('th').text(data.branchName); }, 'json'); + loadLastBuild(); } diff --git a/module/build/js/edit.js b/module/build/js/edit.js index f5a81757a8..cded7b0ab5 100644 --- a/module/build/js/edit.js +++ b/module/build/js/edit.js @@ -3,19 +3,25 @@ $().ready(function() var oldExecutionID = $('#execution').val(); $(document).on('change', '#product, #branch', function() { + var productID = $('#product').val(); + if(executionID) { loadExecutions(oldExecutionID); } else { - var productID = $('#product').val(); $.get(createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=builds&build=&branch=all&index=&needCreate=&type=noempty,notrunk,separate,singled&extra=multiple'), function(data) { if(data) $('#buildBox').html(data); $('#builds').attr('data-placeholder', multipleSelect).chosen(); }); } + + $.get(createLink('product', 'ajaxGetProductById', 'produtID=' + productID), function(data) + { + $('#branchBox').closest('tr').find('th').text(data.branchName); + }, 'json'); }); }); diff --git a/module/build/view/edit.html.php b/module/build/view/edit.html.php index 31dfe9dcaf..5e2ff18c64 100644 --- a/module/build/view/edit.html.php +++ b/module/build/view/edit.html.php @@ -38,7 +38,7 @@
    '> - + @@ -83,7 +87,8 @@ $type, 'reviewResultList', array()); + $reviewResultList = array(); + if(isset($lang->$type))$reviewResultList = zget($lang->$type, 'reviewResultList', array()); if(strpos(",{$config->my->oaObjectType},", ",$type,") !== false) $reviewResultList = zget($lang->$type, 'reviewStatusList', array()); ?> @@ -114,6 +119,10 @@ { common::printLink($module, 'view', $params, $reviewIcon, '', "class='btn' data-toggle='modal' title='{$lang->review->common}'", true, true); } + elseif(!in_array($module, array('story', 'testcase', 'feedback'))) + { + common::printLink($module, 'approvalreview', $params, $reviewIcon, '', "class='btn' data-toggle='modal' title='{$lang->review->common}'", true, true); + } else { common::printLink($module, $method, $params, $reviewIcon, '', "class='btn iframe' title='{$lang->review->common}'", true, true); From ec6f263bd3c926624f35558ae1d221ba036c9075 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 7 Dec 2022 21:42:59 +0800 Subject: [PATCH 260/267] * Code for task#78661. --- module/tree/control.php | 7 ++++--- module/tree/model.php | 5 ++++- module/tree/view/edit.html.php | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/module/tree/control.php b/module/tree/control.php index 9de9df00ab..dc5c7d5285 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -390,7 +390,7 @@ class tree extends control } else { - $this->view->optionMenu = $this->tree->getOptionMenu($module->root, $module->type, 0, $module->branch); + $this->view->optionMenu = $this->tree->getOptionMenu($module->root, $module->type, 0, $module->branch, 'noMainBranch'); } if($type == 'doc') $this->view->libs = $this->loadModel('doc')->getLibs('all', $extra = 'withObject', '', 0, 'book'); @@ -534,12 +534,13 @@ class tree extends control } else { - $optionMenu = $this->tree->getOptionMenu($rootID, $viewType, $rootModuleID, $branch); + $optionMenu = $this->tree->getOptionMenu($rootID, $viewType, $rootModuleID, $branch, $extra); } if(strpos($extra, 'excludeModuleID') !== false) { - parse_str($extra, $output); + list($excludeModule, $noMainBranch) = explode(',', $extra); + parse_str($excludeModule, $output); $excludeModuleID = $output['excludeModuleID']; if(isset($optionMenu[$excludeModuleID])) unset($optionMenu[$excludeModuleID]); } diff --git a/module/tree/model.php b/module/tree/model.php index c84f818e66..c026a3aec2 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -109,11 +109,14 @@ class treeModel extends model ->andWhere('type')->in($type) ->beginIF($grade)->andWhere('grade')->le($grade)->fi() ->beginIF($startModulePath)->andWhere('path')->like($startModulePath)->fi() - ->beginIF($branch !== 'all' and $branch !== '' and $branch !== false) + ->beginIF($branch !== 'all' and $branch !== '' and $branch !== false and strpos($param, 'noMainBranch') === false) ->andWhere('(branch')->eq(0) ->orWhere('branch')->eq($branch) ->markRight(1) ->fi() + ->beginIF($branch !== 'all' and $branch !== '' and $branch !== false and strpos($param, 'noMainBranch') !== false) + ->andWhere('branch')->eq($branch) + ->fi() ->beginIF(strpos($param, 'nodeleted') !== false)->andWhere('deleted')->eq(0)->fi() ->orderBy('grade desc, `order`') ->get(); diff --git a/module/tree/view/edit.html.php b/module/tree/view/edit.html.php index 233893d74e..09e8713b54 100644 --- a/module/tree/view/edit.html.php +++ b/module/tree/view/edit.html.php @@ -189,7 +189,7 @@ function loadModules(branch) if(typeof(branchID) == 'undefined') branchID = 0; if(typeof(moduleID) == 'undefined') moduleID = 0; - link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branchID + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=excludeModuleID=' + id;?> + '¤tModuleID=' + moduleID); + link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branchID + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=excludeModuleID=' + id;?> + ',noMainBranch¤tModuleID=' + moduleID); $(moduleBox).load(link, function() { $(this).children('select').attr('id', 'parent').attr('name', 'parent'); From 3e18aa302a8210edc894048573354c4eb9fec615 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 8 Dec 2022 09:16:17 +0800 Subject: [PATCH 261/267] * fix bug #30584. --- module/build/css/view.css | 1 + module/build/view/view.html.php | 6 +++--- module/project/control.php | 5 ++++- module/projectrelease/css/view.css | 1 + module/projectrelease/view/view.html.php | 6 +++--- module/release/css/view.css | 1 + module/release/view/view.html.php | 6 +++--- 7 files changed, 16 insertions(+), 10 deletions(-) diff --git a/module/build/css/view.css b/module/build/css/view.css index 3f124385b5..0789a2c0c3 100644 --- a/module/build/css/view.css +++ b/module/build/css/view.css @@ -6,3 +6,4 @@ .body-modal #mainContent {min-height: 200px;} td.article-content{overflow:auto !important;} +td.c-build{white-space: nowrap; overflow:hidden;} diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index abdf3700b4..dfdcb00dbf 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -148,7 +148,7 @@ tbody tr td:first-child input {display: none;} ?> - + @@ -254,7 +254,7 @@ tbody tr td:first-child input {display: none;} - + @@ -343,7 +343,7 @@ tbody tr td:first-child input {display: none;} $openedBuilds = ''; foreach(explode(',', $bug->openedBuild) as $buildID) $openedBuilds .= ($buildID == 'trunk' ? 'Trunk' : zget($buildPairs, $buildID, '')) . ' '; ?> - + diff --git a/module/project/control.php b/module/project/control.php index 11669e7579..3bdd635c89 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -1466,7 +1466,10 @@ class project extends control { $showBranch = true; $branchPairs = $branchGroups[$build->product]; - foreach(explode(',', trim($build->branch, ',')) as $branchID) $build->branchName .= "{$branchPairs[$branchID]},"; + foreach(explode(',', trim($build->branch, ',')) as $branchID) + { + if(isset($branchPairs[$branchID])) $build->branchName .= "{$branchPairs[$branchID]},"; + } $build->branchName = trim($build->branchName, ','); } } diff --git a/module/projectrelease/css/view.css b/module/projectrelease/css/view.css index 5be75906d4..a35a23f770 100644 --- a/module/projectrelease/css/view.css +++ b/module/projectrelease/css/view.css @@ -9,3 +9,4 @@ #tabsNav .nav-tabs > li.active + li.pull-right {margin-right: 0;} ol, ul {padding-left: 20px;} .c-id {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;} +td.c-build{white-space: nowrap; overflow:hidden;} diff --git a/module/projectrelease/view/view.html.php b/module/projectrelease/view/view.html.php index 12b816fe23..6c1854caac 100644 --- a/module/projectrelease/view/view.html.php +++ b/module/projectrelease/view/view.html.php @@ -99,7 +99,7 @@ echo html::a($storyLink,$story->title, '', "class='preview'"); ?> - + resolvedBuild, '');?> - + @@ -305,7 +305,7 @@ $openedBuildName = ''; foreach(explode(',', $bug->openedBuild) as $buildID) $openedBuildName .= zget($builds, $buildID, '') . ' '; ?> - + - + resolvedBuild, '');?> - + @@ -307,7 +307,7 @@ $openedBuildName = ''; foreach(explode(',', $bug->openedBuild) as $buildID) $openedBuildName .= zget($builds, $buildID, '') . ' '; ?> - +
    testtask->execution;?> - execution, "class='form-control chosen' onchange='loadExecutionRelated(this.value)'"); - echo html::hidden('product', $task->product); - ?> + execution, "class='form-control chosen' onchange='loadExecutionRelated(this.value)'");?>
    testtask->build;?> build, "class='form-control chosen'");?>
    execution->linkPlan;?> diff --git a/module/task/lang/de.php b/module/task/lang/de.php index 001b5e5e34..f3dbd8518d 100644 --- a/module/task/lang/de.php +++ b/module/task/lang/de.php @@ -241,6 +241,7 @@ $lang->task->confirmRecord = '"Reststunden " sind 0. Möchten Sie de $lang->task->confirmTransfer = '"Left Hour" is 0,Do you want to assign to %s task?'; $lang->task->noticeTaskStart = '"Cost Hour" and "Left Hour" cannot be 0 at the same time.'; $lang->task->noticeLinkStory = "Es wurde keine Story verknüpft. Sie können %s für dieses Projekt, anschließend %s."; +$lang->task->noticeLinkStoryNoProduct = "No story has been linked."; $lang->task->noticeSaveRecord = 'Ihre Stunden wurden nicht gespeichrt. Bitte erst speichern.'; $lang->task->noticeManageTeam = 'Task status is %s, can not manage team.'; $lang->task->commentActions = '%s. %s, kommentiert von %s.'; diff --git a/module/task/lang/en.php b/module/task/lang/en.php index fdd5f404e3..374e09c778 100755 --- a/module/task/lang/en.php +++ b/module/task/lang/en.php @@ -241,6 +241,7 @@ $lang->task->confirmRecord = '"Left Hour" is 0. Do you want to set t $lang->task->confirmTransfer = '"Left Hour" is 0,Do you want to assign to %s task?'; $lang->task->noticeTaskStart = '"Cost Hour" and "Left Hour" cannot be 0 at the same time.'; $lang->task->noticeLinkStory = "No story has been linked. You can %s for this project, then %s."; +$lang->task->noticeLinkStoryNoProduct = "No story has been linked."; $lang->task->noticeSaveRecord = 'Your Hour is not saved. Please save it first.'; $lang->task->noticeManageTeam = 'Task status is %s, can not manage team.'; $lang->task->commentActions = '%s. %s, commented by %s.'; diff --git a/module/task/lang/fr.php b/module/task/lang/fr.php index 8c5c49092d..0501411684 100644 --- a/module/task/lang/fr.php +++ b/module/task/lang/fr.php @@ -241,6 +241,7 @@ $lang->task->confirmRecord = '"Heures Restantes" à 0. Voulez-vous p $lang->task->confirmTransfer = '"Left Hour" is 0,Do you want to assign to %s task?'; $lang->task->noticeTaskStart = '"Cost Hour" and "Left Hour" cannot be 0 at the same time.'; $lang->task->noticeLinkStory = "Aucune Story n'est associée. Vous pouvez %s pour ce projet, alors %s."; +$lang->task->noticeLinkStoryNoProduct = "No story has been linked."; $lang->task->noticeSaveRecord = "Votre temps n'a pas été sauvé. Enregistrez-le d'abord."; $lang->task->noticeManageTeam = 'Task status is %s, can not manage team.'; $lang->task->commentActions = '%s. %s, commenté par %s.'; diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index 9b456371b7..25d58abdbd 100755 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -241,6 +241,7 @@ $lang->task->confirmRecord = '"剩余"为0,任务将标记为"已 $lang->task->confirmTransfer = '剩余工时为0,当前成员已完成任务,任务指派给:%s。'; $lang->task->noticeTaskStart = '"总计消耗"和"预计剩余"不能同时为0'; $lang->task->noticeLinkStory = "没有可关联的相关{$lang->SRCommon},您可以为当前项目%s,然后%s"; +$lang->task->noticeLinkStoryNoProduct = "没有可关联的相关{$lang->SRCommon}"; $lang->task->noticeSaveRecord = '您有尚未保存的工时记录,请先将其保存。'; $lang->task->noticeManageTeam = '任务状态是%s,不能维护团队'; $lang->task->commentActions = '%s. %s, 由 %s 添加备注。'; diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index 8e2f516d47..91b0a6d413 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -108,7 +108,13 @@ foreach(explode(',', $config->task->create->requiredFields) as $field)
    task->story;?> - task->noticeLinkStory, html::a($this->createLink('execution', 'linkStory', "executionID=$execution->id"), $lang->execution->linkStory, '', 'class="text-primary"'), html::a("javascript:loadStories($execution->id)", $lang->refresh, '', 'class="text-primary"'));?> + + task->noticeLinkStory, html::a($this->createLink('execution', 'linkStory', "executionID=$execution->id"), $lang->execution->linkStory, '', 'class="text-primary"'), html::a("javascript:loadStories($execution->id)", $lang->refresh, '', 'class="text-primary"')); + if(empty($execution->hasProduct)) $noticeLinkStory = $lang->task->noticeLinkStoryNoProduct; + echo $noticeLinkStory; + ?> +
    story, "class='form-control chosen' onchange='setStoryRelated();'");?> From 3f556e626b8dd3fc5265d1095d5fe31a8dbecdf6 Mon Sep 17 00:00:00 2001 From: Lufei Date: Wed, 30 Nov 2022 16:57:52 +0800 Subject: [PATCH 129/267] * Fix get extension files error for use softlink. --- lib/zfile/zfile.class.php | 16 +++++++++++++--- module/extension/model.php | 7 +++---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/lib/zfile/zfile.class.php b/lib/zfile/zfile.class.php index c2c0b3a4ac..0d2db1c2e6 100644 --- a/lib/zfile/zfile.class.php +++ b/lib/zfile/zfile.class.php @@ -19,10 +19,11 @@ class zfile * @param bool $logLevel * @param string $logFile * @param array $excludeFiles + * @param bool $toIsLink * @access public * @return array copied files, count, size or message. */ - public function copyDir($from, $to, $logLevel = false, $logFile = '', $excludeFiles = array()) + public function copyDir($from, $to, $logLevel = false, $logFile = '', $excludeFiles = array(), $toIsLink = false) { static $copiedFiles = array(); static $errorFiles = array(); @@ -42,7 +43,16 @@ class zfile if(!empty($log['message'])) return $log; $from = realpath($from) . '/'; - $to = realpath($to) . '/'; + if(is_link($to) || $toIsLink) + { + $to = $to . '/'; + + $toIsLink = true; + } + else + { + $to = realpath($to) . '/'; + } $entries = scandir($from); foreach($entries as $entry) @@ -83,7 +93,7 @@ class zfile { $nextFrom = $fullEntry; $nextTo = $to . $entry; - $result = $this->copyDir($nextFrom, $nextTo, $logLevel, $logFile); + $result = $this->copyDir($nextFrom, $nextTo, $logLevel, $logFile, array(), $toIsLink); $count += $result['count']; $size += $result['size']; } diff --git a/module/extension/model.php b/module/extension/model.php index 9094b74003..b34b2f9b27 100644 --- a/module/extension/model.php +++ b/module/extension/model.php @@ -780,11 +780,10 @@ class extensionModel extends model /** * Update an extension. * - * @param string $extension - * @param string $status - * @param array $files + * @param string $extension + * @param array|object $data * @access public - * @return void + * @return int */ public function updateExtension($extension, $data) { From df0997aa70fe1577bb170c541369da8b7920a596 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 30 Nov 2022 17:11:17 +0800 Subject: [PATCH 130/267] * change deletereleased param to noreleased. --- module/bug/control.php | 22 +++++++++++----------- module/build/control.php | 16 ++++++++-------- module/build/model.php | 4 ++-- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 5d0aa89a24..96e5c208ca 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -559,13 +559,13 @@ class bug extends control /* If executionID is setted, get builds and stories of this execution. */ if($executionID) { - $builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,noterminate,nodone,deletereleased', $executionID, 'execution'); + $builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,noterminate,nodone,noreleased', $executionID, 'execution'); $stories = $this->story->getExecutionStoryPairs($executionID); if(!$projectID) $projectID = $this->dao->select('project')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch('project'); } else { - $builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,noterminate,nodone,withbranch,deletereleased'); + $builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,noterminate,nodone,withbranch,noreleased'); $stories = $this->story->getProductStoryPairs($productID, $branch, 0, 'all','id_desc', 0, 'full', 'story', false); } @@ -767,7 +767,7 @@ class bug extends control /* If executionID is setted, get builds and stories of this execution. */ if($executionID) { - $builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,deletereleased', $executionID, 'execution'); + $builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,noreleased', $executionID, 'execution'); $stories = $this->story->getExecutionStoryPairs($executionID); $execution = $this->loadModel('execution')->getById($executionID); if($execution->type == 'kanban') @@ -787,7 +787,7 @@ class bug extends control } else { - $builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,deletereleased'); + $builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,noreleased'); $stories = $this->story->getProductStoryPairs($productID, $branch); } @@ -1085,15 +1085,15 @@ class bug extends control $allBuilds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty'); if($executionID) { - $openedBuilds = $this->build->getBuildPairs($productID, $bug->branch, 'noempty,noterminate,nodone,withbranch,deletereleased', $executionID, 'execution'); + $openedBuilds = $this->build->getBuildPairs($productID, $bug->branch, 'noempty,noterminate,nodone,withbranch,noreleased', $executionID, 'execution'); } elseif($projectID) { - $openedBuilds = $this->build->getBuildPairs($productID, $bug->branch, 'noempty,noterminate,nodone,withbranch,deletereleased', $projectID, 'project'); + $openedBuilds = $this->build->getBuildPairs($productID, $bug->branch, 'noempty,noterminate,nodone,withbranch,noreleased', $projectID, 'project'); } else { - $openedBuilds = $this->build->getBuildPairs($productID, $bug->branch, 'noempty,noterminate,nodone,withbranch,deletereleased'); + $openedBuilds = $this->build->getBuildPairs($productID, $bug->branch, 'noempty,noterminate,nodone,withbranch,noreleased'); } /* Set the openedBuilds list. */ @@ -1838,7 +1838,7 @@ class bug extends control $this->view->assignedTo = $assignedTo; $this->view->productBugs = $productBugs; $this->view->executions = $this->loadModel('product')->getExecutionPairsByProduct($productID, $bug->branch ? "0,{$bug->branch}" : 0, 'id_desc', $projectID, 'stagefilter'); - $this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $bug->branch, 'withbranch,deletereleased'); + $this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $bug->branch, 'withbranch,noreleased'); $this->view->releasedBuilds = $this->loadModel('release')->getReleasedBuilds($productID, $branch); $this->view->actions = $this->action->getList('bug', $bugID); $this->view->execution = isset($execution) ? $execution : ''; @@ -1938,7 +1938,7 @@ class bug extends control $this->view->bug = $bug; $this->view->users = $this->user->getPairs('noclosed', $bug->resolvedBy); - $this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $bug->branch, 'noempty,deletereleased', 0, 'execution', $bug->openedBuild); + $this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $bug->branch, 'noempty,noreleased', 0, 'execution', $bug->openedBuild); $this->view->actions = $this->action->getList('bug', $bugID); $this->display(); @@ -2155,7 +2155,7 @@ class bug extends control $this->view->bugs = $bugs; $this->view->users = $this->user->getPairs(); - $this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,deletereleased'); + $this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,noreleased'); $this->display(); } @@ -2417,7 +2417,7 @@ class bug extends control public function ajaxGetBugFieldOptions($productID, $executionID = 0) { $modules = $this->loadModel('tree')->getOptionMenu($productID, 'bug'); - $builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'deletereleased', $executionID, 'execution'); + $builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noreleased', $executionID, 'execution'); $type = $this->lang->bug->typeList; $pri = $this->lang->bug->priList; $severity = $this->lang->bug->severityList; diff --git a/module/build/control.php b/module/build/control.php index 0c5c92aa12..b77f4aa391 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -394,20 +394,20 @@ class build extends control $isJsonView = $this->app->getViewType() == 'json'; if($varName == 'openedBuild' ) { - $params = ($type == 'all') ? 'noempty,withbranch,deletereleased' : 'noempty,noterminate,nodone,withbranch,deletereleased'; + $params = ($type == 'all') ? 'noempty,withbranch,noreleased' : 'noempty,noterminate,nodone,withbranch,noreleased'; $builds = $this->build->getBuildPairs($productID, $branch, $params, 0, 'project', $build); if($isJsonView) return print(json_encode($builds)); return print(html::select($varName . '[]', $builds, $build, 'size=4 class=form-control multiple')); } if($varName == 'openedBuilds' ) { - $builds = $this->build->getBuildPairs($productID, $branch, 'noempty,deletereleased', 0, 'project', $build); + $builds = $this->build->getBuildPairs($productID, $branch, 'noempty,noreleased', 0, 'project', $build); if($isJsonView) return print(json_encode($builds)); return print(html::select($varName . "[$index][]", $builds, $build, 'size=4 class=form-control multiple')); } if($varName == 'resolvedBuild') { - $params = ($type == 'all') ? 'withbranch,deletereleased' : 'noterminate,nodone,withbranch,deletereleased'; + $params = ($type == 'all') ? 'withbranch,noreleased' : 'noterminate,nodone,withbranch,noreleased'; $builds = $this->build->getBuildPairs($productID, $branch, $params, 0, 'project', $build); if($isJsonView) return print(json_encode($builds)); return print(html::select($varName, $builds, $build, "class='form-control'")); @@ -440,7 +440,7 @@ class build extends control { if(empty($projectID)) return $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type); - $params = ($type == 'all') ? 'noempty,withbranch,deletereleased' : 'noempty,noterminate,nodone,withbranch,deletereleased'; + $params = ($type == 'all') ? 'noempty,withbranch,noreleased' : 'noempty,noterminate,nodone,withbranch,noreleased'; $builds = $this->build->getBuildPairs($productID, $branch, $params, $projectID, 'project', $build); if($isJsonView) return print(json_encode($builds)); return print(html::select($varName . '[]', $builds , '', 'size=4 class=form-control multiple')); @@ -449,7 +449,7 @@ class build extends control { if(empty($projectID)) return $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type); - $params = ($type == 'all') ? 'withbranch,deletereleased' : 'noterminate,nodone,withbranch,deletereleased'; + $params = ($type == 'all') ? 'withbranch,noreleased' : 'noterminate,nodone,withbranch,noreleased'; $builds = $this->build->getBuildPairs($productID, $branch, $params, $projectID, 'project', $build); if($isJsonView) return print(json_encode($builds)); return print(html::select($varName, $builds, $build, "class='form-control'")); @@ -484,7 +484,7 @@ class build extends control { if(empty($executionID)) return $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type); - $params = ($type == 'all') ? 'noempty,deletereleased' : 'noempty,noterminate,nodone,deletereleased'; + $params = ($type == 'all') ? 'noempty,noreleased' : 'noempty,noterminate,nodone,noreleased'; $builds = $this->build->getBuildPairs($productID, $branch, $params, $executionID, 'execution', $build); if($isJsonView) return print(json_encode($builds)); @@ -495,7 +495,7 @@ class build extends control { if(empty($executionID)) return $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type); - $builds = $this->build->getBuildPairs($productID, $branch, 'noempty,deletereleased', $executionID, 'execution', $build); + $builds = $this->build->getBuildPairs($productID, $branch, 'noempty,noreleased', $executionID, 'execution', $build); if($isJsonView) return print(json_encode($builds)); return print(html::select($varName . "[$index][]", $builds , $build, 'size=4 class=form-control multiple')); } @@ -503,7 +503,7 @@ class build extends control { if(empty($executionID)) return $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type); - $params = ($type == 'all') ? ',deletereleased' : 'noterminate,nodone,deletereleased'; + $params = ($type == 'all') ? ',noreleased' : 'noterminate,nodone,noreleased'; $builds = $this->build->getBuildPairs($productID, $branch, $params, $executionID, 'execution', $build); if($isJsonView) return print(json_encode($builds)); return print(html::select($varName, $builds, $build, "class='form-control'")); diff --git a/module/build/model.php b/module/build/model.php index c06d679602..2225863208 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -234,7 +234,7 @@ class buildModel extends model * * @param int|array $products * @param string|int $branch - * @param string $params noempty|notrunk|noterminate|withbranch|hasproject|noDeleted|singled|deletereleased, can be a set of them + * @param string $params noempty|notrunk|noterminate|withbranch|hasproject|noDeleted|singled|noreleased, can be a set of them * @param string|int $objectID * @param string $objectType * @param int|array $buildIdList @@ -332,7 +332,7 @@ class buildModel extends model { if(!isset($allBuilds[$buildID])) continue; $build = $allBuilds[$buildID]; - if(strpos($params, 'deletereleased') !== false) unset($builds[$build->date][$buildID]); + if(strpos($params, 'noreleased') !== false) unset($builds[$build->date][$buildID]); } } } From fe91c3e210b5fa79d6c03da9ff66fcfe82902987 Mon Sep 17 00:00:00 2001 From: mayue Date: Wed, 30 Nov 2022 16:28:24 +0800 Subject: [PATCH 131/267] * Finish task #77795. --- module/productplan/control.php | 44 +++++++++++++++++++++++------- module/productplan/js/batchedit.js | 4 +-- module/productplan/js/edit.js | 2 +- module/productplan/lang/de.php | 3 ++ module/productplan/lang/en.php | 3 ++ module/productplan/lang/fr.php | 3 ++ module/productplan/lang/zh-cn.php | 3 ++ 7 files changed, 49 insertions(+), 13 deletions(-) diff --git a/module/productplan/control.php b/module/productplan/control.php index f4419871cc..ce80f5e403 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -673,7 +673,7 @@ class productplan extends control $this->config->product->search['style'] = 'simple'; $this->config->product->search['params']['product']['values'] = $products + array('all' => $this->lang->product->allProductsOfProject); $this->config->product->search['params']['plan']['values'] = $this->productplan->getPairsForStory($plan->product, $plan->branch, 'skipParent|withMainPlan'); - $this->config->product->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($plan->product, 'story', 0, $plan->branch); + $this->config->product->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($plan->product, 'story', 0, 'all'); $storyStatusList = $this->lang->story->statusList; unset($storyStatusList['closed']); $this->config->product->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $storyStatusList); @@ -685,8 +685,12 @@ class productplan extends control else { $this->config->product->search['fields']['branch'] = $this->lang->product->branch; - $branchName = $this->loadModel('branch')->getById($plan->branch); - $branches = array('' => '', BRANCH_MAIN => $this->lang->branch->main, $plan->branch => $branchName); + $branchPairs = $this->loadModel('branch')->getPairs($plan->product); + foreach($branchPairs as $branchID => $branchName) + { + if(strpos(",$plan->branch,", ",$branchID,") === false) unset($branchPairs[$branchID]); + } + $branches = array('' => '', BRANCH_MAIN => $this->lang->branch->main) + $branchPairs; $this->config->product->search['params']['branch']['values'] = $branches; } $this->loadModel('search')->setSearchParams($this->config->product->search); @@ -809,7 +813,7 @@ class productplan extends control $this->config->bug->search['params']['execution']['values'] = $this->loadModel('product')->getExecutionPairsByProduct($plan->product, $plan->branch); $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($productID, $branch = 'all', $params = ''); $this->config->bug->search['params']['resolvedBuild']['values'] = $this->build->getBuildPairs($productID, $branch = 'all', $params = ''); - $this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($plan->product, 'bug', 0, $plan->branch); + $this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($plan->product, 'bug', 0, 'all'); $this->config->bug->search['params']['project']['values'] = $this->product->getProjectPairsByProduct($productID, $plan->branch); unset($this->config->bug->search['fields']['product']); @@ -922,29 +926,49 @@ class productplan extends control } /** - * AJAX: Get conflict story. + * AJAX: Get conflict story and bug. * * @param int $planID * @param int $branch * @access public * @return void */ - public function ajaxGetConflictStory($planID, $newBranch) + public function ajaxGetConflict($planID, $newBranch) { - $conflictStoryIdList = ''; - if(empty($newBranch)) return $conflictStoryIdList; + if(empty($newBranch)) return; $plan = $this->productplan->getByID($planID); $oldBranch = $plan->branch; $planStories = $this->loadModel('story')->getPlanStories($planID, 'all'); + $planBugs = $this->loadModel('bug')->getPlanBugs($planID, 'all'); + + $conflictStoryCounts = 0; + $conflictBugCounts = 0; if($oldBranch) { foreach($planStories as $storyID => $story) { - if($story->branch and strpos(",$newBranch,", ",$story->branch,") === false) $conflictStoryIdList .= '[' . $storyID . ']'; + if($story->branch and strpos(",$newBranch,", ",$story->branch,") === false) $conflictStoryCounts ++; + } + + foreach($planBugs as $bugID => $bug) + { + if($bug->branch and strpos(",$newBranch,", ",$bug->branch,") === false) $conflictBugCounts ++; } } - if($conflictStoryIdList != '') printf($this->lang->story->confirmChangePlan, $conflictStoryIdList); + + if($conflictStoryCounts and $conflictBugCounts) + { + printf($this->lang->productplan->confirmChangePlan, $conflictStoryCounts, $conflictBugCounts); + } + elseif($conflictStoryCounts) + { + printf($this->lang->productplan->confirmRemoveStory, $conflictStoryCounts); + } + elseif($conflictBugCounts) + { + printf($this->lang->productplan->confirmRemoveBug, $conflictBugCounts); + } } /** diff --git a/module/productplan/js/batchedit.js b/module/productplan/js/batchedit.js index 2e06088dcb..9384b7631a 100644 --- a/module/productplan/js/batchedit.js +++ b/module/productplan/js/batchedit.js @@ -30,11 +30,11 @@ function changeDate(planID) function getConflictStories(planID) { var newBranch = $('#branch' + planID).val() ? $('#branch' + planID).val().toString() : ''; - $.get(createLink('productplan', 'ajaxGetConflictStory', 'planID=' + planID + '&newBranch=' + newBranch), function(conflictStories) + $.get(createLink('productplan', 'ajaxGetConflict', 'planID=' + planID + '&newBranch=' + newBranch), function(conflictStories) { if(conflictStories != '' && !confirm(conflictStories)) { - $('#branch' + planID).val(oldBranch[planID]); + $('#branch' + planID).val(oldBranch[planID].split(',')); $('#branch' + planID).trigger("chosen:updated"); } }); diff --git a/module/productplan/js/edit.js b/module/productplan/js/edit.js index 0de68fe3d0..14108a29c7 100644 --- a/module/productplan/js/edit.js +++ b/module/productplan/js/edit.js @@ -23,7 +23,7 @@ function convertStringToDate(dateString) function getConflictStories(planID) { var newBranch = $('#branch').val() ? $('#branch').val().toString() : ''; - $.get(createLink('productplan', 'ajaxGetConflictStory', 'planID=' + planID + '&newBranch=' + newBranch), function(conflictStories) + $.get(createLink('productplan', 'ajaxGetConflict', 'planID=' + planID + '&newBranch=' + newBranch), function(conflictStories) { if(conflictStories != '') { diff --git a/module/productplan/lang/de.php b/module/productplan/lang/de.php index 0776e1a3be..7a1550c3fd 100644 --- a/module/productplan/lang/de.php +++ b/module/productplan/lang/de.php @@ -75,6 +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->id = 'ID'; $lang->productplan->product = $lang->productCommon; diff --git a/module/productplan/lang/en.php b/module/productplan/lang/en.php index 41b5fe348c..b87926374b 100644 --- a/module/productplan/lang/en.php +++ b/module/productplan/lang/en.php @@ -75,6 +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->id = 'ID'; $lang->productplan->product = $lang->productCommon; diff --git a/module/productplan/lang/fr.php b/module/productplan/lang/fr.php index dc5390ac80..2cc9a36ff8 100644 --- a/module/productplan/lang/fr.php +++ b/module/productplan/lang/fr.php @@ -75,6 +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->id = 'ID'; $lang->productplan->product = $lang->productCommon; diff --git a/module/productplan/lang/zh-cn.php b/module/productplan/lang/zh-cn.php index 119714e9de..42edec06be 100644 --- a/module/productplan/lang/zh-cn.php +++ b/module/productplan/lang/zh-cn.php @@ -75,6 +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->id = '编号'; $lang->productplan->product = $lang->productCommon; From bf3e8e33b3c99131a7543b68a1b5c36e63fbf405 Mon Sep 17 00:00:00 2001 From: chaideqing Date: Wed, 30 Nov 2022 21:07:12 +0800 Subject: [PATCH 132/267] * Fix feedback #1403 . --- module/execution/js/taskkanban.js | 8 +++++--- module/execution/lang/de.php | 2 ++ module/execution/lang/en.php | 2 ++ module/execution/lang/fr.php | 2 ++ module/execution/lang/zh-cn.php | 2 ++ module/execution/lang/zh-tw.php | 2 ++ module/execution/view/taskkanban.html.php | 1 + module/kanban/model.php | 5 +++++ module/task/model.php | 10 ++++++++++ 9 files changed, 31 insertions(+), 3 deletions(-) diff --git a/module/execution/js/taskkanban.js b/module/execution/js/taskkanban.js index 0c02f13b2c..e7192cbed5 100644 --- a/module/execution/js/taskkanban.js +++ b/module/execution/js/taskkanban.js @@ -67,7 +67,8 @@ function renderUserAvatar(user, objectType, objectID, size, objectStatus) if(objectType == 'bug' && !priv.canAssignBug) return $noPrivAvatar; var realname = user.realname ? user.realname : user.account; - return objectStatus == 'closed' ? '' : $('').avatar({user: user}); + var title = user.title ? user.title : realname; + return objectStatus == 'closed' ? '' : $('').avatar({user: user}); } /** @@ -286,8 +287,9 @@ function renderTaskItem(item, $item, col) { var priHtml = '' + item.pri + ''; var hoursHtml = scaleSize <= 1 && item.status != 'wait' ? ('' + taskLang.leftAB + ' ' + item.left + 'h') : ('' + taskLang.estimateAB + ' ' + item.estimate + 'h'); - var avatarHtml = renderUserAvatar(item.assignedTo, 'task', item.id, '', col.type); - + var avatarHtml = ''; + if(item.assignedTo == '' && item.mode == 'multi') avatarHtml = renderUserAvatar({title: item.assignedMembers, realname: iconTeam}, 'task', item.id, '', col.type); + else avatarHtml = renderUserAvatar(item.assignedTo, 'task', item.id, '', col.type); var $infos = $item.find('.infos'); if(!$infos.length) $infos = $('
    '); $infos.html([priHtml, hoursHtml].join('')); diff --git a/module/execution/lang/de.php b/module/execution/lang/de.php index f57ee64420..0d0f5fbd7e 100644 --- a/module/execution/lang/de.php +++ b/module/execution/lang/de.php @@ -478,6 +478,8 @@ $lang->execution->kanbanViewList['story'] = "{$lang->SRCommon}"; $lang->execution->kanbanViewList['bug'] = 'Bug'; $lang->execution->kanbanViewList['task'] = 'Task'; +$lang->execution->iconTeam = 'Team'; + $lang->kanbanSetting = new stdclass(); $lang->kanbanSetting->noticeReset = 'Möchten Sie die Einstellungen des Kanbans zurücksetzen?'; $lang->kanbanSetting->optionList['0'] = 'Verstecken'; diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index ae355906b7..220e646a7d 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -478,6 +478,8 @@ $lang->execution->kanbanViewList['story'] = "{$lang->SRCommon}"; $lang->execution->kanbanViewList['bug'] = 'Bug'; $lang->execution->kanbanViewList['task'] = 'Task'; +$lang->execution->iconTeam = 'Team'; + $lang->kanbanSetting = new stdclass(); $lang->kanbanSetting->noticeReset = 'Do you want to reset Kanban?'; $lang->kanbanSetting->optionList['0'] = 'Hide'; diff --git a/module/execution/lang/fr.php b/module/execution/lang/fr.php index 123c8c75ba..550fa7556d 100644 --- a/module/execution/lang/fr.php +++ b/module/execution/lang/fr.php @@ -478,6 +478,8 @@ $lang->execution->kanbanViewList['story'] = "{$lang->SRCommon}"; $lang->execution->kanbanViewList['bug'] = 'Bug'; $lang->execution->kanbanViewList['task'] = 'Task'; +$lang->execution->iconTeam = 'Team'; + $lang->kanbanSetting = new stdclass(); $lang->kanbanSetting->noticeReset = 'Voulez-vous réinitialiser le tableau Kanban ?'; $lang->kanbanSetting->optionList['0'] = 'Masquer'; diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index b748cf0623..09f48080d5 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -478,6 +478,8 @@ $lang->execution->kanbanViewList['story'] = "{$lang->SRCommon}看板"; $lang->execution->kanbanViewList['bug'] = 'Bug看板'; $lang->execution->kanbanViewList['task'] = '任务看板'; +$lang->execution->iconTeam = '团队'; + $lang->kanbanSetting = new stdclass(); $lang->kanbanSetting->noticeReset = '是否恢复看板默认设置?'; $lang->kanbanSetting->optionList['0'] = '隐藏'; diff --git a/module/execution/lang/zh-tw.php b/module/execution/lang/zh-tw.php index 3344de7b9e..05ba21bbf9 100644 --- a/module/execution/lang/zh-tw.php +++ b/module/execution/lang/zh-tw.php @@ -453,4 +453,6 @@ $lang->execution->statusColorList['doing'] = '#0BD986'; $lang->execution->statusColorList['suspended'] = '#fdc137'; $lang->execution->statusColorList['closed'] = '#838A9D'; +$lang->execution->iconTeam = '團隊'; + $lang->execution->boardColorList = array('#32C5FF', '#006AF1', '#9D28B2', '#FF8F26', '#7FBB00', '#424BAC', '#66c5f8', '#EC2761'); diff --git a/module/execution/view/taskkanban.html.php b/module/execution/view/taskkanban.html.php index a4c48dbb19..82f91e7280 100644 --- a/module/execution/view/taskkanban.html.php +++ b/module/execution/view/taskkanban.html.php @@ -231,4 +231,5 @@ js::set('priv', config->minColWidth);?> config->maxColWidth);?> +execution->iconTeam);?> diff --git a/module/kanban/model.php b/module/kanban/model.php index a4a02a08c0..4e8773e766 100755 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -1511,6 +1511,11 @@ class kanbanModel extends model $cardData['status'] = $object->status; $cardData['left'] = $object->left; $cardData['estStarted'] = $object->estStarted; + $cardData['mode'] = $object->mode; + if($object->mode == 'multi') + { + $cardData['assignedMembers'] = $object->assignedMembers; + } } else { diff --git a/module/task/model.php b/module/task/model.php index 9bf08e1551..13b9baf141 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -3206,6 +3206,16 @@ class taskModel extends model $task->progress = round($task->consumed / ($task->consumed + $task->left), 2) * 100; } + if($task->mode == 'multi') + { + $assignedMembers = $this->dao->select('t1.realname')->from(TABLE_USER)->alias('t1') + ->leftJoin(TABLE_TASKTEAM)->alias('t2') + ->on('t1.account = t2.account') + ->where('t2.task')->eq($task->id) + ->fetchPairs(); + $task->assignedMembers= join(',', array_keys($assignedMembers)); + } + return $task; } From 7c51a7f99206c9f002bb6fbb0cb1ebfae394646f Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 30 Nov 2022 22:18:27 +0800 Subject: [PATCH 133/267] * Code for task#77802. --- module/productplan/control.php | 42 +++++++++ module/productplan/js/create.js | 17 ++++ module/productplan/js/edit.js | 16 +++- module/productplan/lang/de.php | 1 + module/productplan/lang/en.php | 1 + module/productplan/lang/fr.php | 1 + module/productplan/lang/zh-cn.php | 1 + module/productplan/model.php | 85 +++++++++++-------- module/productplan/view/batchedit.html.php | 2 +- module/productplan/view/browsebylist.html.php | 2 +- module/productplan/view/create.html.php | 13 ++- 11 files changed, 139 insertions(+), 42 deletions(-) diff --git a/module/productplan/control.php b/module/productplan/control.php index f4419871cc..36ff2fcbe9 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -977,4 +977,46 @@ class productplan extends control if(isset($parentPlanPairs[$planID])) unset($parentPlanPairs[$planID]); return print(html::select('parent', array(0 => '') + $parentPlanPairs, 0, 'class="form-control"')); } + + /** + * AJAX: Get diff branches tips. + * + * @param int $productID + * @param int $parentID + * @param string $branches + * @access public + * @return void + */ + public function ajaxGetDiffBranchesTip($productID = 0, $parentID = 0, $branches = '') + { + if(empty($parentID) or empty($productID)) return; + + /* If it has children, return. */ + $parentBranch = $this->productplan->getByID($parentID); + if($parentBranch->parent == '-1') return; + + /* Find diff branches between parent plan and child plan. */ + $diffBranches = array(); + $diffBranchesTip = ''; + $product = $this->loadModel('product')->getByID($productID); + $branchPairs = $this->loadModel('branch')->getPairs($productID); + foreach(explode(',', $parentBranch->branch) as $parentBranchID) + { + if(empty($parentBranchID)) continue; + if(strpos(",$branches,", ",$parentBranchID,") === false) + { + $diffBranches[$parentBranchID] = $parentBranchID; + $diffBranchesTip .= "{$branchPairs[$parentBranchID]},"; + } + } + if(empty($diffBranchesTip)) return; + + /* Find stories and bugs in diff branches. */ + $unlinkStories = $this->dao->select('*')->from(TABLE_STORY)->where('branch')->in($diffBranches)->andWhere("CONCAT(',', plan, ',')")->like("%,{$parentID},%")->fetchAll('id'); + $unlinkBugs = $this->dao->select('*')->from(TABLE_BUG)->where('branch')->in($diffBranches)->andWhere('plan')->eq($parentID)->fetchAll('id'); + if(empty($unlinkStories) and empty($unlinkBugs)) return; + + $this->lang->productplan->diffBranchesTip = str_replace('@branch@', $this->lang->product->branchName[$product->type], $this->lang->productplan->diffBranchesTip); + printf($this->lang->productplan->diffBranchesTip, trim($diffBranchesTip, ',')); + } } diff --git a/module/productplan/js/create.js b/module/productplan/js/create.js index bc7db62c3b..4c4be3f040 100644 --- a/module/productplan/js/create.js +++ b/module/productplan/js/create.js @@ -65,6 +65,8 @@ $('#future').on('change', function() $('#branch').change(function() { + if(parentPlanID) return; + var branchIdList = $(this).val(); if(!branchIdList) return; @@ -86,3 +88,18 @@ $('#branch').change(function() $('#parent').chosen(); }) }); + +$('#submit').click(function() +{ + var parentPlan = $('#parent').val(); + var branches = $('#branch').val(); + if(parentPlan != 0 && branches) + { + link = createLink('productplan', 'ajaxGetDiffBranchesTip', "produtID=" + productID + "&parentID=" + parentPlan + "&branches=" + branches.toString()); + $.post(link, function(diffBranchesTip) + { + if((diffBranchesTip != '' && confirm(diffBranchesTip)) || !diffBranchesTip) $('form#dataform').submit(); + }); + return false; + } +}); diff --git a/module/productplan/js/edit.js b/module/productplan/js/edit.js index 0de68fe3d0..1bf541a2ed 100644 --- a/module/productplan/js/edit.js +++ b/module/productplan/js/edit.js @@ -86,5 +86,19 @@ $('#future').on('change', function() } }); - $('#future').change(); + +$('#submit').click(function() +{ + var parentPlan = $('#parent').val(); + var branches = $('#branch').val(); + if(parentPlan != 0 && branches) + { + link = createLink('productplan', 'ajaxGetDiffBranchesTip', "produtID=" + productID + "&parentID=" + parentPlan + "&branches=" + branches.toString()); + $.post(link, function(diffBranchesTip) + { + if((diffBranchesTip != '' && confirm(diffBranchesTip)) || !diffBranchesTip) $('form#dataform').submit(); + }); + return false; + } +}); diff --git a/module/productplan/lang/de.php b/module/productplan/lang/de.php index 0776e1a3be..31d4eaf9d7 100644 --- a/module/productplan/lang/de.php +++ b/module/productplan/lang/de.php @@ -136,6 +136,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->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 41b5fe348c..e2f19d5f63 100644 --- a/module/productplan/lang/en.php +++ b/module/productplan/lang/en.php @@ -136,6 +136,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->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 dc5390ac80..337fb049ef 100644 --- a/module/productplan/lang/fr.php +++ b/module/productplan/lang/fr.php @@ -136,6 +136,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->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 119714e9de..cec7d028c0 100644 --- a/module/productplan/lang/zh-cn.php +++ b/module/productplan/lang/zh-cn.php @@ -136,6 +136,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->featureBar['browse']['all'] = '全部'; $lang->productplan->featureBar['browse']['undone'] = '未完成'; diff --git a/module/productplan/model.php b/module/productplan/model.php index bf7c2870a9..27e53a301b 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -554,24 +554,10 @@ class productplanModel extends model $planID = $this->dao->lastInsertID(); $this->file->updateObjectID($this->post->uid, $planID, 'plan'); $this->loadModel('score')->create('productplan', 'create', $planID); - if(!empty($plan->parent)) + if(!empty($plan->parent) and $parentPlan->parent == '0') { - if($parentPlan->parent == '0') - { - $this->dao->update(TABLE_PRODUCTPLAN)->set('parent')->eq('-1')->where('id')->eq($plan->parent)->andWhere('parent')->eq('0')->exec(); - - /* Transfer stories and bugs linked with the parent plan to the child plan. */ - $this->dao->update(TABLE_PLANSTORY)->set('plan')->eq($planID)->where('plan')->eq($plan->parent)->exec(); - $this->dao->update(TABLE_BUG)->set('plan')->eq($planID)->where('plan')->eq($plan->parent)->exec(); - $stories = $this->dao->select('*')->from(TABLE_STORY)->where("CONCAT(',', plan, ',')")->like("%,{$plan->parent},%")->fetchAll('id'); - foreach($stories as $storyID => $story) - { - $storyPlan = str_replace(",{$plan->parent},", ",$planID,", ",$story->plan,"); - $storyPlan = trim($storyPlan, ','); - - $this->dao->update(TABLE_STORY)->set('plan')->eq($storyPlan)->where('id')->eq($storyID)->exec(); - } - } + $plan->id = $planID; + $this->transferStoriesAndBugs($plan); } return $planID; } @@ -597,7 +583,7 @@ class productplanModel extends model ->get(); $product = $this->loadModel('product')->getByID($oldPlan->product); - if($product->type != 'normal' and !isset($_POST['branch'])) + if($product->type != 'normal' and $oldPlan->parent != -1 and !isset($_POST['branch'])) { $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); dao::$errors['branch'] = sprintf($this->lang->error->notempty, $this->lang->product->branch); @@ -649,25 +635,7 @@ class productplanModel extends model if(!dao::isError()) { $this->file->updateObjectID($this->post->uid, $planID, 'plan'); - if(!empty($plan->parent)) - { - if($parentPlan->parent == '0') - { - $this->dao->update(TABLE_PRODUCTPLAN)->set('parent')->eq('-1')->where('id')->eq($plan->parent)->andWhere('parent')->eq('0')->exec(); - - /* Transfer stories and bugs linked with the parent plan to the child plan. */ - $this->dao->update(TABLE_PLANSTORY)->set('plan')->eq($planID)->where('plan')->eq($plan->parent)->exec(); - $this->dao->update(TABLE_BUG)->set('plan')->eq($planID)->where('plan')->eq($plan->parent)->exec(); - $stories = $this->dao->select('*')->from(TABLE_STORY)->where("CONCAT(',', plan, ',')")->like("%,{$plan->parent},%")->fetchAll('id'); - foreach($stories as $storyID => $story) - { - $storyPlan = str_replace(",{$plan->parent},", ",$planID,", ",$story->plan,"); - $storyPlan = trim($storyPlan, ','); - - $this->dao->update(TABLE_STORY)->set('plan')->eq($storyPlan)->where('id')->eq($storyID)->exec(); - } - } - } + if(!empty($plan->parent) and $parentPlan->parent == '0') $this->transferStoriesAndBugs($plan); return common::createChanges($oldPlan, $plan); } } @@ -1304,4 +1272,47 @@ class productplanModel extends model if($product->type == 'normal') unset($this->config->productplan->search['fields']['branch']); $this->loadModel('search')->setSearchParams($this->config->productplan->search); } + + /** + * Transfer stories and bugs to new plan. + * + * @param object $plan + * @access public + * @return void + */ + public function transferStoriesAndBugs($plan) + { + $this->dao->update(TABLE_PRODUCTPLAN)->set('parent')->eq('-1')->where('id')->eq($plan->parent)->andWhere('parent')->eq('0')->exec(); + + /* Transfer stories linked with the parent plan to the child plan. */ + $stories = $this->dao->select('*')->from(TABLE_STORY)->where("CONCAT(',', plan, ',')")->like("%,{$plan->parent},%")->fetchAll('id'); + $unlinkStories = array(); + foreach($stories as $storyID => $story) + { + if(!empty($story->branch) and strpos(",$plan->branch,", ",$story->branch,") === false) + { + $unlinkStories[$storyID] = $storyID; + $storyPlan = str_replace(",{$plan->parent},", ',', ",$story->plan,"); + } + else + { + $storyPlan = str_replace(",{$plan->parent},", ",$plan->id,", ",$story->plan,"); + } + $storyPlan = trim($storyPlan, ','); + + $this->dao->update(TABLE_STORY)->set('plan')->eq($storyPlan)->where('id')->eq($storyID)->exec(); + } + if(!empty($unlinkStories)) $this->dao->delete()->from(TABLE_PLANSTORY)->where('plan')->eq($plan->parent)->andWhere('story')->in($unlinkStories)->exec(); + $this->dao->update(TABLE_PLANSTORY)->set('plan')->eq($plan->id)->where('plan')->eq($plan->parent)->exec(); + + /* Transfer bugs linked with the parent plan to the child plan. */ + $bugs = $this->dao->select('*')->from(TABLE_BUG)->where('plan')->eq($plan->parent)->fetchAll('id'); + $unlinkBugs = array(); + foreach($bugs as $bugID => $bug) + { + if(!empty($bug->branch) and strpos(",$plan->branch,", ",$bug->branch,") === false) $unlinkBugs[$bugID] = $bugID; + } + if(!empty($unlinkBugs)) $this->dao->update(TABLE_BUG)->set('plan')->eq(0)->where('plan')->eq($plan->parent)->andWhere('id')->in($unlinkBugs)->exec(); + $this->dao->update(TABLE_BUG)->set('plan')->eq($plan->id)->where('plan')->eq($plan->parent)->exec(); + } } diff --git a/module/productplan/view/batchedit.html.php b/module/productplan/view/batchedit.html.php index 6aab7a43e0..61021133eb 100644 --- a/module/productplan/view/batchedit.html.php +++ b/module/productplan/view/batchedit.html.php @@ -44,7 +44,7 @@ type != 'normal'):?>
    parent == -1 ? "disabled='disabled'" : '';?> - id][]", $plan->parent == '-1' ? '' : $branchTagOption, $plan->branch, "onchange='getConflictStories($plan->id); 'class='form-control chosen' multiple $disabled");?> + id][]", $branchTagOption, $plan->branch, "onchange='getConflictStories($plan->id); 'class='form-control chosen' multiple $disabled");?> id]", $plan->title, "class='form-control'")?> '>parent != '-1') echo trim($planBranches, ',');?>'> begin == $config->productplan->future ? $lang->productplan->future : $plan->begin;?> end == $config->productplan->future ? $lang->productplan->future : $plan->end;?> productplan->product;?> name;?>
    product->branch;?>
    productplan->title;?> story->plan;?>
    - session->currentProductType != 'normal' and empty($story->branch) and count($story->planTitle) > 1) ? true : false;?> - plan, "class='form-control chosen'" . ($multiple ? ' multiple' : '')); + session->currentProductType != 'normal' and empty($story->branch) and count($story->planTitle) > 1) ? 'multiple' : '';?> + plan, "class='form-control chosen' " . $multiple); if(count($plans) == 1) { echo ""; From d16d7fcb089dde89b2e1f8f97577d271adee9dfa Mon Sep 17 00:00:00 2001 From: mayue Date: Thu, 1 Dec 2022 09:06:16 +0800 Subject: [PATCH 136/267] * Unlink bug when edit branch of plan. --- module/productplan/control.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/module/productplan/control.php b/module/productplan/control.php index ce80f5e403..7165026bc8 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -136,7 +136,7 @@ class productplan extends control $changes = $this->productplan->update($planID); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); $change[$planID] = $changes; - $this->syncStory($change); + $this->unlinkOldBranch($change); if($changes) { $actionID = $this->loadModel('action')->create('productplan', $planID, 'edited'); @@ -178,7 +178,7 @@ class productplan extends control if(!empty($_POST['title'])) { $changes = $this->productplan->batchUpdate($productID); - $this->syncStory($changes); + $this->unlinkOldBranch($changes); $this->loadModel('action'); foreach($changes as $planID => $change) { @@ -893,13 +893,13 @@ class productplan extends control } /** - * Synchronize story when edit plan. + * Unlink story and bug when edit branch of plan. * @param int $planID * @param int $oldBranch * @access protected * @return void */ - protected function syncStory($changes) + protected function unlinkOldBranch($changes) { foreach($changes as $planID => $changes) { @@ -915,12 +915,18 @@ class productplan extends control } } $planStories = $this->loadModel('story')->getPlanStories($planID, 'all'); + $planBugs = $this->loadModel('bug')->getPlanBugs($planID, 'all'); if($oldBranch) { foreach($planStories as $storyID => $story) { if($story->branch and strpos(",$newBranch,", ",$story->branch,") === false) $this->productplan->unlinkStory($storyID, $planID); } + + foreach($planBugs as $bugID => $bug) + { + if($bug->branch and strpos(",$newBranch,", ",$bug->branch,") === false) $this->productplan->unlinkBug($bugID, $planID); + } } } } From aff72c1c262897757313ecf5c90478723d7503b4 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 1 Dec 2022 09:44:04 +0800 Subject: [PATCH 137/267] * fix bug #30402 --- module/story/view/edit.html.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php index 3c32c76524..2cd17c4cf0 100644 --- a/module/story/view/edit.html.php +++ b/module/story/view/edit.html.php @@ -192,7 +192,8 @@
    story->plan;?>
    - session->currentProductType != 'normal' and empty($story->branch) and count($story->planTitle) > 1) ? 'multiple' : '';?> + planTitle) ? count($story->planTitle) : 0?> + session->currentProductType != 'normal' and empty($story->branch) and $planCount > 1) ? 'multiple' : '';?> plan, "class='form-control chosen' " . $multiple); if(count($plans) == 1) { From c109140c81cffb70a4b9816e3482821f893dc30a Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 1 Dec 2022 10:06:33 +0800 Subject: [PATCH 138/267] * Code for task#77802. Modify batch edit plan. --- module/productplan/control.php | 20 +++++++++++++------- module/productplan/view/batchedit.html.php | 14 ++++++++++++-- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/module/productplan/control.php b/module/productplan/control.php index 7ab604895f..d8d8f76643 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -194,15 +194,21 @@ class productplan extends control $this->commonAction($productID, $branch); - $plans = $this->productplan->getByIDList($this->post->planIDList); - $oldBranch = array(); + $plans = $this->productplan->getByIDList($this->post->planIDList); + $oldBranch = array(); + $parentIdList = array(); - foreach($plans as $plan) $oldBranch[$plan->id] = $plan->branch; + foreach($plans as $plan) + { + $oldBranch[$plan->id] = $plan->branch; + $parentIdList[$plan->parent] = $plan->parent; + } - $this->view->title = $this->lang->productplan->batchEdit; - $this->view->plans = $plans; - $this->view->oldBranch = $oldBranch; - $this->view->product = $this->loadModel('product')->getById($productID);; + $this->view->title = $this->lang->productplan->batchEdit; + $this->view->plans = $plans; + $this->view->oldBranch = $oldBranch; + $this->view->product = $this->loadModel('product')->getById($productID);; + $this->view->parentList = $this->productplan->getByIDList($parentIdList); $this->display(); } diff --git a/module/productplan/view/batchedit.html.php b/module/productplan/view/batchedit.html.php index 61021133eb..d3099683f3 100644 --- a/module/productplan/view/batchedit.html.php +++ b/module/productplan/view/batchedit.html.php @@ -43,8 +43,18 @@
    id . html::hidden("id[$plan->id]", $plan->id);?> - parent == -1 ? "disabled='disabled'" : '';?> - id][]", $branchTagOption, $plan->branch, "onchange='getConflictStories($plan->id); 'class='form-control chosen' multiple $disabled");?> + parent == -1 ? "disabled='disabled'" : ''; + $parentBranches = array(); + if($plan->parent > 0 and isset($parentList[$plan->parent])) + { + foreach($branchTagOption as $branchID => $branchName) + { + if(strpos(",{$parentList[$plan->parent]->branch},", ",$branchID,") !== false) $parentBranches[$branchID] = $branchName; + } + } + echo html::select("branch[$plan->id][]", ($plan->parent > 0 and !empty($parentBranches)) ? $parentBranches : $branchTagOption, $plan->branch, "onchange='getConflictStories($plan->id); 'class='form-control chosen' multiple $disabled"); + ?> id]", $plan->title, "class='form-control'")?>
    bug->openedBuild;?>openedBuild, 'size=4 multiple=multiple class="form-control chosen"');?>openedBuild, 'size=4 multiple=multiple class="form-control picker-select"');?>
    comment;?>
    关联产品和计划 +
    +
    +
    +
    +
    + product->common;?> + + + + project->addProduct, '', "onchange=addNewProduct(this);");?> +
    +
    + +
    +
    + +
    +
    +
    +
    + product->plan;?> + +
    + + +
    +
    +
    +
    + +
    project->division;?>
    productplan->id?> productplan->branch;?>product->branch;?> productplan->title?> productplan->status?>
    admin->safe->loginCaptcha?>admin->safe->loginCaptchaList, isset($config->safe->loginCaptcha) ? $config->safe->loginCaptcha : 0)?>admin->safe->loginCaptchaList, isset($config->safe->loginCaptcha) ? $config->safe->loginCaptcha : 0)?>admin->safe->noticeGd;?>
    @@ -89,6 +91,7 @@ $(function() { var mode = $("input[name='mode']:checked").val(); showModeRule(mode); + if(!loadedGD) $('#loginCaptcha1').attr('disabled', true); }); function showModeRule(mode) { From 3c3ce6735408cea370e293ec64c70f0fb1b7d2ac Mon Sep 17 00:00:00 2001 From: chaideqing Date: Thu, 1 Dec 2022 13:35:05 +0800 Subject: [PATCH 149/267] * Refactor code. --- module/message/model.php | 4 ++-- module/task/model.php | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/module/message/model.php b/module/message/model.php index 9312d318a5..f0191d4173 100755 --- a/module/message/model.php +++ b/module/message/model.php @@ -202,8 +202,8 @@ class messageModel extends model } if(empty($toList) and $objectType == 'task' and $object->mode == 'multi') { - $assignedTo = $this->loadModel('task')->getTeamTaskAssignedTo($object->id); - $toList = array_filter($assignedTo, function($account){ + $teamMembers = $this->loadModel('task')->getTeamMembers($object->id); + $toList = array_filter($teamMembers, function($account){ return $account != $this->app->user->account; }); $toList = implode(',', $toList); diff --git a/module/task/model.php b/module/task/model.php index 9bf08e1551..a4f91f91b2 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -3926,7 +3926,7 @@ class taskModel extends model $toTeamTaskList = ''; if($task->mode == 'multi') { - $toTeamTaskList = $this->getTeamTaskAssignedTo($task->id); + $toTeamTaskList = $this->getTeamMembers($task->id); $toTeamTaskList = implode(',', $toTeamTaskList); $toList = $toTeamTaskList; } @@ -4348,17 +4348,17 @@ class taskModel extends model } /** - * Get teamTask assignedTo. + * Get teamTask members. * * @param int $taskID * @access public * @return array */ - public function getTeamTaskAssignedTo($taskID) + public function getTeamMembers($taskID) { $taskType = $this->dao->select('mode')->from(TABLE_TASK)->where('id')->eq($taskID)->fetch('mode'); if($taskType != 'multi') return array(); - $assignedToList = $this->dao->select('account')->from(TABLE_TASKTEAM)->where('task')->eq($taskID)->fetchPairs(); - return empty($assignedToList) ? array() : array_keys($assignedToList); + $teamMembers = $this->dao->select('account')->from(TABLE_TASKTEAM)->where('task')->eq($taskID)->fetchPairs(); + return empty($teamMembers) ? $teamMembers : array_keys($teamMembers); } } From 7a843ece3780fe9700cdc3cbb8c827c4cef5bc6e Mon Sep 17 00:00:00 2001 From: Yagami Date: Thu, 1 Dec 2022 13:52:46 +0800 Subject: [PATCH 150/267] * Code for task #77800. --- module/project/control.php | 12 +-- module/project/css/edit.css | 1 - module/project/js/common.js | 128 ---------------------------- module/project/js/create.js | 4 +- module/project/js/edit.js | 127 ++++++++++++++++++++++++++- module/project/lang/de.php | 1 + module/project/lang/en.php | 1 + module/project/lang/fr.php | 1 + module/project/lang/vi.php | 1 + module/project/lang/zh-cn.php | 1 + module/project/model.php | 2 +- module/project/view/create.html.php | 6 +- module/project/view/edit.html.php | 64 +++++++------- 13 files changed, 169 insertions(+), 180 deletions(-) diff --git a/module/project/control.php b/module/project/control.php index 52d6916bec..df07cc71d1 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -722,9 +722,8 @@ class project extends control $withProgram = $this->config->systemMode == 'ALM' ? true : false; - $linkedBranches = array(); $linkedBranchList = array(); - $productPlans = array(0 => ''); + $productPlans = array(); $branches = $this->project->getBranchesByProject($projectID); $linkedProductIdList = empty($branches) ? '' : array_keys($branches); $allProducts = $this->program->getProductPairs($project->parent, 'all', 'noclosed', '', 0, $withProgram); @@ -743,11 +742,10 @@ class project extends control if(!isset($allProducts[$productID])) $allProducts[$productID] = $linkedProduct->name; foreach($branches[$productID] as $branchID => $branch) { - $linkedBranchList[$branchID] = $branchID; - $linkedBranches[$productID][$branchID] = $branchID; + $linkedBranchList[$branchID] = $branchID; - if($branch != BRANCH_MAIN) $productPlans[$productID][$branchID] = isset($plans[$productID][BRANCH_MAIN]) ? $plans[$productID][BRANCH_MAIN] : array(); - $productPlans[$productID][$branchID] += isset($plans[$productID][$branchID]) ? $plans[$productID][$branchID] : array(); + if($branch != BRANCH_MAIN) $productPlans[$productID] = isset($plans[$productID][BRANCH_MAIN]) ? $plans[$productID][BRANCH_MAIN] : array(); + $productPlans[$productID] += isset($plans[$productID][$branchID]) ? $plans[$productID][$branchID] : array(); if(!empty($projectStories[$productID][$branchID]) or !empty($projectBranches[$productID][$branchID])) { @@ -773,7 +771,6 @@ class project extends control $this->view->multiBranchProducts = $this->loadModel('product')->getMultiBranchPairs(); $this->view->productPlans = array_filter($productPlans); $this->view->linkedProducts = $linkedProducts; - $this->view->linkedBranches = $linkedBranches; $this->view->branches = $branches; $this->view->executions = $this->execution->getPairs($projectID); $this->view->unmodifiableProducts = $unmodifiableProducts; @@ -1286,7 +1283,6 @@ 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/module/project/css/edit.css b/module/project/css/edit.css index e586511016..12113d5d32 100644 --- a/module/project/css/edit.css +++ b/module/project/css/edit.css @@ -5,5 +5,4 @@ #dateRange, .futureBox {vertical-align: top !important; padding-top: 13px !important;} #endList {vertical-align: top; padding-top: 13px;} #linkPlan {padding-top: 25px !important;} -#productsBox .row .col-sm-4.required::after {right: -5px;} #projectType {padding-top: 7px !important;} diff --git a/module/project/js/common.js b/module/project/js/common.js index 9234174496..7af601555d 100644 --- a/module/project/js/common.js +++ b/module/project/js/common.js @@ -138,134 +138,6 @@ function computeEndDate(delta) $('#days').trigger('mousedown'); } -/** - * Load branches. - * - * @param object product - * @access public - * @return void - */ -function loadBranches(product) -{ - /* When selecting a product, delete a plan that is empty by default. */ - $("#planDefault").remove(); - - var chosenProducts = []; - $("#productsBox select[name^='products']").each(function() - { - var $product = $(product); - var productID = $(this).val(); - if(productID > 0 && chosenProducts.indexOf(productID) == -1) chosenProducts.push(productID); - if($product.val() != 0 && $product.val() == $(this).val() && $product.attr('id') != $(this).attr('id') && !multiBranchProducts[$product.val()]) - { - bootbox.alert(errorSameProducts); - $product.val(0); - $product.trigger("chosen:updated"); - return false; - } - }); - - chosenProducts.length > 1 ? $('.division').removeClass('hide') : $('.division').addClass('hide'); - - if($('#productsBox .input-group:last select:first').val() != 0) - { - var length = $('#productsBox .row .input-group').size(); - $('#productsBox .row').append('
    ' + $('#productsBox .col-sm-4:last').html() + '
    '); - if($('#productsBox .input-group:last select').size() >= 2) $('#productsBox .input-group:last select:last').remove(); - $('#productsBox .input-group:last .chosen-container').remove(); - $('#productsBox .input-group:last select:first').attr('name', 'products[' + length + ']').attr('id', 'products' + length); - $('#productsBox .input-group:last .chosen').chosen(); - - adjustProductBoxMargin(); - } - - var $inputgroup = $(product).closest('.input-group'); - if($inputgroup.find('select').size() >= 2) $inputgroup.removeClass('has-branch').find('select:last').remove(); - if($inputgroup.find('.chosen-container').size() >= 2) $inputgroup.find('.chosen-container:last').remove(); - - var index = $inputgroup.find('select:first').attr('id').replace('products' , ''); - var oldBranch = $(product).attr('data-branch') !== undefined ? $(product).attr('data-branch') : 0; - $.get(createLink('branch', 'ajaxGetBranches', "productID=" + $(product).val() + "&oldBranch=" + oldBranch + "¶m=active"), function(data) - { - if(data) - { - $inputgroup.addClass('has-branch').append(data); - $inputgroup.find('select:last').attr('name', 'branch[' + index + ']').attr('id', 'branch' + index).attr('onchange', "loadPlans('#products" + index + "', this.value)").chosen(); - - $inputgroup.find('select:last').each(disableSelectedBranch); - disableSelectedProduct(); - } - - var branchID = $('#branch' + index).val(); - loadPlans(product, branchID); - }); - - if(!multiBranchProducts[$(product).val()]) disableSelectedProduct(); - - $("input[name='products[" + index + "]']").remove(); - $("input[name='branch[" + index + "]']").remove(); -} - -function loadPlans(product, branchID) -{ - if($('#plansBox').size() == 0) return false; - - var productID = $(product).val(); - var branchID = typeof(branchID) == 'undefined' ? 0 : branchID; - var planID = $(product).attr('data-plan') !== undefined ? $(product).attr('data-plan') : 0; - var index = $(product).attr('id').replace('products', ''); - - $("input[name='products[" + index + "]']").remove(); - $("input[name='branch[" + index + "]']").remove(); - - $.get(createLink('product', 'ajaxGetPlans', "productID=" + productID + '&branch=0,' + branchID + '&planID=' + planID + '&fieldID&needCreate=&expired=unexpired,noclosed¶m=skipParent,multiple'), function(data) - { - if(data) - { - if($("div#plan" + index).size() == 0) $("#plansBox .row").append('
    '); - $("div#plan" + index).html(data).find('select').attr('name', 'plans[' + productID + ']' + '[' + branchID + '][]').attr('id', 'plans' + productID).chosen(); - - adjustPlanBoxMargin(); - } - }); -} - -/** - * Adjust the layout of product selection. - * - * @access public - * @return void - */ -function adjustProductBoxMargin() -{ - var productRows = Math.ceil($('#productsBox > .row > .col-sm-4').length / 3); - if(productRows > 1) - { - for(i = 1; i <= productRows - 1; i++) - { - $('#productsBox .col-sm-4:lt(' + (i * 3) + ')').css('margin-bottom', '10px'); - } - } -} - -/** - * Adjust the layout of the plan selection. - * - * @access public - * @return void - */ -function adjustPlanBoxMargin() -{ - var planRows = Math.ceil($('#plansBox > .row > .col-sm-4').length / 3); - if(planRows > 1) - { - for(j = 1; j <= planRows - 1; j++) - { - $('#plansBox .col-sm-4:lt(' + (j * 3) + ')').css('margin-bottom', '10px'); - } - } -} - /** * Initialization operation. * diff --git a/module/project/js/create.js b/module/project/js/create.js index 7bce25f5f7..ee7393ff6e 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -370,7 +370,7 @@ function loadBranches(product) function loadPlans(product, branch) { var productID = $(product).val(); - var branchID = $(branch).val() == null ? 0 : $(branch).val(); + var branchID = $(branch).val() == null ? 0 : '0,' + $(branch).val(); var planID = $(product).attr('data-plan') !== undefined ? $(product).attr('data-plan') : 0; var index = $(product).attr('id').replace('products', ''); @@ -380,7 +380,7 @@ function loadPlans(product, branch) { $("div#plan" + index).find("select[name^='plans']").replaceWith(data); $("div#plan" + index).find('.chosen-container').remove(); - $("div#plan" + index).find('select').attr('name', 'plans[' + productID + '][' + branchID + '][]').attr('id', 'plans' + productID).chosen(); + $("div#plan" + index).find('select').attr('name', 'plans[' + productID + ']' + '[]').attr('id', 'plans' + productID).chosen(); } }); } diff --git a/module/project/js/edit.js b/module/project/js/edit.js index 73d391e9c5..e676a6a499 100644 --- a/module/project/js/edit.js +++ b/module/project/js/edit.js @@ -32,9 +32,6 @@ $(function() }); }); - adjustProductBoxMargin(); - adjustPlanBoxMargin(); - $(document).on('change', '[name*=products]', function() { var current = $(this).val(); @@ -173,3 +170,127 @@ function setAclList(programID) $('.aclBox').html($('#projectAcl').html()); } } + +/** + * Load branches. + * + * @param int $product + * @access public + * @return void + */ +function loadBranches(product) +{ + /* When selecting a product, delete a plan that is empty by default. */ + $("#planDefault").remove(); + + var chosenProducts = []; + $(".productsBox select[name^='products']").each(function() + { + var $product = $(product); + var productID = $(this).val(); + if(productID > 0 && chosenProducts.indexOf(productID) == -1) chosenProducts.push(productID); + if($product.val() != 0 && $product.val() == $(this).val() && $product.attr('id') != $(this).attr('id') && !multiBranchProducts[$product.val()]) + { + bootbox.alert(errorSameProducts); + $product.val(0); + $product.trigger("chosen:updated"); + return false; + } + }); + + (chosenProducts.length > 1 && model == 'waterfall') ? $('.division').removeClass('hide') : $('.division').addClass('hide'); + + var $tableRow = $(product).closest('.table-row'); + var index = $tableRow.find('select:first').attr('id').replace('products' , ''); + var oldBranch = $(product).attr('data-branch') !== undefined ? $(product).attr('data-branch') : 0; + + if(!multiBranchProducts[$(product).val()]) + { + $tableRow.find('.table-col:last select').val('').trigger('chosen:updated'); + $tableRow.find('.table-col:last').addClass('hidden'); + } + + $.get(createLink('branch', 'ajaxGetBranches', "productID=" + $(product).val() + "&oldBranch=" + oldBranch + "¶m=active"), function(data) + { + if(data) + { + $tableRow.find("select[name^='branch']").replaceWith(data); + $tableRow.find('.table-col:last .chosen-container').remove(); + $tableRow.find('.table-col:last').removeClass('hidden'); + $tableRow.find("select[name^='branch']").attr('multiple', '').attr('name', 'branch[' + index + '][]').attr('id', 'branch' + index).attr('onchange', "loadPlans('#products" + index + "', this)").chosen(); + + disableSelectedProduct(); + } + + var branch = $('#branch' + index); + loadPlans(product, branch); + }); +} + +/** + * Load plans. + * + * @param obj $product + * @param obj $branchID + * @access public + * @return void + */ +function loadPlans(product, branch) +{ + var productID = $(product).val(); + var branchID = $(branch).val() == null ? 0 : '0,' + $(branch).val(); + var planID = $(product).attr('data-plan') !== undefined ? $(product).attr('data-plan') : 0; + var index = $(product).attr('id').replace('products', ''); + + $.get(createLink('product', 'ajaxGetPlans', "productID=" + productID + '&branch=' + branchID + '&planID=' + planID + '&fieldID&needCreate=&expired=unexpired,noclosed¶m=skipParent,multiple'), function(data) + { + if(data) + { + $("div#plan" + index).find("select[name^='plans']").replaceWith(data); + $("div#plan" + index).find('.chosen-container').remove(); + $("div#plan" + index).find('select').attr('name', 'plans[' + productID + ']' + '[]').attr('id', 'plans' + productID).chosen(); + } + }); +} + +/** + * Add new line for link product. + * + * @param obj $obj + * @access public + * @return void + */ +function addNewLine(obj) +{ + var newLine = $(obj).closest('tr').clone(); + var index = 0; + $(".productsBox select[name^='products']").each(function() + { + var id = $(this).attr('id').replace('products' , ''); + + id = parseInt(id); + id ++; + + index = id > index ? id : index; + }) + + newLine.addClass('newLine'); + newLine.find('th').html(''); + newLine.find('.removeLine').css('visibility', 'visible'); + newLine.find('.chosen-container').remove(); + newLine.find('.productsBox .table-col:last').addClass('hidden'); + newLine.find("select[name^='products']").attr('name', 'products[' + index + ']').attr('id', 'products' + index).val('').chosen(); + newLine.find("select[name^='plans']").attr('name', 'plans[' + index + '][' + 0 + '][]').chosen(); + newLine.find("div[id^='plan']").attr('id', 'plan' + index); + + $(obj).closest('tr').after(newLine); + var product = newLine.find("select[name^='products']"); + var branch = newLine.find("select[name^='branch']"); + loadPlans(product, branch); + disableSelectedProduct(); +} + +function removeLine(obj) +{ + $(obj).closest('tr').remove(); +} diff --git a/module/project/lang/de.php b/module/project/lang/de.php index e09b2f5b08..00cdcccc94 100644 --- a/module/project/lang/de.php +++ b/module/project/lang/de.php @@ -42,6 +42,7 @@ $lang->project->addWhitelist = 'Project Add Whitelist'; $lang->project->unbindWhitelist = 'Project Remove Whitelist'; $lang->project->manageProducts = 'Manage Products'; $lang->project->manageOtherProducts = 'Manage Other Products'; +$lang->project->manageProductPlan = 'Manage Products And Plans'; $lang->project->copyTitle = 'Please select an project to copy'; $lang->project->errorSameProducts = 'Project cannot be associated with multiple identical products.'; $lang->project->errorSameBranches = 'Project cannot be associated with multiple identical branches.'; diff --git a/module/project/lang/en.php b/module/project/lang/en.php index bd8aea81c6..378f35cebc 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -42,6 +42,7 @@ $lang->project->addWhitelist = 'Project Add Whitelist'; $lang->project->unbindWhitelist = 'Project Remove Whitelist'; $lang->project->manageProducts = 'Manage Products'; $lang->project->manageOtherProducts = 'Manage Other Products'; +$lang->project->manageProductPlan = 'Manage Products And Plans'; $lang->project->copyTitle = 'Please select an project to copy'; $lang->project->errorSameProducts = 'Project cannot be associated with multiple identical products.'; $lang->project->errorSameBranches = 'Project cannot be associated with multiple identical branches.'; diff --git a/module/project/lang/fr.php b/module/project/lang/fr.php index 2ee664d94a..114555b75d 100644 --- a/module/project/lang/fr.php +++ b/module/project/lang/fr.php @@ -42,6 +42,7 @@ $lang->project->addWhitelist = 'Project Add Whitelist'; $lang->project->unbindWhitelist = 'Project Remove Whitelist'; $lang->project->manageProducts = 'Manage Products'; $lang->project->manageOtherProducts = 'Manage Other Products'; +$lang->project->manageProductPlan = 'Manage Products And Plans'; $lang->project->copyTitle = 'Please select an project to copy'; $lang->project->errorSameProducts = 'Project cannot be associated with multiple identical products.'; $lang->project->errorSameBranches = 'Project cannot be associated with multiple identical branches.'; diff --git a/module/project/lang/vi.php b/module/project/lang/vi.php index e6b35cab56..f2284e3c3f 100644 --- a/module/project/lang/vi.php +++ b/module/project/lang/vi.php @@ -42,6 +42,7 @@ $lang->project->addWhitelist = 'Project Add Whitelist'; $lang->project->unbindWhitelist = 'Project Remove Whitelist'; $lang->project->manageProducts = 'Manage Products'; $lang->project->manageOtherProducts = 'Manage Other Products'; +$lang->project->manageProductPlan = 'Manage Products And Plans'; $lang->project->copyTitle = 'Please select an project to copy'; $lang->project->errorSameProducts = 'Project cannot be associated with multiple identical products.'; $lang->project->errorSameBranches = 'Project cannot be associated with multiple identical branches.'; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index c440a69b35..9a9cc0e98c 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -42,6 +42,7 @@ $lang->project->addWhitelist = '项目添加白名单'; $lang->project->unbindWhitelist = '项目删除白名单'; $lang->project->manageProducts = '关联产品'; $lang->project->manageOtherProducts = '关联其他产品'; +$lang->project->manageProductPlan = '关联产品和计划'; $lang->project->copyTitle = '请选择要复制的项目'; $lang->project->errorSameProducts = '项目不能关联多个相同的产品。'; $lang->project->errorSameBranches = '项目不能关联多个相同的分支。'; diff --git a/module/project/model.php b/module/project/model.php index 81b3bc3dd9..4dfe09b2b3 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2420,7 +2420,7 @@ class projectModel extends model $data->project = $projectID; $data->product = $productID; $data->branch = $branchID; - $data->plan = isset($plans[$productID][$branchID]) ? implode(',', $plans[$productID][$branchID]) : $oldPlan; + $data->plan = isset($plans[$productID]) ? implode(',', $plans[$productID]) : $oldPlan; $data->plan = trim($data->plan, ','); $data->plan = empty($data->plan) ? 0 : ",$data->plan,"; diff --git a/module/project/view/create.html.php b/module/project/view/create.html.php index 5c1b77ab19..d7cde1dc6c 100755 --- a/module/project/view/create.html.php +++ b/module/project/view/create.html.php @@ -139,7 +139,7 @@
    关联产品和计划project->manageProductPlan;?>
    @@ -154,8 +154,8 @@
    -
    +
    project->manageProducts;?> + project->manageProductPlan;?>
    - - - type != 'normal' and isset($branchGroups[$product->id]);?> - id] as $branchID => $branch):?> -
    -
    - id, "class='form-control chosen' onchange='loadBranches(this)' data-last='" . $product->id . "' data-type='" . $product->type . "' data-lastBranch='" . $branchID . "'");?> - - id], $branchID, "class='form-control chosen' onchange=\"loadPlans('#products{$i}', this.value)\" data-last='" . $branchID . "'");?> +
    +
    +
    + type != 'normal' and isset($branchGroups[$product->id]);?> +
    '> + product->common;?> + id, "class='form-control chosen' onchange='loadBranches(this)' data-last='" . $product->id . "' data-type='" . $product->type . "'");?> +
    +
    +
    '> +
    + product->branchName['branch'];?> + branches);?> + id]) ? $branchGroups[$product->id] : array(), $branchIdList, "class='form-control chosen' multiple onchange=\"loadPlans('#products{$i}', this)\"");?> +
    +
    - - - -
    ' style="padding-right: 6px;"> -
    - - +
    +
    > + product->plan;?> + id][]", isset($productPlans[$product->id]) ? $productPlans[$product->id] : array(), $product->plans, "class='form-control chosen' multiple");?> +
    + + > +
    execution->linkPlan;?> -
    - - - id] as $branchID => $branch):?> - id][$branchID]) ? $productPlans[$product->id][$branchID] : array();?> -
    id}][{$branchID}][]", $plans, $branches[$product->id][$branchID]->plan, "class='form-control chosen' multiple");?>
    - - - -
    -
    -
    bug->openedBuild?> - +
    bug->allBuilds, "class='btn' id='all' data-toggle='tooltip' onclick='loadAllBuilds()'")?>
    From 1651a1492e19511baeb489725af16a38ab88499e Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 1 Dec 2022 14:23:31 +0800 Subject: [PATCH 155/267] edit story fix empty --- module/story/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/story/model.php b/module/story/model.php index bb95eea787..e4ff3f4f38 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -889,7 +889,7 @@ class storyModel extends model return false; } - $storyPlan = !empty($_POST['plan']) ? $_POST['plan'] : array(); + $storyPlan = !empty($_POST['plan']) ? array_filter($_POST['plan']) : array(); if(count($storyPlan) > 1) { $oldStoryPlan = !empty($oldStory->planTitle) ? array_keys($oldStory->planTitle) : array(); From f7c3965d57add14819a851fe1c0907f4f40b3534 Mon Sep 17 00:00:00 2001 From: mayue Date: Thu, 1 Dec 2022 14:23:39 +0800 Subject: [PATCH 156/267] * Fix bug #30373. --- module/story/lang/de.php | 2 +- module/story/lang/en.php | 2 +- module/story/lang/fr.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/story/lang/de.php b/module/story/lang/de.php index a102071878..7111526b98 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -12,7 +12,7 @@ global $config; $lang->story->create = "Story hinzufügen"; -$lang->story->requirement = zget($lang, 'URCommon', "Requirement"); +$lang->story->requirement = 'UR'; $lang->story->story = zget($lang, 'SRCommon', "Story"); $lang->story->createStory = 'Create ' . $lang->story->story; $lang->story->createRequirement = 'Create ' . $lang->story->requirement; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 17ae16c93a..664d1a114b 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -12,7 +12,7 @@ global $config; $lang->story->create = "Create Story"; -$lang->story->requirement = zget($lang, 'URCommon', "Requirement"); +$lang->story->requirement = 'UR'; $lang->story->story = zget($lang, 'SRCommon', "Story"); $lang->story->createStory = 'Create ' . $lang->story->story; $lang->story->createRequirement = 'Create ' . $lang->story->requirement; diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index b05c47cf17..e11cd9a62c 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -12,7 +12,7 @@ global $config; $lang->story->create = "Créer Story"; -$lang->story->requirement = zget($lang, 'URCommon', "Requirement"); +$lang->story->requirement = 'UR'; $lang->story->story = zget($lang, 'SRCommon', "Story"); $lang->story->createStory = 'Create ' . $lang->story->story; $lang->story->createRequirement = 'Create ' . $lang->story->requirement; From 80bd2c745ce704701ee5c1c05797b421ec1e67d5 Mon Sep 17 00:00:00 2001 From: liuyongkai Date: Thu, 1 Dec 2022 14:25:21 +0800 Subject: [PATCH 157/267] * Resolve feedback #1461. --- module/product/control.php | 2 +- module/program/model.php | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/module/product/control.php b/module/product/control.php index e2e4757e2b..5f9a78b411 100755 --- a/module/product/control.php +++ b/module/product/control.php @@ -1368,7 +1368,7 @@ class product extends control $this->view->title = $this->lang->product->line; $this->view->position[] = $this->lang->product->line; - $this->view->programs = array('') + $this->loadModel('program')->getTopPairs(); + $this->view->programs = array('') + $this->loadModel('program')->getTopPairs('', 'withDeleted'); $this->view->lines = $this->product->getLines(); $this->display(); } diff --git a/module/program/model.php b/module/program/model.php index f53edac0b6..4ea12f895f 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -1031,15 +1031,31 @@ class programModel extends model */ public function getTopPairs($model = '', $mode = '', $isQueryAll = false) { - return $this->dao->select('id,name')->from(TABLE_PROGRAM) + $topPairs = $this->dao->select('id,name')->from(TABLE_PROGRAM) ->where('type')->eq('program') ->andWhere('grade')->eq(1) ->beginIF(strpos($mode, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi() ->beginIF(!$isQueryAll)->andWhere('id')->in($this->app->user->view->programs)->fi() - ->andWhere('deleted')->eq(0) + ->beginIF(strpos($mode, 'withDeleted') === false)->andWhere('deleted')->eq(0)->fi() ->beginIF($model)->andWhere('model')->eq($model)->fi() ->orderBy('`order` asc') ->fetchPairs(); + + if(strpos($mode, 'withDeleted') !== false) + { + $deletedTopPairs = $this->dao->select('id, name')->from(TABLE_PROGRAM) + ->where('type')->eq('program') + ->andWhere('grade')->eq(1) + ->andWhere('deleted')->eq(1) + ->fetchPairs(); + + foreach($topPairs as $id => $name) + { + if(isset($deletedTopPairs[$id])) $topPairs[$id] .= ' (' . $this->lang->program->deleted . ')'; + } + } + + return $topPairs; } /** From c4b508dd06c30267853972f402ac7c8602172de1 Mon Sep 17 00:00:00 2001 From: mayue Date: Thu, 1 Dec 2022 14:27:07 +0800 Subject: [PATCH 158/267] * Fix bug #30422. --- module/productplan/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/productplan/control.php b/module/productplan/control.php index d8d8f76643..a597de93d1 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -947,7 +947,7 @@ class productplan extends control */ public function ajaxGetConflict($planID, $newBranch) { - if(empty($newBranch)) return; + if($newBranch != '') return; $plan = $this->productplan->getByID($planID); $oldBranch = $plan->branch; From 2bd28233ea3e9c84bfce913bfd19df92649a86cd Mon Sep 17 00:00:00 2001 From: wangyuting <851424971@qq.com> Date: Thu, 1 Dec 2022 06:28:13 +0000 Subject: [PATCH 159/267] * Fix bug #30429. --- module/build/lang/zh-cn.php | 1 - module/build/model.php | 18 ++++++++---------- module/project/control.php | 1 + module/project/view/build.html.php | 13 ++++++++++--- module/testtask/js/common.js | 1 - 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/module/build/lang/zh-cn.php b/module/build/lang/zh-cn.php index 5761210a57..fe804daf9c 100644 --- a/module/build/lang/zh-cn.php +++ b/module/build/lang/zh-cn.php @@ -63,7 +63,6 @@ $lang->build->notice->changeBuilds = "提交测试单的版本,不能修改 $lang->build->notice->autoRelation = "相关版本下完成的需求、解决的Bug、产生的Bug将会自动关联到项目版本中"; $lang->build->notice->createTest = "该版本所属执行已删除,不能提交测试"; - $lang->build->finishStories = " 本次共完成 %s 个{$lang->SRCommon}"; $lang->build->resolvedBugs = ' 本次共解决 %s 个Bug'; $lang->build->createdBugs = ' 本次共产生 %s 个Bug'; diff --git a/module/build/model.php b/module/build/model.php index 2225863208..2dc021d654 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -275,7 +275,7 @@ class buildModel extends model ->beginIF($branch !== 'all')->andWhere('t1.branch')->in("$branchs")->fi() ->orderBy('t1.date desc, t1.id desc')->fetchAll('id'); - $executions = $this->dao->select('id, deleted')->from(TABLE_EXECUTION)->where('type')->eq('sprint')->andWhere('deleted')->eq('1')->fetchPairs(); + $deletedExecutions = $this->dao->select('id, deleted')->from(TABLE_EXECUTION)->where('type')->eq('sprint')->andWhere('deleted')->eq('1')->fetchPairs(); /* Set builds and filter done executions and terminate releases. */ $builds = array(); @@ -285,7 +285,7 @@ class buildModel extends model { if(empty($build->releaseID) and (strpos($params, 'nodone') !== false) and ($build->objectStatus === 'done')) continue; if((strpos($params, 'noterminate') !== false) and ($build->releaseStatus === 'terminate')) continue; - if((strpos($params, 'withexecution') !== false) and $build->execution and !empty($executions[$build->execution])) continue; + if((strpos($params, 'withexecution') !== false) and $build->execution and isset($executions[$build->execution])) continue; if($build->deleted == 1) $build->name .= ' (' . $this->lang->build->deleted . ')'; $branchName = $build->branchName ? $build->branchName : $this->lang->branch->main; @@ -656,6 +656,8 @@ class buildModel extends model { $action = strtolower($action); + if($module == 'testtask' and $action == 'create') return !$object->executionDeleted; + return true; } @@ -684,18 +686,14 @@ class buildModel extends model { $executionID = $tab == 'execution' ? $extraParams['executionID'] : $build->execution; $execution = $this->loadModel('execution')->getByID($executionID); + $build->executionDeleted = $execution ? $execution->deleted : 0; + $testtaskApp = (!empty($execution->type) and $execution->type == 'kanban') ? 'data-app="qa"' : "data-app='{$tab}'"; if(common::hasPriv($module, 'linkstory') and common::canBeChanged('build', $build)) $menu .= $this->buildMenu($module, 'view', "{$params}&type=story&link=true", $build, $type, 'link', '', '', '', "data-app={$tab}", $this->lang->build->linkStory); - if($execution and $execution->deleted === '1') - { - if(common::hasPriv('testtask', 'create')) $menu .= html::a(helper::createLink('testtask', 'create', "product=$build->product&execution={$executionID}&build=$build->id&projectID=$build->project"), "", '', "class='btn' title='{$this->lang->build->notice->createTest}' disabled"); - } - else - { - $menu .= $this->buildMenu('testtask', 'create', "product=$build->product&execution={$executionID}&build=$build->id&projectID=$build->project", $build, $type, 'bullhorn', '', '', '', $testtaskApp); - } + $title = ($execution and $execution->deleted === '1') ? $this->lang->build->notice->createTest : ''; + $menu .= $this->buildMenu('testtask', 'create', "product=$build->product&execution={$executionID}&build=$build->id&projectID=$build->project", $build, $type, 'bullhorn', '', '', '', $testtaskApp, $title); if($tab == 'execution' and !empty($execution->type) and $execution->type != 'kanban') $menu .= $this->buildMenu('execution', 'bug', "execution={$extraParams['executionID']}&productID={$extraParams['productID']}&branchID=all&orderBy=status&build=$build->id", $build, $type, '', '', '', '', $this->lang->execution->viewBug); if($tab == 'project' or empty($execution->type) or $execution->type == 'kanban') $menu .= $this->buildMenu($module, 'view', "{$params}&type=generatedBug", $build, $type, 'bug', '', '', '', "data-app='$tab'", $this->lang->project->bug); diff --git a/module/project/control.php b/module/project/control.php index 3f60d6c8fc..067259fdd9 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -1462,6 +1462,7 @@ class project extends control { foreach($builds as $build) { + $build->builds = $this->build->getByList($build->builds); /* If product is normal, unset branch name. */ if(isset($productList[$build->product]) and $productList[$build->product]->type == 'normal') { diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index 750854ea57..6c5358032b 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -85,9 +85,16 @@
    executionName;?> - builds) as $childBuild):?> - -
    + + builds as $childBuild):?> + execution] = $childBuild->execution;?> + + + + + +
    +
    project->manageProductPlan;?> +
    +
    +
    +
    + type != 'normal' and isset($branchGroups[$product->id]);?> +
    '> + product->common;?> + id, "class='form-control chosen' onchange='loadBranches(this)' data-last='" . $product->id . "' data-type='" . $product->type . "'");?> +
    +
    +
    '> +
    + product->branchName['branch'];?> + branches);?> + id]) ? $branchGroups[$product->id] : array(), $branchIdList, "class='form-control chosen' multiple onchange=\"loadPlans('#products{$i}', this)\"");?> +
    +
    +
    +
    +
    +
    > + product->plan;?> + id][]", isset($productPlans[$product->id]) ? $productPlans[$product->id] : array(), $product->plans, "class='form-control chosen' multiple");?> +
    + + > +
    +
    +
    +
    +
    project->manageProductPlan;?> @@ -181,6 +222,7 @@
    project->division;?>
    project->manageProductPlan;?> +
    +
    +
    +
    +
    + product->common;?> + +
    +
    + +
    +
    +
    +
    + product->plan;?> + +
    + + +
    +
    +
    +
    +
    build->id;?>build->name;?>build->name;?> build->product;?>
    id"), sprintf('%03d', $build->id), '', "data-app='project'");?> - execution):?> - - branchName) echo "{$build->branchName}"?> createLink($module, 'view', "buildID=$build->id"), $build->name, '', "data-app='project'");?> + execution):?> + + productName;?>
    release->includedBuild;?> build->placeholder->multipleSelect}'");?> +
    + + +
    +
    release->date;?>
    -
    release->includedBuild;?> build->placeholder->multipleSelect}'");?> +
    + + +
    +
    release->date;?>
    -
    build->id;?> build->product;?> build->name;?>build->scmPath;?>build->filePath;?>build->url;?> build->date;?> build->builder;?> actions;?>scmPath, 'http') === 0 ? html::a($build->scmPath) : $build->scmPath;?>filePath, 'http') === 0 ? html::a($build->filePath) : $build->filePath;?> + scmPath) echo "
    " . (strpos($build->scmPath, 'http') === 0 ? html::a($build->scmPath) : $build->scmPath) . '
    '; + if($build->filePath) echo "
    " . (strpos($build->filePath, 'http') === 0 ? html::a($build->filePath) : $build->filePath) . '
    '; + ?> +
    date?> builder);?> build->buildOperateMenu($build, 'browse', "executionID={$execution->id}&productID={$productID}");?>build->id;?> build->name;?> build->product;?>build->product;?> executionCommon;?>executionCommon;?> build->scmPath;?>build->filePath;?>build->url;?> build->date;?> build->builder;?> actions;?> scmPath, 'http') === 0 ? html::a($build->scmPath) : $build->scmPath;?>filePath, 'http') === 0 ? html::a($build->filePath) : $build->filePath;?> + scmPath) echo "
    " . (strpos($build->scmPath, 'http') === 0 ? html::a($build->scmPath) : $build->scmPath) . '
    '; + if($build->filePath) echo "
    " . (strpos($build->filePath, 'http') === 0 ? html::a($build->filePath) : $build->filePath) . '
    '; + ?> +
    date?> builder);?> build->buildOperateMenu($build, 'browse');?> scmPath) echo "
    " . (strpos($build->scmPath, 'http') === 0 ? html::a($build->scmPath) : $build->scmPath) . '
    '; + if($build->scmPath) echo "
    " . (strpos($build->scmPath, 'http') === 0 ? html::a($build->scmPath) : $build->scmPath) . '
    '; if($build->filePath) echo "
    " . (strpos($build->filePath, 'http') === 0 ? html::a($build->filePath) : $build->filePath) . '
    '; ?>
    scmPath) echo "
    " . (strpos($build->scmPath, 'http') === 0 ? html::a($build->scmPath) : $build->scmPath) . '
    '; + if($build->scmPath) echo "
    " . (strpos($build->scmPath, 'http') === 0 ? html::a($build->scmPath) : $build->scmPath) . '
    '; if($build->filePath) echo "
    " . (strpos($build->filePath, 'http') === 0 ? html::a($build->filePath) : $build->filePath) . '
    '; ?>
    ' . html::textarea("$name", $selected, "class='form-control' cols='50' rows='1'") . '' . $stepDesc . '
    id, "onchange='loadBranches(this.value);' class='form-control chosen' required");?> - type != 'normal') - { - echo "" . html::select('branch', $branches, key($product->branches), "class='form-control chosen'"); - } - ?>
    build->branch;?> +
    + branches), "class='form-control chosen' multiple required"); ?> +
    +
    build->builds;?> build->placeholder->multipleSelect}'");?>name;?>
    productplan->parent;?> '') + $parentPlanPairs, 0, "class='form-control chosen'");?> +
    product->branch;?> productplan->last . ': ' . $lastPlan->title . ')';?>
    productplan->parent;?> '') + $parentPlanPairs, 0, "class='form-control chosen'");?> -
    productplan->begin;?> productplan->product;?> name;?>
    product->branch;?>branch, "onchange='getConflictStories($plan->id);' class='form-control chosen' multiple");?>
    productplan->title;?>title, "class='form-control' required");?>
    '') + $parentPlanPairs, $plan->parent, "class='form-control chosen'");?>
    product->branch;?>branch, "class='form-control chosen' multiple");?>
    productplan->title;?>title, "class='form-control' required");?>
    productplan->status;?> ' . html::textarea("$name", $selected, "class='form-control' style='overflow:hidden;'") . '' . html::input("$name", $selected, "class='form-control autocomplete='off'") . 'pri;?>>priAB);?>pri;?>>priAB);?> story->title);?>build->common;?> openedByAB);?> story->estimateAB);?> statusAB);?>
    @@ -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);?>
    @@ -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;?> build->product;?> executionCommon;?> build->url;?>build->date;?>build->builder;?>build->date;?>build->builder;?> actions;?>
    bug->title);?> bug->status);?> build->common?> bug->status);?> openedByAB);?> bug->openedDateAB);?> bug->resolvedByAB);?>
    title, '', isonlybody() ? "data-width='1000'" : "class='iframe' data-width='1000'");?> processStatus('bug', $bug);?> openedBy);?> openedDate) ? '' : substr($bug->openedDate, 5, 11);?> resolvedBy);?>bug->severity;?>>bug->severityAB);?> bug->title);?> bug->status);?>bug->openedBuild;?> openedByAB);?> bug->openedDateAB);?> bug->resolvedByAB);?> openedBy);?> openedDate) ? '' : substr($bug->openedDate, 5, 11);?> resolvedBy);?>
    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'");?>
    build->notice->changeProduct;?>
    build->branch;?> +
    + branch, "class='form-control chosen' multiple required $disabled"); ?> +
    +
    build->branch;?>
    @@ -53,7 +52,6 @@
    build->builds;?> build->placeholder->multipleSelect}'");?> build->notice->changeProduct;?>
    build->branch;?>
    @@ -45,7 +45,6 @@
    priAB);?> story->title);?>build->common;?> openedByAB);?> story->estimateAB);?> statusAB);?>buildName?> openedBy);?> estimate . $config->hourUnit;?> diff --git a/module/release/control.php b/module/release/control.php index 1fedaf1531..aa1331ba6b 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -185,14 +185,15 @@ class release extends control if(strpos($sort, 'pri_') !== false) $sort = str_replace('pri_', 'priOrder_', $sort); $storyPager = new pager($type == 'story' ? $recTotal : 0, $recPerPage, $type == 'story' ? $pageID : 1); - $stories = $this->dao->select("*, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder")->from(TABLE_STORY) - ->where('id')->in($release->stories) - ->andWhere('deleted')->eq(0) + $stories = $this->dao->select("t1.*,t2.id as buildID, t2.name as buildName, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder")->from(TABLE_STORY)->alias('t1') + ->leftJoin(TABLE_BUILD)->alias('t2')->on("FIND_IN_SET(t1.id, t2.stories)") + ->where('t1.id')->in($release->stories) + ->andWhere('t1.deleted')->eq(0) ->beginIF($type == 'story')->orderBy($sort)->fi() ->page($storyPager) ->fetchAll('id'); - $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story'); + $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story', false); $stages = $this->dao->select('*')->from(TABLE_STORYSTAGE)->where('story')->in(array_keys($stories))->andWhere('branch')->eq($release->branch)->fetchPairs('story', 'stage'); foreach($stages as $storyID => $stage) $stories[$storyID]->stage = $stage; diff --git a/module/release/view/view.html.php b/module/release/view/view.html.php index 6ec80c73bd..d792e605a9 100644 --- a/module/release/view/view.html.php +++ b/module/release/view/view.html.php @@ -73,6 +73,7 @@ pri;?>>priAB);?> story->title);?>build->common;?> openedByAB);?> story->estimateAB);?> statusAB);?>buildName?> openedBy);?> estimate . $config->hourUnit;?> From e3b57ed1f509b6a49241ffe83025b02dbc94543b Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 6 Dec 2022 17:59:21 +0800 Subject: [PATCH 236/267] * code task #78915,78916. --- module/projectrelease/control.php | 3 ++- module/projectrelease/view/view.html.php | 9 +++++++++ module/release/control.php | 1 + module/release/view/view.html.php | 9 +++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index 64efe20e94..abcca88bf6 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -256,7 +256,7 @@ class projectrelease extends control ->beginIF($type == 'story')->orderBy($sort)->fi() ->page($storyPager) ->fetchAll('id'); - $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story' false); + $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story', false); $stages = $this->dao->select('*')->from(TABLE_STORYSTAGE)->where('story')->in(array_keys($stories))->andWhere('branch')->eq($release->branch)->fetchPairs('story', 'stage'); foreach($stages as $storyID => $stage) $stories[$storyID]->stage = $stage; @@ -305,6 +305,7 @@ class projectrelease extends control $this->view->storyPager = $storyPager; $this->view->bugPager = $bugPager; $this->view->leftBugPager = $leftBugPager; + $this->view->builds = $this->loadModel('build')->getBuildPairs($release->product, 'all', 'withbranch|hasproject', 0, 'execution', '', false); $this->display(); } diff --git a/module/projectrelease/view/view.html.php b/module/projectrelease/view/view.html.php index c7fee7a44d..19ed80d00d 100644 --- a/module/projectrelease/view/view.html.php +++ b/module/projectrelease/view/view.html.php @@ -169,6 +169,7 @@ bug->title);?> bug->status);?>bug->resolvedBuild;?> openedByAB);?> bug->openedDateAB);?> bug->resolvedByAB);?> processStatus('bug', $bug);?> openedBy);?> openedDate) ? '' : substr($bug->openedDate, 5, 11);?> resolvedBy);?>bug->severity;?>>bug->severityAB);?> bug->title);?> bug->status);?>bug->openedBuild;?> openedByAB);?> bug->openedDateAB);?> actions;?> title, '', "class='preview'");?> processStatus('bug', $bug);?> openedBy);?> openedDate?> diff --git a/module/release/control.php b/module/release/control.php index aa1331ba6b..5e2b5508f0 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -239,6 +239,7 @@ class release extends control $this->view->storyPager = $storyPager; $this->view->bugPager = $bugPager; $this->view->leftBugPager = $leftBugPager; + $this->view->builds = $this->loadModel('build')->getBuildPairs($release->product, 'all', 'withbranch|hasproject', 0, 'execution', '', false); if($this->app->getViewType() == 'json') { diff --git a/module/release/view/view.html.php b/module/release/view/view.html.php index d792e605a9..727313e5d5 100644 --- a/module/release/view/view.html.php +++ b/module/release/view/view.html.php @@ -171,6 +171,7 @@ bug->title);?> bug->status);?>bug->resolvedBuild;?> openedByAB);?> bug->openedDateAB);?> bug->resolvedByAB);?> processStatus('bug', $bug);?> openedBy);?> openedDate, 5, 11)?> resolvedBy);?>bug->severity;?>>bug->severityAB);?> bug->title);?> bug->status);?>bug->openedBuild;?> openedByAB);?> bug->openedDateAB);?> actions;?> title, '', "class='preview'");?> processStatus('bug', $bug);?> openedBy);?> openedDate?> From e5b21b632e31c20ef1ced2fd708536d2743ef709 Mon Sep 17 00:00:00 2001 From: Yagami Date: Wed, 7 Dec 2022 09:10:37 +0800 Subject: [PATCH 237/267] * Change execution link stories lang. --- module/execution/lang/zh-cn.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index ce258165b5..decdee30da 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -351,8 +351,8 @@ $lang->execution->howToUpdateBurn = "关联{$lang->SRCommon}。"; -$lang->execution->haveBranchDraft = "有%s条草稿状态或非本{$lang->executionCommon}关联分支的{$lang->SRCommon}无法关联到该{$lang->executionCommon}"; -$lang->execution->haveDraft = "有%s条草稿状态的{$lang->SRCommon}无法关联到该{$lang->executionCommon}"; +$lang->execution->haveBranchDraft = "有%s条非激活状态或不是{$lang->executionCommon}关联分支的{$lang->SRCommon}无法导入"; +$lang->execution->haveDraft = "有%s条非激活状态的{$lang->SRCommon}无法导入"; $lang->execution->doneExecutions = '已结束'; $lang->execution->selectDept = '选择部门'; $lang->execution->selectDeptTitle = '选择一个部门的成员'; From e6df8be8a655c4bede5816f3ef852144b2f1cc6e Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Wed, 7 Dec 2022 09:21:19 +0800 Subject: [PATCH 238/267] add default branch --- module/build/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/build/control.php b/module/build/control.php index 562595c968..021f442967 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -334,7 +334,7 @@ class build extends control $this->view->bugs = $bugs; $this->view->type = $type; $this->view->bugPager = $bugPager; - $this->view->branchName = $branchName; + $this->view->branchName = empty($branchName) ? $this->lang->branch->main : $branchName; $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') From 1b26176882f3fef68b89beaef4d43892864a635c Mon Sep 17 00:00:00 2001 From: Yagami Date: Wed, 7 Dec 2022 09:36:05 +0800 Subject: [PATCH 239/267] * Modify sql. --- db/update18.0.beta1.sql | 1 + db/update18.0.sql | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 db/update18.0.sql diff --git a/db/update18.0.beta1.sql b/db/update18.0.beta1.sql index d9197b8193..8135c190d3 100644 --- a/db/update18.0.beta1.sql +++ b/db/update18.0.beta1.sql @@ -1,3 +1,4 @@ ALTER TABLE `zt_story` ADD COLUMN `siblings` varchar(255) NOT NULL AFTER `linkRequirements`; ALTER TABLE `zt_productplan` MODIFY COLUMN `branch` varchar(255) NOT NULL DEFAULT '0'; ALTER TABLE `zt_effort` ADD `extra` text COLLATE 'utf8_general_ci' NOT NULL AFTER `end`; +ALTER TABLE `zt_build` MODIFY COLUMN `branch` varchar(255) NOT NULL DEFAULT '0'; diff --git a/db/update18.0.sql b/db/update18.0.sql deleted file mode 100644 index 926795ad20..0000000000 --- a/db/update18.0.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE `zt_story` ADD COLUMN `siblings` varchar(255) NOT NULL AFTER `linkRequirements`; - -ALTER TABLE `zt_productplan` MODIFY COLUMN `branch` varchar(255) NOT NULL DEFAULT '0'; - -ALTER TABLE `zt_build` MODIFY COLUMN `branch` varchar(255) NOT NULL DEFAULT '0'; \ No newline at end of file From a11b1deeb95299cc54c06f3e525d47d7d639f2be Mon Sep 17 00:00:00 2001 From: wangzemei Date: Wed, 7 Dec 2022 09:48:12 +0800 Subject: [PATCH 240/267] * Optimize the display of radar charts --- module/report/view/annualdata.html.php | 28 +++++++++++++++++--------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/module/report/view/annualdata.html.php b/module/report/view/annualdata.html.php index 35234b8d7a..68c95a9617 100644 --- a/module/report/view/annualdata.html.php +++ b/module/report/view/annualdata.html.php @@ -292,31 +292,39 @@ $(function() timeline: { show: yearsData.length && yearsData.length > 1, axisType: 'category', - autoPlay: true, - loop: false, + autoPlay: false, + loop: true, playInterval: 1000, left: "1%", bottom: "1%", width: '90%', data: yearsData, - symbolSize: [8, 4], + currentIndex: yearsData.length - 1, + symbolSize: [5, 5], label: { - normal: { - color: '#fff', - interval: 'auto', - fontSize: 12, - lineHeight: 20 - }, + fontSize: 10, + lineHeight: 18, interval: 'auto', }, + emphasis: { + label: { + fontSize: 10, + }, + }, + progress: { + label: { + fontSize: 10, + }, + }, lineStyle: { width: 5, }, controlStyle: { - itemSize: 18 + itemSize: 18, }, }, + tooltip: {}, series: [{ name:'radar;?>', areaStyle:{color: 'rgb(45, 40, 33)'}, From 15d16d3eb69e14f4d2650a43fc704f3885729b6e Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Wed, 7 Dec 2022 09:50:09 +0800 Subject: [PATCH 241/267] add default branchName --- module/build/js/create.js | 11 +++++++++++ module/build/view/create.html.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/module/build/js/create.js b/module/build/js/create.js index f74d9ca74e..96516eb760 100644 --- a/module/build/js/create.js +++ b/module/build/js/create.js @@ -14,6 +14,12 @@ $().ready(function() if(data) $('#buildBox').html(data); $('#builds').attr('data-placeholder', multipleSelect).chosen(); }); + + $.get(createLink('product', 'ajaxGetProductById', 'produtID=' + productID), function(data) + { + console.log(data.branchName) + $('#branchBox').closest('tr').find('th').text(data.branchName); + }, 'json'); }); $('input[name=isIntegrated]').change(function() @@ -69,6 +75,11 @@ function loadProducts(executionID) loadBranches($("#product").val()); } }); + + $.get(createLink('product', 'ajaxGetProductById', 'produtID=' + $("#product").val()), function(data) + { + $('#branchBox').closest('tr').find('th').text(data.branchName); + }, 'json'); loadLastBuild(); } diff --git a/module/build/view/create.html.php b/module/build/view/create.html.php index d2b96aadc9..40269a87dd 100644 --- a/module/build/view/create.html.php +++ b/module/build/view/create.html.php @@ -45,7 +45,7 @@
    build->branch;?>type == 'normal' ? '' : $lang->product->branchName[$product->type]?>
    branches), "class='form-control chosen' multiple required"); ?> From 595ec286b67afee187346deef00088a4ecbcb8f9 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 7 Dec 2022 10:34:10 +0800 Subject: [PATCH 242/267] * adjust for show build path. --- module/execution/view/build.html.php | 4 ++-- module/programplan/model.php | 10 +++++----- module/project/view/build.html.php | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/module/execution/view/build.html.php b/module/execution/view/build.html.php index 41f1b2b7d0..da0d847f1e 100644 --- a/module/execution/view/build.html.php +++ b/module/execution/view/build.html.php @@ -69,8 +69,8 @@
    scmPath) echo "
    " . (strpos($build->scmPath, 'http') === 0 ? html::a($build->scmPath) : $build->scmPath) . '
    '; - if($build->filePath) echo "
    " . (strpos($build->filePath, 'http') === 0 ? html::a($build->filePath) : $build->filePath) . '
    '; + if($build->scmPath) echo "
    " . (strpos($build->scmPath, 'http') === 0 ? html::a($build->scmPath, $build->scmPath, '_blank') : $build->scmPath) . '
    '; + if($build->filePath) echo "
    " . (strpos($build->filePath, 'http') === 0 ? html::a($build->filePath, $build->filePath, '_blank') : $build->filePath) . '
    '; ?>
    date?> scmPath) echo "
    " . (strpos($build->scmPath, 'http') === 0 ? html::a($build->scmPath) : $build->scmPath) . '
    '; - if($build->filePath) echo "
    " . (strpos($build->filePath, 'http') === 0 ? html::a($build->filePath) : $build->filePath) . '
    '; + if($build->scmPath) echo "
    " . (strpos($build->scmPath, 'http') === 0 ? html::a($build->scmPath, $build->scmPath, '_blank') : $build->scmPath) . '
    '; + if($build->filePath) echo "
    " . (strpos($build->filePath, 'http') === 0 ? html::a($build->filePath, $build->filePath, '_blank') : $build->filePath) . '
    '; ?>
    date?>
    build->id;?>build->product;?>build->product;?>build->branch;?> build->name;?>build->url;?>build->url;?> build->date;?> build->builder;?> actions;?>
    id"), sprintf('%03d', $build->id));?> productName;?> - branchName) echo "{$build->branchName}"?> - createLink('build', 'view', "build=$build->id"), $build->name);?> - branchName;?>createLink('build', 'view', "build=$build->id"), $build->name);?> scmPath) echo "
    " . (strpos($build->scmPath, 'http') === 0 ? html::a($build->scmPath) : $build->scmPath) . '
    '; diff --git a/module/project/control.php b/module/project/control.php index 6a5787404b..e9bd7a942d 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -1448,24 +1448,28 @@ class project extends control /* Set project builds. */ $projectBuilds = array(); $productList = $this->product->getProducts($projectID); - $this->app->loadLang('branch'); + $showBranch = false; if(!empty($builds)) { foreach($builds as $build) { $build->builds = $this->build->getByList($build->builds); - /* If product is normal, unset branch name. */ - if(isset($productList[$build->product]) and $productList[$build->product]->type == 'normal') - { - $build->branchName = ''; - } - else - { - $build->branchName = isset($build->branchName) ? $build->branchName : $this->lang->branch->main; - } - $projectBuilds[$build->product][] = $build; } + + /* Get branch name. */ + $branchGroups = $this->loadModel('branch')->getByProducts(array_keys($projectBuilds)); + foreach($builds as $build) + { + $build->branchName = ''; + if(isset($branchGroups[$build->product])) + { + $showBranch = true; + $branchPairs = $branchGroups[$build->product]; + foreach(explode(',', $build->branch) as $branchID) $build->branchName .= "{$branchPairs[$branchID]},"; + $build->branchName = trim($build->branchName, ','); + } + } } /* Header and position. */ @@ -1482,6 +1486,7 @@ class project extends control $this->view->executions = $this->execution->getPairs(); $this->view->buildPairs = $this->loadModel('build')->getBuildPairs(0); $this->view->type = $type; + $this->view->showBranch = $showBranch; $this->display(); } diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index 124480f679..44009af45d 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -51,11 +51,14 @@
    build->name;?> build->product;?>build->branch;?> executionCommon;?> build->url;?>build->url;?> build->date;?> build->builder;?> actions;?>
    id"), sprintf('%03d', $build->id), '', "data-app='project'");?> - branchName) echo "{$build->branchName}"?> createLink($module, 'view', "buildID=$build->id"), $build->name, '', "data-app='project'");?> execution):?> @@ -76,6 +78,9 @@ productName;?>branchName;?> projectrelease->product;?> release->includedBuild;?>release->branch;?> release->status;?> release->date;?> class='c-branch text-center'>branchName; ?> class='c-status text-center' title=''> title='productName?>'>productName?> createLink($build->execution ? 'build' : 'projectbuild', 'view', "buildID=$buildID"), $build->name, '', "data-app='project' title='name;?>'");?>createLink($build->execution ? 'build' : 'projectbuild', 'view', "buildID=$buildID"), $build->name, '', "data-app='project' title='{$build->name}'");?> class='c-status text-center' title=''> From ae62bdff75e61eb06999c1c783713c8f6ee1bb62 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 7 Dec 2022 14:19:36 +0800 Subject: [PATCH 250/267] * Code for task#78661. --- module/tree/control.php | 8 ++++++++ module/tree/view/edit.html.php | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/module/tree/control.php b/module/tree/control.php index 90280d30ea..9de9df00ab 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -536,6 +536,14 @@ class tree extends control { $optionMenu = $this->tree->getOptionMenu($rootID, $viewType, $rootModuleID, $branch); } + + if(strpos($extra, 'excludeModuleID') !== false) + { + parse_str($extra, $output); + $excludeModuleID = $output['excludeModuleID']; + if(isset($optionMenu[$excludeModuleID])) unset($optionMenu[$excludeModuleID]); + } + if($returnType == 'html') { //Code for task #5081. diff --git a/module/tree/view/edit.html.php b/module/tree/view/edit.html.php index 861740098a..233893d74e 100644 --- a/module/tree/view/edit.html.php +++ b/module/tree/view/edit.html.php @@ -189,7 +189,7 @@ function loadModules(branch) if(typeof(branchID) == 'undefined') branchID = 0; if(typeof(moduleID) == 'undefined') moduleID = 0; - link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branchID + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=¤tModuleID=' + moduleID); + link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branchID + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=excludeModuleID=' + id;?> + '¤tModuleID=' + moduleID); $(moduleBox).load(link, function() { $(this).children('select').attr('id', 'parent').attr('name', 'parent'); From 5f3444278b918eb60e4511ee88350ba3f38d3ea6 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Wed, 7 Dec 2022 14:22:27 +0800 Subject: [PATCH 251/267] * Finish Task #78688 --- module/product/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/product/control.php b/module/product/control.php index c1d0f08da2..f4bcefe82b 100755 --- a/module/product/control.php +++ b/module/product/control.php @@ -356,7 +356,7 @@ class product extends control $this->view->productName = $productName; $this->view->moduleID = $moduleID; $this->view->stories = $stories; - $this->view->plans = $this->loadModel('productplan')->getPairs($productID, ($branch === 'all' or empty($branch)) ? '' : $branch, '', true); + $this->view->plans = $this->loadModel('productplan')->getPairs($productID, ($branch === 'all' or empty($branch)) ? '' : $branch, 'unexpired', true); $this->view->productPlans = isset($productPlans) ? array(0 => '') + $productPlans : array(); $this->view->summary = $this->product->summary($stories, $storyType); $this->view->moduleTree = $moduleTree; From 57dbeba6d9f83e389375da686bdd070d58393f79 Mon Sep 17 00:00:00 2001 From: Yagami Date: Wed, 7 Dec 2022 14:45:14 +0800 Subject: [PATCH 252/267] * Finish task #78672. --- module/release/model.php | 16 +++++++++++++++- module/release/view/view.html.php | 8 ++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/module/release/model.php b/module/release/model.php index 5b94a157b0..87aa0a513d 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -31,7 +31,21 @@ class releaseModel extends model ->fetch(); if(!$release) return false; - $release->builds = $this->dao->select('id, filePath, scmPath, name, execution, project')->from(TABLE_BUILD)->where('id')->in($release->build)->fetchAll(); + $builds = $this->dao->select('id, branch, filePath, scmPath, name, execution, project')->from(TABLE_BUILD)->where('id')->in($release->build)->fetchAll(); + + /* Get release's branches by build. */ + $branches = array(); + if($release->productType != 'normal') + { + foreach($builds as $build) + { + $branch = explode(',', $build->branch); + if(is_array($branch)) $branches += $branch; + } + } + + $release->builds = $builds; + $release->branches = $branches; $this->loadModel('file'); $release = $this->file->replaceImgURL($release, 'desc'); diff --git a/module/release/view/view.html.php b/module/release/view/view.html.php index 727313e5d5..59862c8d8d 100644 --- a/module/release/view/view.html.php +++ b/module/release/view/view.html.php @@ -378,6 +378,14 @@ ?>
    release->branch;?> + branches as $branchID) echo zget($branches, $branchID, '') . ' ';?> +
    release->status;?> processStatus('release', $release);?>
    release->branch;?> + branches as $branchID) echo zget($branches, $branchID, '') . ' ';?> +
    release->status;?> processStatus('release', $release);?>
    build->branch;?>type == 'normal' ? '' : $lang->product->branchName[$product->type]?>
    branch, "class='form-control chosen' multiple required $disabled"); ?> From 7189103e60ae3390db0d5e4d39561a2547e24490 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Wed, 7 Dec 2022 15:58:31 +0800 Subject: [PATCH 258/267] * Finish Bug #30558 --- module/execution/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index b1ac471826..4f7ac2c7e2 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1587,12 +1587,12 @@ class executionModel extends model $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') ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t3')->on('t1.id=t3.project') - ->beginIF($project->division)->leftJoin(TABLE_PRODUCT)->alias('t4')->on('t4.id=t3.product')->fi() + ->beginIF(!empty($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(!empty($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 771dd4c8ed66fec1d15fff919b222af7b7f55adb Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 7 Dec 2022 17:42:41 +0800 Subject: [PATCH 259/267] * code for task #78908,78918. --- module/my/config.php | 5 +- module/my/control.php | 9 +++ module/my/model.php | 147 +++++++++++++++++++++++++++++++--- module/my/view/audit.html.php | 15 +++- 4 files changed, 160 insertions(+), 16 deletions(-) diff --git a/module/my/config.php b/module/my/config.php index d4020cd11e..c7d74d5ed1 100644 --- a/module/my/config.php +++ b/module/my/config.php @@ -9,10 +9,7 @@ $config->my->taskCounts = 10; $config->my->bugCounts = 10; $config->my->storyCounts = 10; -$config->my->oaObjectType = 'attend,leave,makeup,overtime,lieu'; -$config->my->reviewObjectType = 'story,case'; -if($config->edition == 'biz') $config->my->reviewObjectType = 'story,case,feedback,attend,leave,makeup,overtime,lieu'; -if($config->edition == 'max') $config->my->reviewObjectType = 'story,case,review,feedback,attend,leave,makeup,overtime,lieu'; +$config->my->oaObjectType = 'attend,leave,makeup,overtime,lieu'; $config->mobile = new stdclass(); $config->mobile->todoBar = array('today', 'yesterday', 'thisWeek', 'lastWeek', 'all'); diff --git a/module/my/control.php b/module/my/control.php index 9474df1719..f4f4a98646 100755 --- a/module/my/control.php +++ b/module/my/control.php @@ -955,15 +955,24 @@ EOF; $this->app->loadClass('pager', true); $pager = pager::init($recTotal, $recPerPage, $pageID); + $typeList = array(); if($this->app->rawMethod == 'contribute') { $reviewList = $this->my->getReviewedList($browseType, $orderBy, $pager); } else { + $this->lang->my->auditMenu->audit = $this->my->getReviewingTypeList(); $reviewList = $this->my->getReviewingList($browseType, $orderBy, $pager); } + $this->view->flows = array(); + if($this->config->edition == 'max') + { + $this->app->loadLang('approval'); + $this->view->flows = $this->dao->select('module,name')->from(TABLE_WORKFLOW)->where('buildin')->eq(0)->fetchPairs('module', 'name'); + } + $this->view->title = $this->lang->review->common; $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter'); $this->view->reviewList = $reviewList; diff --git a/module/my/model.php b/module/my/model.php index 7cb33794fd..cc02ea712e 100644 --- a/module/my/model.php +++ b/module/my/model.php @@ -993,6 +993,34 @@ class myModel extends model return $requirements; } + /** + * Get reviewing type list for menu. + * + * @access public + * @return object + */ + public function getReviewingTypeList() + { + $typeList = array(); + if($this->getReviewingStories('id_desc', true)) $typeList[] = 'story'; + if($this->getReviewingCases('id_desc', true)) $typeList[] = 'testcase'; + if($this->getReviewingApprovals('id_desc', true)) $typeList[] = 'project'; + if($this->getReviewingFeedbacks('id_desc', true)) $typeList[] = 'feedback'; + $typeList = array_merge($typeList, $this->getReviewingOA('status', true)); + $typeList = array_merge($typeList, $this->getReviewingFlows('all', 'id_desc', true)); + + $flows = ($this->config->edition == 'open') ? array() : $this->dao->select('module,name')->from(TABLE_WORKFLOW)->where('module')->in($typeList)->andWhere('buildin')->eq(0)->fetchPairs('module', 'name'); + $menu = new stdclass(); + $menu->all = $this->lang->my->auditMenu->audit->all; + foreach($typeList as $type) + { + $this->app->loadLang($type); + $menu->$type = isset($this->lang->$type->common) ? $this->lang->$type->common : zget($flows, $type); + } + + return $menu; + } + /** * Get reviewing list for me. * @@ -1010,6 +1038,7 @@ class myModel extends model if($browseType == 'all' or $browseType == 'project') $reviewList = array_merge($reviewList, $this->getReviewingApprovals()); if($browseType == 'all' or $browseType == 'feedback') $reviewList = array_merge($reviewList, $this->getReviewingFeedbacks()); if($browseType == 'all' or $browseType == 'oa') $reviewList = array_merge($reviewList, $this->getReviewingOA()); + if($browseType == 'all' or !in_array($browseType, array('story', 'testcase', 'project', 'feedback', 'oa'))) $reviewList = array_merge($reviewList, $this->getReviewingFlows($browseType)); if(empty($reviewList)) return array(); @@ -1044,10 +1073,11 @@ class myModel extends model * Get reviewing stories. * * @param string $orderBy + * @param bool $checkExists * @access public * @return array */ - public function getReviewingStories($orderBy = 'id_desc') + public function getReviewingStories($orderBy = 'id_desc', $checkExists = false) { if(!common::hasPriv('story', 'review')) return array(); @@ -1066,6 +1096,7 @@ class myModel extends model $stories = array(); while($data = $stmt->fetch()) { + if($checkExists) return true; $story = new stdclass(); $story->id = $data->id; $story->title = $data->title; @@ -1084,10 +1115,11 @@ class myModel extends model * Get reviewing cases. * * @param string $orderBy + * @param bool $checkExists * @access public * @return array */ - public function getReviewingCases($orderBy = 'id_desc') + public function getReviewingCases($orderBy = 'id_desc', $checkExists = false) { if(!common::hasPriv('testcase', 'review')) return array(); @@ -1102,6 +1134,7 @@ class myModel extends model $cases = array(); while($data = $stmt->fetch()) { + if($checkExists) return true; $case = new stdclass(); $case->id = $data->id; $case->title = $data->title; @@ -1118,10 +1151,11 @@ class myModel extends model * Get reviewing approvals. * * @param string $orderBy + * @param bool $checkExists * @access public * @return array */ - public function getReviewingApprovals($orderBy = 'id_desc') + public function getReviewingApprovals($orderBy = 'id_desc', $checkExists = false) { if(!common::hasPriv('review', 'assess')) return array(); if($this->config->edition != 'max') return array(); @@ -1136,6 +1170,7 @@ class myModel extends model foreach($projectReviews as $review) { if(!isset($pendingList[$review->id])) continue; + if($checkExists) return true; $data = new stdclass(); $data->id = $review->id; @@ -1149,13 +1184,80 @@ class myModel extends model } /** - * Get reviewing feedbacks. + * Get reviewing for flows setting. * + * @param string $objectType * @param string $orderBy + * @param bool $checkExists * @access public * @return array */ - public function getReviewingFeedbacks($orderBy = 'id_desc') + public function getReviewingFlows($objectType = 'all', $orderBy = 'id_desc', $checkExists = false) + { + if($this->config->edition != 'max') return array(); + + $stmt = $this->dao->select('t2.objectType,t2.objectID')->from(TABLE_APPROVALNODE)->alias('t1') + ->leftJoin(TABLE_APPROVALOBJECT)->alias('t2') + ->on('t2.approval = t1.approval') + ->where('t2.objectType')->ne('review') + ->beginIF($objectType != 'all')->andWhere('t2.objectType')->eq($objectType)->fi() + ->andWhere('t1.account')->eq($this->app->user->account) + ->andWhere('t1.status')->eq('doing') + ->query(); + $objectIdList = array(); + while($object = $stmt->fetch()) $objectIdList[$object->objectType][$object->objectID] = $object->objectID; + if($checkExists) return array_keys($objectIdList); + + $flows = $this->dao->select('module,`table`,name,titleField')->from(TABLE_WORKFLOW)->where('module')->in(array_keys($objectIdList))->andWhere('buildin')->eq(0)->fetchAll('module'); + $objectGroup = array(); + foreach($objectIdList as $objectType => $idList) + { + $table = zget($this->config->objectTables, $objectType, ''); + if(empty($table) and isset($flows[$objectType])) $table = $flows[$objectType]->table; + if(empty($table)) continue; + + $objectGroup[$objectType] = $this->dao->select('*')->from($table)->where('id')->in($idList)->fetchAll('id'); + } + + $this->app->loadConfig('action'); + $approvalList = array(); + foreach($objectGroup as $objectType => $objects) + { + $title = ''; + $titleFieldName = zget($this->config->action->objectNameFields, $objectType, ''); + $openedDateField = 'openedDate'; + if(in_array($objectType, array('product', 'productplan', 'release', 'build', 'testtask'))) $openedDateField = 'createdDate'; + if(in_array($objectType, array('testsuite', 'caselib')))$openedDateField = 'addedDate'; + if(empty($titleFieldName) and isset($flows[$objectType])) + { + if(!empty($flows[$objectType]->titleField)) $titleFieldName = $flows[$objectType]->titleField; + if(empty($flows[$objectType]->titleField)) $title = $flows[$objectType]->name; + $openedDateField = 'createdDate'; + } + + foreach($objects as $object) + { + $data = new stdclass(); + $data->id = $object->id; + $data->title = (empty($titleFieldName) or !isset($object->$titleFieldName)) ? $title . " #{$object->id}" : $object->$titleFieldName; + $data->type = $objectType; + $data->time = $object->$openedDateField; + $data->status = (isset($object->status) and !isset($flows[$objectType])) ? $object->status : 'doing'; + $approvalList[] = $data; + } + } + return $approvalList; + } + + /** + * Get reviewing feedbacks. + * + * @param string $orderBy + * @param bool $checkExists + * @access public + * @return array + */ + public function getReviewingFeedbacks($orderBy = 'id_desc', $checkExists = false) { if(!common::hasPriv('feedback', 'review')) return array(); if($this->config->edition == 'open') return array(); @@ -1164,6 +1266,8 @@ class myModel extends model $reviewList = array(); foreach($feedbacks as $feedback) { + if($checkExists) return true; + $data = new stdclass(); $data->id = $feedback->id; $data->title = $feedback->title; @@ -1179,10 +1283,11 @@ class myModel extends model * Get reviewing OA. * * @param string $orderBy + * @param bool $checkExists * @access public * @return array */ - public function getReviewingOA($orderBy = 'status') + public function getReviewingOA($orderBy = 'status', $checkExists = false) { if($this->config->edition == 'open') return array(); @@ -1203,6 +1308,16 @@ class myModel extends model if(common::hasPriv('makeup', 'review') and common::hasPriv('makeup', 'view')) $oa['makeup'] = $this->getReviewingMakeups($allDeptList, $managedDeptList, $orderBy); if(common::hasPriv('lieu', 'review') and common::hasPriv('lieu', 'view')) $oa['lieu'] = $this->getReviewingLieus($allDeptList, $managedDeptList, $orderBy); + if($checkExists) + { + $typeList = array(); + foreach($oa as $type => $reviewings) + { + if(!empty($reviewings)) $typeList[$type] = true; + } + return array_keys($typeList); + } + $reviewList = array(); foreach($oa as $type => $reviewings) { @@ -1251,19 +1366,19 @@ class myModel extends model if(empty($actionField)) $actionField = 'date'; $orderBy = $actionField . '_' . $direction; - $condition = "action = 'reviewed'"; + $condition = "(action = 'reviewed' or action = 'approvalreview')"; if($browseType == 'createdbyme') { $condition = "(objectType in('story','case','feedback') and action = 'submitreview') OR "; $condition .= "(objectType = 'review' and action = 'opened') OR "; $condition .= "(objectType = 'attend' and action = 'commited') OR "; + $condition .= "(action = 'approvalsubmit') OR "; $condition .= "(objectType in('leave','makeup','overtime','lieu') and action = 'created')"; $condition = "($condition)"; } $actions = $this->dao->select('objectType,objectID,actor,action,MAX(`date`) as `date`,extra')->from(TABLE_ACTION) ->where('actor')->eq($this->app->user->account) - ->andWhere('objectType')->in($this->config->my->reviewObjectType) ->andWhere('vision')->eq($this->config->vision) ->andWhere($condition) ->groupBy('objectType,objectID') @@ -1273,10 +1388,12 @@ class myModel extends model $objectTypeList = array(); foreach($actions as $action) $objectTypeList[$action->objectType][] = $action->objectID; + $flows = ($this->config->edition == 'open') ? array() : $this->dao->select('module,`table`,name,titleField')->from(TABLE_WORKFLOW)->where('module')->in(array_keys($objectTypeList))->andWhere('buildin')->eq(0)->fetchAll('module'); $objectGroup = array(); foreach($objectTypeList as $objectType => $idList) { $table = zget($this->config->objectTables, $objectType, ''); + if(empty($table) and isset($flows[$objectType])) $table = $flows[$objectType]->table; if(empty($table)) continue; $objectGroup[$objectType] = $this->dao->select('*')->from($table)->where('id')->in($idList)->fetchAll('id'); @@ -1290,6 +1407,7 @@ class myModel extends model } $users = $this->loadModel('user')->getPairs('noletter'); + $this->app->loadConfig('action'); $reviewList = array(); foreach($actions as $action) { @@ -1302,7 +1420,7 @@ class myModel extends model $review->type = $objectType; $review->time = $action->date; $review->result = strtolower($action->extra); - $review->status = $objectType == 'attend' ? $object->reviewStatus : $object->status; + $review->status = $objectType == 'attend' ? $object->reviewStatus : ((isset($object->status) and !isset($flows[$objectType])) ? $object->status : 'done'); if(strpos($review->result, ',') !== false) list($review->result) = explode(',', $review->result); if($review->type == 'review') $review->type = 'project'; @@ -1320,6 +1438,17 @@ class myModel extends model { $review->title = sprintf($this->lang->my->auditField->oaTitle[$objectType], zget($users, $object->createdBy), $object->begin . ' ' . substr($object->start, 0, 5) . ' ~ ' . $object->end . ' ' . substr($object->finish, 0, 5)); } + else + { + $title = ''; + $titleFieldName = zget($this->config->action->objectNameFields, $objectType, ''); + if(empty($titleFieldName) and isset($flows[$objectType])) + { + if(!empty($flows[$objectType]->titleField)) $titleFieldName = $flows[$objectType]->titleField; + if(empty($flows[$objectType]->titleField)) $title = $flows[$objectType]->name; + } + $review->title = (empty($titleFieldName) or !isset($object->$titleFieldName)) ? $title . " #{$object->id}" : $object->$titleFieldName; + } $reviewList[] = $review; } diff --git a/module/my/view/audit.html.php b/module/my/view/audit.html.php index 3a999df645..5dc9efa094 100644 --- a/module/my/view/audit.html.php +++ b/module/my/view/audit.html.php @@ -55,11 +55,15 @@ $type = $review->type; if($type == 'project') $type = 'review'; - $typeName = $lang->{$review->type}->common; + $typeName = ''; + if(isset($lang->{$review->type}->common)) $typeName = $lang->{$review->type}->common; if($type == 'story') $typeName = $lang->my->auditMenu->audit->story; + if(isset($flows[$review->type])) $typeName = $flows[$review->type]; - $statusList = $lang->$type->statusList; + $statusList = array(); + if(isset($lang->$type->statusList)) $statusList = $lang->$type->statusList; if($type == 'attend') $statusList = $lang->attend->reviewStatusList; + if(isset($flows[$review->type])) $statusList = $lang->approval->statusList; ?>
    id?>time?> result);?> openedBy);?> estimate . $config->hourUnit;?> openedBy);?> openedDate) ? '' : substr($bug->openedDate, 5, 11);?> openedBy);?> openedDate) ? '' : substr($bug->openedDate, 5, 11);?> resolvedBy);?>buildName?>buildName?> openedBy);?> estimate . $config->hourUnit;?> @@ -195,7 +195,7 @@ processStatus('bug', $bug);?> openedBy);?> openedDate) ? '' : substr($bug->openedDate, 5, 11);?> resolvedBy);?> openedBy);?> openedDate?> diff --git a/module/release/css/view.css b/module/release/css/view.css index c750db6903..acc96a13fd 100644 --- a/module/release/css/view.css +++ b/module/release/css/view.css @@ -10,3 +10,4 @@ ol, ul {padding-left: 20px;} .body-modal #mainContent {min-height: 240px;} .c-id {width: 110px;} +td.c-build{white-space: nowrap; overflow:hidden;} diff --git a/module/release/view/view.html.php b/module/release/view/view.html.php index 59862c8d8d..80e65b07f0 100644 --- a/module/release/view/view.html.php +++ b/module/release/view/view.html.php @@ -101,7 +101,7 @@ echo html::a($storyLink,$story->title, '', "class='preview'"); ?> buildName?>buildName?> openedBy);?> estimate . $config->hourUnit;?> @@ -197,7 +197,7 @@ processStatus('bug', $bug);?> openedBy);?> openedDate, 5, 11)?> resolvedBy);?> openedBy);?> openedDate?> From 44c075b0aedebd804e8c23eafdc8190cdb366524 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 8 Dec 2022 09:50:30 +0800 Subject: [PATCH 262/267] * Fix bug#30613. --- module/execution/control.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/execution/control.php b/module/execution/control.php index 852ff8a755..1c1768fb15 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1312,7 +1312,10 @@ class execution extends control { $showBranch = true; $branchPairs = $branchGroups[$build->product]; - foreach(explode(',', trim($build->branch, ',')) as $branchID) $build->branchName .= "{$branchPairs[$branchID]},"; + foreach(explode(',', trim($build->branch, ',')) as $branchID) + { + if(isset($branchPairs[$branchID])) $build->branchName .= "{$branchPairs[$branchID]},"; + } $build->branchName = trim($build->branchName, ','); } } From e4b9ef4536748336201f1f781c3a7490ea1a664f Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 8 Dec 2022 09:56:31 +0800 Subject: [PATCH 263/267] * fix bug #30585. --- module/build/control.php | 2 +- module/build/model.php | 2 ++ module/testtask/control.php | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index 021f442967..f351795698 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -428,7 +428,7 @@ class build extends control return print(html::select($varName, $builds, $build, "class='form-control'")); } - $builds = $this->build->getBuildPairs($productID, $branch, $type, 0, 'project', $build); + $builds = $this->build->getBuildPairs($productID, $branch, $type, 0, 'project', $build, false); if(strpos($extra, 'multiple') !== false) $varName .= '[]'; if($isJsonView) return print(json_encode($builds)); return print(html::select($varName, $builds, $build, "class='form-control chosen' $extra")); diff --git a/module/build/model.php b/module/build/model.php index 6f2f11d422..ad3e227710 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -256,6 +256,7 @@ class buildModel extends model ->fetchPairs(); } + $shadows = $this->dao->select('shadow')->from(TABLE_RELEASE)->where('product')->in($products)->fetchPairs('shadow', 'shadow'); $branchs = strpos($params, 'separate') === false ? "0,$branch" : $branch; $allBuilds = $this->dao->select('t1.id, t1.name, t1.execution, t1.date, t1.deleted, t2.status as objectStatus, t3.id as releaseID, t3.status as releaseStatus, t4.name as branchName, t5.type as productType')->from(TABLE_BUILD)->alias('t1') ->beginIF($objectType === 'execution')->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id')->fi() @@ -264,6 +265,7 @@ class buildModel extends model ->leftJoin(TABLE_BRANCH)->alias('t4')->on('t1.branch = t4.id') ->leftJoin(TABLE_PRODUCT)->alias('t5')->on('t1.product = t5.id') ->where('1=1') + ->andWhere('t1.id')->notIN($shadows) ->beginIF(strpos($params, 'hasDeleted') === false)->andWhere('t1.deleted')->eq(0)->fi() ->beginIF(strpos($params, 'hasproject') !== false)->andWhere('t1.project')->ne(0)->fi() ->beginIF(strpos($params, 'singled') !== false)->andWhere('t1.execution')->ne(0)->fi() diff --git a/module/testtask/control.php b/module/testtask/control.php index c3d4a34b99..58129d9a6d 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -250,7 +250,7 @@ class testtask extends control /* Create testtask from testtask of test.*/ $productID = $productID ? $productID : key($this->products); $executions = empty($productID) ? array() : $this->loadModel('product')->getExecutionPairsByProduct($productID, '', 'id_desc', $projectID, 'stagefilter'); - $builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk,withexecution', $projectID, 'project'); + $builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk,withexecution', $projectID, 'project', '', false); $execution = $this->loadModel('execution')->getByID($executionID); if(!empty($execution) and $execution->type == 'kanban') $this->lang->testtask->execution = str_replace($this->lang->execution->common, $this->lang->kanban->common, $this->lang->testtask->execution); @@ -816,11 +816,11 @@ class testtask extends control $executions[$executionID] = $project->name . "({$this->lang->project->disableExecution})"; } } - $builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk,withexecution', $executionID, 'execution'); + $builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk,withexecution', $executionID, 'execution', $task->build, false); } else { - $builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk,withexecution', $task->project, 'project'); + $builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk,withexecution', $task->project, 'project', $task->build, false); } $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->edit; From 80af5ddba5681fded59153d4cf5b17e7b2b993af Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 8 Dec 2022 10:06:46 +0800 Subject: [PATCH 264/267] * Finish task#78690. --- module/productplan/control.php | 2 +- module/story/control.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/productplan/control.php b/module/productplan/control.php index 486c675848..bf60aab4f2 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -605,7 +605,7 @@ class productplan extends control */ public function ajaxGetProductplans($productID, $branch = 0, $number = '', $expired = '') { - $plans = $this->productplan->getPairs($productID, $branch, $expired, true); + $plans = $this->productplan->getPairs($productID, empty($branch) ? '' : $branch, $expired, true); $planName = $number === '' ? 'plan' : "plan[$number]"; $plans = empty($plans) ? array('' => '') : $plans; echo html::select($planName, $plans, '', "class='form-control'"); diff --git a/module/story/control.php b/module/story/control.php index 2bc3434095..6b869ad089 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -691,7 +691,7 @@ class story extends control } $this->view->titles = $titles; } - $plans = $this->loadModel('productplan')->getPairsForStory($productID, ($branch === 'all' or !in_array($branch, array_keys($branches))) ? 0 : $branch, 'skipParent|unexpired|noclosed'); + $plans = $this->loadModel('productplan')->getPairsForStory($productID, ($branch === 'all' or empty($branch)) ? '' : $branch, 'skipParent|unexpired|noclosed'); $plans['ditto'] = $this->lang->story->ditto; $priList = (array)$this->lang->story->priList; From 8472e0a1914966474412aaeb2d6b45f4ee076824 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 8 Dec 2022 10:34:46 +0800 Subject: [PATCH 265/267] * Finish task#78699. --- module/productplan/css/browse.css | 5 +++-- module/productplan/lang/de.php | 1 - module/productplan/lang/en.php | 1 - module/productplan/lang/fr.php | 1 - module/productplan/lang/zh-cn.php | 3 +-- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/module/productplan/css/browse.css b/module/productplan/css/browse.css index 8a0fe5b64d..ae54b036db 100644 --- a/module/productplan/css/browse.css +++ b/module/productplan/css/browse.css @@ -17,11 +17,12 @@ td.c-branch {overflow: hidden; text-align: left !important; white-space: nowrap; @-moz-document url-prefix() {.main-table tbody > tr.table-children > td:first-child::before {width: 4px;};} .c-title {width: 160px;} -.c-branch {width: 100px;} +.c-branch {width: 130px;} .c-story, .c-status {width: 80px;} .c-execution {width: 60px !important;} .c-bug, .c-hour {width: 60px;} -.c-desc {width: 160px;} +.c-desc {width: 140px;} +.c-date {width: 90px;} .plan-name {position: relative; display: flex; align-items: center;} .plan-name > span {flex: none;} diff --git a/module/productplan/lang/de.php b/module/productplan/lang/de.php index ac56c0aeec..e418f42088 100644 --- a/module/productplan/lang/de.php +++ b/module/productplan/lang/de.php @@ -100,7 +100,6 @@ $lang->productplan->childrenAB = "C"; $lang->productplan->order = "Rank"; $lang->productplan->deleted = "Deleted"; $lang->productplan->mailto = "Mailto"; -$lang->productplan->status = 'Status'; $lang->productplan->planStatus = "Status"; $lang->productplan->statusList['wait'] = 'Wait'; diff --git a/module/productplan/lang/en.php b/module/productplan/lang/en.php index 49a6bf5bd1..86a0808f04 100644 --- a/module/productplan/lang/en.php +++ b/module/productplan/lang/en.php @@ -100,7 +100,6 @@ $lang->productplan->childrenAB = "C"; $lang->productplan->order = "Order"; $lang->productplan->deleted = "Deleted"; $lang->productplan->mailto = "Mailto"; -$lang->productplan->status = "Plan Status"; $lang->productplan->planStatus = "Status"; $lang->productplan->statusList['wait'] = 'Wait'; diff --git a/module/productplan/lang/fr.php b/module/productplan/lang/fr.php index 5fd88247f3..ad1e414469 100644 --- a/module/productplan/lang/fr.php +++ b/module/productplan/lang/fr.php @@ -100,7 +100,6 @@ $lang->productplan->childrenAB = "C"; $lang->productplan->order = "Order"; $lang->productplan->deleted = "Deleted"; $lang->productplan->mailto = "Mailto"; -$lang->productplan->status = 'Status'; $lang->productplan->planStatus = "Status"; $lang->productplan->statusList['wait'] = 'Wait'; diff --git a/module/productplan/lang/zh-cn.php b/module/productplan/lang/zh-cn.php index f756060d8e..aee350b57a 100644 --- a/module/productplan/lang/zh-cn.php +++ b/module/productplan/lang/zh-cn.php @@ -86,7 +86,7 @@ $lang->productplan->title = '名称'; $lang->productplan->desc = '描述'; $lang->productplan->begin = '开始日期'; $lang->productplan->end = '结束日期'; -$lang->productplan->status = '计划状态'; +$lang->productplan->status = '状态'; $lang->productplan->last = "上次计划"; $lang->productplan->future = '待定'; $lang->productplan->stories = "{$lang->SRCommon}数"; @@ -100,7 +100,6 @@ $lang->productplan->childrenAB = "子"; $lang->productplan->order = "排序"; $lang->productplan->deleted = "已删除"; $lang->productplan->mailto = "抄送给"; -$lang->productplan->status = "计划状态"; $lang->productplan->planStatus = "状态"; $lang->productplan->statusList['wait'] = '未开始'; From 847bb6be13be6798e3d842510a3fe87619db61b3 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 8 Dec 2022 10:46:58 +0800 Subject: [PATCH 266/267] * Finish task#78698. --- module/productplan/view/view.html.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index 47cf7f6a8a..4c91630e9c 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -31,9 +31,6 @@
    id;?> title;?> - - type !== 'normal') echo "" . $branchOption[$branchID] . '';?> - begin == $config->productplan->future || $plan->end == $config->productplan->future) ? $lang->productplan->future : $plan->begin . '~' . $plan->end;?> From b7dfd47433959012ca0abde1884a87b754fb919b Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 8 Dec 2022 11:04:55 +0800 Subject: [PATCH 267/267] * fix bug. --- lib/pager/pager.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/pager/pager.class.php b/lib/pager/pager.class.php index 0d0b016fa9..a3cfd2f4ba 100644 --- a/lib/pager/pager.class.php +++ b/lib/pager/pager.class.php @@ -130,7 +130,11 @@ class pager extends basePager } } - echo "
      "; + global $app, $lang; + $appendApp = ''; + $moduleName = $this->moduleName; + if(isset($lang->navGroup->{$moduleName}) and $lang->navGroup->{$moduleName} != $app->tab) $appendApp = "#app={$app->tab}"; + echo "
        "; } } else