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' => '
| 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/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'"; + } ?>|||||||||||||||||||||||||||||||||||||||
| 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 @@ | |||||||||||||||||||||||||||||||||||||||