* code for task#1592.
This commit is contained in:
@@ -785,10 +785,11 @@ class story extends control
|
||||
* @param int $productID
|
||||
* @param int $moduleID
|
||||
* @param int $storyID
|
||||
* @param string $onlyOption
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxGetProductStories($productID, $moduleID = 0, $storyID = 0)
|
||||
public function ajaxGetProductStories($productID, $moduleID = 0, $storyID = 0, $onlyOption = 'false')
|
||||
{
|
||||
if($moduleID)
|
||||
{
|
||||
@@ -796,7 +797,11 @@ class story extends control
|
||||
$moduleID = $this->tree->getAllChildID($moduleID);
|
||||
}
|
||||
$stories = $this->story->getProductStoryPairs($productID, $moduleID);
|
||||
die(html::select('story', $stories, $storyID, "class=''"));
|
||||
$select = html::select('story' . $index, $stories, $storyID, "class=''");
|
||||
|
||||
/* If only need options, remove select wrap. */
|
||||
if($onlyOption == 'true') die(substr($select, strpos($select, '>') + 1, -10));
|
||||
die($select);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -69,6 +69,7 @@ function setAfter()
|
||||
}
|
||||
}
|
||||
|
||||
/* Get select of stories.*/
|
||||
function setStories(moduleID, projectID, productID)
|
||||
{
|
||||
link = createLink('story', 'ajaxGetProjectStories', 'projectID=' + projectID + '&productID=' + productID + '&moduleID=' + moduleID);
|
||||
|
||||
@@ -1,4 +1,27 @@
|
||||
$(document).ready(function()
|
||||
{
|
||||
for(i = 0; i < testcaseBatchCreateNum; i++) $("#story" + i).chosen({no_results_text: noResultsMatch});
|
||||
for(var i = 0; i < testcaseBatchCreateNum; i++)
|
||||
{
|
||||
$("#story" + i).chosen({no_results_text: noResultsMatch}).bind('liszt:showing_dropdown', function()
|
||||
{
|
||||
index = $(this).attr('id').substring(5);
|
||||
module = $('#module' + index).val();
|
||||
if(module == 'same')
|
||||
{
|
||||
for(var i = index - 1; i >=0; i--)
|
||||
{
|
||||
if($('#module' + i).val() != 'same')
|
||||
{
|
||||
module = $('#module' + i).val();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&moduleID=' + module + '&storyID=0&onlyOption=true');
|
||||
$(this).load(link, function()
|
||||
{
|
||||
$('#story' + index).trigger("liszt:updated");
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/chosen.html.php';?>
|
||||
<?php js::set('testcaseBatchCreateNum', $config->testcase->batchCreate);?>
|
||||
<?php js::set('productID', $productID);?>
|
||||
<form method='post' enctype='multipart/form-data' target='hiddenwin'>
|
||||
<table align='center' class='table-1 fixed'>
|
||||
<caption><?php echo $lang->testcase->batchCreate;?></caption>
|
||||
@@ -32,7 +33,7 @@
|
||||
<td><?php echo $i+1;?></td>
|
||||
<td><?php echo html::select("module[$i]", $moduleOptionMenu, $currentModuleID, "class=select-1");?></td>
|
||||
<td><?php echo html::select("type[$i]", $lang->testcase->typeList, $type, "class=select-1");?></td>
|
||||
<td class='a-left'style='overflow:visible'><?php echo html::select("story[$i]", $stories, $story, 'class=select-1');?></td>
|
||||
<td class='a-left'style='overflow:visible'><?php echo html::select("story[$i]", '', $story, 'class="select-1 storySelect"');?></td>
|
||||
<td><?php echo html::input("title[$i]", '', "class='text-1'");?></td>
|
||||
</tr>
|
||||
<?php endfor;?>
|
||||
|
||||
Reference in New Issue
Block a user