* Merge 18.9 testcase module.

This commit is contained in:
hufangzhou
2023-11-30 10:45:20 +08:00
parent ff591a06a6
commit 03aa2f3faf
7 changed files with 22 additions and 13 deletions
+1 -1
View File
@@ -125,7 +125,7 @@ $config->testcase->dtable->fieldList['stepNumber']['sortType'] = true;
$config->testcase->dtable->fieldList['version']['title'] = $lang->testcase->version;
$config->testcase->dtable->fieldList['version']['type'] = 'text';
$config->testcase->dtable->fieldList['version']['group'] = 5;
$config->testcase->dtable->fieldList['version']['sortType'] = true;
$config->testcase->dtable->fieldList['version']['sortType'] = false;
$config->testcase->dtable->fieldList['lastEditedBy']['title'] = $lang->testcase->lastEditedBy;
$config->testcase->dtable->fieldList['lastEditedBy']['type'] = 'user';
+8 -3
View File
@@ -1110,10 +1110,11 @@ class testcase extends control
if($_POST)
{
list($cases, $steps, $files, $imported) = $this->testcaseZen->buildDataForImportFromLib($productID, $branch, $libID);
list($cases, $steps, $files, $hasImported) = $this->testcaseZen->buildDataForImportFromLib($productID, $branch, $libID);
$this->loadModel('action');
$errors = '';
$errors = '';
$importedCases = array();
foreach($cases as $oldCaseID => $case)
{
$this->config->testcase->create->requiredFields = strpos(",{$this->config->testcase->create->requiredFields},", ',module,') !== false ? ',module,' : '';
@@ -1122,6 +1123,7 @@ class testcase extends control
{
$errors .= "{$oldCaseID}:";
foreach(dao::getError() as $fieldErrors) $errors .= implode(',', $fieldErrors);
continue;
}
$caseID = $this->dao->lastInsertID();
$this->executeHooks($caseID);
@@ -1129,11 +1131,14 @@ class testcase extends control
$this->testcase->importSteps($caseID, zget($steps, $oldCaseID, array()));
$this->testcase->importFiles($caseID, zget($files, $oldCaseID, array()));
$importedCases[] = $libCaseID;
$this->action->create('case', $caseID, 'fromlib', '', $case->lib);
}
if(!empty($errors)) return $this->send(array('result' => 'fail', 'callback' => "zui.Modal.alert('{$errors}');"));
if(!empty($imported) && is_string($imported)) return $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->testcase->importedCases, trim($imported, ','))));
if(!empty($importedCases)) $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->testcase->importedFromLib, count($importedCases), implode(',', $importedCases))));
if(!empty($hasImported) && is_string($hasImported)) return $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->testcase->importedCases, trim($hasImported, ','))));
return $this->send(array('result' => 'success', 'message' => $this->lang->importSuccess, 'load' => true));
}
+1
View File
@@ -256,6 +256,7 @@ $lang->testcase->mustChooseResult = 'Prüfungsergebnis wird benötigt.';
$lang->testcase->noModule = '<div>Es existieren keine Module</div><div>Jetzt verwalten</div>';
$lang->testcase->noCase = 'Keine Fälle. ';
$lang->testcase->importedCases = 'The case with ID%s has been imported in the same module and has been ignored.';
$lang->testcase->importedFromLib = '%s items imported successfully: %s.';
$lang->testcase->searchStories = 'Story suchen';
$lang->testcase->selectLib = 'Bibliothek wählen';
+1
View File
@@ -256,6 +256,7 @@ $lang->testcase->mustChooseResult = 'Review result is required.';
$lang->testcase->noModule = '<div>You have no modules.</div><div>Manage it now.</div>';
$lang->testcase->noCase = 'No cases yet. ';
$lang->testcase->importedCases = 'The case with ID%s has been imported in the same module and has been ignored.';
$lang->testcase->importedFromLib = '%s items imported successfully: %s.';
$lang->testcase->searchStories = 'Enter to search for stories';
$lang->testcase->selectLib = 'Select Library';
+1
View File
@@ -256,6 +256,7 @@ $lang->testcase->mustChooseResult = 'La Validation du résultat est nécessaire.
$lang->testcase->noModule = "<div>Vous n'avez aucun modules.</div><div>Gérer les modules maintenant.</div>";
$lang->testcase->noCase = "Aucun CasTest pour l'instant. ";
$lang->testcase->importedCases = 'Le cas d\'utilisation avec l\'ID %s est déjà importé dans le même module, il est donc ignoré.';
$lang->testcase->importedFromLib = '%s items imported successfully: %s.';
$lang->testcase->searchStories = 'Rechercher des stories';
$lang->testcase->selectLib = 'Sélectionner Library';
+1
View File
@@ -256,6 +256,7 @@ $lang->testcase->mustChooseResult = '必须选择评审结果';
$lang->testcase->noModule = '<div>您现在还没有模块信息</div><div>请维护测试模块</div>';
$lang->testcase->noCase = '暂时没有用例。';
$lang->testcase->importedCases = 'ID为 %s 的用例在相同模块已经导入,已忽略。';
$lang->testcase->importedFromLib = '导入成功%s项:%s。';
$lang->testcase->searchStories = "键入来搜索{$lang->SRCommon}";
$lang->testcase->selectLib = '请选择库';
+9 -9
View File
@@ -1485,13 +1485,13 @@ class testcaseZen extends testcase
/* 构建用例。 */
/* Build cases. */
$imported = '';
$cases = array();
$steps = array();
$files = array();
$fromCases = $this->testcase->getByList($caseIdList);
$fromSteps = $this->testcase->getRelatedSteps($caseIdList);
$fromFiles = $this->testcase->getRelatedFiles($caseIdList);
$hasImported = '';
$cases = array();
$steps = array();
$files = array();
$fromCases = $this->testcase->getByList($caseIdList);
$fromSteps = $this->testcase->getRelatedSteps($caseIdList);
$fromFiles = $this->testcase->getRelatedFiles($caseIdList);
foreach($caseIdList as $caseID)
{
if(!isset($fromCases[$caseID])) continue;
@@ -1509,7 +1509,7 @@ class testcaseZen extends testcase
if(empty($caseModules[$branch][$case->fromCaseID][$case->module]))
{
$imported .= "$case->fromCaseID,";
$hasImported .= "$case->fromCaseID,";
}
else
{
@@ -1519,7 +1519,7 @@ class testcaseZen extends testcase
}
}
return array($cases, $steps, $files, $imported);
return array($cases, $steps, $files, $hasImported);
}
/**