* rename importlib to importfromlib.
This commit is contained in:
+52
-60
@@ -1346,6 +1346,58 @@ class testcase extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Import case from lib.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param int $libID
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function importFromLib($productID, $branch = 0, $libID = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$this->testcase->importFromLib($productID);
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
|
||||
$this->testcase->setMenu($this->products, $productID, $branch);
|
||||
|
||||
$libraries = $this->loadModel('testsuite')->getLibraries();
|
||||
if(empty($libraries))
|
||||
{
|
||||
echo js::alert($this->lang->testcase->noLibrary);
|
||||
die(js::locate(inlink('browse')));
|
||||
}
|
||||
if(empty($libID) or !isset($libraries[$libID])) $libID = key($libraries);
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = pager::init($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$this->view->title = $this->lang->testcase->common . $this->lang->colon . $this->lang->testcase->importFromLib;
|
||||
$this->view->position[] = $this->lang->testcase->importFromLib;
|
||||
|
||||
$this->view->libraries = $libraries;
|
||||
$this->view->libID = $libID;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->branch = $branch;
|
||||
$this->view->cases = $this->testsuite->getNotImportedCases($productID, $libID, $orderBy, $pager);
|
||||
$this->view->modules = $this->loadModel('tree')->getOptionMenu($productID, 'case', 0, $branch);
|
||||
$this->view->libModules = $this->tree->getOptionMenu($libID, 'caselib');
|
||||
$this->view->pager = $pager;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->branches = $this->loadModel('branch')->getPairs($productID);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show import data
|
||||
*
|
||||
@@ -1520,64 +1572,4 @@ class testcase extends control
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Import case from lib.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param int $libID
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function importLib($productID, $branch = 0, $libID = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$this->testcase->importLib($productID);
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
|
||||
$this->testcase->setMenu($this->products, $productID, $branch);
|
||||
|
||||
$libraries = $this->loadModel('testsuite')->getLibraries();
|
||||
if(empty($libraries))
|
||||
{
|
||||
echo js::alert($this->lang->testcase->noLibrary);
|
||||
die(js::locate(inlink('browse')));
|
||||
}
|
||||
if(empty($libID) or !isset($libraries[$libID])) $libID = key($libraries);
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = pager::init($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$modules = $this->loadModel('tree')->getOptionMenu($productID, 'case', 0, $branch);
|
||||
$libName = $libraries[$libID];
|
||||
$libModules = $this->tree->getOptionMenu($libID, 'caselib');
|
||||
foreach($libModules as $moduleID => $moduleName)
|
||||
{
|
||||
if($moduleID == 0) continue;
|
||||
$modules[$moduleID] = $libName . $moduleName;
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->testcase->common . $this->lang->colon . $this->lang->testcase->importFromLib;
|
||||
$this->view->position[] = $this->lang->testcase->importFromLib;
|
||||
|
||||
$this->view->libraries = $libraries;
|
||||
$this->view->libID = $libID;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->branch = $branch;
|
||||
$this->view->cases = $this->testsuite->getNotImportedCases($productID, $libID, $orderBy, $pager);
|
||||
$this->view->modules = $modules;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->branches = $this->loadModel('branch')->getPairs($productID);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user