* Rename project session to PRJ.

This commit is contained in:
Yagami
2021-03-09 15:29:06 +08:00
parent 9516eeafff
commit d1e6e9265b
43 changed files with 266 additions and 266 deletions
+5 -5
View File
@@ -69,7 +69,7 @@ class testsuite extends control
$this->session->set('testsuiteList', $this->app->getURI(true));
/* Set menu. */
$projectID = $this->lang->navGroup->testreport == 'qa' ? 0 : $this->session->project;
$projectID = $this->lang->navGroup->testreport == 'qa' ? 0 : $this->session->PRJ;
$this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($projectID);
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=testsuite")));
$productID = $this->product->saveState($productID, $this->products);
@@ -136,7 +136,7 @@ class testsuite extends control
}
/* Set menu. */
$this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($this->session->project);
$this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($this->session->PRJ);
$productID = $this->product->saveState($productID, $this->products);
$this->testsuite->setMenu($this->products, $productID);
@@ -169,7 +169,7 @@ class testsuite extends control
if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) die(js::error($this->lang->error->accessDenied) . js::locate('back'));
$productID = $suite->product;
$this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($this->session->project);
$this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($this->session->PRJ);
$this->testsuite->setMenu($this->products, $productID);
/* Save session. */
@@ -239,7 +239,7 @@ class testsuite extends control
if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) die(js::error($this->lang->error->accessDenied) . js::locate('back'));
/* Get suite info. */
$this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($this->session->project);
$this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($this->session->PRJ);
$productID = $this->product->saveState($suite->product, $this->products);
/* Set menu. */
@@ -319,7 +319,7 @@ class testsuite extends control
$this->session->set('caseList', $this->app->getURI(true));
/* Get suite and product id. */
$this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($this->session->project);
$this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($this->session->PRJ);
$suite = $this->testsuite->getById($suiteID);
$productID = $this->product->saveState($suite->product, $this->products);
+6 -6
View File
@@ -101,7 +101,7 @@ class testsuiteModel extends model
{
$suite = fixer::input('post')
->stripTags($this->config->testsuite->editor->create['id'], $this->config->allowedTags)
->setIF($this->config->systemMode == 'new' and $this->lang->navGroup->testsuite != 'qa', 'project', $this->session->project)
->setIF($this->config->systemMode == 'new' and $this->lang->navGroup->testsuite != 'qa', 'project', $this->session->PRJ)
->add('product', (int)$productID)
->add('addedBy', $this->app->user->account)
->add('addedDate', helper::now())
@@ -133,7 +133,7 @@ class testsuiteModel extends model
{
return $this->dao->select("*")->from(TABLE_TESTSUITE)
->where('product')->eq((int)$productID)
->beginIF($this->config->systemMode == 'new' and $this->lang->navGroup->testsuite != 'qa')->andWhere('project')->eq($this->session->project)->fi()
->beginIF($this->config->systemMode == 'new' and $this->lang->navGroup->testsuite != 'qa')->andWhere('project')->eq($this->session->PRJ)->fi()
->andWhere('deleted')->eq(0)
->andWhere("(`type` = 'public' OR (`type` = 'private' and addedBy = '{$this->app->user->account}'))")
->orderBy($orderBy)
@@ -242,7 +242,7 @@ class testsuiteModel extends model
$cases = $this->dao->select('t1.*,t2.version as caseVersion')->from(TABLE_CASE)->alias('t1')
->leftJoin(TABLE_SUITECASE)->alias('t2')->on('t1.id=t2.case')
->where('t2.suite')->eq($suiteID)
->beginIF($this->config->systemMode == 'new' and $this->lang->navGroup->testsuite != 'qa')->andWhere('t1.project')->eq($this->session->project)->fi()
->beginIF($this->config->systemMode == 'new' and $this->lang->navGroup->testsuite != 'qa')->andWhere('t1.project')->eq($this->session->PRJ)->fi()
->andWhere('t1.product')->eq($suite->product)
->andWhere('t1.product')->eq($suite->product)
->andWhere('t1.deleted')->eq(0)
@@ -286,7 +286,7 @@ class testsuiteModel extends model
$linkedCases = $this->getLinkedCases($suite->id, 'id_desc', null, $append = false);
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)
->andWhere('id')->notIN(array_keys($linkedCases))
->beginIF($this->config->systemMode == 'new' and $this->lang->navGroup->testsuite != 'qa')->andWhere('project')->eq($this->session->project)->fi()
->beginIF($this->config->systemMode == 'new' and $this->lang->navGroup->testsuite != 'qa')->andWhere('project')->eq($this->session->PRJ)->fi()
->andWhere('deleted')->eq(0)
->orderBy('id desc')
->page($pager)
@@ -323,7 +323,7 @@ class testsuiteModel extends model
{
$importedCases = $this->dao->select('fromCaseID')->from(TABLE_CASE)
->where('product')->eq($productID)
->beginIF($this->config->systemMode == 'new' and $this->lang->navGroup->testsuite != 'qa')->andWhere('project')->eq($this->session->project)->fi()
->beginIF($this->config->systemMode == 'new' and $this->lang->navGroup->testsuite != 'qa')->andWhere('project')->eq($this->session->PRJ)->fi()
->andWhere('lib')->eq($libID)
->andWhere('fromCaseID')->ne('')
->andWhere('deleted')->eq(0)
@@ -357,7 +357,7 @@ class testsuiteModel extends model
return $this->dao->select('*')->from(TABLE_CASE)->where('deleted')->eq(0)
->beginIF($browseType != 'bysearch')->andWhere('lib')->eq($libID)->fi()
->beginIF($browseType == 'bysearch')->andWhere($query)->fi()
->begin($this->config->systemMode == 'new' and $this->lang->navGroup->testsuite != 'qa')->andWhere('project')->eq($this->session->project)->fi()
->begin($this->config->systemMode == 'new' and $this->lang->navGroup->testsuite != 'qa')->andWhere('project')->eq($this->session->PRJ)->fi()
->andWhere('product')->eq(0)
->andWhere('id')->notIN($importedCases)
->orderBy($orderBy)