* fix a bug for showImport.

This commit is contained in:
wyd621
2014-03-27 06:59:24 +00:00
parent dd0f637ee3
commit 91497edc0f
3 changed files with 18 additions and 18 deletions
+14 -14
View File
@@ -838,27 +838,27 @@ class testcase extends control
if($field == 'story')
{
if($cellValue == 0)
if(strrpos($cellValue, '(#') !== false)
{
$case->$field = 0;
}
elseif(preg_match('/^#\d+$/', $cellValue))
{
$case->$field = substr($cellValue, 1);
}
$id = trim(substr($cellValue, strrpos($cellValue,'(#') + 2), ')');
$case->$field = $id;
}
else
{
$selectedID = 0;
foreach($stories as $id => $story)
{
if(strpos($story, $cellValue) !== false) $selectedID = $id;
}
$case->$field = $selectedID;
$case->$field = 0;
}
}
elseif($field == 'module')
{
$case->$field = array_search($cellValue, $modules);
if(strrpos($cellValue, '(#') !== false)
{
$id = trim(substr($cellValue, strrpos($cellValue,'(#') + 2), ')');
$case->$field = $id;
}
else
{
$case->$field = 0;
}
}
elseif(in_array($field, $caseConfig->export->listFields))
{
+2 -2
View File
@@ -23,7 +23,7 @@ function closeWindow()
<table class='table-1 mt-10px'>
<caption><?php echo $lang->testcase->exportTemplet?></caption>
<tr>
<td align='center'>
<td align='center' style="padding:30px">
<?php
echo $lang->testcase->num;
echo html::input('num', '10');
@@ -31,7 +31,7 @@ function closeWindow()
echo html::submitButton();
?>
</td>
<tr>
</tr>
</table>
</form>
<?php include '../../common/view/footer.lite.html.php';?>
+2 -2
View File
@@ -3,12 +3,12 @@
<table class='table-1 mt-10px'>
<caption><?php echo $lang->testcase->import?></caption>
<tr>
<td align='center'>
<td align='center' style="padding:30px">
<input type='file' name='file'/>
<?php echo html::select('encode', $config->charsets[$this->cookie->lang], 'utf-8');?>
<?php echo html::submitButton();?>
</td>
<tr>
</tr>
</table>
</form>
<?php include '../../common/view/footer.lite.html.php';?>