* change field name fromLib to fromCaseID.
This commit is contained in:
+1
-1
@@ -19,7 +19,7 @@ CREATE TABLE `zt_suitecase` (
|
||||
UNIQUE KEY `suitecase` (`suite`,`case`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
ALTER TABLE `zt_case` ADD `lib` mediumint(8) unsigned NOT NULL DEFAULT '0' AFTER `branch`;
|
||||
ALTER TABLE `zt_case` ADD `fromLib` mediumint(8) unsigned NOT NULL AFTER `fromBug`;
|
||||
ALTER TABLE `zt_case` ADD `fromCaseID` mediumint(8) unsigned NOT NULL AFTER `fromBug`;
|
||||
ALTER TABLE `zt_case` ADD `reviewedBy` varchar(255) NOT NULL AFTER `openedDate`;
|
||||
ALTER TABLE `zt_case` ADD `reviewedDate` date NOT NULL AFTER `reviewedBy`;
|
||||
ALTER TABLE `zt_casestep` ADD `parent` mediumint(8) unsigned NOT NULL DEFAULT '0' AFTER `id`;
|
||||
|
||||
@@ -113,7 +113,7 @@ class testcase extends control
|
||||
$linkedLibs = array();
|
||||
foreach($cases as $case)
|
||||
{
|
||||
if($case->lib and $case->fromLib) $linkedLibs[$case->lib] = $case->lib;
|
||||
if($case->lib and $case->fromCaseID) $linkedLibs[$case->lib] = $case->lib;
|
||||
}
|
||||
$showModule = !empty($this->config->datatable->testcaseBrowse->showModule) ? $this->config->datatable->testcaseBrowse->showModule : '';
|
||||
$this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'case', $showModule, $linkedLibs) : array();
|
||||
@@ -633,7 +633,7 @@ class testcase extends control
|
||||
$this->testcase->setMenu($this->products, $productID, $case->branch);
|
||||
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $case->branch);
|
||||
if($case->lib and $case->fromLib)
|
||||
if($case->lib and $case->fromCaseID)
|
||||
{
|
||||
$libName = $this->loadModel('testsuite')->getById($case->lib)->name;
|
||||
$libModules = $this->tree->getOptionMenu($case->lib, 'caselib');
|
||||
@@ -724,7 +724,7 @@ class testcase extends control
|
||||
$existModules = array();
|
||||
foreach($cases as $case)
|
||||
{
|
||||
if($case->lib and $case->fromLib) $libs[$case->lib] = $case->lib;
|
||||
if($case->lib and $case->fromCaseID) $libs[$case->lib] = $case->lib;
|
||||
$existModules[$case->module] = $case->module;
|
||||
}
|
||||
$modules = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $branch);
|
||||
@@ -752,7 +752,7 @@ class testcase extends control
|
||||
$existModules = array();
|
||||
foreach($cases as $case)
|
||||
{
|
||||
if($case->lib and $case->fromLib) $libs[$case->lib] = $case->lib;
|
||||
if($case->lib and $case->fromCaseID) $libs[$case->lib] = $case->lib;
|
||||
$productIdList[$case->product] = $case->product;
|
||||
$existModules[$case->module] = $case->module;
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ class testcaseModel extends model
|
||||
$toBugs = $this->dao->select('id, title')->from(TABLE_BUG)->where('`case`')->eq($caseID)->fetchAll();
|
||||
foreach($toBugs as $toBug) $case->toBugs[$toBug->id] = $toBug->title;
|
||||
|
||||
if($case->linkCase or $case->fromLib) $case->linkCaseTitles = $this->dao->select('id,title')->from(TABLE_CASE)->where('id')->in($case->linkCase)->orWhere('id')->eq($case->fromLib)->fetchPairs();
|
||||
if($case->linkCase or $case->fromCaseID) $case->linkCaseTitles = $this->dao->select('id,title')->from(TABLE_CASE)->where('id')->in($case->linkCase)->orWhere('id')->eq($case->fromCaseID)->fetchPairs();
|
||||
if($version == 0) $version = $case->version;
|
||||
$case->steps = $this->dao->select('*')->from(TABLE_CASESTEP)->where('`case`')->eq($caseID)->andWhere('version')->eq($version)->orderBy('id')->fetchAll();
|
||||
$case->files = $this->loadModel('file')->getByObject('testcase', $caseID);
|
||||
@@ -1087,8 +1087,8 @@ class testcaseModel extends model
|
||||
$libSteps = $this->dao->select('*')->from(TABLE_CASESTEP)->where('`case`')->in($data->caseIdList)->orderBy('id')->fetchGroup('case');
|
||||
foreach($libCases as $libCaseID => $case)
|
||||
{
|
||||
$case->fromLib = $case->id;
|
||||
$case->product = $productID;
|
||||
$case->fromCaseID = $case->id;
|
||||
$case->product = $productID;
|
||||
if(isset($data->module[$case->id])) $case->module = $data->module[$case->id];
|
||||
if(isset($data->branch[$case->id])) $case->branch = $data->branch[$case->id];
|
||||
unset($case->id);
|
||||
|
||||
@@ -423,12 +423,12 @@ class testsuiteModel extends model
|
||||
*/
|
||||
public function getNotImportedCases($productID, $libID, $orderBy = 'id_desc', $pager = null)
|
||||
{
|
||||
$importedCases = $this->dao->select('fromLib')->from(TABLE_CASE)
|
||||
$importedCases = $this->dao->select('fromCaseID')->from(TABLE_CASE)
|
||||
->where('product')->eq($productID)
|
||||
->andWhere('lib')->eq($libID)
|
||||
->andWhere('fromLib')->ne('')
|
||||
->andWhere('fromCaseID')->ne('')
|
||||
->andWhere('deleted')->eq(0)
|
||||
->fetchPairs('fromLib', 'fromLib');
|
||||
->fetchPairs('fromCaseID', 'fromCaseID');
|
||||
return $this->dao->select('*')->from(TABLE_CASE)
|
||||
->where('lib')->eq($libID)
|
||||
->andWhere('product')->eq(0)
|
||||
|
||||
@@ -1543,7 +1543,7 @@ class treeModel extends model
|
||||
foreach($cases as $case)
|
||||
{
|
||||
$existModules[$case->module] = $case->module;
|
||||
if($case->lib and $case->fromLib) $libs[$case->lib] = $case->lib;
|
||||
if($case->lib and $case->fromCaseID) $libs[$case->lib] = $case->lib;
|
||||
}
|
||||
if(empty($libs)) return null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user