* Adjust the cases of all products.
This commit is contained in:
@@ -920,9 +920,7 @@ class product extends control
|
||||
foreach($this->config->qa->menuList as $menu) $this->lang->navGroup->$menu = 'qa';
|
||||
}
|
||||
|
||||
$moduleGroup = zget($this->lang->navGroup, $module);
|
||||
$moduleGroup = in_array($moduleGroup, array('product', 'qa'))? $moduleGroup : 'project';
|
||||
$products = $moduleGroup == 'project' ? $this->product->getProducts($this->session->project) : $this->product->getList();
|
||||
$products = $this->app->openApp == 'project' ? $this->product->getProducts($this->session->project) : $this->product->getList();
|
||||
|
||||
$this->view->link = $this->product->getProductLink($module, $method, $extra);
|
||||
$this->view->productID = $productID;
|
||||
@@ -930,10 +928,10 @@ class product extends control
|
||||
$this->view->method = $method;
|
||||
$this->view->extra = $extra;
|
||||
$this->view->products = $products;
|
||||
$this->view->projectID = $moduleGroup == 'project' ? $this->session->project : 0;
|
||||
$this->view->projectID = $this->app->openApp == 'project' ? $this->session->project : 0;
|
||||
$this->view->programs = $this->loadModel('program')->getPairs(true);
|
||||
$this->view->lines = $this->product->getLinePairs();
|
||||
$this->view->openApp = $moduleGroup;
|
||||
$this->view->openApp = $this->app->openApp;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -70,10 +70,10 @@ class productModel extends model
|
||||
*/
|
||||
public function select($products, $productID, $currentModule, $currentMethod, $extra = '', $branch = 0, $module = 0, $moduleType = '')
|
||||
{
|
||||
$isProjectBug = isset($products[0]) ? true : false;
|
||||
$isProject = ($this->app->openApp == 'project' and strpos('bug,testcase,testtask', $this->app->rawMethod) !== false and isset($products[0])) ? true : false;
|
||||
|
||||
$this->app->loadLang('product');
|
||||
if(!$isProjectBug and !$productID)
|
||||
if(!$isProject and !$productID)
|
||||
{
|
||||
unset($this->lang->product->menu->settings['subMenu']->branch);
|
||||
return;
|
||||
@@ -82,7 +82,9 @@ class productModel extends model
|
||||
|
||||
setCookie("lastProduct", $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
if($productID) $currentProduct = $this->getById($productID);
|
||||
if($isProjectBug and !$productID)
|
||||
|
||||
if($isProject) $extra = $this->session->project;
|
||||
if($isProject and !$productID)
|
||||
{
|
||||
$currentProduct = new stdclass();
|
||||
$currentProduct->name = $products[$productID];
|
||||
@@ -93,7 +95,7 @@ class productModel extends model
|
||||
$output = '';
|
||||
if(!empty($products))
|
||||
{
|
||||
$dropMenuLink = helper::createLink($isProjectBug ? 'bug' : 'product', 'ajaxGetDropMenu', "objectID=$productID&module=$currentModule&method=$currentMethod&extra=$extra");
|
||||
$dropMenuLink = helper::createLink($isProject ? 'bug' : 'product', 'ajaxGetDropMenu', "objectID=$productID&module=$currentModule&method=$currentMethod&extra=$extra");
|
||||
$output = "<div class='btn-group angle-btn'><div class='btn-group'><button data-toggle='dropdown' type='button' class='btn btn-limit' id='currentItem' title='{$currentProduct->name}'><span class='text'>{$currentProduct->name}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
|
||||
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
|
||||
$output .= "</div></div>";
|
||||
@@ -1522,7 +1524,7 @@ class productModel extends model
|
||||
public function getProductLink($module, $method, $extra, $branch = false)
|
||||
{
|
||||
$link = '';
|
||||
if(strpos('programplan,product,roadmap,bug,testcase,testtask,story,qa,testsuite,testreport,build,projectrelease,projectstory', $module) !== false)
|
||||
if(strpos('programplan,product,roadmap,bug,testcase,testtask,story,qa,testsuite,testreport,build,projectrelease,projectstory', ',' . $module . ',') !== false)
|
||||
{
|
||||
if($module == 'product' && $method == 'project')
|
||||
{
|
||||
@@ -1583,6 +1585,10 @@ class productModel extends model
|
||||
{
|
||||
return helper::createLink('design', 'browse', "productID=%s");
|
||||
}
|
||||
elseif($module == 'project')
|
||||
{
|
||||
return helper::createLink('project', $method, "projectID=$extra&productID=%s");
|
||||
}
|
||||
|
||||
return $link;
|
||||
}
|
||||
|
||||
@@ -20,12 +20,6 @@ $myProductsHtml = '';
|
||||
$normalProductsHtml = '';
|
||||
$closedProductsHtml = '';
|
||||
|
||||
if($this->app->openApp == 'project' and $this->app->rawModule == 'testcase')
|
||||
{
|
||||
$linkHtml = $this->product->setParamsForLink($module, $link, $projectID, 0);
|
||||
$myProductsHtml .= html::a($linkHtml, $this->lang->product->all, '', "class='text-important' title='{$this->lang->product->all}' data-key='" . zget($productsPinYin, $this->lang->product->all, '') . "' data-app='project'");
|
||||
}
|
||||
|
||||
foreach($products as $product)
|
||||
{
|
||||
$selected = $product->id == $productID ? 'selected' : '';
|
||||
|
||||
@@ -757,6 +757,10 @@ class project extends control
|
||||
*/
|
||||
public function testcase($projectID = 0, $productID = 0, $branch = 0, $browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$this->loadModel('product');
|
||||
$products = array('0' => $this->lang->product->all) + $this->project->getProducts($projectID, false);
|
||||
$this->lang->modulePageNav = $this->product->select($products, $productID, 'project', 'testcase', '', $branch);
|
||||
|
||||
echo $this->fetch('testcase', 'browse', "productID=$productID&branch=$branch&browseType=$browseType¶m=$param&orderBy=$orderBy&recTotal=$orderBy&recPerPage=$recPerPage&pageID=$pageID&projectID=$projectID");
|
||||
}
|
||||
|
||||
|
||||
@@ -1465,6 +1465,8 @@ class story extends control
|
||||
if($this->app->openApp == 'project')
|
||||
{
|
||||
$this->loadModel('project')->setMenu($this->session->project);
|
||||
$this->app->rawModule = 'qa';
|
||||
$this->lang->project->menu->qa['subMenu']->testcase['subModule'] = 'story';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -567,7 +567,7 @@ class testcase extends control
|
||||
if($isLibCase)
|
||||
{
|
||||
$libraries = $this->loadModel('caselib')->getLibraries();
|
||||
$this->caselib->setLibMenu($libraries, $case->lib);
|
||||
$this->app->openApp == 'project' ? $this->loadModel('project')->setMenu($this->session->project) : $this->caselib->setLibMenu($libraries, $case->lib);
|
||||
|
||||
$this->view->title = "CASE #$case->id $case->title - " . $libraries[$case->lib];
|
||||
$this->view->position[] = html::a($this->createLink('caselib', 'browse', "libID=$case->lib"), $libraries[$case->lib]);
|
||||
@@ -577,7 +577,7 @@ class testcase extends control
|
||||
else
|
||||
{
|
||||
$productID = $case->product;
|
||||
$this->testcase->setMenu($this->products, $productID, $case->branch);
|
||||
$this->app->openApp == 'project' ? $this->loadModel('project')->setMenu($this->session->project) : $this->testcase->setMenu($this->products, $productID, $case->branch);
|
||||
|
||||
$this->view->title = "CASE #$case->id $case->title - " . $this->products[$productID];
|
||||
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]);
|
||||
@@ -673,7 +673,7 @@ class testcase extends control
|
||||
if($isLibCase)
|
||||
{
|
||||
$libraries = $this->loadModel('caselib')->getLibraries();
|
||||
$this->caselib->setLibMenu($libraries, $case->lib);
|
||||
$this->app->openApp == 'project' ? $this->loadModel('project')->setMenu($this->session->project) : $this->caselib->setLibMenu($libraries, $case->lib);
|
||||
|
||||
$title = "CASE #$case->id $case->title - " . $libraries[$case->lib];
|
||||
$position[] = html::a($this->createLink('caselib', 'browse', "libID=$case->lib"), $libraries[$case->lib]);
|
||||
@@ -1538,7 +1538,7 @@ class testcase extends control
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
|
||||
$this->testcase->setMenu($this->products, $productID, $branch);
|
||||
$this->app->openApp == 'project' ? $this->loadModel('project')->setMenu($this->session->project) : $this->testcase->setMenu($this->products, $productID, $branch);
|
||||
|
||||
$libraries = $this->loadModel('caselib')->getLibraries();
|
||||
if(empty($libraries))
|
||||
|
||||
@@ -143,7 +143,7 @@ class testcaseModel extends model
|
||||
|
||||
$data[$i] = new stdclass();
|
||||
$data[$i]->product = $productID;
|
||||
if($this->config->systemMode == 'new' && $this->lang->navGroup->testcase == 'project') $data[$i]->project = $this->session->project;
|
||||
if($this->config->systemMode == 'new' && $this->app->openApp == 'project') $data[$i]->project = $this->session->project;
|
||||
$data[$i]->branch = $cases->branch[$i];
|
||||
$data[$i]->module = $cases->module[$i];
|
||||
$data[$i]->type = $cases->type[$i];
|
||||
@@ -224,7 +224,7 @@ class testcaseModel extends model
|
||||
return $this->dao->select('t1.*, t2.title as storyTitle')->from(TABLE_CASE)->alias('t1')
|
||||
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story=t2.id')
|
||||
->where('t1.product')->eq((int)$productID)
|
||||
->beginIF($this->lang->navGroup->testcase != 'qa')->andWhere('t1.project')->eq($this->session->project)->fi()
|
||||
->beginIF($this->app->openApp = 'project')->andWhere('t1.project')->eq($this->session->project)->fi()
|
||||
->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi()
|
||||
->beginIF($moduleIdList)->andWhere('t1.module')->in($moduleIdList)->fi()
|
||||
->beginIF($browseType == 'wait')->andWhere('t1.status')->eq($browseType)->fi()
|
||||
@@ -330,7 +330,7 @@ class testcaseModel extends model
|
||||
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story=t2.id')
|
||||
->leftJoin(TABLE_SUITECASE)->alias('t3')->on('t1.id=t3.case')
|
||||
->where('t1.product')->eq((int)$productID)
|
||||
->beginIF($this->lang->navGroup->testcase != 'qa')->andWhere('t1.project')->eq($this->session->project)->fi()
|
||||
->beginIF($this->app->openApp == 'project')->andWhere('t1.project')->eq($this->session->project)->fi()
|
||||
->andWhere('t3.suite')->eq((int)$suiteID)
|
||||
->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi()
|
||||
->beginIF($moduleIdList)->andWhere('t1.module')->in($moduleIdList)->fi()
|
||||
@@ -1201,7 +1201,7 @@ class testcaseModel extends model
|
||||
}
|
||||
else
|
||||
{
|
||||
if($this->config->systemMode == 'new' && $this->lang->navGroup->testcase != 'qa') $caseData->project = $this->session->project;
|
||||
if($this->config->systemMode == 'new' && $this->app->openApp == 'project') $caseData->project = $this->session->project;
|
||||
$caseData->version = 1;
|
||||
$caseData->openedBy = $this->app->user->account;
|
||||
$caseData->openedDate = $now;
|
||||
@@ -1317,12 +1317,12 @@ class testcaseModel extends model
|
||||
}
|
||||
|
||||
/* If under the project module, the cases is imported need linking to the project. */
|
||||
if($this->lang->navGroup->testcase != 'qa')
|
||||
if($this->app->openApp == 'project')
|
||||
{
|
||||
$lastOrder = (int)$this->dao->select('*')->from(TABLE_PROJECTCASE)->where('project')->eq($this->session->project)->orderBy('order_desc')->limit(1)->fetch('order');
|
||||
|
||||
$this->dao->insert(TABLE_PROJECTCASE)
|
||||
->set('project')->eq($case->project)
|
||||
->set('project')->eq($this->session->project)
|
||||
->set('product')->eq($case->product)
|
||||
->set('case')->eq($caseID)
|
||||
->set('version')->eq($case->version)
|
||||
@@ -1358,8 +1358,8 @@ class testcaseModel extends model
|
||||
*/
|
||||
public function buildSearchForm($productID, $products, $queryID, $actionURL)
|
||||
{
|
||||
$product = ($this->app->openApp == 'project' and empty($productID)) ? $products : array($productID => $products[$productID]);
|
||||
$this->config->testcase->search['params']['product']['values'] = $product + array('all' => $this->lang->testcase->allProduct);
|
||||
$product = ($this->app->openApp == 'project' and empty($productID)) ? $products : array($productID => $products[$productID]) + array('all' => $this->lang->testcase->allProduct);
|
||||
$this->config->testcase->search['params']['product']['values'] = $product;
|
||||
|
||||
$module = $this->loadModel('tree')->getOptionMenu($productID, 'case', 0);
|
||||
if(!$productID)
|
||||
|
||||
@@ -67,10 +67,9 @@
|
||||
<?php foreach($caseIDList as $caseID):?>
|
||||
<?php
|
||||
if(!isset($cases[$caseID])) continue;
|
||||
if(!$productID)
|
||||
if(!$productID and !$cases[$caseID]->lib)
|
||||
{
|
||||
$product = $this->product->getByID($cases[$caseID]->product);
|
||||
|
||||
$product = $this->product->getByID($cases[$caseID]->product);
|
||||
$branches = $product->type == 'normal' ? array('' => '') : $this->loadModel('branch')->getPairs($product->id);
|
||||
if($product->type != 'normal')
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ class testtask extends control
|
||||
parent::__construct($moduleName, $methodName);
|
||||
|
||||
/* Set testtask menu group. */
|
||||
$this->projectID = isset($_GET['PRJ']) ? $_GET['PRJ'] : 0;
|
||||
$this->projectID = isset($_GET['project']) ? $_GET['project'] : 0;
|
||||
if($this->app->openApp == 'qa')
|
||||
{
|
||||
$this->app->loadConfig('qa');
|
||||
@@ -144,6 +144,7 @@ class testtask extends control
|
||||
if($this->app->openApp == 'project')
|
||||
{
|
||||
$this->loadModel('project')->setMenu($this->session->project);
|
||||
$this->lang->modulePageNav = $this->product->select($this->products, $productID, 'testtask', 'browseUnits');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1097,7 +1098,7 @@ class testtask extends control
|
||||
/* The case of tasks of qa. */
|
||||
if($productID)
|
||||
{
|
||||
$this->loadModel('qa')->setMenu($this->products, $productID, $taskID);
|
||||
$this->app->openApp == 'project' ? $this->loadModel('project')->setMenu($this->session->project) : $this->loadModel('qa')->setMenu($this->products, $productID, $taskID);
|
||||
$this->view->moduleOptionMenu = $this->loadModel('tree')->getOptionMenu($productID, 'case');
|
||||
|
||||
$cases = $this->dao->select('*')->from(TABLE_CASE)->where('id')->in($caseIDList)->fetchAll('id');
|
||||
@@ -1105,8 +1106,15 @@ class testtask extends control
|
||||
/* The case of my. */
|
||||
else
|
||||
{
|
||||
$this->lang->testtask->menu = $this->lang->my->menu->work;
|
||||
$this->lang->my->menu->work['subModule'] = 'testtask';
|
||||
if($this->app->openApp == 'project')
|
||||
{
|
||||
$this->loadModel('project')->setMenu($this->session->project);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->lang->testtask->menu = $this->lang->my->menu->work;
|
||||
$this->lang->my->menu->work['subModule'] = 'testtask';
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->testtask->batchRun;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user