diff --git a/config/zentaopms.php b/config/zentaopms.php index 4e0296a8bb..d95d5c86cc 100644 --- a/config/zentaopms.php +++ b/config/zentaopms.php @@ -19,6 +19,30 @@ $config->productCommonList['fr'][0] = 'Product'; $config->productCommonList['vi'][0] = 'Sản phẩm'; /* Project common list. */ +$config->projectCommonList['zh-cn'][0] = '项目'; +$config->projectCommonList['zh-cn'][1] = '迭代'; +$config->projectCommonList['zh-cn'][2] = '冲刺'; + +$config->projectCommonList['zh-tw'][0] = '項目'; +$config->projectCommonList['zh-tw'][1] = '迭代'; +$config->projectCommonList['zh-tw'][2] = '冲刺'; + +$config->projectCommonList['en'][0] = 'Project'; +$config->projectCommonList['en'][1] = 'Iteration'; +$config->projectCommonList['en'][2] = 'Sprint'; + +$config->projectCommonList['de'][0] = 'Project'; +$config->projectCommonList['de'][1] = 'Iteration'; +$config->projectCommonList['de'][2] = 'Sprint'; + +$config->projectCommonList['fr'][0] = 'Project'; +$config->projectCommonList['fr'][1] = 'Iteration'; +$config->projectCommonList['fr'][2] = 'Sprint'; + +$config->projectCommonList['vi'][0] = 'Project'; +$config->projectCommonList['vi'][1] = 'Iteration'; +$config->projectCommonList['vi'][2] = 'Sprint'; + $config->executionCommonList['zh-cn'][0] = '迭代'; $config->executionCommonList['zh-cn'][1] = '冲刺'; $config->executionCommonList['zh-cn'][2] = '阶段'; diff --git a/framework/router.class.php b/framework/router.class.php index 29ee9dc018..ffc3561397 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -171,7 +171,7 @@ class router extends baseRouter $commonSettings = array(); try { - $commonSettings = $this->dbh->query('SELECT section, `key`, value FROM' . TABLE_CONFIG . "WHERE `owner`='system' AND `module`='custom' and `key` in ('sprintConcept', 'hourPoint', 'URSR')")->fetchAll(); + $commonSettings = $this->dbh->query('SELECT section, `key`, value FROM' . TABLE_CONFIG . "WHERE `owner`='system' AND (`module`='custom' or `module`='common') and `key` in ('sprintConcept', 'hourPoint', 'URSR', 'mode')")->fetchAll(); } catch (PDOException $exception) { @@ -180,6 +180,7 @@ class router extends baseRouter } $hourKey = $planKey = $URSR = 0; + $mode = 'new'; $projectKey = empty($this->config->isINT) ? ITERATION_KEY : SPRINT_KEY; foreach($commonSettings as $setting) @@ -187,8 +188,13 @@ class router extends baseRouter if($setting->key == 'sprintConcept') $projectKey = $setting->value; if($setting->key == 'hourPoint') $hourKey = $setting->value; if($setting->key == 'URSR') $URSR = $setting->value; + if($setting->key == 'mode' and $setting->section == 'global') $mode = $setting->value; } + /* Record system mode. */ + $config->systemMode = $mode; + if($config->systemMode == 'old') $this->config->executionCommonList = $this->config->projectCommonList; + /* Record hour unit. */ $config->hourUnit = 'H'; if($hourKey == STORYPOINT_KEY) $config->hourUnit = 'SP'; diff --git a/module/action/model.php b/module/action/model.php index 985dbe7e4a..7b006d6a6b 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -208,6 +208,7 @@ class actionModel extends model */ public function getList($objectType, $objectID) { + if($this->config->global->mode == 'old' and $objectType == 'execution') $objectType = 'project'; $commiters = $this->loadModel('user')->getCommiters(); $actions = $this->dao->select('*')->from(TABLE_ACTION) ->beginIF($objectType == 'project') diff --git a/module/block/control.php b/module/block/control.php index 7522f3e703..665b2212aa 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -609,7 +609,8 @@ class block extends control $this->session->set('bugList', $this->app->getURI(true)); if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die(); - $projectID = $this->view->block->module == 'my' ? 0 : (int)$this->session->PRJ; + $projectID = $this->lang->navGroup->qa == 'project' ? $this->session->PRJ : 0; + $projectID = $this->view->block->module == 'my' ? 0 : $projectID; $this->view->bugs = $this->loadModel('bug')->getUserBugs($this->app->user->account, $this->params->type, $this->params->orderBy, $this->viewType == 'json' ? 0 : (int)$this->params->count, null, $projectID); } @@ -625,6 +626,9 @@ class block extends control $this->app->loadLang('testcase'); $this->app->loadLang('testtask'); + $projectID = $this->lang->navGroup->qa == 'project' ? $this->session->PRJ : 0; + $projectID = $this->view->block->module == 'my' ? 0 : $projectID; + $cases = array(); if($this->params->type == 'assigntome') { @@ -636,7 +640,7 @@ class block extends control ->andWhere('t3.status')->ne('done') ->andWhere('t3.deleted')->eq(0) ->andWhere('t2.deleted')->eq(0) - ->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('t2.PRJ')->eq((int)$this->session->PRJ)->fi() + ->beginIF($projectID)->andWhere('t2.PRJ')->eq($projectID)->fi() ->orderBy($this->params->orderBy) ->beginIF($this->viewType != 'json')->limit((int)$this->params->count)->fi() ->fetchAll(); @@ -645,12 +649,12 @@ class block extends control { $cases = $this->dao->findByOpenedBy($this->app->user->account)->from(TABLE_CASE) ->andWhere('deleted')->eq(0) - ->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('PRJ')->eq((int)$this->session->PRJ)->fi() + ->beginIF($projectID)->andWhere('PRJ')->eq($projectID)->fi() ->orderBy($this->params->orderBy) ->beginIF($this->viewType != 'json')->limit((int)$this->params->count)->fi() ->fetchAll(); } - $this->view->cases = $cases; + $this->view->cases = $cases; } /** @@ -661,16 +665,21 @@ class block extends control */ public function printTesttaskBlock() { + $this->app->loadLang('testtask'); + $this->session->set('testtaskList', $this->app->getURI(true)); if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die(); - $this->app->loadLang('testtask'); + + $projectID = $this->lang->navGroup->qa == 'project' ? $this->session->PRJ : 0; + $projectID = $this->view->block->module == 'my' ? 0 : $projectID; + $this->view->testtasks = $this->dao->select('t1.*,t2.name as productName,t3.name as buildName,t4.name as projectName')->from(TABLE_TESTTASK)->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id') ->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build=t3.id') ->leftJoin(TABLE_PROJECT)->alias('t4')->on('t1.project=t4.id') ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t5')->on('t1.project=t5.project') ->where('t1.deleted')->eq('0') - ->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('t1.PRJ')->eq((int)$this->session->PRJ)->fi() + ->beginIF($projectID)->andWhere('t1.PRJ')->eq($projectID)->fi() ->beginIF(!$this->app->user->admin)->andWhere('t1.product')->in($this->app->user->view->products)->fi() ->andWhere('t1.product = t5.product') ->beginIF($this->params->type != 'all')->andWhere('t1.status')->eq($this->params->type)->fi() @@ -1474,19 +1483,19 @@ class block extends control $status = isset($this->params->type) ? $this->params->type : ''; $count = isset($this->params->count) ? (int)$this->params->count : 0; - $products = $this->loadModel('product')->getOrderedProducts($status, $count, $this->session->PRJ); - $productIdList = array_keys($products); - + $projectID = $this->lang->navGroup->qa == 'project' ? $this->session->PRJ : 0; + $products = $this->loadModel('product')->getOrderedProducts($status, $count, $projectID); if(empty($products)) { $this->view->products = $products; return false; } - $today = date(DT_DATE1); - $yesterday = date(DT_DATE1, strtotime('yesterday')); - $testtasks = $this->dao->select('*')->from(TABLE_TESTTASK)->where('product')->in($productIdList)->andWhere('project')->ne(0)->andWhere('deleted')->eq(0)->orderBy('id')->fetchAll('product'); - $bugs = $this->dao->select("product, count(id) as total, + $productIdList = array_keys($products); + $today = date(DT_DATE1); + $yesterday = date(DT_DATE1, strtotime('yesterday')); + $testtasks = $this->dao->select('*')->from(TABLE_TESTTASK)->where('product')->in($productIdList)->andWhere('project')->ne(0)->andWhere('deleted')->eq(0)->orderBy('id')->fetchAll('product'); + $bugs = $this->dao->select("product, count(id) as total, count(assignedTo = '{$this->app->user->account}' or null) as assignedToMe, count(status != 'closed' or null) as unclosed, count((status != 'closed' and status != 'resolved') or null) as unresolved, diff --git a/module/bug/control.php b/module/bug/control.php index 3e955b5d63..e37c108aec 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -11,7 +11,8 @@ */ class bug extends control { - public $products = array(); + public $products = array(); + public $projectID = 0; /** * Construct function, load some modules auto. @@ -32,7 +33,16 @@ class bug extends control $this->loadModel('story'); $this->loadModel('task'); - $this->view->products = $this->products = $this->product->getProductPairsByProject($this->session->PRJ); + /* Set bug menu group. */ + $this->projectID = isset($_GET['PRJ']) ? $_GET['PRJ'] : 0; + if(!$this->projectID) + { + $this->app->loadConfig('qa'); + foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; + $this->lang->noMenuModule[] = $this->app->rawModule; + } + + $this->view->products = $this->products = $this->product->getProductPairsByProject($this->projectID); if($this->session->PRJ and empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=bug"))); } diff --git a/module/bug/model.php b/module/bug/model.php index 406280e446..3bfa4fa363 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -48,6 +48,8 @@ class bugModel extends model $replace = $productID; common::setMenuVars($this->lang->bug->menu, $key, $replace); } + + if($this->lang->navGroup->bug == 'qa') $this->lang->qa->menu = $this->lang->bug->menu; } /** @@ -61,12 +63,12 @@ class bugModel extends model { $now = helper::now(); $bug = fixer::input('post') - ->setDefault('PRJ', $this->session->PRJ) ->setDefault('openedBy', $this->app->user->account) ->setDefault('openedDate', $now) ->setDefault('project,story,task', 0) ->setDefault('openedBuild', '') ->setDefault('deadline', '0000-00-00') + ->setIF($this->config->global->mode == 'new', 'PRJ', $this->session->PRJ) ->setIF(strpos($this->config->bug->create->requiredFields, 'deadline') !== false, 'deadline', $this->post->deadline) ->setIF($this->post->assignedTo != '', 'assignedDate', $now) ->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story)) @@ -228,7 +230,7 @@ class bugModel extends model } } - $bug->PRJ = $this->session->PRJ; + if($this->config->global->mode == 'new') $bug->PRJ = $this->session->PRJ; $this->dao->insert(TABLE_BUG)->data($bug) ->autoCheck() ->batchCheck($this->config->bug->create->requiredFields, 'notempty') diff --git a/module/caselib/control.php b/module/caselib/control.php index 5f842dcc3a..c2ff20a916 100644 --- a/module/caselib/control.php +++ b/module/caselib/control.php @@ -13,6 +13,21 @@ class caselib extends control { public $products = array(); + public function __construct($moduleName = '', $methodName = '') + { + parent::__construct($moduleName, $methodName); + + /* Set testtask menu group. */ + $this->projectID = isset($_GET['PRJ']) ? $_GET['PRJ'] : 0; + if(!$this->projectID) + { + $this->app->loadConfig('qa'); + foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; + $this->lang->noMenuModule[] = $this->app->rawModule; + } + } + + /** * Index page, header to browse. * diff --git a/module/caselib/model.php b/module/caselib/model.php index fc6db0159c..692d10ab64 100644 --- a/module/caselib/model.php +++ b/module/caselib/model.php @@ -104,7 +104,9 @@ class caselibModel extends model $replace = $libID; common::setMenuVars($this->lang->caselib->menu, $key, $replace); } + if($this->config->global->flow != 'full' && $this->app->getMethodName() != 'view') $this->lang->caselib->menu->bysearch = " {$this->lang->testcase->bySearch}"; + if($this->lang->navGroup->caselib == 'qa') $this->lang->qa->menu = $this->lang->caselib->menu; } /** @@ -217,7 +219,7 @@ class caselibModel extends model $lib = fixer::input('post') ->stripTags($this->config->caselib->editor->create['id'], $this->config->allowedTags) ->setForce('type', 'library') - ->add('PRJ', $this->session->PRJ) + ->setIF($this->config->global->mode == 'new', 'PRJ', $this->session->PRJ) ->add('addedBy', $this->app->user->account) ->add('addedDate', helper::now()) ->remove('uid') @@ -610,7 +612,7 @@ class caselibModel extends model $data[$i]->openedDate = $now; $data[$i]->status = $forceNotReview ? 'normal' : 'wait'; $data[$i]->version = 1; - $data[$i]->PRJ = $this->session->PRJ; + if($this->config->global->mode == 'new') $data[$i]->PRJ = $this->session->PRJ; $this->dao->insert(TABLE_CASE)->data($data[$i]) ->autoCheck() diff --git a/module/common/lang/de.php b/module/common/lang/de.php index f6cda578b1..23e55ae0fc 100644 --- a/module/common/lang/de.php +++ b/module/common/lang/de.php @@ -141,7 +141,6 @@ list($projectModule, $projectMethod) = explode('-', $config->projectLink); /* Main menu. */ $lang->mainNav = new stdclass(); $lang->mainNav->my = ' My|my|index|'; -$lang->mainNav->program = ' Program|program|pgmbrowse|'; $lang->mainNav->product = ' Product|product|index|'; $lang->mainNav->project = ' Project|program|prjbrowse|'; $lang->mainNav->qa = ' Test|qa|index|'; @@ -150,6 +149,7 @@ $lang->mainNav->doc = ' Doc|doc|index|'; $lang->mainNav->report = " Statistic|report|productsummary|"; $lang->mainNav->system = ' System|custom|estimate|'; $lang->mainNav->admin = ' Admin|admin|index|'; +if($config->systemMode == 'new') $lang->mainNav->program = ' Program|program|pgmbrowse|'; $lang->reporting = new stdclass(); $lang->dividerMenu = ',qa,report,admin,'; @@ -294,8 +294,15 @@ $lang->my->menu = new stdclass(); $lang->my->menu->index = 'Index|my|index'; $lang->my->menu->calendar = array('link' => 'Calendar|my|calendar|', 'subModule' => 'todo', 'alias' => 'todo'); $lang->my->menu->myWork = array('link' => 'Work|my|work|mode=task'); -$lang->my->menu->myProject = array('link' => 'Project|my|project|'); -$lang->my->menu->myExecution = 'Execution|my|execution|type=undone'; +if($config->systemMode == 'new') +{ + $lang->my->menu->myProject = array('link' => 'Project|my|project|'); + $lang->my->menu->myExecution = 'Execution|my|execution|type=undone'; +} +else +{ + $lang->my->menu->myExecution = $lang->executionCommon . '|my|execution|type=undone'; +} $lang->my->menu->contribute = array('link' => 'Contribute|my|contribute|mode=task'); $lang->my->menu->dynamic = 'Dynamic|my|dynamic|'; $lang->my->menu->score = 'Score|my|score|'; @@ -309,8 +316,11 @@ $lang->my->workMenu->story = "$lang->SRCommon|my|work|mode=story"; $lang->my->workMenu->bug = 'Bug|my|work|mode=bug'; $lang->my->workMenu->testcase = 'Test Case|my|work|mode=testcase&type=assigntome'; $lang->my->workMenu->testtask = 'Test Task|my|work|mode=testtask&type=wait'; -$lang->my->workMenu->issue = 'Issue|my|work|mode=issue'; -$lang->my->workMenu->risk = 'Risk|my|work|mode=risk'; +if($config->systemMode == 'new') +{ + $lang->my->workMenu->issue = 'Issue|my|work|mode=issue'; + $lang->my->workMenu->risk = 'Risk|my|work|mode=risk'; +} $lang->my->contributeMenu = new stdclass(); $lang->my->contributeMenu->task = 'Task|my|contribute|mode=task'; @@ -319,8 +329,11 @@ $lang->my->contributeMenu->story = "$lang->SRCommon|my|contribute|mode=sto $lang->my->contributeMenu->bug = 'Bug|my|contribute|mode=bug'; $lang->my->contributeMenu->testcase = 'Test Case|my|contribute|mode=testtask&type=openedbyme'; $lang->my->contributeMenu->testtask = 'Test Task|my|contribute|mode=testtask&type=done'; -$lang->my->contributeMenu->issue = 'Issue|my|contribute|mode=issue'; -$lang->my->contributeMenu->risk = 'Risk|my|contribute|mode=risk'; +if($config->systemMode == 'new') +{ + $lang->my->contributeMenu->issue = 'Issue|my|contribute|mode=issue'; + $lang->my->contributeMenu->risk = 'Risk|my|contribute|mode=risk'; +} $lang->my->dividerMenu = ',myProject,team,'; @@ -1026,5 +1039,10 @@ $lang->design->menu->bysearch = array('link' => ' My|my|index|'; -$lang->mainNav->program = ' Program|program|pgmbrowse|'; $lang->mainNav->product = ' Product|product|index|'; $lang->mainNav->project = ' Project|program|prjbrowse|'; $lang->mainNav->qa = ' Test|qa|index|'; @@ -150,6 +149,7 @@ $lang->mainNav->doc = ' Doc|doc|index|'; $lang->mainNav->report = " Statistic|report|productsummary|"; $lang->mainNav->system = ' System|custom|estimate|'; $lang->mainNav->admin = ' Admin|admin|index|'; +if($config->systemMode == 'new') $lang->mainNav->program = ' Program|program|pgmbrowse|'; $lang->reporting = new stdclass(); $lang->dividerMenu = ',qa,report,admin,'; @@ -294,8 +294,15 @@ $lang->my->menu = new stdclass(); $lang->my->menu->index = 'Index|my|index'; $lang->my->menu->calendar = array('link' => 'Calendar|my|calendar|', 'subModule' => 'todo', 'alias' => 'todo'); $lang->my->menu->myWork = array('link' => 'Work|my|work|mode=task'); -$lang->my->menu->myProject = array('link' => 'Project|my|project|'); -$lang->my->menu->myExecution = 'Execution|my|execution|type=undone'; +if($config->systemMode == 'new') +{ + $lang->my->menu->myProject = array('link' => 'Project|my|project|'); + $lang->my->menu->myExecution = 'Execution|my|execution|type=undone'; +} +else +{ + $lang->my->menu->myExecution = $lang->executionCommon . '|my|execution|type=undone'; +} $lang->my->menu->contribute = array('link' => 'Contribute|my|contribute|mode=task'); $lang->my->menu->dynamic = 'Dynamic|my|dynamic|'; $lang->my->menu->score = 'Score|my|score|'; @@ -309,8 +316,11 @@ $lang->my->workMenu->story = "$lang->SRCommon|my|work|mode=story"; $lang->my->workMenu->bug = 'Bug|my|work|mode=bug'; $lang->my->workMenu->testcase = 'Test Case|my|work|mode=testcase&type=assigntome'; $lang->my->workMenu->testtask = 'Test Task|my|work|mode=testtask&type=wait'; -$lang->my->workMenu->issue = 'Issue|my|work|mode=issue'; -$lang->my->workMenu->risk = 'Risk|my|work|mode=risk'; +if($config->systemMode == 'new') +{ + $lang->my->workMenu->issue = 'Issue|my|work|mode=issue'; + $lang->my->workMenu->risk = 'Risk|my|work|mode=risk'; +} $lang->my->contributeMenu = new stdclass(); $lang->my->contributeMenu->task = 'Task|my|contribute|mode=task'; @@ -319,8 +329,11 @@ $lang->my->contributeMenu->story = "$lang->SRCommon|my|contribute|mode=sto $lang->my->contributeMenu->bug = 'Bug|my|contribute|mode=bug'; $lang->my->contributeMenu->testcase = 'Test Case|my|contribute|mode=testtask&type=openedbyme'; $lang->my->contributeMenu->testtask = 'Test Task|my|contribute|mode=testtask&type=done'; -$lang->my->contributeMenu->issue = 'Issue|my|contribute|mode=issue'; -$lang->my->contributeMenu->risk = 'Risk|my|contribute|mode=risk'; +if($config->systemMode == 'new') +{ + $lang->my->contributeMenu->issue = 'Issue|my|contribute|mode=issue'; + $lang->my->contributeMenu->risk = 'Risk|my|contribute|mode=risk'; +} $lang->my->dividerMenu = ',myProject,team,'; @@ -1026,5 +1039,10 @@ $lang->design->menu->bysearch = array('link' => ' My|my|index|'; -$lang->mainNav->program = ' Program|program|pgmbrowse|'; $lang->mainNav->product = ' Product|product|index|'; $lang->mainNav->project = ' Project|program|prjbrowse|'; $lang->mainNav->qa = ' Test|qa|index|'; @@ -150,6 +149,7 @@ $lang->mainNav->report = " Statistic|report| $lang->mainNav->doc = ' Doc|doc|index|'; $lang->mainNav->system = ' System|custom|estimate|'; $lang->mainNav->admin = ' Admin|admin|index|'; +if($config->systemMode == 'new') $lang->mainNav->program = ' Program|program|pgmbrowse|'; $lang->reporting = new stdclass(); $lang->dividerMenu = ',qa,report,admin,'; @@ -294,8 +294,15 @@ $lang->my->menu = new stdclass(); $lang->my->menu->index = 'Index|my|index'; $lang->my->menu->calendar = array('link' => 'Calendar|my|calendar|', 'subModule' => 'todo', 'alias' => 'todo'); $lang->my->menu->myWork = array('link' => 'Work|my|work|mode=task'); -$lang->my->menu->myProject = array('link' => 'Project|my|project|'); -$lang->my->menu->myExecution = 'Execution|my|execution|type=undone'; +if($config->systemMode == 'new') +{ + $lang->my->menu->myProject = array('link' => 'Project|my|project|'); + $lang->my->menu->myExecution = 'Execution|my|execution|type=undone'; +} +else +{ + $lang->my->menu->myExecution = $lang->executionCommon . '|my|execution|type=undone'; +} $lang->my->menu->contribute = array('link' => 'Contribute|my|contribute|mode=task'); $lang->my->menu->dynamic = 'Dynamic|my|dynamic|'; $lang->my->menu->score = 'Score|my|score|'; @@ -309,8 +316,11 @@ $lang->my->workMenu->story = "$lang->SRCommon|my|work|mode=story"; $lang->my->workMenu->bug = 'Bug|my|work|mode=bug'; $lang->my->workMenu->testcase = 'Test Case|my|work|mode=testcase&type=assigntome'; $lang->my->workMenu->testtask = 'Test Task|my|work|mode=testtask&type=wait'; -$lang->my->workMenu->issue = 'Issue|my|work|mode=issue'; -$lang->my->workMenu->risk = 'Risk|my|work|mode=risk'; +if($config->systemMode == 'new') +{ + $lang->my->workMenu->issue = 'Issue|my|work|mode=issue'; + $lang->my->workMenu->risk = 'Risk|my|work|mode=risk'; +} $lang->my->contributeMenu = new stdclass(); $lang->my->contributeMenu->task = 'Task|my|contribute|mode=task'; @@ -319,8 +329,11 @@ $lang->my->contributeMenu->story = "$lang->SRCommon|my|contribute|mode=sto $lang->my->contributeMenu->bug = 'Bug|my|contribute|mode=bug'; $lang->my->contributeMenu->testcase = 'Test Case|my|contribute|mode=testtask&type=openedbyme'; $lang->my->contributeMenu->testtask = 'Test Task|my|contribute|mode=testtask&type=done'; -$lang->my->contributeMenu->issue = 'Issue|my|contribute|mode=issue'; -$lang->my->contributeMenu->risk = 'Risk|my|contribute|mode=risk'; +if($config->systemMode == 'new') +{ + $lang->my->contributeMenu->issue = 'Issue|my|contribute|mode=issue'; + $lang->my->contributeMenu->risk = 'Risk|my|contribute|mode=risk'; +} $lang->my->dividerMenu = ',myProject,team,'; @@ -1026,5 +1039,10 @@ $lang->design->menu->bysearch = array('link' => ' My|my|index|'; -$lang->mainNav->program = ' Program|program|pgmbrowse|'; $lang->mainNav->product = ' Product|product|index|'; $lang->mainNav->project = ' Project|program|prjbrowse|'; $lang->mainNav->qa = ' Test|qa|index|'; @@ -150,6 +149,7 @@ $lang->mainNav->doc = ' Doc|doc|index|'; $lang->mainNav->report = " Statistic|report|productsummary|"; $lang->mainNav->system = ' System|custom|estimate|'; $lang->mainNav->admin = ' Admin|admin|index|'; +if($config->systemMode == 'new') $lang->mainNav->program = ' Program|program|pgmbrowse|'; $lang->reporting = new stdclass(); $lang->dividerMenu = ',qa,report,admin,'; @@ -294,8 +294,15 @@ $lang->my->menu = new stdclass(); $lang->my->menu->index = 'Index|my|index'; $lang->my->menu->calendar = array('link' => 'Calendar|my|calendar|', 'subModule' => 'todo', 'alias' => 'todo'); $lang->my->menu->myWork = array('link' => 'Work|my|work|mode=task'); -$lang->my->menu->myProject = array('link' => 'Project|my|project|'); -$lang->my->menu->myExecution = 'Execution|my|execution|type=undone'; +if($config->systemMode == 'new') +{ + $lang->my->menu->myProject = array('link' => 'Project|my|project|'); + $lang->my->menu->myExecution = 'Execution|my|execution|type=undone'; +} +else +{ + $lang->my->menu->myExecution = $lang->executionCommon . '|my|execution|type=undone'; +} $lang->my->menu->contribute = array('link' => 'Contribute|my|contribute|mode=task'); $lang->my->menu->dynamic = 'Dynamic|my|dynamic|'; $lang->my->menu->score = 'Score|my|score|'; @@ -309,8 +316,11 @@ $lang->my->workMenu->story = "$lang->SRCommon|my|work|mode=story"; $lang->my->workMenu->bug = 'Bug|my|work|mode=bug'; $lang->my->workMenu->testcase = 'Test Case|my|work|mode=testcase&type=assigntome'; $lang->my->workMenu->testtask = 'Test Task|my|work|mode=testtask&type=wait'; -$lang->my->workMenu->issue = 'Issue|my|work|mode=issue'; -$lang->my->workMenu->risk = 'Risk|my|work|mode=risk'; +if($config->systemMode == 'new') +{ + $lang->my->workMenu->issue = 'Issue|my|work|mode=issue'; + $lang->my->workMenu->risk = 'Risk|my|work|mode=risk'; +} $lang->my->contributeMenu = new stdclass(); $lang->my->contributeMenu->task = 'Task|my|contribute|mode=task'; @@ -319,8 +329,11 @@ $lang->my->contributeMenu->story = "$lang->SRCommon|my|contribute|mode=sto $lang->my->contributeMenu->bug = 'Bug|my|contribute|mode=bug'; $lang->my->contributeMenu->testcase = 'Test Case|my|contribute|mode=testtask&type=openedbyme'; $lang->my->contributeMenu->testtask = 'Test Task|my|contribute|mode=testtask&type=done'; -$lang->my->contributeMenu->issue = 'Issue|my|contribute|mode=issue'; -$lang->my->contributeMenu->risk = 'Risk|my|contribute|mode=risk'; +if($config->systemMode == 'new') +{ + $lang->my->contributeMenu->issue = 'Issue|my|contribute|mode=issue'; + $lang->my->contributeMenu->risk = 'Risk|my|contribute|mode=risk'; +} $lang->my->dividerMenu = ',myProject,team,'; @@ -1026,5 +1039,10 @@ $lang->design->menu->bysearch = array('link' => ' 地盘|my|index|'; -$lang->mainNav->program = " 项目集|$programModule|$programMethod|"; $lang->mainNav->product = " 产品|$productModule|$productMethod|"; $lang->mainNav->project = " 项目|$projectModule|$projectMethod|"; $lang->mainNav->qa = ' 测试|qa|index|'; @@ -150,6 +149,7 @@ $lang->mainNav->doc = ' 文档|doc|index|'; $lang->mainNav->report = " 统计|report|productSummary|"; $lang->mainNav->system = ' 组织|subject|browse|'; $lang->mainNav->admin = ' 后台|admin|index|'; +if($config->systemMode == 'new') $lang->mainNav->program = " 项目集|$programModule|$programMethod|"; $lang->dividerMenu = ',qa,report,admin,'; @@ -293,8 +293,15 @@ $lang->my->menu = new stdclass(); $lang->my->menu->index = '首页|my|index'; $lang->my->menu->calendar = array('link' => '日程|my|calendar|', 'subModule' => 'todo', 'alias' => 'todo'); $lang->my->menu->myWork = array('link' => '待处理|my|work|mode=task'); -$lang->my->menu->myProject = array('link' => '项目|my|project|'); -$lang->my->menu->myExecution = '执行|my|execution|type=undone'; +if($config->systemMode == 'new') +{ + $lang->my->menu->myProject = array('link' => '项目|my|project|'); + $lang->my->menu->myExecution = '执行|my|execution|type=undone'; +} +else +{ + $lang->my->menu->myExecution = $lang->executionCommon . '|my|execution|type=undone'; +} $lang->my->menu->contribute = array('link' => '贡献|my|contribute|mode=task'); $lang->my->menu->dynamic = '动态|my|dynamic|'; $lang->my->menu->score = array('link' => '积分|my|score|', 'subModule' => 'score'); @@ -308,8 +315,11 @@ $lang->my->workMenu->story = "$lang->SRCommon|my|work|mode=story"; $lang->my->workMenu->bug = 'Bug|my|work|mode=bug'; $lang->my->workMenu->testcase = '用例|my|work|mode=testcase&type=assigntome'; $lang->my->workMenu->testtask = '测试单|my|work|mode=testtask&type=wait'; -$lang->my->workMenu->issue = '问题|my|work|mode=issue'; -$lang->my->workMenu->risk = '风险|my|work|mode=risk'; +if($config->systemMode == 'new') +{ + $lang->my->workMenu->issue = '问题|my|work|mode=issue'; + $lang->my->workMenu->risk = '风险|my|work|mode=risk'; +} $lang->my->contributeMenu = new stdclass(); $lang->my->contributeMenu->task = '任务|my|contribute|mode=task'; @@ -318,8 +328,11 @@ $lang->my->contributeMenu->story = "$lang->SRCommon|my|contribute|mode=sto $lang->my->contributeMenu->bug = 'Bug|my|contribute|mode=bug'; $lang->my->contributeMenu->testcase = '用例|my|contribute|mode=testcase&type=openedbyme'; $lang->my->contributeMenu->testtask = '测试单|my|contribute|mode=testtask&type=done'; -$lang->my->contributeMenu->issue = '问题|my|contribute|mode=issue'; -$lang->my->contributeMenu->risk = '风险|my|contribute|mode=risk'; +if($config->systemMode == 'new') +{ + $lang->my->contributeMenu->issue = '问题|my|contribute|mode=issue'; + $lang->my->contributeMenu->risk = '风险|my|contribute|mode=risk'; +} $lang->my->dividerMenu = ',myProject,team,'; @@ -403,7 +416,7 @@ $lang->qa->menu->caselib = array('link' => '用例库|caselib|browse', 'alias' $lang->qa->subMenu = new stdclass(); $lang->qa->subMenu->testcase = new stdclass(); $lang->qa->subMenu->testcase->feature = array('link' => '功能测试|testcase|browse|productID=%s', 'alias' => 'view,create,batchcreate,edit,batchedit,showimport,groupcase,importfromlib', 'subModule' => 'tree,story'); -$lang->qa->subMenu->testcase->unit = array('link' => '单元测试|testtask|browseUnits|productID=%s'); +$lang->qa->subMenu->testcase->unit = array('link' => '单元测试|testtask|browseUnits|productID=%s', 'alias' => 'browseunits'); $lang->bug = new stdclass(); $lang->bug->menu = new stdclass(); @@ -1024,5 +1037,10 @@ $lang->design->menu->bysearch = array('link' => 'fetch(); if(empty($program)) return; diff --git a/module/common/view/header.html.php b/module/common/view/header.html.php index de01ee312e..aa043be7b2 100755 --- a/module/common/view/header.html.php +++ b/module/common/view/header.html.php @@ -18,16 +18,22 @@ $isReport = $rawModule == 'report';
+ product->switcherMenu) ? $lang->product->switcherMenu : '';?> + config->global->mode == 'new'):?> program->switcherMenu) ? $lang->program->switcherMenu : '';?> loadModel('program')->getPRJSwitcher($this->session->PRJ, $app->rawModule, $app->rawMethod);?> - product->switcherMenu) ? $lang->product->switcherMenu : '';?> + config->global->mode == 'old'):?> + project->switcherMenu) ? $lang->project->switcherMenu : '';;?> +
+ config->global->mode == 'new'):?> program->mainMenuAction) ? $lang->program->mainMenuAction : '';?> loadModel('program')->getPRJMainAction($app->rawModule, $app->rawMethod);?> product->mainMenuAction) ? $lang->product->mainMenuAction : '';?> report->mainMenuAction) ? $lang->report->mainMenuAction : '';?> +
diff --git a/module/doc/control.php b/module/doc/control.php index 42675cb466..fd4c05d90b 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -125,6 +125,7 @@ class doc extends control $this->lang->navGroup->doc = 'project'; $this->lang->doc->menu = $this->lang->project->menu; $this->lang->doc->menuOrder = $this->lang->project->menuOrder; + if($this->config->global->mode == 'old') $this->lang->noMenuModule[] = 'doc'; $this->project->setMenu($this->project->getExecutionsByProject($this->session->PRJ, 'all', 0, true), $lib->project); $this->lang->set('menugroup.doc', 'project'); } @@ -361,6 +362,7 @@ class doc extends control $this->lang->navGroup->doc = 'project'; $this->lang->doc->menu = $this->lang->project->menu; $this->lang->doc->menuOrder = $this->lang->project->menuOrder; + if($this->config->global->mode == 'old') $this->lang->noMenuModule[] = 'doc'; $this->project->setMenu($this->project->getExecutionsByProject($this->session->PRJ, 'all', 0, true), $lib->project); $this->lang->set('menugroup.doc', 'project'); @@ -447,6 +449,7 @@ class doc extends control $this->lang->navGroup->doc = 'project'; $this->lang->doc->menu = $this->lang->project->menu; $this->lang->doc->menuOrder = $this->lang->project->menuOrder; + if($this->config->global->mode == 'old') $this->lang->noMenuModule[] = 'doc'; $this->project->setMenu($this->project->getExecutionsByProject($this->session->PRJ, 'all', 0, true), $objectID); $this->lang->set('menugroup.doc', 'project'); } @@ -512,6 +515,7 @@ class doc extends control $this->lang->navGroup->doc = 'project'; $this->lang->doc->menu = $this->lang->project->menu; $this->lang->doc->menuOrder = $this->lang->project->menuOrder; + if($this->config->global->mode == 'old') $this->lang->noMenuModule[] = 'doc'; $this->project->setMenu($this->project->getExecutionsByProject($this->session->PRJ, 'all', 0, true), $objectID); $this->lang->set('menugroup.doc', 'project'); } @@ -841,6 +845,7 @@ class doc extends control $this->lang->navGroup->doc = 'project'; $this->lang->doc->menu = $this->lang->project->menu; $this->lang->doc->menuOrder = $this->lang->project->menuOrder; + if($this->config->global->mode == 'old') $this->lang->noMenuModule[] = 'doc'; $this->project->setMenu($this->project->getExecutionsByProject($this->session->PRJ, 'all', 0, true), $objectID); $this->lang->set('menugroup.doc', 'project'); } @@ -940,6 +945,7 @@ class doc extends control $this->lang->navGroup->doc = 'project'; $this->lang->doc->menu = $this->lang->project->menu; $this->lang->doc->menuOrder = $this->lang->project->menuOrder; + if($this->config->global->mode == 'old') $this->lang->noMenuModule[] = 'doc'; $this->project->setMenu($this->project->getExecutionsByProject($this->session->PRJ, 'all', 0, true), $objectID); $this->lang->set('menugroup.doc', 'project'); } diff --git a/module/index/js/index.js b/module/index/js/index.js index 6bf44ae6ed..74c627256f 100644 --- a/module/index/js/index.js +++ b/module/index/js/index.js @@ -79,7 +79,10 @@ { return 'system'; } - + if(['caselib', 'testreport', 'testsuite', 'testtask', 'testcase', 'bug', 'qa'].includes(moduleName)) + { + return link.prj ? 'project' : 'qa'; + } if(moduleName === 'report') { if(['usereport', 'editreport', 'deletereport', 'custom'].includes(methodLowerCase) && link.params.from) diff --git a/module/my/view/preference.html.php b/module/my/view/preference.html.php index a8ac2c580b..941204ac93 100755 --- a/module/my/view/preference.html.php +++ b/module/my/view/preference.html.php @@ -39,10 +39,12 @@ html,body {height: 100%;} my->storyConcept;?> + config->global->mode == 'new'):?> my->programLink;?> my->programLinkList, $programLink, "class='form-control chosen'");?> + my->productLink;?> my->productLinkList, $productLink, "class='form-control chosen'");?> diff --git a/module/personnel/view/putinto.html.php b/module/personnel/view/putinto.html.php index 74ff77e190..5158510330 100644 --- a/module/personnel/view/putinto.html.php +++ b/module/personnel/view/putinto.html.php @@ -21,16 +21,16 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/module/product/config.php b/module/product/config.php index 4181e48150..97935c7ffa 100644 --- a/module/product/config.php +++ b/module/product/config.php @@ -83,8 +83,13 @@ $config->product->search['params']['lastEditedDate'] = array('operator' => '=', $config->product->create = new stdclass(); $config->product->edit = new stdclass(); -$config->product->create->requiredFields = 'name,program'; -$config->product->edit->requiredFields = 'name,program'; +$config->product->create->requiredFields = 'name'; +$config->product->edit->requiredFields = 'name'; +if($config->global->mode == 'new') +{ + $config->product->create->requiredFields .= ',program'; + $config->product->edit->requiredFields .= ',program'; +} $config->product->editor = new stdclass(); $config->product->editor->create = array('id' => 'desc', 'tools' => 'simpleTools'); diff --git a/module/product/control.php b/module/product/control.php index e9d4d82462..f929a4c248 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -333,6 +333,7 @@ class product extends control $this->view->rdUsers = $rdUsers; $this->view->users = $this->user->getPairs('nodeleted|noclosed'); $this->view->programs = array('') + $this->loadModel('program')->getTopPGMPairs('', 'noclosed'); + $this->view->lines = $this->config->global->mode == 'new' ? array() : array('' => '') + $this->product->getLinePairs(); $this->view->URSRPairs = $this->loadModel('custom')->getURSRPairs(); unset($this->lang->product->typeList['']); @@ -467,6 +468,10 @@ class product extends control $rdUsers = $this->user->getPairs('nodeleted|devfirst', $product->RD, $this->config->maxCount); if(!empty($this->config->user->moreLink)) $this->config->moreLinks["RD"] = $this->config->user->moreLink; + $lines = array(); + if($product->program) $lines = array('') + $this->product->getLinePairs($product->program); + if($this->config->global->mode == 'old') $lines = array('') + $this->product->getLinePairs(); + $this->view->title = $this->lang->product->edit . $this->lang->colon . $product->name; $this->view->position[] = html::a($this->createLink($this->moduleName, 'browse'), $product->name); $this->view->position[] = $this->lang->product->edit; @@ -480,7 +485,7 @@ class product extends control $this->view->rdUsers = $rdUsers; $this->view->users = $this->user->getPairs('nodeleted|noclosed'); $this->view->programs = array('') + $this->loadModel('program')->getTopPGMPairs(); - $this->view->lines = $product->program ? array('') + $this->product->getLinePairs($product->program) : array(); + $this->view->lines = $lines; $this->view->URSRPairs = $this->loadModel('custom')->getURSRPairs(); $this->view->canChangePGM = $canChangePGM; $this->view->singleLinkProjects = $singleLinkProjects; diff --git a/module/product/model.php b/module/product/model.php index 70ec4b0f19..ab012d7a34 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -328,8 +328,8 @@ class productModel extends model ->leftJoin(TABLE_PRODUCT)->alias('t2') ->on('t1.product = t2.id') ->where('t2.deleted')->eq(0) - ->andWhere('t2.id')->in($this->app->user->view->products) - ->beginIF($projectID)->andWhere('t1.project')->eq($projectID)->fi() + ->beginIF(!empty($projectID))->andWhere('t1.project')->eq($projectID)->fi() + ->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->products)->fi() ->beginIF(strpos($status, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi() ->orderBy('t2.order desc') ->fetchAll('id'); diff --git a/module/product/view/all.html.php b/module/product/view/all.html.php index f3e08c9b3b..e9dbdfce47 100644 --- a/module/product/view/all.html.php +++ b/module/product/view/all.html.php @@ -80,9 +80,18 @@ $line):?> config->global->mode == 'new') + { + $trAttrs = "data-id='line.$lineID' data-parent='program.$programID'"; + $trClass .= ' is-nest-child table-nest'; + $trAttrs .= " data-nest-parent='program.$programID' data-nest-path='program.$programID,$lineID'"; + } + else + { + $trAttrs = "data-id='line.$lineID' data-parent='0' data-nested='true'"; + $trClass = 'is-top-level table-nest-child'; + $trAttrs .= " class='$trClass'"; + } ?> >
personnel->name;?>personnel->role;?>personnel->projects;?>personnel->executions;?>personnel->workingHours;?>personnel->task;?>personnel->bug;?>personnel->createStories;?>personnel->issue;?>personnel->risk;?> personnel->name;?> personnel->role;?> personnel->projects;?> personnel->executions;?> personnel->workingHours;?> personnel->task;?> personnel->bug;?>personnel->createStories;?> personnel->issue;?> personnel->risk;?>
personnel->putInto;?>
diff --git a/module/product/view/create.html.php b/module/product/view/create.html.php index abbdb91279..d09c54ffd3 100644 --- a/module/product/view/create.html.php +++ b/module/product/view/create.html.php @@ -21,13 +21,15 @@
+ config->global->mode == 'new'):?> - + + - + diff --git a/module/product/view/edit.html.php b/module/product/view/edit.html.php index cf2ff439d4..1c31b82941 100644 --- a/module/product/view/edit.html.php +++ b/module/product/view/edit.html.php @@ -32,10 +32,12 @@
program->PGMCommon;?>
product->line;?>
product->name;?>
+ config->global->mode == 'new'):?> + diff --git a/module/product/view/manageline.html.php b/module/product/view/manageline.html.php index 42c6edd274..47e21e121f 100644 --- a/module/product/view/manageline.html.php +++ b/module/product/view/manageline.html.php @@ -44,21 +44,27 @@
product->lineName;?>
+ config->global->mode == 'new'):?>
product->program;?>
+
id]", $line->name, 'class="form-control"');?>
+ config->global->mode == 'new'):?>
id]", $programs, $line->root, "class='form-control chosen'");?>
+
+ config->global->mode == 'new'):?>
+
@@ -69,7 +75,9 @@
+ config->global->mode == 'new'):?>
+
diff --git a/module/program/model.php b/module/program/model.php index 40413305c3..dd91e5e1b9 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -924,7 +924,8 @@ class programModel extends model } $projectList = $this->dao->select('*')->from(TABLE_PROJECT) - ->where('type')->eq('project') + ->where('deleted')->eq('0') + ->beginIF($this->config->global->mode == 'new')->andWhere('type')->eq('project')->fi() ->beginIF($browseType != 'all')->andWhere('status')->eq($browseType)->fi() ->beginIF($path)->andWhere('path')->like($path . '%')->fi() ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi() @@ -933,13 +934,12 @@ class programModel extends model ->orWhere('PM')->eq($this->app->user->account) ->markRight(1) ->fi() - ->andWhere('deleted')->eq('0') ->orderBy($orderBy) ->page($pager) ->fetchAll('id'); /* Determine how to display the name of the program. */ - if($programTitle) + if($programTitle and $this->config->global->mode == 'new') { $programList = $this->getPGMPairs(); foreach($projectList as $id => $project) @@ -1841,7 +1841,7 @@ class programModel extends model { $canOrder = common::hasPriv('program', 'PRJOrderUpdate'); $canBatchEdit = common::hasPriv('program', 'PRJBatchEdit'); - $projectLink = helper::createLink('program', 'index', "projectID=$project->id", '', '', $project->id); + $projectLink = $this->config->global->mode == 'new' ? helper::createLink('program', 'index', "projectID=$project->id", '', '', $project->id) : helper::createLink('project', 'task', "projectID=$project->id"); $account = $this->app->user->account; $id = $col->id; @@ -1957,16 +1957,16 @@ class programModel extends model $from = $project->from == 'PRJ' ? 'PRJ' : 'pgmproject'; $openModule = $project->from == 'PRJ' ? 'project' : 'program'; common::printIcon('program', 'PRJEdit', "projectID=$project->id&from=$from", $project, 'list', 'edit', '', '', '', "data-group=$openModule", '', $project->id); - common::printIcon('program', 'PRJManageMembers', "projectID=$project->id", $project, 'list', 'group', '', '', '', '', '', $project->id); - common::printIcon('program', 'PRJGroup', "projectID=$project->id&programID=$programID", $project, 'list', 'lock', '', '', '', '', '', $project->id); + common::printIcon('program', 'PRJManageMembers', "projectID=$project->id", $project, 'list', 'group', '', '', '', '', $this->lang->project->team, $project->id); + if($this->config->global->mode == 'new') common::printIcon('program', 'PRJGroup', "projectID=$project->id&programID=$programID", $project, 'list', 'lock', '', '', '', '', '', $project->id); if(common::hasPriv('program','PRJManageProducts') || common::hasPriv('program','PRJWhitelist') || common::hasPriv('program','PRJDelete')) { echo "
"; echo ""; echo ""; echo "
"; diff --git a/module/program/view/prjbrowse.html.php b/module/program/view/prjbrowse.html.php index 6b70341343..d704327ac7 100644 --- a/module/program/view/prjbrowse.html.php +++ b/module/program/view/prjbrowse.html.php @@ -17,12 +17,14 @@ js::set('programID', $programID); js::set('browseType', $browseType); ?>
+ config->global->mode == 'new'):?>
+

program->noPRJ;?> + config->global->mode == 'new'):?> ' . $lang->program->PRJCreate, '', 'class="btn btn-info btn-wide " data-toggle="modal" data-target="#guideDialog"');?> + + ' . $lang->program->PRJCreate, '', 'class="btn btn-info btn-wide"');?> +

