This commit is contained in:
lanzongjun
2022-11-01 09:58:04 +08:00
parent 22f0fce8d0
commit 67737d25c2
10 changed files with 98 additions and 21 deletions
+1 -1
View File
@@ -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");
+3 -1
View File
@@ -17,4 +17,6 @@
#sourceNoteBox {width: 80px;}
#moduleIdBox .input-group-addon {min-width: 77px;}
.btn.btn-action, .c-actions .btn {color: grey}
.btn.btn-action, .c-actions .btn {color: grey}
#storyNoticeBranch {font-size: 13px; color: #5e626d;}
#storyNoticeBranch i {font-size: 14px; color: #0075ff; margin-right: 3px;}
+8 -8
View File
@@ -119,15 +119,15 @@ $(window).unload(function(){
function addBranchesBox(obj)
{
var item = $('#addBranchesBox').html().replace(/%i%/g, itemIndex);
$(obj).closest('tr').after('<tr class="addedItem">' + item + '</tr>');
$('#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('<tr class="addBranchesBox' + itemIndex + '">' + item + '</tr>');
$('#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')
}
/**
+4
View File
@@ -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';
+4
View File
@@ -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';
+4
View File
@@ -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';
+4
View File
@@ -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 = '每个分支会建立一个需求,需求间互为孪生关系,孪生需求间除产品、分支、模块、计划、阶段字段外均同步,后期您可以手动解除孪生关系';
+17 -10
View File
@@ -92,16 +92,16 @@ foreach(explode(',', $config->story->create->requiredFields) as $field)
<div class='table-col' id='branchBox'>
<div class='input-group'>
<span class='input-group-addon fix-border'><?php echo sprintf($lang->product->branch, $lang->product->branchName[$product->type])?></span>
<?php echo html::select('branches[0]', $branches, $branch, "onchange='loadBranch2(this.value, 0);' class='form-control chosen control-branch'");?>
<?php echo html::select('branches[0]', $branches, $branch, "onchange='loadBranchForBranch(this.value, 0);' class='form-control chosen control-branch'");?>
</div>
</div>
<div class='table-col' id='moduleBox'>
<div class='table-col' id='moduleIdBox'>
<div class='input-group'>
<span class='input-group-addon fix-border'><?php echo $lang->story->module?></span>
<?php echo html::select('modules[0]', $moduleOptionMenu, $moduleID, "class='form-control chosen'");?>
</div>
</div>
<div class='table-col' id='planBox'>
<div class='table-col' id='planIdBox'>
<div class='input-group'>
<span class='input-group-addon fix-border'><?php echo $lang->story->plan;?></span>
<?php echo html::select('plans[0]', $plans, $planID, "class='form-control chosen'");?>
@@ -111,10 +111,16 @@ foreach(explode(',', $config->story->create->requiredFields) as $field)
</td>
<td class="table-col c-actions text-left w-60px">
<div>
<a href='javascript:;' onclick='addBranchesBox(this)' class='btn btn-link' title='xxxx'><i class='icon-plus'></i></a>
<a href='javascript:;' onclick='addBranchesBox(this)' class='btn btn-link' title='<?php echo $lang->story->addBranch;?>'><i class='icon-plus'></i></a>
</div>
</td>
</tr>
<tr>
<th></th>
<td colspan="4" id="storyNoticeBranch">
<i class="icon-exclamation-sign"></i>&nbsp;<?php echo $lang->story->notice->branch;?>
</td>
</tr>
<?php else: ?>
<tr>
<th class='planTh'><?php echo $lang->story->planAB;?></th>
@@ -353,16 +359,16 @@ foreach(explode(',', $config->story->create->requiredFields) as $field)
<div class='table-col' id='branchBox' style='flex: 1 0 160px'>
<div class='input-group'>
<span class='input-group-addon fix-border'><?php echo sprintf($lang->product->branch, $lang->product->branchName[$product->type])?></span>
<?php echo html::select("branches[$i]", $branches, $branch, "onchange='loadBranches();' class='form-control chosen control-branch'");?>
<?php echo html::select("branches[$i]", $branches, $branch, "onchange='loadBranchForBranch(this.value, $i);' class='form-control chosen control-branch'");?>
</div>
</div>
<div class='table-col' id='moduleBox' style='flex: 1 0 160px'>
<div class='table-col' id='moduleIdBox' style='flex: 1 0 160px'>
<div class='input-group'>
<span class='input-group-addon fix-border'><?php echo $lang->story->module?></span>
<?php echo html::select("modules[$i]", $moduleOptionMenu, $moduleID, "class='form-control chosen'");?>
</div>
</div>
<div class='table-col' id='planBox'>
<div class='table-col' id='planIdBox'>
<div class='input-group'>
<span class='input-group-addon fix-border'><?php echo $lang->story->plan;?></span>
<?php echo html::select("plans[$i]", $plans, $planID, "class='form-control chosen'");?>
@@ -372,20 +378,21 @@ foreach(explode(',', $config->story->create->requiredFields) as $field)
</td>
<td class="table-col text-left w-60px c-actions">
<div>
<a href='javascript:;' onclick='addBranchesBox(this)' class='btn btn-link' title='xxxx'><i class='icon-plus'></i></a>
<a href='javascript:;' onclick='deleteBranchesBox(this)' class='btn btn-link' title=''><i class='icon icon-close'></i></a>
<a href='javascript:;' onclick='addBranchesBox(this)' class='btn btn-link' title='<?php echo $lang->story->addBranch;?>'><i class='icon-plus'></i></a>
<a href='javascript:;' onclick='deleteBranchesBox(this)' class='btn btn-link' title='<?php echo $lang->story->deleteBranch;?>'><i class='icon icon-close'></i></a>
</div>
</td>
</tr>
</table>
<?php js::set('executionID', $objectID);?>
<?php js::set('storyModule', $lang->story->module);?>
<?php js::set('storyPlan', $lang->story->plan);?>
<?php js::set('storyType', $type);?>
<script>
$(function(){parent.$('body.hide-modal-close').removeClass('hide-modal-close');})
var gap = $('#assignedTo').parent().parent().width();
$('#planBox').css('flex', '0 0 ' + gap + 'px')
$('#planIdBox').css('flex', '0 0 ' + gap + 'px')
$("#branches0").parent().parent().css('flex', '1 0 160px')
$("#modules0").parent().parent().css('flex', '1 0 160px')
+52
View File
@@ -68,6 +68,58 @@ function loadBranch()
loadProductPlans(productID, branch);
}
/**
* Load branch for multi branch or multi platform.
*
* @access public
* @return void
*/
function loadBranchForBranch(branch, branchIndex)
{
var branch = $('#branches' + branchIndex).val();
var productID = $('#product').val();
if(typeof(branch) == 'undefined') branch = 0;
if(typeof(productID) == 'undefined' && config.currentMethod == 'edit') productID = oldProductID;
/* 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=&currentModuleID=' + currentModule);
if(branchIndex > 0)
{
var $moduleIDBox = $('.addBranchesBox'+ branchIndex +' #moduleIdBox');
}
else
{
var $moduleIDBox = $('#moduleIdBox');
}
$moduleIDBox.load(moduleLink, function()
{
$moduleIDBox.find('#modules' + branchIndex).chosen();
$moduleIDBox.prepend("<span class='input-group-addon fix-border'>" + storyModule + "</span>");
$moduleIDBox.fixInputGroup();
});
/* Load plan */
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 +'&param=skipParent,' + config.currentMethod);
if(branchIndex > 0)
{
var $planIdBox = $('.addBranchesBox'+ branchIndex +' #planIdBox');
}
else
{
var $planIdBox = $('#planIdBox');
}
$planIdBox.load(planLink, function()
{
$planIdBox.find('#plans' + branchIndex).chosen();
$planIdBox.prepend("<span class='input-group-addon fix-border'>" + storyPlan + "</span>");
$planIdBox.fixInputGroup();
});
}
/**
* Load branches when change product.
*
+1 -1
View File
@@ -538,7 +538,7 @@ class tree extends control
$changeFunc = '';
if($viewType == 'bug' or $viewType == 'case') $changeFunc = "onchange='loadModuleRelated()'";
if($viewType == 'task') $changeFunc = "onchange='setStories(this.value, $rootID)'";
$field = $fieldID ? "modules[$fieldID]" : 'module';
$field = $fieldID !== '' ? "modules[$fieldID]" : 'module';
$currentModule = $this->tree->getById($currentModuleID);
$currentModuleID = (isset($currentModule->branch) and $currentModule->branch == 0) ? $currentModuleID : 0;