From 9cfd8f0f8e395ec166f0f215e92330669f318503 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Mon, 31 Oct 2022 16:29:21 +0800 Subject: [PATCH 1/7] * 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 2/7] * 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 67737d25c2b41c5733dbe9a427e757d455f0d749 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Tue, 1 Nov 2022 09:58:04 +0800 Subject: [PATCH 3/7] * task #74142 --- module/product/control.php | 2 +- module/story/css/create.css | 4 ++- module/story/js/create.js | 16 +++++----- module/story/lang/de.php | 4 +++ module/story/lang/en.php | 4 +++ module/story/lang/fr.php | 4 +++ module/story/lang/zh-cn.php | 4 +++ module/story/view/create.html.php | 27 ++++++++++------ module/story/view/header.html.php | 52 +++++++++++++++++++++++++++++++ module/tree/control.php | 2 +- 10 files changed, 98 insertions(+), 21 deletions(-) diff --git a/module/product/control.php b/module/product/control.php index e9261dddfc..632894c186 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -1063,7 +1063,7 @@ class product extends control { $param = strtolower($param); $plans = $this->loadModel('productplan')->getPairs($productID, $branch, $expired, strpos($param, 'skipparent') !== false); - $field = $fieldID ? "plans[$fieldID]" : 'plan'; + $field = $fieldID !== '' ? "plans[$fieldID]" : 'plan'; $multiple = strpos($param, 'multiple') === false ? '' : 'multiple'; $output = html::select($field, $plans, $planID, "class='form-control chosen' $multiple"); diff --git a/module/story/css/create.css b/module/story/css/create.css index 409b9492ec..ad21e95319 100644 --- a/module/story/css/create.css +++ b/module/story/css/create.css @@ -17,4 +17,6 @@ #sourceNoteBox {width: 80px;} #moduleIdBox .input-group-addon {min-width: 77px;} -.btn.btn-action, .c-actions .btn {color: grey} \ No newline at end of file +.btn.btn-action, .c-actions .btn {color: grey} +#storyNoticeBranch {font-size: 13px; color: #5e626d;} +#storyNoticeBranch i {font-size: 14px; color: #0075ff; margin-right: 3px;} \ No newline at end of file diff --git a/module/story/js/create.js b/module/story/js/create.js index a5b95f195e..f80710337e 100644 --- a/module/story/js/create.js +++ b/module/story/js/create.js @@ -119,15 +119,15 @@ $(window).unload(function(){ function addBranchesBox(obj) { var item = $('#addBranchesBox').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(); + $(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