diff --git a/config/filter.php b/config/filter.php
index ad76a9f679..0ff898303e 100755
--- a/config/filter.php
+++ b/config/filter.php
@@ -360,7 +360,7 @@ $filter->testtask->default->cookie['preProductID'] = 'int';
$filter->testcase->browse->cookie['onlyScene'] = 'code';
if(empty($filter->project->testcase)) $filter->project->testcase = new stdclass();
-$filter->project->testcase->cookie= array('onlyScene' => 'code');
+$filter->project->testcase->cookie = array('onlyScene' => 'code');
$filter->todo->export->cookie['checkedItem'] = 'reg::checked';
diff --git a/db/update18.3.sql b/db/update18.3.sql
index c7e72600f1..5d85834e83 100644
--- a/db/update18.3.sql
+++ b/db/update18.3.sql
@@ -169,7 +169,6 @@ UNION
2 AS `isCase`
FROM `zt_scene`;
-UPDATE `zt_screen` SET `name` = '燃尽图大屏' WHERE `id` = '5';
CREATE TABLE `zt_chart_back` SELECT * FROM `zt_chart`;
ALTER TABLE `zt_chart` MODIFY `fields` mediumtext NULL;
diff --git a/lib/xmind/xmind.class.php b/lib/xmind/xmind.class.php
new file mode 100644
index 0000000000..a89ad6a888
--- /dev/null
+++ b/lib/xmind/xmind.class.php
@@ -0,0 +1,213 @@
+
+ * @package Xmind
+ * @version $Id$
+ * @link http://www.zentao.net
+ */
+class xmind{
+ function createModuleNode($xmlDoc, $context, $productNode, &$moduleNodes)
+ {
+ $config = $context['config'];
+ $moduleList = $context['moduleList'];
+
+ foreach($moduleList as $key => $name)
+ {
+ $suffix = $config['module'].':'.$key;
+ $moduleNode = $this->createNode($xmlDoc, $name, $suffix, array('nodeType' => 'module'));
+ $productNode->appendChild($moduleNode);
+
+ $moduleNodes[$key] = $moduleNode;
+ }
+ }
+
+ function createSceneNode($xmlDoc, $context, $productNode, &$moduleNodes, &$sceneNodes)
+ {
+ $sceneMaps = $context['sceneMaps'];
+ $config = $context['config'];
+
+ $topScenes = $context['topScenes'];
+
+ foreach($topScenes as $scene)
+ {
+ $suffix = $config['scene'].':'.$scene->sceneID;
+ $sceneNode = $this->createNode($xmlDoc, $scene->sceneName, $suffix, array('nodeType' => 'scene'));
+
+ $this->createNextChildScenesNode($scene, $sceneNode, $xmlDoc, $context, $moduleNodes, $sceneNodes);
+
+ if(isset($moduleNodes[$scene->moduleID]))
+ {
+ $moduleNode = $moduleNodes[$scene->moduleID];
+ $moduleNode->appendChild($sceneNode);
+ }
+ else
+ {
+ $productNode->appendChild($sceneNode);
+ }
+
+ $sceneNodes[$scene->sceneID] = $sceneNode;
+ }
+ }
+
+ function createNextChildScenesNode($parentScene,$parentNode, $xmlDoc, $context, &$moduleNodes, &$sceneNodes)
+ {
+ $sceneMaps = $context['sceneMaps'];
+ $config = $context['config'];
+
+ foreach($sceneMaps as $key => $scene)
+ {
+ if($scene->parentID != $parentScene->sceneID + CHANGEVALUE) continue;
+
+ $suffix = $config['scene'].':'.$scene->sceneID;
+ $sceneNode = $this->createNode($xmlDoc, $scene->sceneName, $suffix, array('nodeType'=>'scene'));
+
+ $this->createNextChildScenesNode($scene, $sceneNode, $xmlDoc, $context, $moduleNodes, $sceneNodes);
+
+ $parentNode->appendChild($sceneNode);
+ $sceneNodes[$scene->sceneID] = $sceneNode;
+ }
+ }
+
+ function createTestcaseNode($xmlDoc, $context, $productNode, &$moduleNodes, &$sceneNodes)
+ {
+ $caseList = $context['caseList'];
+
+ foreach($caseList as $case)
+ {
+ if(empty($case->testcaseID)) continue;
+
+ $parentNode = $sceneNodes[$case->sceneID];
+ if(!isset($parentNode)) $parentNode = $moduleNodes[$case->moduleID];
+ if(!isset($parentNode)) $parentNode = $productNode;
+
+ $this->createTestcaseNodeImpl($case, $xmlDoc, $context, $parentNode);
+ }
+ }
+
+ function createTestcaseNodeImpl($case, $xmlDoc, $context, $parentNode)
+ {
+ $caseList = $context['caseList'];
+ $stepList = $context['stepList'];
+ $config = $context['config'];
+ $suffix = $config['case'].':'.$case->testcaseID.','.$config['pri'].':'.$case->pri;
+ $caseNode = $this->createNode($xmlDoc, $case->name, $suffix, array('nodeType'=>'testcase'));
+
+ $parentNode->appendChild($caseNode);
+
+ $topStepList = $this->findTopStepListByCase($case, $stepList);
+
+ foreach($topStepList as $step)
+ {
+ $subStepList = $this->findSubStepListByStep($step,$stepList);
+
+ $suffix = count($subStepList) > 0 ? $config['group'] : '';
+ $stepNode = $this->createNode($xmlDoc, $step->desc, $suffix, array('nodeType' => 'step'));
+ $caseNode->appendChild($stepNode);
+
+ if(count($subStepList))
+ {
+ foreach($subStepList as $sub)
+ {
+ $subNode = $this->createNode($xmlDoc, $sub->desc, '', array('nodeType'=>'substep'));
+ $stepNode->appendChild($subNode);
+
+ if(!empty($sub->expect))
+ {
+ $expectNode = $this->createNode($xmlDoc, $sub->expect, '', array('nodeType'=>'expect'));
+ $subNode->appendChild($expectNode);
+ }
+ }
+ }
+
+ if(count($subStepList) == 0 && !empty($step->expect))
+ {
+ $expectNode = $this->createNode($xmlDoc, $step->expect, '', array('nodeType'=>'expect'));
+ $stepNode->appendChild($expectNode);
+ }
+ }
+ }
+
+ function findSubStepListByStep($step,$stepList)
+ {
+ $subList = array();
+ foreach($stepList as $one)
+ {
+ if($one->parentID == $step->stepID)
+ {
+ $subList[] = $one;
+ }
+ }
+
+ return $subList;
+ }
+
+ public function findTopStepListByCase($case,$stepList)
+ {
+ $topList = array();
+ foreach($stepList as $step)
+ {
+ if($step->parentID == '0' && $step->testcaseID == $case->testcaseID)
+ {
+ $topList[] = $step;
+ }
+ }
+
+ return $topList;
+ }
+
+ public function createNode($xmlDoc, $text, $suffix = '', $attrs=array())
+ {
+ $node = $xmlDoc->createElement('node');
+
+ $textAttr = $xmlDoc->createAttribute('TEXT');
+ $textAttrValue = $xmlDoc->createTextNode($this->toText($text,$suffix));
+
+ $textAttr->appendChild($textAttrValue);
+ $node->appendChild($textAttr);
+
+ $positionAttr = $xmlDoc->createAttribute("POSITION");
+ $positionAttrValue = $xmlDoc->createTextNode('right');
+
+ $positionAttr->appendChild($positionAttrValue);
+ $node->appendChild($positionAttr);
+
+ foreach($attrs as $key => $value)
+ {
+ $attr = $xmlDoc->createAttribute($key);
+ $attrValue = $xmlDoc->createTextNode($value);
+
+ $attr->appendChild($attrValue);
+ $node->appendChild($attr);
+ }
+
+ return $node;
+ }
+
+ public function toText($str, $suffix)
+ {
+ if(empty($suffix)) return $str;
+ return $str . '['.$suffix.']';
+ }
+
+ function getBetween($kw1, $mark1, $mark2)
+ {
+ $kw = $kw1;
+ $kw = '123' . $kw . '123';
+ $st = strripos($kw, $mark1);
+ $ed = strripos($kw, $mark2);
+
+ if(($st == false || $ed == false) || $st >= $ed) return 0;
+
+ $kw = substr($kw, ($st + 1), ($ed - $st - 1));
+ return $kw;
+ }
+
+ function endsWith($haystack, $needle)
+ {
+ return $needle === '' || substr_compare($haystack, $needle, -strlen($needle)) === 0;
+ }
+}
\ No newline at end of file
diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php
index a0fc6d64f0..1065120926 100755
--- a/module/action/lang/zh-cn.php
+++ b/module/action/lang/zh-cn.php
@@ -810,7 +810,6 @@ $lang->action->search->objectTypeList['testsuite'] = '套件';
$lang->action->search->objectTypeList['caselib'] = '公共库';
$lang->action->search->objectTypeList['testreport'] = '报告';
-
/* 用来在动态显示中显示动作 */
$lang->action->search->label[''] = '';
$lang->action->search->label['created'] = $lang->action->label->created;
diff --git a/module/action/view/trash.html.php b/module/action/view/trash.html.php
index 909571d76e..48510b55e4 100755
--- a/module/action/view/trash.html.php
+++ b/module/action/view/trash.html.php
@@ -101,66 +101,57 @@
objectType == 'case' ? 'testcase' : $action->objectType;?>
| action->objectTypes, $action->objectType, '');?> |
+ objectID;?> |
objectType == 'scene'){ ?>
- objectID,1);
- //$showid = preg_replace('/^0+/', '', $showid);
+
+ objectName;?>
+ |
+
+
+ objectType == 'user' ? "account={$action->objectName}" : "id={$action->objectID}";
+ $methodName = 'view';
+ if($module == 'caselib')
+ {
+ $methodName = 'view';
+ $module = 'caselib';
+ }
+ if($module == 'basicmeas')
+ {
+ $module = 'measurement';
+ $methodName = 'setSQL';
+ $params = "id={$action->objectID}";
+ }
+ if($action->objectType == 'api')
+ {
+ $params = "libID=0&moduelID=0&apiID={$action->objectID}";
+ $methodName = 'index';
+ }
+ if(strpos('traincourse,traincontents', $module) !== false)
+ {
+ $methodName = $module == 'traincourse' ? 'viewcourse' : 'viewchapter';
+ $module = 'traincourse';
+ }
+ if(isset($config->action->customFlows[$action->objectType]))
+ {
+ $flow = $config->action->customFlows[$action->objectType];
+ $module = $flow->module;
+ }
+ if(strpos($this->config->action->noLinkModules, ",{$module},") !== false)
+ {
+ echo $action->objectName;
+ }
+ else
+ {
+ $tab = '';
+ $canView = common::hasPriv($module, $methodName);
+ if($action->objectType == 'meeting') $tab = $action->project ? "data-app='project'" : "data-app='my'";
+ if($module == 'requirement') $module = 'story';
+ echo $canView ? html::a($this->createLink($module, $methodName, $params), $action->objectName, '_self', "title='{$action->objectName}' $tab") : "$action->objectName";
+ }
?>
- | objectID;?> |
-
- objectID;?> |
-
-
- objectType == 'scene'){ ?>
-
- objectName;?>
- |
-
-
- objectType == 'user' ? "account={$action->objectName}" : "id={$action->objectID}";
- $methodName = 'view';
- if($module == 'caselib')
- {
- $methodName = 'view';
- $module = 'caselib';
- }
- if($module == 'basicmeas')
- {
- $module = 'measurement';
- $methodName = 'setSQL';
- $params = "id={$action->objectID}";
- }
- if($action->objectType == 'api')
- {
- $params = "libID=0&moduelID=0&apiID={$action->objectID}";
- $methodName = 'index';
- }
- if(strpos('traincourse,traincontents', $module) !== false)
- {
- $methodName = $module == 'traincourse' ? 'viewcourse' : 'viewchapter';
- $module = 'traincourse';
- }
- if(isset($config->action->customFlows[$action->objectType]))
- {
- $flow = $config->action->customFlows[$action->objectType];
- $module = $flow->module;
- }
- if(strpos($this->config->action->noLinkModules, ",{$module},") !== false)
- {
- echo $action->objectName;
- }
- else
- {
- $tab = '';
- $canView = common::hasPriv($module, $methodName);
- if($action->objectType == 'meeting') $tab = $action->project ? "data-app='project'" : "data-app='my'";
- if($module == 'requirement') $module = 'story';
- echo $canView ? html::a($this->createLink($module, $methodName, $params), $action->objectName, '_self', "title='{$action->objectName}' $tab") : "$action->objectName";
- }
- ?>
- |
-
+
+
project]->name;?>
diff --git a/module/common/view/mindmap.html.php b/module/common/view/mindmap.html.php
index 9df19feacd..f33807f168 100644
--- a/module/common/view/mindmap.html.php
+++ b/module/common/view/mindmap.html.php
@@ -1,4 +1,3 @@
-getExtViewFile(__FILE__)){include $extView; return helper::cd();}?>
config->datatable->moduleAlias, "$module-$method", $module);
if(!isset($this->config->$module)) $this->loadModel($module);
- $setting = "";
if(isset($this->config->datatable->$datatableId->$key))
{
if($datatableId == 'testcaseBrowse' && $key == 'tablecols' && $this->cookie->onlyScene)
diff --git a/module/testcase/config.php b/module/testcase/config.php
index 226489ecde..e0c751dd96 100644
--- a/module/testcase/config.php
+++ b/module/testcase/config.php
@@ -236,7 +236,6 @@ $config->testcase->datatable->fieldList['actions']['width'] = '180';
$config->testcase->datatable->fieldList['actions']['required'] = 'yes';
$config->testcase->datatable->fieldList['actions']['sort'] = 'no';
-
$config->testcase->search['module'] = 'testcase';
$config->testcase->search['fields']['scene'] = $lang->testcase->iScene;
$config->testcase->search['params']['scene'] = array('operator' => 'belong', 'control' => 'select', 'values' => '');
diff --git a/module/testcase/control.php b/module/testcase/control.php
index a6c469d5db..445ae73cba 100644
--- a/module/testcase/control.php
+++ b/module/testcase/control.php
@@ -147,6 +147,7 @@ class testcase extends control
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$sort = common::appendOrder($orderBy);
+ /* Get test cases. */
$cases = $this->testcase->getTestCases($productID, $branch, $browseType, $browseType == 'bysearch' ? $queryID : $suiteID, $moduleID, $caseType, $sort, null);
$caseIdList = array();
@@ -257,7 +258,6 @@ class testcase extends control
$this->view->moduleName = $moduleID ? $tree->name : $this->lang->tree->all;
$this->view->moduleID = $moduleID;
$this->view->projectType = !empty($projectID) ? $this->dao->select('model')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch('model') : '';
- // $this->view->summary = $this->testcase->summary($cases);
$this->view->summary = $summary;
$this->view->pager = $pager;
$this->view->users = $this->user->getPairs('noletter');
@@ -586,7 +586,7 @@ class testcase extends control
}
$currentModuleID = $moduleID ? (int)$moduleID : (int)$this->cookie->lastCaseModule;
- $currentSceneID = (int)$this->cookie->lastCaseScene;
+ $currentSceneID = (int)$this->cookie->lastCaseScene;
if($testcaseID > 0) $currentSceneID = $scene;
/* Get the status of stories are not closed. */
$modules = array();
@@ -2846,7 +2846,7 @@ class testcase extends control
{
$scene = $this->dao->select('*')->from(VIEW_SCENECASE)->where('id')->eq($sceneID)->andWhere('isCase')->eq(2)->fetch();
- if($confirm == 'no') return print(js::confirm(sprintf(addslashes($this->lang->testcase->confirmDeleteScene),addslashes($scene->title)), $this->createLink('testcase', 'deleteScene', "sceneID=$sceneID&confirm=yes")));
+ if($confirm == 'no') return print(js::confirm(sprintf($this->lang->testcase->confirmDeleteScene,addslashes($scene->title)), $this->createLink('testcase', 'deleteScene', "sceneID=$sceneID&confirm=yes")));
$childrenCount = $this->dao->select('count(*) as count')->from(VIEW_SCENECASE)->where('parent')->eq($sceneID)->andWhere('deleted')->eq(0)->fetch('count');
if($childrenCount)
@@ -3036,6 +3036,7 @@ class testcase extends control
{
if($_POST)
{
+ $this->classXmind = $this->app->loadClass('xmind');
if (isset($_POST['imodule'])) $imoduleID = $_POST['imodule'];
$configResult = $this->testcase->saveXmindConfig();
@@ -3067,7 +3068,7 @@ class testcase extends control
$productNode = $xmlDoc->createElement('node');
$textAttr = $xmlDoc->createAttribute('TEXT');
- $textAttrValue = $xmlDoc->createTextNode($this->toText("$productName", $productID));
+ $textAttrValue = $xmlDoc->createTextNode($this->classXmind->toText("$productName", $productID));
$textAttr->appendChild($textAttrValue);
$productNode->appendChild($textAttr);
@@ -3076,9 +3077,9 @@ class testcase extends control
$sceneNodes = array();
$moduleNodes = array();
- $this->createModuleNode($xmlDoc, $context, $productNode, $moduleNodes);
- $this->createSceneNode($xmlDoc, $context, $productNode, $moduleNodes, $sceneNodes);
- $this->createTestcaseNode($xmlDoc, $context, $productNode, $moduleNodes, $sceneNodes);
+ $this->classXmind->createModuleNode($xmlDoc, $context, $productNode, $moduleNodes);
+ $this->classXmind->createSceneNode($xmlDoc, $context, $productNode, $moduleNodes, $sceneNodes);
+ $this->classXmind->createTestcaseNode($xmlDoc, $context, $productNode, $moduleNodes, $sceneNodes);
$xmlStr = $xmlDoc->saveXML();
$this->fetch('file', 'sendDownHeader', array('fileName' => $productName, 'mm', $xmlStr));
@@ -3097,189 +3098,6 @@ class testcase extends control
$this->display();
}
- function createModuleNode($xmlDoc, $context, $productNode, &$moduleNodes)
- {
- $config = $context['config'];
- $moduleList = $context['moduleList'];
-
- foreach($moduleList as $key => $name)
- {
- $suffix = $config['module'].':'.$key;
- $moduleNode = $this->createNode($xmlDoc, $name, $suffix, array('nodeType' => 'module'));
- $productNode->appendChild($moduleNode);
-
- $moduleNodes[$key] = $moduleNode;
- }
- }
-
- function createSceneNode($xmlDoc, $context, $productNode, &$moduleNodes, &$sceneNodes)
- {
- $sceneMaps = $context['sceneMaps'];
- $config = $context['config'];
-
- $topScenes = $context['topScenes'];
-
- foreach($topScenes as $scene)
- {
- $suffix = $config['scene'].':'.$scene->sceneID;
- $sceneNode = $this->createNode($xmlDoc, $scene->sceneName, $suffix, array('nodeType' => 'scene'));
-
- $this->createNextChildScenesNode($scene, $sceneNode, $xmlDoc, $context, $moduleNodes, $sceneNodes);
-
- if(isset($moduleNodes[$scene->moduleID]))
- {
- $moduleNode = $moduleNodes[$scene->moduleID];
- $moduleNode->appendChild($sceneNode);
- }
- else
- {
- $productNode->appendChild($sceneNode);
- }
-
- $sceneNodes[$scene->sceneID] = $sceneNode;
- }
- }
-
- function createNextChildScenesNode($parentScene,$parentNode, $xmlDoc, $context, &$moduleNodes, &$sceneNodes)
- {
- $sceneMaps = $context['sceneMaps'];
- $config = $context['config'];
-
- foreach($sceneMaps as $key => $scene)
- {
- if($scene->parentID != $parentScene->sceneID + CHANGEVALUE) continue;
-
- $suffix = $config['scene'].':'.$scene->sceneID;
- $sceneNode = $this->createNode($xmlDoc, $scene->sceneName, $suffix, array('nodeType'=>'scene'));
-
- $this->createNextChildScenesNode($scene, $sceneNode, $xmlDoc, $context, $moduleNodes, $sceneNodes);
-
- $parentNode->appendChild($sceneNode);
- $sceneNodes[$scene->sceneID] = $sceneNode;
- }
- }
-
- function createTestcaseNode($xmlDoc, $context, $productNode, &$moduleNodes, &$sceneNodes)
- {
- $caseList = $context['caseList'];
-
- foreach($caseList as $case)
- {
- if(empty($case->testcaseID)) continue;
-
- $parentNode = $sceneNodes[$case->sceneID];
- if(!isset($parentNode)) $parentNode = $moduleNodes[$case->moduleID];
- if(!isset($parentNode)) $parentNode = $productNode;
-
- $this->createTestcaseNodeImpl($case, $xmlDoc, $context, $parentNode);
- }
- }
-
- function createTestcaseNodeImpl($case, $xmlDoc, $context, $parentNode)
- {
- $caseList = $context['caseList'];
- $stepList = $context['stepList'];
- $config = $context['config'];
- $suffix = $config['case'].':'.$case->testcaseID.','.$config['pri'].':'.$case->pri;
- $caseNode = $this->createNode($xmlDoc, $case->name, $suffix, array('nodeType'=>'testcase'));
-
- $parentNode->appendChild($caseNode);
-
- $topStepList = $this->findTopStepListByCase($case, $stepList);
-
- foreach($topStepList as $step)
- {
- $subStepList = $this->findSubStepListByStep($step,$stepList);
-
- $suffix = count($subStepList) > 0 ? $config['group'] : '';
- $stepNode = $this->createNode($xmlDoc, $step->desc, $suffix, array('nodeType' => 'step'));
- $caseNode->appendChild($stepNode);
-
- if(count($subStepList))
- {
- foreach($subStepList as $sub)
- {
- $subNode = $this->createNode($xmlDoc, $sub->desc, '', array('nodeType'=>'substep'));
- $stepNode->appendChild($subNode);
-
- if(!empty($sub->expect))
- {
- $expectNode = $this->createNode($xmlDoc, $sub->expect, '', array('nodeType'=>'expect'));
- $subNode->appendChild($expectNode);
- }
- }
- }
-
- if(count($subStepList) == 0 && !empty($step->expect))
- {
- $expectNode = $this->createNode($xmlDoc, $step->expect, '', array('nodeType'=>'expect'));
- $stepNode->appendChild($expectNode);
- }
- }
- }
-
- function findSubStepListByStep($step,$stepList)
- {
- $subList = array();
- foreach($stepList as $one)
- {
- if($one->parentID == $step->stepID)
- {
- $subList[] = $one;
- }
- }
-
- return $subList;
- }
-
- public function findTopStepListByCase($case,$stepList)
- {
- $topList = array();
- foreach($stepList as $step)
- {
- if($step->parentID == '0' && $step->testcaseID == $case->testcaseID)
- {
- $topList[] = $step;
- }
- }
-
- return $topList;
- }
-
- public function createNode($xmlDoc, $text, $suffix = '', $attrs=array())
- {
- $node = $xmlDoc->createElement('node');
-
- $textAttr = $xmlDoc->createAttribute('TEXT');
- $textAttrValue = $xmlDoc->createTextNode($this->toText($text,$suffix));
-
- $textAttr->appendChild($textAttrValue);
- $node->appendChild($textAttr);
-
- $positionAttr = $xmlDoc->createAttribute("POSITION");
- $positionAttrValue = $xmlDoc->createTextNode('right');
-
- $positionAttr->appendChild($positionAttrValue);
- $node->appendChild($positionAttr);
-
- foreach($attrs as $key => $value)
- {
- $attr = $xmlDoc->createAttribute($key);
- $attrValue = $xmlDoc->createTextNode($value);
-
- $attr->appendChild($attrValue);
- $node->appendChild($attr);
- }
-
- return $node;
- }
-
- public function toText($str, $suffix)
- {
- if(empty($suffix)) return $str;
- return $str . '['.$suffix.']';
- }
-
public function getXmindConfig()
{
$result = $this->testcase->getXmindConfig();
@@ -3311,6 +3129,7 @@ class testcase extends control
{
if($_FILES)
{
+ $this->classXmind = $this->app->loadClass('xmind');
if($_FILES['file']['size'] == 0) return print(js::alert($this->lang->testcase->errorFileNotEmpty));
$configResult = $this->testcase->saveXmindConfig();
@@ -3386,9 +3205,9 @@ class testcase extends control
}
$pId = $productID;
- if($this->endsWith($title,"]") == true)
+ if($this->classXmind->endsWith($title,"]") == true)
{
- $tmpId = $this->getBetween($title,"[","]");
+ $tmpId = $this->classXmind->getBetween($title,"[","]");
if(empty($tmpId) == false)
{
$projectCount = $this->dao->select('count(*) as count')
@@ -3419,9 +3238,9 @@ class testcase extends control
}
$pId = $productID;
- if($this->endsWith($title,"]") == true)
+ if($this->classXmind->endsWith($title,"]") == true)
{
- $tmpId = $this->getBetween($title,"[","]");
+ $tmpId = $this->classXmind->getBetween($title,"[","]");
if(empty($tmpId) == false)
{
$projectCount = $this->dao->select('count(*) as count')
@@ -3440,24 +3259,6 @@ class testcase extends control
return array('result'=>'success','pId'=>$pId,'type'=>'json');
}
- function getBetween($kw1, $mark1, $mark2)
- {
- $kw = $kw1;
- $kw = '123' . $kw . '123';
- $st = strripos($kw, $mark1);
- $ed = strripos($kw, $mark2);
-
- if(($st == false || $ed == false) || $st >= $ed) return 0;
-
- $kw = substr($kw, ($st + 1), ($ed - $st - 1));
- return $kw;
- }
-
- function endsWith($haystack, $needle)
- {
- return $needle === '' || substr_compare($haystack, $needle, -strlen($needle)) === 0;
- }
-
public function saveXmindConfig()
{
$result = $this->testcase->saveXmindConfig();
diff --git a/module/testcase/lang/de.php b/module/testcase/lang/de.php
index 624fe038a8..d52449dfbe 100644
--- a/module/testcase/lang/de.php
+++ b/module/testcase/lang/de.php
@@ -325,7 +325,7 @@ $lang->testcase->summaryScene = 'Total %d Top Scene.';
$lang->testcase->deleteScene = 'Delete Scene';
$lang->testcase->editScene = 'Edit Scene';
$lang->testcase->hasChildren = 'This scene has sub scene or test cases. Do you want to delete them all?';
-$lang->testcase->confirmDeleteScene = 'Are you sure you want to delete the scene: "%s"?';
+$lang->testcase->confirmDeleteScene = 'Are you sure you want to delete the scene: \"%s\"?';
$lang->testcase->sceneb = "Scene";
$lang->testcase->onlyScene = 'Only Scene';
$lang->testcase->iScene = 'Scene';
diff --git a/module/testcase/lang/en.php b/module/testcase/lang/en.php
index f6b49f9653..5d85d79b93 100644
--- a/module/testcase/lang/en.php
+++ b/module/testcase/lang/en.php
@@ -325,7 +325,7 @@ $lang->testcase->summaryScene = 'Total %d Top Scene.';
$lang->testcase->deleteScene = 'Delete Scene';
$lang->testcase->editScene = 'Edit Scene';
$lang->testcase->hasChildren = 'This scene has sub scene or test cases. Do you want to delete them all?';
-$lang->testcase->confirmDeleteScene = 'Are you sure you want to delete the scene: "%s"?';
+$lang->testcase->confirmDeleteScene = 'Are you sure you want to delete the scene: \"%s\"?';
$lang->testcase->sceneb = "Scene";
$lang->testcase->onlyScene = 'Only Scene';
$lang->testcase->iScene = 'Scene';
diff --git a/module/testcase/lang/fr.php b/module/testcase/lang/fr.php
index 927475a348..e85d1bef92 100644
--- a/module/testcase/lang/fr.php
+++ b/module/testcase/lang/fr.php
@@ -325,7 +325,7 @@ $lang->testcase->summaryScene = 'Total %d Top Scene.';
$lang->testcase->deleteScene = 'Delete Scene';
$lang->testcase->editScene = 'Edit Scene';
$lang->testcase->hasChildren = 'This scene has sub scene or test cases. Do you want to delete them all?';
-$lang->testcase->confirmDeleteScene = 'Are you sure you want to delete the scene: "%s"?';
+$lang->testcase->confirmDeleteScene = 'Are you sure you want to delete the scene: \"%s\"?';
$lang->testcase->sceneb = "Scene";
$lang->testcase->onlyScene = 'Only Scene';
$lang->testcase->iScene = 'Scene';
diff --git a/module/testcase/lang/vi.php b/module/testcase/lang/vi.php
index c4f7ef958d..7aa8ce7c8f 100644
--- a/module/testcase/lang/vi.php
+++ b/module/testcase/lang/vi.php
@@ -325,7 +325,7 @@ $lang->testcase->summaryScene = 'Total %d Top Scene.';
$lang->testcase->deleteScene = 'Delete Scene';
$lang->testcase->editScene = 'Edit Scene';
$lang->testcase->hasChildren = 'This scene has sub scene or test cases. Do you want to delete them all?';
-$lang->testcase->confirmDeleteScene = 'Are you sure you want to delete the scene: "%s"?';
+$lang->testcase->confirmDeleteScene = 'Are you sure you want to delete the scene: \"%s\"?';
$lang->testcase->sceneb = "Scene";
$lang->testcase->onlyScene = 'Only Scene';
$lang->testcase->iScene = 'Scene';
diff --git a/module/testcase/lang/zh-cn.php b/module/testcase/lang/zh-cn.php
index 50acdc1af4..83f23c1950 100644
--- a/module/testcase/lang/zh-cn.php
+++ b/module/testcase/lang/zh-cn.php
@@ -325,7 +325,7 @@ $lang->testcase->summaryScene = '本页共 %d 个顶级场景。';
$lang->testcase->deleteScene = '删除场景';
$lang->testcase->editScene = '编辑场景';
$lang->testcase->hasChildren = '该场景有子场景或测试用例存在,要全部删除吗?';
-$lang->testcase->confirmDeleteScene = '您确定要删除场景:\“%s\”吗?';
+$lang->testcase->confirmDeleteScene = '您确定要删除场景:“%s”吗?';
$lang->testcase->sceneb = "场景";
$lang->testcase->onlyScene = '仅场景';
$lang->testcase->iScene = '所属场景';
|