From 91497edc0fea2fe75fa8c5186739817409e8487d Mon Sep 17 00:00:00 2001 From: wyd621 Date: Thu, 27 Mar 2014 06:59:24 +0000 Subject: [PATCH] * fix a bug for showImport. --- module/testcase/control.php | 28 ++++++++++----------- module/testcase/view/exporttemplet.html.php | 4 +-- module/testcase/view/import.html.php | 4 +-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index 96a26a2599..f288dc3ea3 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -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)) { diff --git a/module/testcase/view/exporttemplet.html.php b/module/testcase/view/exporttemplet.html.php index b9b12109a1..61a37f92a7 100644 --- a/module/testcase/view/exporttemplet.html.php +++ b/module/testcase/view/exporttemplet.html.php @@ -23,7 +23,7 @@ function closeWindow() - - +
testcase->exportTemplet?>
+ testcase->num; echo html::input('num', '10'); @@ -31,7 +31,7 @@ function closeWindow() echo html::submitButton(); ?>
diff --git a/module/testcase/view/import.html.php b/module/testcase/view/import.html.php index 87d61214bd..b8624ba30b 100755 --- a/module/testcase/view/import.html.php +++ b/module/testcase/view/import.html.php @@ -3,12 +3,12 @@ - - +
testcase->import?>
+ charsets[$this->cookie->lang], 'utf-8');?>