@@ -64,7 +76,7 @@ js::set('browseType', $browseType); $setting = $this->datatable->getSetting('program'); ?>
product->program;?> program, "class='form-control chosen'");?>
product->line;?> line, "class='form-control chosen'");?>
- + config->global->mode == 'new' ? common::hasPriv('program', 'PRJBatchEdit') : common::hasPriv('project', 'batchEdit');?> createLink('program', 'PRJBatchEdit', 'from=prjbrowse'); + $actionLink = $this->config->global->mode == 'new' ? $this->createLink('program', 'PRJBatchEdit', 'from=prjbrowse') : $this->createLink('project', 'batchEdit'); $misc = "data-form-action='$actionLink'"; echo html::commonButton($lang->edit, $misc); } diff --git a/module/project/control.php b/module/project/control.php index 2d28c0e106..65f0f4a447 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -113,9 +113,12 @@ class project extends control public function task($executionID = 0, $status = 'unclosed', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 100, $pageID = 1) { /* Save last PRJ. */ - $projectID = $this->loadModel('program')->savePRJState($this->session->PRJ, $this->program->getPRJPairs()); - if(!$projectID) $this->locate($this->createLink('program', 'PRJbrowse')); - setCookie("lastPRJ", $projectID, $this->config->cookieLife, $this->config->webRoot, '', false, true); + if($this->config->global->mode == 'new') + { + $projectID = $this->loadModel('program')->savePRJState($this->session->PRJ, $this->program->getPRJPairs()); + if(!$projectID) $this->locate($this->createLink('program', 'PRJbrowse')); + setCookie("lastPRJ", $projectID, $this->config->cookieLife, $this->config->webRoot, '', false, true); + } $this->loadModel('tree'); $this->loadModel('search'); @@ -1191,14 +1194,24 @@ class project extends control $this->view->isSprint = false; $project = $this->project->getById($this->session->PRJ); - if($project->model == 'scrum' && isset($this->config->custom->sprintConcept) and $this->config->custom->sprintConcept == 1) + if($this->config->global->mode == 'new') { - $this->view->isSprint = true; + if($project->model == 'scrum' && isset($this->config->custom->sprintConcept) and $this->config->custom->sprintConcept == 1) + { + $this->view->isSprint = true; - unset($this->lang->project->endList[62]); - unset($this->lang->project->endList[93]); - unset($this->lang->project->endList[186]); - unset($this->lang->project->endList[365]); + unset($this->lang->project->endList[62]); + unset($this->lang->project->endList[93]); + unset($this->lang->project->endList[186]); + unset($this->lang->project->endList[365]); + } + + $this->view->isStage = $project->model == 'waterfall' ? true : false; + $this->view->iconObject = $project->model == 'waterfall' ? 'stage' : 'sprint'; + } + else + { + $this->view->isStage = false; } $projectID = key($this->projects); @@ -1223,8 +1236,6 @@ class project extends control $this->view->copyProjectID = $copyProjectID; $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products)); $this->view->users = $this->loadModel('user')->getPairs('nodeleted|noclosed'); - $this->view->isStage = $project->model == 'waterfall' ? true : false; - $this->view->iconObject = $project->model == 'waterfall' ? 'stage' : 'sprint'; $this->display(); } @@ -1320,15 +1331,24 @@ class project extends control } $this->view->isSprint = false; - $PRJData = $this->project->getById($this->session->PRJ); - if($PRJData->model == 'scrum' && isset($this->config->custom->sprintConcept) && $this->config->custom->sprintConcept == 1) + if($this->config->global->mode == 'new') { - $this->view->isSprint = true; + $PRJData = $this->project->getById($this->session->PRJ); + if($PRJData->model == 'scrum' && isset($this->config->custom->sprintConcept) && $this->config->custom->sprintConcept == 1) + { + $this->view->isSprint = true; - unset($this->lang->project->endList[62]); - unset($this->lang->project->endList[93]); - unset($this->lang->project->endList[186]); - unset($this->lang->project->endList[365]); + unset($this->lang->project->endList[62]); + unset($this->lang->project->endList[93]); + unset($this->lang->project->endList[186]); + unset($this->lang->project->endList[365]); + } + + $this->view->isStage = $PRJData->model == 'waterfall' ? true : false; + } + else + { + $this->view->isStage = false; } $this->loadModel('user'); @@ -1359,7 +1379,6 @@ class project extends control $this->view->notRemoveProducts = $notRemoveProducts; $this->view->productPlans = $productPlans; $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($linkedProducts), '', $linkedBranches); - $this->view->isStage = $PRJData->model == 'waterfall' ? true : false; $this->display(); } diff --git a/module/project/model.php b/module/project/model.php index f72d07d85c..10ae7399e2 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -129,7 +129,7 @@ class projectModel extends model if($methodName == 'create' and $moduleName == 'project') $label = $this->lang->project->create; $projectIndex = $this->select($projects, $projectID, null, $moduleName, $methodName, $extra); - $this->lang->modulePageNav = $projectIndex; + if($this->config->global->mode == 'new') $this->lang->modulePageNav = $projectIndex; foreach($this->lang->project->menu as $key => $menu) { @@ -185,21 +185,33 @@ class projectModel extends model setCookie("lastProject", $projectID, $this->config->cookieLife, $this->config->webRoot, '', false, true); $currentProject = $this->getById($projectID); - if(isset($currentProject->type) and $currentProject->type == 'program') return; - - if(isset($currentProject->project)) $project = $this->loadModel('program')->getPRJByID($currentProject->project); - - if(isset($project) and $project->model == 'waterfall') + if($this->config->global->mode == 'new') { - $productID = $this->loadModel('product')->getProductIDByProject($currentProject->id); - $productName = $this->dao->findByID($productID)->from(TABLE_PRODUCT)->fetch('name'); - $currentProject->name = $productName . '/' . $currentProject->name; + if(isset($currentProject->type) and $currentProject->type == 'program') return; + + if(isset($currentProject->project)) $project = $this->loadModel('program')->getPRJByID($currentProject->project); + + if(isset($project) and $project->model == 'waterfall') + { + $productID = $this->loadModel('product')->getProductIDByProject($currentProject->id); + $productName = $this->dao->findByID($productID)->from(TABLE_PRODUCT)->fetch('name'); + $currentProject->name = $productName . '/' . $currentProject->name; + } } $dropMenuLink = helper::createLink('project', 'ajaxGetDropMenu', "objectID=$projectID&module=$currentModule&method=$currentMethod&extra=$extra"); - $currentProjectName = ''; if(isset($currentProject->name)) $currentProjectName = $currentProject->name; + + if($this->config->global->mode == 'old') + { + $output = "
"; + + $this->lang->project->switcherMenu = $output; + } + $output = "
"; @@ -314,7 +326,7 @@ class projectModel extends model /* Determine whether to add a sprint or a stage according to the model of the project. */ $project = $this->getByID($this->session->PRJ); - $sprintType = zget($this->config->project->modelList, $project->model, ''); + $sprintType = $this->config->global->mode == 'new' ? zget($this->config->project->modelList, $project->model, '') : 'sprint'; /* If the project model is a stage, determine whether the product is linked. */ if($sprintType == 'stage' and empty($this->post->products[0])) @@ -325,13 +337,13 @@ class projectModel extends model /* Get the data from the post. */ $sprint = fixer::input('post') - ->setDefault('project', $this->session->PRJ) ->setDefault('status', 'wait') - ->setDefault('parent', $this->session->PRJ) ->setDefault('openedBy', $this->app->user->account) ->setDefault('openedDate', helper::now()) ->setDefault('openedVersion', $this->config->version) ->setDefault('team', substr($this->post->name,0, 30)) + ->setIF($this->config->global->mode == 'new', 'project', $this->session->PRJ) + ->setIF($this->config->global->mode == 'new', 'parent', $this->session->PRJ) ->setIF($this->post->acl == 'open', 'whitelist', '') ->join('whitelist', ',') ->add('type', $sprintType) @@ -861,9 +873,9 @@ class projectModel extends model /* Order by status's content whether or not done */ $executions = $this->dao->select('*, IF(INSTR(" done,closed", status) < 2, 0, 1) AS isDone, INSTR("doing,wait,suspended,closed", status) AS sortStatus')->from(TABLE_EXECUTION) ->where('deleted')->eq(0) - ->beginIF(!$projectID && $type == 'all')->andWhere('type')->in('stage,sprint')->fi() - ->beginIF($projectID)->andWhere('project')->eq($projectID)->fi() - ->beginIF($type != 'all')->andWhere('type')->eq($type)->fi() + ->beginIF(!$projectID && $type == 'all' && $this->config->global->mode == 'new')->andWhere('type')->in('stage,sprint')->fi() + ->beginIF($projectID && $this->config->global->mode == 'new')->andWhere('project')->eq($projectID)->fi() + ->beginIF($type != 'all' && $this->config->global->mode == 'new')->andWhere('type')->eq($type)->fi() ->beginIF(strpos($mode, 'withdelete') === false)->andWhere('deleted')->eq(0)->fi() ->beginIF(!$this->app->user->admin and strpos($mode, 'all') === false)->andWhere('id')->in($this->app->user->view->sprints)->fi() ->orderBy($orderBy) diff --git a/module/project/view/ajaxgetdropmenu.html.php b/module/project/view/ajaxgetdropmenu.html.php index 082e6d9aad..00d506784e 100644 --- a/module/project/view/ajaxgetdropmenu.html.php +++ b/module/project/view/ajaxgetdropmenu.html.php @@ -49,7 +49,7 @@ foreach($projects as $project) ?> diff --git a/module/project/view/manageproducts.html.php b/module/project/view/manageproducts.html.php index da47ea9a47..5ff2ad0b8c 100644 --- a/module/project/view/manageproducts.html.php +++ b/module/project/view/manageproducts.html.php @@ -43,7 +43,7 @@ - grade == 1):?> + config->global->mode == 'old' or $project->grade == 1):?>
project->unlinkedProducts;?>
diff --git a/module/qa/config.php b/module/qa/config.php index e69de29bb2..12593ff1d2 100644 --- a/module/qa/config.php +++ b/module/qa/config.php @@ -0,0 +1,2 @@ +qa->menuList = array('caselib', 'testreport', 'testsuite', 'testtask', 'testcase', 'bug', 'qa'); diff --git a/module/qa/control.php b/module/qa/control.php index afa0522863..ac590e1aeb 100644 --- a/module/qa/control.php +++ b/module/qa/control.php @@ -11,6 +11,27 @@ */ class qa extends control { + public $projectID; + + /** + * Construct. + * + * @access public + * @return void + */ + public function __construct() + { + parent::__construct(); + + /* Set report menu group. */ + $this->projectID = isset($_GET['PRJ']) ? $_GET['PRJ'] : 0; + if(!$this->projectID) + { + foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; + $this->lang->noMenuModule[] = $this->app->rawModule; + } + } + /** * The index of qa, go to bug's browse page. * @@ -19,7 +40,7 @@ class qa extends control */ public function index($locate = 'auto', $productID = 0) { - $this->products = $this->loadModel('product')->getProductPairsByProject($this->session->PRJ); + $this->products = $this->loadModel('product')->getProductPairsByProject($this->projectID, 'noclosed'); if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=qa"))); if($locate == 'yes') $this->locate($this->createLink('bug', 'browse')); diff --git a/module/task/control.php b/module/task/control.php index 9217afb633..1c88223315 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -206,7 +206,7 @@ class task extends control $this->view->title = $title; $this->view->position = $position; $this->view->project = $project; - $this->view->projects = $this->loadModel('project')->getExecutionsByProject($this->session->PRJ, 'all', 0, true); + $this->view->projects = $this->config->global->mode == 'old' ? $projects : $this->loadModel('project')->getExecutionsByProject($this->session->PRJ, 'all', 0, true); $this->view->task = $task; $this->view->users = $users; $this->view->stories = $stories; @@ -237,8 +237,11 @@ class task extends control die(js::locate($this->createLink('project', 'task', "projectID=$projectID"))); } - $program = $this->loadModel('project')->getByID($this->session->PRJ); - if($program->model == 'waterfall') $this->config->task->create->requiredFields .= ',estStarted,deadline'; + if($this->config->global->mode == 'new') + { + $program = $this->loadModel('project')->getByID($this->session->PRJ); + if($program->model == 'waterfall') $this->config->task->create->requiredFields .= ',estStarted,deadline'; + } $project = $this->project->getById($projectID); $taskLink = $this->createLink('project', 'browse', "projectID=$projectID&tab=task"); @@ -389,7 +392,7 @@ class task extends control $this->view->users = $this->loadModel('user')->getPairs('nodeleted', "{$this->view->task->openedBy},{$this->view->task->canceledBy},{$this->view->task->closedBy}"); $this->view->showAllModule = isset($this->config->project->task->allModule) ? $this->config->project->task->allModule : ''; $this->view->modules = $this->tree->getTaskOptionMenu($this->view->task->project, 0, 0, $this->view->showAllModule ? 'allModule' : ''); - $this->view->projects = $this->loadModel('project')->getExecutionsByProject($this->session->PRJ, 'all', 0, true); + $this->view->projects = $this->config->global->mode == 'old' ? $this->project->getExecutionPairs() : $this->loadModel('project')->getExecutionsByProject($this->session->PRJ, 'all', 0, true); $this->display(); } diff --git a/module/task/model.php b/module/task/model.php index d108901ead..45fbfe58b8 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -47,7 +47,7 @@ class taskModel extends model ->setDefault('project', $projectID) ->setDefault('estimate,left,story', 0) ->setDefault('status', 'wait') - ->setDefault('PRJ', $this->session->PRJ) + ->setIF($this->config->global->mode == 'new', 'PRJ', $this->session->PRJ) ->setIF($this->post->estimate != false, 'left', $this->post->estimate) ->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story)) ->setDefault('estStarted', '0000-00-00') @@ -303,7 +303,7 @@ class taskModel extends model $data[$i]->pri = $tasks->pri[$i]; $data[$i]->estimate = $tasks->estimate[$i]; $data[$i]->left = $tasks->estimate[$i]; - $data[$i]->PRJ = $this->session->PRJ; + $data[$i]->PRJ = $this->config->global->mode == 'new' ? $this->session->PRJ : 0; $data[$i]->project = $projectID; $data[$i]->estStarted = empty($tasks->estStarted[$i]) ? '0000-00-00' : $tasks->estStarted[$i]; $data[$i]->deadline = empty($tasks->deadline[$i]) ? '0000-00-00' : $tasks->deadline[$i]; diff --git a/module/testcase/control.php b/module/testcase/control.php index 803d34e1a4..d19b37b627 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -11,7 +11,8 @@ */ class testcase extends control { - public $products = array(); + public $products = array(); + public $projectID = 0; /** * Construct function, load product, tree, user auto. @@ -25,7 +26,17 @@ class testcase extends control $this->loadModel('product'); $this->loadModel('tree'); $this->loadModel('user'); - $this->view->products = $this->products = $this->product->getProductPairsByProject($this->session->PRJ); + + /* Set test case menu group. */ + $this->projectID = isset($_GET['PRJ']) ? $_GET['PRJ'] : 0; + if(!$this->projectID) + { + $this->app->loadConfig('qa'); + foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; + $this->lang->noMenuModule[] = $this->app->rawModule; + } + + $this->view->products = $this->products = $this->product->getProductPairsByProject($this->projectID); if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=testcase"))); } diff --git a/module/testcase/model.php b/module/testcase/model.php index ed48b2c70e..bb2776b08d 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -48,6 +48,8 @@ class testcaseModel extends model $replace = $productID; common::setMenuVars($this->lang->testcase->menu, $key, $replace); } + + if($this->lang->navGroup->testcase == 'qa') $this->lang->qa->menu = $this->lang->testcase->menu; } /** @@ -65,9 +67,9 @@ class testcaseModel extends model ->add('status', $status) ->add('version', 1) ->add('fromBug', $bugID) - ->add('PRJ', $this->session->PRJ) ->setDefault('openedBy', $this->app->user->account) ->setDefault('openedDate', $now) + ->setIF($this->config->global->mode == 'new', 'PRJ', $this->session->PRJ) ->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion((int)$this->post->story)) ->remove('steps,expects,files,labels,stepType,forceNotReview') ->setDefault('story', 0) @@ -159,7 +161,7 @@ class testcaseModel extends model $data[$i] = new stdclass(); $data[$i]->product = $productID; - $data[$i]->PRJ = $this->session->PRJ; + if($this->config->global->mode == 'new') $data[$i]->PRJ = $this->session->PRJ; $data[$i]->branch = $cases->branch[$i]; $data[$i]->module = $cases->module[$i]; $data[$i]->type = $cases->type[$i]; @@ -1118,7 +1120,7 @@ class testcaseModel extends model } else { - $caseData->PRJ = $this->session->PRJ; + if($this->config->global->mode == 'new') $caseData->PRJ = $this->session->PRJ; $caseData->version = 1; $caseData->openedBy = $this->app->user->account; $caseData->openedDate = $now; diff --git a/module/testreport/control.php b/module/testreport/control.php index dd9fb7838f..53315a26f9 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -11,6 +11,8 @@ */ class testreport extends control { + public $projectID = 0; + /** * Construct * @@ -32,6 +34,15 @@ class testreport extends control $this->loadModel('testtask'); $this->loadModel('user'); $this->app->loadLang('report'); + + /* Set testreport menu group. */ + $this->projectID = isset($_GET['PRJ']) ? $_GET['PRJ'] : 0; + if(!$this->projectID) + { + $this->app->loadConfig('qa'); + foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; + $this->lang->noMenuModule[] = $this->app->rawModule; + } } /** diff --git a/module/testreport/model.php b/module/testreport/model.php index cbe33daaf0..9a38f5a879 100644 --- a/module/testreport/model.php +++ b/module/testreport/model.php @@ -39,6 +39,8 @@ class testreportModel extends model $replace = $productID; common::setMenuVars($this->lang->testreport->menu, $key, $replace); } + + if($this->lang->navGroup->testreport == 'qa') $this->lang->qa->menu = $this->lang->testreport->menu; } /** diff --git a/module/testsuite/control.php b/module/testsuite/control.php index 565e563474..07ad32b04f 100644 --- a/module/testsuite/control.php +++ b/module/testsuite/control.php @@ -13,6 +13,20 @@ class testsuite extends control { public $products = array(); + public function __construct($moduleName = '', $methodName = '') + { + parent::__construct($moduleName, $methodName); + + /* Set testtask menu group. */ + $this->projectID = isset($_GET['PRJ']) ? $_GET['PRJ'] : 0; + if(!$this->projectID) + { + $this->app->loadConfig('qa'); + foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; + $this->lang->noMenuModule[] = $this->app->rawModule; + } + } + /** * Index page, header to browse. * diff --git a/module/testsuite/model.php b/module/testsuite/model.php index 2eb799854d..c7a9a3087c 100644 --- a/module/testsuite/model.php +++ b/module/testsuite/model.php @@ -45,6 +45,8 @@ class testsuiteModel extends model $replace = $productID; common::setMenuVars($this->lang->testsuite->menu, $key, $replace); } + + if($this->lang->navGroup->testsuite == 'qa') $this->lang->qa->menu = $this->lang->testsuite->menu; } /** diff --git a/module/testtask/control.php b/module/testtask/control.php index 100d179fc0..c3c27f09b5 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -11,7 +11,8 @@ */ class testtask extends control { - public $products = array(); + public $products = array(); + public $projectID = 0; /** * Construct function, load product module, assign products to view auto. @@ -22,8 +23,18 @@ class testtask extends control public function __construct($moduleName = '', $methodName = '') { parent::__construct($moduleName, $methodName); + + /* Set testtask menu group. */ + $this->projectID = isset($_GET['PRJ']) ? $_GET['PRJ'] : 0; + if(!$this->projectID) + { + $this->app->loadConfig('qa'); + foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; + $this->lang->noMenuModule[] = $this->app->rawModule; + } + $this->loadModel('product'); - $this->view->products = $this->products = $this->product->getProductPairsByProject($this->session->PRJ); + $this->view->products = $this->products = $this->product->getProductPairsByProject($this->projectID); if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=testtask"))); } diff --git a/module/testtask/model.php b/module/testtask/model.php index 8e8d7f8cd2..ce77d71463 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -66,6 +66,8 @@ class testtaskModel extends model $replace = ($key == 'product') ? $selectHtml : $productID; common::setMenuVars($this->lang->testtask->menu, $key, $replace); } + + if($this->lang->navGroup->testtask == 'qa') $this->lang->qa->menu = $this->lang->testtask->menu; } /** @@ -129,6 +131,9 @@ class testtaskModel extends model $replace = ($key == 'product') ? $selectHtml : $productID; common::setMenuVars($this->lang->testtask->menu, $key, $replace); } + + $this->lang->testtask->menu->testcase['subModule'] = 'testtask'; + if($this->lang->navGroup->testtask == 'qa') $this->lang->qa->menu = $this->lang->testtask->menu; } /** @@ -142,7 +147,7 @@ class testtaskModel extends model { $task = fixer::input('post') ->setDefault('build', '') - ->setDefault('PRJ', $this->session->PRJ) + ->setIF($this->config->global->mode == 'new', 'PRJ', $this->session->PRJ) ->stripTags($this->config->testtask->editor->create['id'], $this->config->allowedTags) ->join('mailto', ',') ->remove('uid,contactListMenu') diff --git a/module/testtask/view/browseunits.html.php b/module/testtask/view/browseunits.html.php index a3c400d304..0a8767252a 100644 --- a/module/testtask/view/browseunits.html.php +++ b/module/testtask/view/browseunits.html.php @@ -89,12 +89,6 @@ $(function() { $('#Tab').addClass('btn-active-text').append(" recTotal >= $pager->recPerPage) ? $pager->recPerPage : $pager->recTotal;?>"); - config->global->flow == 'full'):?> - $('#subNavbar [data-id=testcase]').addClass('active'); - - $('#navbar li.active').removeClass('active'); - $('#navbar li[data-id=unit]').addClass('active'); - }) diff --git a/module/upgrade/view/createprogram.html.php b/module/upgrade/view/createprogram.html.php index 81bb12dc8f..f774e8c687 100644 --- a/module/upgrade/view/createprogram.html.php +++ b/module/upgrade/view/createprogram.html.php @@ -45,7 +45,7 @@
- + diff --git a/module/user/view/featurebar.html.php b/module/user/view/featurebar.html.php index 9d2a1d8e5b..e88cd83614 100755 --- a/module/user/view/featurebar.html.php +++ b/module/user/view/featurebar.html.php @@ -40,13 +40,16 @@ $active = $methodName == 'execution' ? ' btn-active-text' : ''; common::printLink('user', 'execution', "userID={$user->id}", $label, '', "class='btn btn-link $active'"); - $label = "{$lang->user->issue}"; - $active = ($methodName == 'issue' or $methodName == 'issue')? ' btn-active-text' : ''; - common::printLink('user', 'issue', "userID={$user->id}", $label, '', "class='btn btn-link $active'"); + if($this->config->global->mode == 'new') + { + $label = "{$lang->user->issue}"; + $active = ($methodName == 'issue' or $methodName == 'issue')? ' btn-active-text' : ''; + common::printLink('user', 'issue', "userID={$user->id}", $label, '', "class='btn btn-link $active'"); - $label = "{$lang->user->risk}"; - $active = ($methodName == 'risk' or $methodName == 'risk')? ' btn-active-text' : ''; - common::printLink('user', 'risk', "userID={$user->id}", $label, '', "class='btn btn-link $active'"); + $label = "{$lang->user->risk}"; + $active = ($methodName == 'risk' or $methodName == 'risk')? ' btn-active-text' : ''; + common::printLink('user', 'risk', "userID={$user->id}", $label, '', "class='btn btn-link $active'"); + } $label = "{$lang->user->dynamic}"; $active = $methodName == 'dynamic' ? ' btn-active-text' : '';
program->PRJCommon . $lang->program->PRJStatus;?>program->PRJStatus;?> program->statusList, '', "class='form-control chosen'");?>