From c8fcf59875019a7b8037f4b3b033703e15560958 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Tue, 23 Feb 2021 13:46:21 +0800 Subject: [PATCH 01/14] * Code for task #36042. --- module/product/config.php | 9 +++++++-- module/product/control.php | 7 ++++++- module/product/view/all.html.php | 15 ++++++++++++--- module/product/view/create.html.php | 6 ++++-- module/product/view/edit.html.php | 2 ++ 5 files changed, 31 insertions(+), 8 deletions(-) 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/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 @@
+ 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'):?> + From e3fcb7c71067534ca5a30a3078d7e7bdd53d8833 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Tue, 23 Feb 2021 13:56:49 +0800 Subject: [PATCH 02/14] * Code for task #36042. --- module/product/view/manageline.html.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/module/product/view/manageline.html.php b/module/product/view/manageline.html.php index 42c6edd274..bfd2229b38 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'):?>
+
From f6c0564234e1bab547c983e2a77d5235a6f4acc5 Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Tue, 23 Feb 2021 13:58:43 +0800 Subject: [PATCH 03/14] * Code for task #36042. --- framework/router.class.php | 8 +++++++- module/action/model.php | 1 + module/common/lang/menuOrder.php | 2 +- module/common/lang/zh-cn.php | 3 ++- module/common/model.php | 7 ++++--- module/common/view/header.html.php | 8 +++++++- module/my/view/preference.html.php | 2 ++ module/program/model.php | 16 ++++++++-------- module/program/view/prjbrowse.html.php | 16 ++++++++++++++-- module/project/control.php | 9 ++++++--- module/project/model.php | 19 ++++++++++++++----- module/project/view/ajaxgetdropmenu.html.php | 2 +- 12 files changed, 67 insertions(+), 26 deletions(-) diff --git a/framework/router.class.php b/framework/router.class.php index 29ee9dc018..f4e8b8768a 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; + /* 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/common/lang/menuOrder.php b/module/common/lang/menuOrder.php index 47eaf86b71..de006bb55c 100644 --- a/module/common/lang/menuOrder.php +++ b/module/common/lang/menuOrder.php @@ -1,6 +1,5 @@ mainNav->menuOrder[5] = 'my'; -$lang->mainNav->menuOrder[10] = 'program'; $lang->mainNav->menuOrder[15] = 'product'; $lang->mainNav->menuOrder[20] = 'project'; $lang->mainNav->menuOrder[23] = 'qa'; @@ -9,6 +8,7 @@ $lang->mainNav->menuOrder[30] = 'doc'; $lang->mainNav->menuOrder[35] = 'report'; $lang->mainNav->menuOrder[60] = 'system'; $lang->mainNav->menuOrder[70] = 'admin'; +if($config->global->mode == 'new') $lang->mainNav->menuOrder[10] = 'program'; /* Sort of main menu. */ $lang->waterfall->menuOrder[5] = 'programindex'; diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 41e53f1280..c68305e599 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -141,7 +141,6 @@ list($projectModule, $projectMethod) = explode('-', $config->projectLink); /* 主导航菜单。*/ $lang->mainNav = new stdclass(); $lang->mainNav->my = ' 地盘|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,'; @@ -1024,5 +1024,6 @@ $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/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%;}
+ config->global->mode == 'new'):?> + diff --git a/module/program/model.php b/module/program/model.php index 864bf26eb5..9a48709399 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'");?>my->storyConcept;?>
my->programLink;?> my->programLinkList, $programLink, "class='form-control chosen'");?>
my->productLink;?> my->productLinkList, $productLink, "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..dfcdbc203a 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'); diff --git a/module/project/model.php b/module/project/model.php index f72d07d85c..e27bb47a7f 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) { @@ -197,9 +197,18 @@ class projectModel extends model } $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 = "
"; @@ -861,9 +870,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) ?> From 467508d3fe0173a7a28d7d570fef6695282a00a8 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Tue, 23 Feb 2021 14:00:37 +0800 Subject: [PATCH 04/14] * Code for task #36042. --- module/product/view/manageline.html.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/product/view/manageline.html.php b/module/product/view/manageline.html.php index bfd2229b38..47e21e121f 100644 --- a/module/product/view/manageline.html.php +++ b/module/product/view/manageline.html.php @@ -75,7 +75,9 @@
+ config->global->mode == 'new'):?>
+
From 151760b145fbe89846c7d2d8b375bd8f2a39a854 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Tue, 23 Feb 2021 14:10:11 +0800 Subject: [PATCH 05/14] * Code for task #36042. --- module/common/lang/menuOrder.php | 2 +- module/common/lang/zh-cn.php | 14 ++++++++++---- module/user/view/featurebar.html.php | 15 +++++++++------ 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/module/common/lang/menuOrder.php b/module/common/lang/menuOrder.php index de006bb55c..f6402611f6 100644 --- a/module/common/lang/menuOrder.php +++ b/module/common/lang/menuOrder.php @@ -8,7 +8,7 @@ $lang->mainNav->menuOrder[30] = 'doc'; $lang->mainNav->menuOrder[35] = 'report'; $lang->mainNav->menuOrder[60] = 'system'; $lang->mainNav->menuOrder[70] = 'admin'; -if($config->global->mode == 'new') $lang->mainNav->menuOrder[10] = 'program'; +if($config->systemMode == 'new') $lang->mainNav->menuOrder[10] = 'program'; /* Sort of main menu. */ $lang->waterfall->menuOrder[5] = 'programindex'; diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index c68305e599..ca80803aa6 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -308,8 +308,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 +321,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,'; 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' : ''; From 20075135abc75d65bbe37e2f2becd8defa89e0ec Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Tue, 23 Feb 2021 14:36:54 +0800 Subject: [PATCH 06/14] * Finish task#36038. --- module/block/control.php | 35 ++++++++++++++--------- module/bug/control.php | 14 +++++++-- module/bug/model.php | 2 ++ module/caselib/control.php | 15 ++++++++++ module/caselib/model.php | 2 ++ module/common/lang/zh-cn.php | 2 +- module/common/model.php | 5 ++++ module/product/model.php | 4 +-- module/qa/config.php | 2 ++ module/qa/control.php | 23 ++++++++++++++- module/testcase/control.php | 15 ++++++++-- module/testcase/model.php | 2 ++ module/testreport/control.php | 11 +++++++ module/testreport/model.php | 2 ++ module/testsuite/control.php | 14 +++++++++ module/testsuite/model.php | 2 ++ module/testtask/control.php | 15 ++++++++-- module/testtask/model.php | 5 ++++ module/testtask/view/browseunits.html.php | 6 ---- 19 files changed, 147 insertions(+), 29 deletions(-) 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..fc69eec36c 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; } /** 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..7da3933270 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; } /** diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index ca80803aa6..37a2b69439 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -409,7 +409,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(); diff --git a/module/common/model.php b/module/common/model.php index c2b105220d..e814eccf88 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -2312,6 +2312,11 @@ EOD; $lang->menu = $lang->report->menu; $lang->menuOrder = $lang->report->menuOrder; } + if($group == 'qa') + { + $lang->menu = $lang->qa->menu; + $lang->menuOrder = $lang->qa->menuOrder; + } if($group == 'attend') { $lang->menu = $lang->attend->menu; 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/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/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..bd48e6f3b1 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; } /** 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..4b36961c50 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; } /** 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'); - }) From 9ae184c762bc17a77e7dcbdca337c813ea92dcfe Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Tue, 23 Feb 2021 15:01:34 +0800 Subject: [PATCH 07/14] * Finish task#36038. --- module/common/model.php | 1 + module/index/js/index.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/module/common/model.php b/module/common/model.php index e814eccf88..735f26bc1d 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -2295,6 +2295,7 @@ EOD; public static function setMainMenuByGroup($group, $moduleName, $methodName) { global $lang; + global $config; if($group == 'my') { $lang->menu = $lang->my->menu; 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) From 3ca1f79fd22420ac02e0cb63333ab45ec26643f3 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Tue, 23 Feb 2021 15:33:23 +0800 Subject: [PATCH 08/14] * Code for task #36042. --- config/zentaopms.php | 24 ++++++++++++++++++ framework/router.class.php | 2 +- module/common/lang/de.php | 32 ++++++++++++++++++------ module/common/lang/en.php | 32 ++++++++++++++++++------ module/common/lang/fr.php | 32 ++++++++++++++++++------ module/common/lang/vi.php | 32 ++++++++++++++++++------ module/common/lang/zh-cn.php | 17 ++++++++++--- module/common/model.php | 2 +- module/doc/control.php | 6 +++++ module/project/control.php | 48 ++++++++++++++++++++++++------------ module/project/model.php | 19 ++++++++------ module/task/control.php | 7 ++++-- module/task/model.php | 4 +-- 13 files changed, 196 insertions(+), 61 deletions(-) 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 f4e8b8768a..ffc3561397 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -191,9 +191,9 @@ class router extends baseRouter 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'; 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' => '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"); diff --git a/module/task/control.php b/module/task/control.php index 9217afb633..b2781f13a2 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -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"); 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]; From cacf93eb5dc4e3e632bc5985286395e2be54b163 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Tue, 23 Feb 2021 15:38:20 +0800 Subject: [PATCH 09/14] * Adjust the code. --- module/personnel/view/putinto.html.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 @@
- - - - - - - - - - + + + + + + + + + + From a16d3e30aaad2c039799d20646a6c9bc43143eae Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Tue, 23 Feb 2021 16:18:51 +0800 Subject: [PATCH 10/14] * Code for task #36042. --- module/common/lang/zh-cn.php | 2 +- module/project/model.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 03761d3932..014cf47f9e 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -1037,7 +1037,7 @@ $lang->design->menu->bysearch = array('link' => '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(); } From 4319d006b815733b04edbcdcd685918f544b5396 Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Tue, 23 Feb 2021 16:27:37 +0800 Subject: [PATCH 12/14] * Fix bug. --- module/upgrade/view/createprogram.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 @@ - + From baf3dbefa7a87afa6d05bb27586b81ddac041e1b Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Tue, 23 Feb 2021 16:40:01 +0800 Subject: [PATCH 13/14] * Code for project link product. --- module/project/view/manageproducts.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;?>
From 8b5ac139169905665769745b125a1cd2c2c176de Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Tue, 23 Feb 2021 17:15:12 +0800 Subject: [PATCH 14/14] * Code for task #36042. --- module/bug/model.php | 4 ++-- module/caselib/model.php | 4 ++-- module/testcase/model.php | 6 +++--- module/testtask/model.php | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index fc69eec36c..3bfa4fa363 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -63,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)) @@ -230,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/model.php b/module/caselib/model.php index 7da3933270..692d10ab64 100644 --- a/module/caselib/model.php +++ b/module/caselib/model.php @@ -219,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') @@ -612,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/testcase/model.php b/module/testcase/model.php index bd48e6f3b1..bb2776b08d 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -67,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) @@ -161,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]; @@ -1120,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/testtask/model.php b/module/testtask/model.php index 4b36961c50..ce77d71463 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -147,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')
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;?>
program->PRJCommon . $lang->program->PRJStatus;?>program->PRJStatus;?> program->statusList, '', "class='form-control chosen'");?>