* Finish task #44496.
This commit is contained in:
@@ -31,13 +31,39 @@ function loadBranches(product, branch, caseID)
|
||||
if(!branch) branch = 0;
|
||||
|
||||
moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + product + '&viewtype=case&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=' + caseID + '&needManage=true');
|
||||
$('#modules' + caseID).parent('td').load(moduleLink, function(){$('#modules' + caseID).chosen();})
|
||||
$('#modules' + caseID).parent('td').load(moduleLink, function()
|
||||
{
|
||||
$("#modules" + caseID).attr('onchange', "loadStories("+ product + ", this.value, " + caseID + ")").chosen();
|
||||
});
|
||||
|
||||
loadStories(product, 0, caseID);
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
removeDitto(); //Remove 'ditto' in first row.
|
||||
$('#subNavbar li[data-id="testcase"]').addClass('active');
|
||||
if($("[name^='story']").length > 0)
|
||||
{
|
||||
$("[name^='story']").each(function()
|
||||
{
|
||||
var id = $(this).attr('id');
|
||||
var num = id.substring(5);
|
||||
var moduleID = $('#modules' + num).val();
|
||||
var branchID = $('#branches' + num).val();
|
||||
var storyID = $("#story" + num).val();
|
||||
var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&executionID=0&number=' + num);
|
||||
$.get(storyLink, function(stories)
|
||||
{
|
||||
if(!stories) modules = '<select id="story' + num + '" name="story[' + num + ']" class="form-control"></select>';
|
||||
$('#story' + num).replaceWith(stories);
|
||||
$('#story' + num + "_chosen").remove();
|
||||
$('#story' + num).next('.picker').remove();
|
||||
$('#story' + num).attr('name', 'story[' + num + ']').chosen();
|
||||
$('#story' + num).val(storyID).trigger('chosen:updated');
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.chosen-with-drop', function(){oldValue = $(this).prev('select').val();})//Save old value.
|
||||
|
||||
@@ -355,14 +355,16 @@ function updateStepID()
|
||||
*/
|
||||
function loadStories(productID, moduleID, num)
|
||||
{
|
||||
var branchID = $('#branch' + num).val();
|
||||
var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&executionID=0&number=' + num);
|
||||
var branchIDName = config.currentMethod == 'batchcreate' ? '#branch' : '#branches';
|
||||
var branchID = $(branchIDName + num).val();
|
||||
var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&executionID=0&number=' + num);
|
||||
$.get(storyLink, function(stories)
|
||||
{
|
||||
if(!stories) modules = '<select id="story' + num + '" name="story[' + num + ']" class="form-control"></select>';
|
||||
$('#story' + num).replaceWith(stories);
|
||||
$("#story" + num + "_chosen").remove();
|
||||
$("#story" + num).next('.picker').remove();
|
||||
$("#story" + num).chosen();
|
||||
$('#story' + num + "_chosen").remove();
|
||||
$('#story' + num).next('.picker').remove();
|
||||
$('#story' + num).attr('name', 'story[' + num + ']');
|
||||
$('#story' + num).chosen();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -863,13 +863,13 @@ class testcaseModel extends model
|
||||
if($data->pris[$caseID] == 'ditto') $data->pris[$caseID] = isset($prev['pri']) ? $prev['pri'] : 3;
|
||||
if($data->branches[$caseID] == 'ditto') $data->branches[$caseID] = isset($prev['branch']) ? $prev['branch'] : 0;
|
||||
if($data->modules[$caseID] == 'ditto') $data->modules[$caseID] = isset($prev['module']) ? $prev['module'] : 0;
|
||||
if($data->stories[$caseID] == 'ditto') $data->stories[$caseID] = isset($prev['story']) ? $prev['story'] : 0;
|
||||
if($data->story[$caseID] == 'ditto') $data->story[$caseID] = isset($prev['story']) ? $prev['story'] : 0;
|
||||
if($data->types[$caseID] == 'ditto') $data->types[$caseID] = isset($prev['type']) ? $prev['type'] : '';
|
||||
if($data->stories[$caseID] == '') $data->stories[$caseID] = 0;
|
||||
if($data->story[$caseID] == '') $data->story[$caseID] = 0;
|
||||
|
||||
$prev['pri'] = $data->pris[$caseID];
|
||||
$prev['type'] = $data->types[$caseID];
|
||||
$prev['story'] = $data->stories[$caseID];
|
||||
$prev['story'] = $data->story[$caseID];
|
||||
$prev['branch'] = $data->branches[$caseID];
|
||||
$prev['module'] = $data->modules[$caseID];
|
||||
}
|
||||
@@ -885,7 +885,7 @@ class testcaseModel extends model
|
||||
$case->branch = $data->branches[$caseID];
|
||||
$case->module = $data->modules[$caseID];
|
||||
$case->status = $data->statuses[$caseID];
|
||||
$case->story = $data->stories[$caseID];
|
||||
$case->story = $data->story[$caseID];
|
||||
$case->color = $data->color[$caseID];
|
||||
$case->title = $data->title[$caseID];
|
||||
$case->precondition = $data->precondition[$caseID];
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php js::set('dittoNotice', $this->lang->testcase->dittoNotice);?>
|
||||
<?php js::set('productID', $productID);?>
|
||||
<div id="mainContent" class="main-content">
|
||||
<div class="main-header">
|
||||
<h2><?php echo $lang->testcase->common . $lang->colon . $lang->testcase->batchEdit;?></h2>
|
||||
@@ -103,8 +104,8 @@
|
||||
<?php echo html::select("branches[$caseID]", $branches, $cases[$caseID]->branch, "class='form-control chosen' onchange='loadBranches($branchProductID, this.value, $caseID)', $disabled");?>
|
||||
</td>
|
||||
<?php endif;?>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'><?php echo html::select("modules[$caseID]", $modules[$caseBranch], $cases[$caseID]->module, "class='form-control chosen'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'story', ' hidden')?>' style='overflow:visible'><?php echo html::select("stories[$caseID]", $stories, $cases[$caseID]->story, "class='form-control chosen'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'><?php echo html::select("modules[$caseID]", $modules[$caseBranch], $cases[$caseID]->module, "class='form-control chosen' onchange='loadStories($productID, this.value, $caseID)'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'story', ' hidden')?>' style='overflow:visible'><?php echo html::select("story[$caseID]", $stories, $cases[$caseID]->story, "class='form-control chosen'");?></td>
|
||||
<td style='overflow:visible' title='<?php echo $cases[$caseID]->title?>'>
|
||||
<div class='input-group'>
|
||||
<div class="input-control has-icon-right">
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<?php js::set('lblBefore', $lang->testcase->insertBefore);?>
|
||||
<?php js::set('lblAfter', $lang->testcase->insertAfter);?>
|
||||
<?php js::set('caseID', $case->id);?>
|
||||
<?php js::set('executionID', $case->execution);?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='main-header'>
|
||||
<h2>
|
||||
|
||||
Reference in New Issue
Block a user