@@ -86,31 +85,9 @@ execution->type;?> - - execution->lifeTimeList, '', "class='form-control' onchange='showLifeTimeTips()'"); - } - else - { - echo html::select('attribute', $lang->stage->typeList, '', "class='form-control'"); - } - ?> - + execution->lifeTimeList, '', "class='form-control' onchange='showLifeTimeTips()'"); ?>
execution->typeDesc;?>
- - - programplan->percent;?> - -
- - % -
- - - execution->status;?> @@ -183,7 +160,6 @@ - diff --git a/module/product/model.php b/module/product/model.php index b8b1fc5a25..33f6921931 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -32,7 +32,7 @@ class productModel extends model $product = $this->getByID($productID); if($product) { - $this->lang->modulePageNav = $this->getModuleNav($products, '', $product, $extra, $branch, $module, $moduleType); + $this->getModuleNav($products, '', $product, $extra, $branch, $module, $moduleType); } foreach($this->lang->product->menu as $key => $menu) From 6b69424799c08bcd2a218e3782465272303a51c3 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Thu, 18 Mar 2021 11:21:56 +0800 Subject: [PATCH 05/14] * Finish task #36750. --- module/build/control.php | 19 ++--- module/build/js/common.js | 14 +++- module/build/js/create.js | 23 ++++++ module/build/model.php | 4 +- module/build/view/create.html.php | 6 ++ module/product/control.php | 17 +++- module/project/control.php | 62 +++++++++++++++ module/project/js/build.js | 25 ++++++ module/project/lang/de.php | 1 + module/project/lang/en.php | 1 + module/project/lang/fr.php | 1 + module/project/lang/vi.php | 1 + module/project/lang/zh-cn.php | 1 + .../view/build.html.php} | 34 +++----- module/projectbuild/control.php | 77 ------------------- module/projectbuild/js/browse.js | 20 ----- module/projectbuild/lang/de.php | 5 -- module/projectbuild/lang/en.php | 5 -- module/projectbuild/lang/fr.php | 5 -- module/projectbuild/lang/vi.php | 5 -- module/projectbuild/lang/zh-cn.php | 5 -- module/projectbuild/lang/zh-tw.php | 5 -- 22 files changed, 168 insertions(+), 168 deletions(-) create mode 100644 module/project/js/build.js rename module/{projectbuild/view/browse.html.php => project/view/build.html.php} (80%) delete mode 100644 module/projectbuild/control.php delete mode 100644 module/projectbuild/js/browse.js delete mode 100644 module/projectbuild/lang/de.php delete mode 100644 module/projectbuild/lang/en.php delete mode 100644 module/projectbuild/lang/fr.php delete mode 100644 module/projectbuild/lang/vi.php delete mode 100644 module/projectbuild/lang/zh-cn.php delete mode 100644 module/projectbuild/lang/zh-tw.php diff --git a/module/build/control.php b/module/build/control.php index f5b8eecad5..0627f029e3 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -19,14 +19,19 @@ class build extends control * @access public * @return void */ - public function create($executionID, $productID = 0) + public function create($executionID = 0, $productID = 0, $projectID = 0) { - /* Create execution if no execution. */ - if($executionID == 0) die(js::locate($this->createLink('execution', 'create'), 'parent')); + if($this->app->openApp == 'project') + { + commonModel::setAppObjectID('project', $projectID); + $executions = $this->loadModel('execution')->getPairs($projectID); + $executionID = key($executions); + } if(!empty($_POST)) { - $buildID = $this->build->create($executionID); + $executionID = $this->post->execution; + $buildID = $this->build->create($executionID); if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); $this->loadModel('action')->create('build', $buildID, 'opened'); @@ -44,23 +49,19 @@ class build extends control $this->session->set('buildCreate', $this->app->getURI(true)); $execution = $this->execution->getByID($executionID); - /* Set menu. */ - $executions = $this->execution->getPairs($execution->project); - $this->execution->setMenu($executions, $executionID); - $productGroups = $this->execution->getProducts($executionID); $productID = $productID ? $productID : key($productGroups); $products = array(); foreach($productGroups as $product) $products[$product->id] = $product->name; $this->view->title = $execution->name . $this->lang->colon . $this->lang->build->create; - $this->view->position[] = html::a($this->createLink('execution', 'task', "executionID=$executionID"), $execution->name); $this->view->position[] = $this->lang->build->create; $this->view->product = isset($productGroups[$productID]) ? $productGroups[$productID] : ''; $this->view->branches = (isset($productGroups[$productID]) and $productGroups[$productID]->type == 'normal') ? array() : $this->loadModel('branch')->getPairs($productID); $this->view->executionID = $executionID; $this->view->products = $products; + $this->view->executions = isset($executions) ? $executions : array(); $this->view->lastBuild = $this->build->getLast($executionID); $this->view->productGroups = $productGroups; $this->view->users = $this->user->getPairs('nodeleted|noclosed'); diff --git a/module/build/js/common.js b/module/build/js/common.js index 6e672a87da..96d639687b 100644 --- a/module/build/js/common.js +++ b/module/build/js/common.js @@ -1,7 +1,7 @@ /** - * Load branches - * - * @param int $productID + * Load branches + * + * @param int $productID * @access public * @return void */ @@ -9,7 +9,13 @@ function loadBranches(productID) { $('#branch').remove(); $('#branch_chosen').remove(); - $.get(createLink('branch', 'ajaxGetBranches', 'productID=' + productID + '&oldBranch=' + productGroups[productID]['branch']), function(data) + var oldBranch = 0; + if(typeof(productGroups[productID]) != "undefined") + { + oldBranch = productGroups[productID]['branch']; + } + + $.get(createLink('branch', 'ajaxGetBranches', 'productID=' + productID + '&oldBranch=' + oldBranch), function(data) { if(data) { diff --git a/module/build/js/create.js b/module/build/js/create.js index 3f64da6a53..88b5082cb7 100644 --- a/module/build/js/create.js +++ b/module/build/js/create.js @@ -4,4 +4,27 @@ $().ready(function() { $('#name').val($(this).text()).focus(); }); + }); +/** + * Load products. + * + * @param int $executionID + * @access public + * @return void + */ +function loadProducts(executionID) +{ + $('#product').remove(); + $('#product_chosen').remove(); + $('#branch').remove(); + $('#branch_chosen').remove(); + $.get(createLink('product', 'ajaxGetProducts', 'executionID=' + executionID), function(data) + { + if(data) + { + $('.input-group').append(data); + $('#product').chosen(); + } + }); +} diff --git a/module/build/model.php b/module/build/model.php index 4dd05b93e9..fe1490b0e2 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -60,9 +60,9 @@ class buildModel extends model */ public function getProjectBuilds($projectID = 0, $type = 'all', $param = 0) { - return $this->dao->select('t1.*, t2.name as projectName, t2.id as projectID, t3.name as productName, t4.name as branchName') + return $this->dao->select('t1.*, t2.name as executionName, t2.id as executionID, t3.name as productName, t4.name as branchName') ->from(TABLE_BUILD)->alias('t1') - ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') + ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id') ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id') ->leftJoin(TABLE_BRANCH)->alias('t4')->on('t1.branch = t4.id') ->where('t1.project')->eq((int)$projectID) diff --git a/module/build/view/create.html.php b/module/build/view/create.html.php index cbd885034e..cac65c62b6 100644 --- a/module/build/view/create.html.php +++ b/module/build/view/create.html.php @@ -19,6 +19,12 @@
+ + + + + + diff --git a/module/product/control.php b/module/product/control.php index 3cb60beadc..a2d76e6a68 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -811,6 +811,21 @@ class product extends control $this->display(); } + /** + * Ajax get products. + * + * @param int $executionID + * @access public + * @return void + */ + public function ajaxGetProducts($executionID) + { + $products = array('' => ''); + $products += $this->product->getProductPairsByProject($executionID); + + die(html::select('product', $products, '', "class='form-control' onchange='loadBranches(this.value)'")); + } + /** * AJAX: get projects of a product in html select. * @@ -824,7 +839,7 @@ class product extends control { $projects = array('' => ''); $projects += $this->product->getProjectPairsByProduct($productID, $branch ? "0,$branch" : $branch); - if($this->app->getViewType() == 'json') die(json_encode($peojects)); + if($this->app->getViewType() == 'json') die(json_encode($projects)); die(html::select('project', $projects, $projectID, "class='form-control' onchange='loadProductExecutions({$productID})'")); } diff --git a/module/project/control.php b/module/project/control.php index 1b6ecf4547..1d56002c3f 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -675,6 +675,68 @@ class project extends control $this->locate($this->createLink('execution', 'all', "status=all&executionID=0&from=project", '', false, $PRJ)); } + /** + * Browse builds of a project. + * + * @param string $type all|product|bysearch + * @param int $param + * @access public + * @return void + */ + public function build($projectID = 0, $type = 'all', $param = 0) + { + /* Load module and get project. */ + $this->loadModel('build'); + $project = $this->project->getByID($projectID); + + /* Get products' list. */ + $products = $this->project->getProducts($projectID, false); + $products = array('' => '') + $products; + + /* Build the search form. */ + $type = strtolower($type); + $queryID = ($type == 'bysearch') ? (int)$param : 0; + $actionURL = $this->createLink('project', 'build', "projectID=$projectID&type=bysearch&queryID=myQueryID"); + + $executions = $this->execution->getByProject($projectID, 'all', '', true); + $this->config->build->search['fields']['execution'] = $this->project->lang->executionCommon; + $this->config->build->search['params']['execution'] = array('operator' => '=', 'control' => 'select', 'values' => array('' => '') + $executions); + + $this->project->buildProjectBuildSearchForm($products, $queryID, $actionURL, 'project'); + + if($type == 'bysearch') + { + $builds = $this->build->getProjectBuildsBySearch((int)$projectID, (int)$param); + } + else + { + $builds = $this->build->getProjectBuilds((int)$projectID, $type, $param); + } + + /* Set project builds. */ + $projectBuilds = array(); + if(!empty($builds)) + { + foreach($builds as $build) $projectBuilds[$build->product][] = $build; + } + + /* Header and position. */ + $this->view->title = $project->name . $this->lang->colon . $this->lang->execution->build; + $this->view->position[] = $this->lang->execution->build; + + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->buildsTotal = count($builds); + $this->view->projectBuilds = $projectBuilds; + $this->view->product = $type == 'product' ? $param : 'all'; + $this->view->projectID = $projectID; + $this->view->project = $project; + $this->view->products = $products; + $this->view->executions = $executions; + $this->view->type = $type; + + $this->display(); + } + /** * Project manage view. * diff --git a/module/project/js/build.js b/module/project/js/build.js new file mode 100644 index 0000000000..a383a83c1e --- /dev/null +++ b/module/project/js/build.js @@ -0,0 +1,25 @@ +$(function() +{ + $('#createBuild').click(function() + { + if(executions.length == 0) + { + alert(createExecution); + location.href = createLink('execution', 'create'); + return false; + } + }); +}); + +/** + * Change product. + * + * @param int $productID + * @access public + * @return void + */ +function changeProduct(productID) +{ + link = createLink('project', 'build', 'type=product¶m=' + productID); + location.href = link; +} diff --git a/module/project/lang/de.php b/module/project/lang/de.php index 439ff81b84..a5ef7b364a 100644 --- a/module/project/lang/de.php +++ b/module/project/lang/de.php @@ -101,6 +101,7 @@ $lang->project->changeProgramTip = 'After modifying the project set, the p $lang->project->linkedProjectsTip = 'Linked projects are as follows'; $lang->project->multiLinkedProductsTip = 'The following products linked to this project are also linked to other projects, please unlink before proceeding.'; $lang->project->linkStoryByPlanTips = "This action will associate all {$lang->SRCommon} under the selected plan to this project"; +$lang->project->createExecution = "There is no {$lang->executionCommon} under this project, please create {$lang->executionCommon} first"; $lang->project->tenThousand = ''; diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 028e07b1fc..2c859094ea 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -101,6 +101,7 @@ $lang->project->changeProgramTip = 'After modifying the project set, the p $lang->project->linkedProjectsTip = 'Linked projects are as follows'; $lang->project->multiLinkedProductsTip = 'The following products linked to this project are also linked to other projects, please unlink before proceeding.'; $lang->project->linkStoryByPlanTips = "This action will associate all {$lang->SRCommon} under the selected plan to this project"; +$lang->project->createExecution = "There is no {$lang->executionCommon} under this project, please create {$lang->executionCommon} first"; $lang->project->tenThousand = ''; diff --git a/module/project/lang/fr.php b/module/project/lang/fr.php index 62b00a54fa..4df2b05dcf 100644 --- a/module/project/lang/fr.php +++ b/module/project/lang/fr.php @@ -101,6 +101,7 @@ $lang->project->changeProgramTip = 'After modifying the project set, the p $lang->project->linkedProjectsTip = 'Linked projects are as follows'; $lang->project->multiLinkedProductsTip = 'The following products linked to this project are also linked to other projects, please unlink before proceeding.'; $lang->project->linkStoryByPlanTips = "This action will associate all {$lang->SRCommon} under the selected plan to this project"; +$lang->project->createExecution = "There is no {$lang->executionCommon} under this project, please create {$lang->executionCommon} first"; $lang->project->tenThousand = ''; diff --git a/module/project/lang/vi.php b/module/project/lang/vi.php index ced76f81f8..7f2141c49f 100644 --- a/module/project/lang/vi.php +++ b/module/project/lang/vi.php @@ -101,6 +101,7 @@ $lang->project->changeProgramTip = 'After modifying the project set, the p $lang->project->linkedProjectsTip = 'Linked projects are as follows'; $lang->project->multiLinkedProductsTip = 'The following products linked to this project are also linked to other projects, please unlink before proceeding.'; $lang->project->linkStoryByPlanTips = "This action will associate all {$lang->SRCommon} under the selected plan to this project"; +$lang->project->createExecution = "There is no {$lang->executionCommon} under this project, please create {$lang->executionCommon} first"; $lang->project->tenThousand = ''; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index c94f09ccd5..869fff4f8f 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -102,6 +102,7 @@ $lang->project->changeProgramTip = '修改项目集后,该项目关联 $lang->project->linkedProjectsTip = '关联的项目如下'; $lang->project->multiLinkedProductsTip = '该项目关联的如下产品还关联了其他项目,请取消关联后再操作'; $lang->project->linkStoryByPlanTips = "此操作会将所选计划下面的{$lang->SRCommon}全部关联到此项目中"; +$lang->project->createExecution = "该项目下没有{$lang->executionCommon},请先创建{$lang->executionCommon}"; $lang->project->tenThousand = '万'; diff --git a/module/projectbuild/view/browse.html.php b/module/project/view/build.html.php similarity index 80% rename from module/projectbuild/view/browse.html.php rename to module/project/view/build.html.php index 36f48c90e6..8c68de6b57 100644 --- a/module/projectbuild/view/browse.html.php +++ b/module/project/view/build.html.php @@ -11,8 +11,10 @@ */ ?> -build->confirmDelete)?> + +project->createExecution)?> +build->confirmDelete)?>
-

- build->noBuild;?> - - " . $lang->build->create, '', "data-toggle='modal' class='btn btn-info'");?> - -

+

build->noBuild;?>

@@ -66,7 +66,7 @@ branchName) echo "{$build->branchName}"?> createLink('build', 'view', "build=$build->id"), $build->name);?> -
+ @@ -96,20 +96,4 @@ - diff --git a/module/projectbuild/control.php b/module/projectbuild/control.php deleted file mode 100644 index 9237ec454e..0000000000 --- a/module/projectbuild/control.php +++ /dev/null @@ -1,77 +0,0 @@ - - * @package projectBuild - * @version $Id: control.php 5094 2013-07-10 08:46:15Z chencongzhi520@gmail.com $ - * @link http://www.zentao.net - */ -class projectBuild extends control -{ - /** - * Browse builds of a project. - * - * @param int $projectID - * @param string $type all|product|bysearch - * @param int $param - * @access public - * @return void - */ - public function browse($projectID = 0, $type = 'all', $param = 0) - { - $this->loadModel('project'); - $this->loadModel('execution'); - $this->loadModel('build'); - $project = $this->project->getByID($projectID); - - /* Get products' list. */ - $products = $this->project->getProducts($projectID, false); - $products = array('' => '') + $products; - - /* Build the search form. */ - $type = strtolower($type); - $queryID = ($type == 'bysearch') ? (int)$param : 0; - $actionURL = $this->createLink('projectbuild', 'browse', "projectID=$projectID&type=bysearch&queryID=myQueryID"); - - $executions = $this->execution->getByProject($projectID, 'all', '', true); - $this->config->build->search['fields']['project'] = $this->project->lang->executionCommon; - $this->config->build->search['params']['project'] = array('operator' => '=', 'control' => 'select', 'values' => array('' => '') + $executions); - - $this->project->buildProjectBuildSearchForm($products, $queryID, $actionURL, 'project'); - - if($type == 'bysearch') - { - $builds = $this->build->getProjectBuildsBySearch((int)$projectID, (int)$param); - } - else - { - $builds = $this->build->getProjectBuilds((int)$projectID, $type, $param); - } - - /* Set project builds. */ - $projectBuilds = array(); - if(!empty($builds)) - { - foreach($builds as $build) $projectBuilds[$build->product][] = $build; - } - - /* Header and position. */ - $this->view->title = $project->name . $this->lang->colon . $this->lang->execution->build; - $this->view->position[] = html::a(inlink('browse', "projectID=$projectID"), $project->name); - $this->view->position[] = $this->lang->execution->build; - - $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->buildsTotal = count($builds); - $this->view->projectBuilds = $projectBuilds; - $this->view->projectID = $projectID; - $this->view->product = $type == 'product' ? $param : 'all'; - $this->view->project = $project; - $this->view->products = $products; - $this->view->executions = $executions; - $this->view->type = $type; - - $this->display(); - } -} diff --git a/module/projectbuild/js/browse.js b/module/projectbuild/js/browse.js deleted file mode 100644 index 8b795f93b7..0000000000 --- a/module/projectbuild/js/browse.js +++ /dev/null @@ -1,20 +0,0 @@ -$(function() -{ - $('#createBuildButton').on('click', function() - { - var projectID = $('#project').val(); - parent.location.href = createLink('build', 'create', 'projectID=' + projectID); - }) -}); -/** - * Change product. - * - * @param int $productID - * @access public - * @return void - */ -function changeProduct(productID) -{ - link = createLink('projectbuild', 'browse', 'projectID=' + projectID + '&type=product¶m=' + productID); - location.href = link; -} diff --git a/module/projectbuild/lang/de.php b/module/projectbuild/lang/de.php deleted file mode 100644 index 81dd597cdd..0000000000 --- a/module/projectbuild/lang/de.php +++ /dev/null @@ -1,5 +0,0 @@ -projectbuild->common = 'Project Build'; -$lang->projectbuild->browse = 'Build List'; - -$lang->projectbuild->project = "Please select {$lang->executionCommon}"; diff --git a/module/projectbuild/lang/en.php b/module/projectbuild/lang/en.php deleted file mode 100644 index 81dd597cdd..0000000000 --- a/module/projectbuild/lang/en.php +++ /dev/null @@ -1,5 +0,0 @@ -projectbuild->common = 'Project Build'; -$lang->projectbuild->browse = 'Build List'; - -$lang->projectbuild->project = "Please select {$lang->executionCommon}"; diff --git a/module/projectbuild/lang/fr.php b/module/projectbuild/lang/fr.php deleted file mode 100644 index 81dd597cdd..0000000000 --- a/module/projectbuild/lang/fr.php +++ /dev/null @@ -1,5 +0,0 @@ -projectbuild->common = 'Project Build'; -$lang->projectbuild->browse = 'Build List'; - -$lang->projectbuild->project = "Please select {$lang->executionCommon}"; diff --git a/module/projectbuild/lang/vi.php b/module/projectbuild/lang/vi.php deleted file mode 100644 index 81dd597cdd..0000000000 --- a/module/projectbuild/lang/vi.php +++ /dev/null @@ -1,5 +0,0 @@ -projectbuild->common = 'Project Build'; -$lang->projectbuild->browse = 'Build List'; - -$lang->projectbuild->project = "Please select {$lang->executionCommon}"; diff --git a/module/projectbuild/lang/zh-cn.php b/module/projectbuild/lang/zh-cn.php deleted file mode 100644 index abfbf6155c..0000000000 --- a/module/projectbuild/lang/zh-cn.php +++ /dev/null @@ -1,5 +0,0 @@ -projectbuild->common = '项目版本'; -$lang->projectbuild->browse = '版本列表'; - -$lang->projectbuild->project = "请选择所属{$lang->executionCommon}"; diff --git a/module/projectbuild/lang/zh-tw.php b/module/projectbuild/lang/zh-tw.php deleted file mode 100644 index 5aba86e958..0000000000 --- a/module/projectbuild/lang/zh-tw.php +++ /dev/null @@ -1,5 +0,0 @@ -projectbuild->common = '項目版本'; -$lang->projectbuild->browse = '版本列表'; - -$lang->projectbuild->project = "請選擇所屬{$lang->executionCommon}"; From 9641aeffd59ccc071e2c0cce59abea74079db105 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Thu, 18 Mar 2021 13:04:05 +0800 Subject: [PATCH 06/14] * Fix bug. --- module/build/control.php | 26 +++++++++++++++----------- module/execution/control.php | 5 +++++ 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index 520e2a6073..0c49f66a62 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -21,10 +21,14 @@ class build extends control */ public function create($executionID = 0, $productID = 0, $projectID = 0) { + /* Load these models. */ + $this->loadModel('execution'); + $this->loadModel('user'); + if($this->app->openApp == 'project') { commonModel::setAppObjectID('project', $projectID); - $executions = $this->loadModel('execution')->getPairs($projectID); + $executions = $this->execution->getPairs($projectID); $executionID = key($executions); } @@ -41,18 +45,18 @@ class build extends control $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('build', 'view', "buildID=$buildID"))); } - /* Load these models. */ - $this->loadModel('execution'); - $this->loadModel('user'); - - /* Set session and get execution by id. */ - $this->session->set('buildCreate', $this->app->getURI(true)); $execution = $this->execution->getByID($executionID); + if($this->app->openApp == 'execution') + { + /* Set session and get execution by id. */ + $this->session->set('buildCreate', $this->app->getURI(true)); + + /* Set menu. */ + $executions = $this->execution->getPairs($execution->project); + $this->execution->setMenu($executions, $executionID); + commonModel::setAppObjectID('execution', $executionID); + } - /* Set menu. */ - $executions = $this->execution->getPairs($execution->project); - $this->execution->setMenu($executions, $executionID); - commonModel::setAppObjectID('execution', $executionID); $productGroups = $this->execution->getProducts($executionID); $productID = $productID ? $productID : key($productGroups); diff --git a/module/execution/control.php b/module/execution/control.php index 982ddc00c3..4b183d3423 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1181,6 +1181,11 @@ class execution extends control */ public function create($productID = '', $executionID = '', $copyExecutionID = '', $planID = 0, $confirm = 'no', $projectID = 0) { + if($this->app->openApp == 'project') + { + commonModel::setAppobjectID('project', $projectID); + } + $this->app->loadLang('program'); $this->app->loadLang('stage'); $this->app->loadLang('programplan'); From d05dc1b8e2de24aca20b33b7eb92b4d6858cf9cd Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Thu, 18 Mar 2021 13:06:14 +0800 Subject: [PATCH 07/14] * Add parameters to the link. --- module/project/js/build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/project/js/build.js b/module/project/js/build.js index a383a83c1e..fdab9a0141 100644 --- a/module/project/js/build.js +++ b/module/project/js/build.js @@ -5,7 +5,7 @@ $(function() if(executions.length == 0) { alert(createExecution); - location.href = createLink('execution', 'create'); + location.href = createLink('execution', 'create', 'productID=&executionID=©ExecutionID=&planID=&confirm=&projectID=' + projectID); return false; } }); From 8acff18969d52f34c0c071998695aecf784daa6d Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Thu, 18 Mar 2021 13:11:47 +0800 Subject: [PATCH 08/14] * Fix add product jump error. --- module/product/control.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/product/control.php b/module/product/control.php index 686e3b7d24..76e8191a49 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -313,9 +313,10 @@ class product extends control $this->executeHooks($productID); - $moduleName = $programID ? 'program' : $this->moduleName; - $methodName = $programID ? 'product' : 'browse'; - $param = $programID ? "programID=$programID" : "productID=$productID"; + $openApp = $this->app->openApp; + $moduleName = $openApp == 'program'? 'program' : $this->moduleName; + $methodName = $openApp == 'program'? 'product' : 'browse'; + $param = $openApp == 'program' ? "programID=$programID" : "productID=$productID"; $locate = $this->createLink($moduleName, $methodName, $param); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate)); } From f70697ac7433e219360947b4c8c0ae2c00062a2a Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Thu, 18 Mar 2021 13:18:40 +0800 Subject: [PATCH 09/14] * Delete the left of the list in the project by execution. --- module/common/lang/zh-cn.php | 2 +- module/execution/control.php | 6 ++---- module/project/control.php | 8 +++----- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 24fac298e1..37ec98ad07 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -864,7 +864,7 @@ $lang->icons['score'] = 'tint'; $lang->menu = new stdclass(); $lang->menu->scrum = new stdclass(); $lang->menu->scrum->index = '仪表盘|project|index|project={PROJECT}'; -$lang->menu->scrum->execution = "$lang->executionCommon|execution|all|status=all&projectID={PROJECT}"; +$lang->menu->scrum->execution = "$lang->executionCommon|project|execution|projectID={PROJECT}"; $lang->menu->scrum->projectstory = array('link' => $lang->SRCommon . '|projectstory|story|projectID={PROJECT}', 'alias' => 'story,track'); $lang->menu->scrum->doc = array('link' => '文档|doc|objectLibs|type=project&objectID={PROJECT}', 'subModule' => 'doc'); $lang->menu->scrum->qa = array('link' => '测试|qa|index', 'subModule' => 'testcase,testtask'); diff --git a/module/execution/control.php b/module/execution/control.php index 4b183d3423..0be9080db5 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -59,7 +59,6 @@ class execution extends control */ public function index($locate = 'auto', $executionID = 0) { - $this->lang->execution->menu = $this->lang->execution->homeMenu; if($locate == 'yes') $this->locate($this->createLink('execution', 'task')); $this->commonAction($executionID); @@ -2669,14 +2668,13 @@ class execution extends control * @access public * @return void */ - public function all($status = 'all', $projectID = 0, $from = 'execution', $orderBy = 'id_desc', $productID = 0, $recTotal = 0, $recPerPage = 10, $pageID = 1) + public function all($status = 'all', $projectID = 0, $orderBy = 'id_desc', $productID = 0, $recTotal = 0, $recPerPage = 10, $pageID = 1) { - $this->lang->execution->menu = $this->lang->execution->homeMenu; - $this->app->loadLang('my'); $this->app->loadLang('product'); $this->app->loadLang('programplan'); + $from = $this->app->openApp; if($from == 'execution') $this->session->set('executionList', $this->app->getURI(true)); if($from == 'project') $this->lang->navGroup->execution = 'project'; diff --git a/module/project/control.php b/module/project/control.php index af1ea80e39..066f76ad6c 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -662,15 +662,13 @@ class project extends control /** * Execution list. * + * @param int $projectID * @access public * @return void */ - public function execution() + public function execution($projectID = 0) { - $PRJ = $this->session->PRJ; - if(!$PRJ) $PRJ = current(explode(',', $this->app->user->view->projects)); - - $this->locate($this->createLink('execution', 'all', "status=all&executionID=0&from=project", '', false, $PRJ)); + $this->locate($this->createLink('execution', 'all', "status=all&projectID=$projectID", '', false)); } /** From 26733c7ae322fb62b8b57a7c004e870f65d4a7d2 Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Thu, 18 Mar 2021 13:22:57 +0800 Subject: [PATCH 10/14] * Fix bug. --- module/execution/view/all.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/view/all.html.php b/module/execution/view/all.html.php index d3433b1de9..ea89ecf3b5 100644 --- a/module/execution/view/all.html.php +++ b/module/execution/view/all.html.php @@ -36,7 +36,7 @@
execution->featureBar['all'] as $key => $label):?> - {$label}", '', "class='btn btn-link' id='{$key}Tab'");?> + {$label}", '', "class='btn btn-link' id='{$key}Tab'");?>
From c025042e95bbc0c3c3c91dd512cca91cf21dd6ab Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Thu, 18 Mar 2021 13:24:16 +0800 Subject: [PATCH 11/14] * Adjust the code. --- module/story/control.php | 2 ++ module/story/view/create.html.php | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index 8ef1ce3776..8054977273 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -48,6 +48,8 @@ class story extends control */ public function create($productID = 0, $branch = 0, $moduleID = 0, $storyID = 0, $executionID = 0, $bugID = 0, $planID = 0, $todoID = 0, $extra = '', $type = 'story') { + commonModel::setAppObjectID('product', $productID); + $this->story->replaceURLang($type); $this->lang->product->switcherMenu = $this->product->getSwitcher($productID); diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index 46a2fddee6..04fdee8ca2 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -89,7 +89,8 @@
story->source;?>
story->sourceList, $source, "class='form-control chosen'");?> story->sourceNote;?> - + +
@@ -120,7 +121,7 @@
executionCommon;?>
build->product;?> projectName;?>executionName;?> scmPath, 'http') === 0 ? html::a($build->scmPath) : $build->scmPath;?> filePath, 'http') === 0 ? html::a($build->filePath) : $build->filePath;?> date?>
-
story->source;?>
+
story->source;?>
story->sourceList, $source, "class='form-control chosen'");?> story->sourceNote;?> From a61fa90c18300a5e36faf38295027930db3a6123 Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Thu, 18 Mar 2021 13:38:47 +0800 Subject: [PATCH 12/14] * Add repo navGroup. --- module/common/lang/zh-cn.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 37ec98ad07..37c436e227 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -634,6 +634,8 @@ $lang->navGroup->doc = 'doc'; $lang->navGroup->qa = 'qa'; +$lang->navGroup->repo = 'repo'; + $lang->navGroup->company = 'system'; $lang->navGroup->sqlbuilder = 'system'; $lang->navGroup->auditcl = 'system'; From ec38482e486cbaa09e196b436a0b365394eec273 Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Thu, 18 Mar 2021 13:41:18 +0800 Subject: [PATCH 13/14] * Fix bug. --- module/build/model.php | 1 - 1 file changed, 1 deletion(-) diff --git a/module/build/model.php b/module/build/model.php index fe1490b0e2..f18e6f96ad 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -293,7 +293,6 @@ class buildModel extends model ->leftJoin(TABLE_RELEASE)->alias('t3')->on('t1.id = t3.build') ->leftJoin(TABLE_BRANCH)->alias('t4')->on('t1.branch = t4.id') ->where('t1.product')->in($products) - ->beginIF($this->lang->navGroup->testtask != 'qa')->andWhere('t1.project')->eq($this->session->PRJ)->fi() ->beginIF($branch)->andWhere('t1.branch')->in("0,$branch")->fi() ->andWhere('t1.deleted')->eq(0) ->orderBy('t1.date desc, t1.id desc')->fetchAll('id'); From 14e247a05dbcda7280636e9cfe187b82648fba20 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Thu, 18 Mar 2021 13:45:32 +0800 Subject: [PATCH 14/14] * Make the case link to the execution when link the testtask. --- module/testtask/control.php | 14 ++++++++++---- module/testtask/model.php | 6 ++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/module/testtask/control.php b/module/testtask/control.php index 540717c016..6310d2e720 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -39,15 +39,21 @@ class testtask extends control /* Set testtask menu group. */ $this->projectID = isset($_GET['PRJ']) ? $_GET['PRJ'] : 0; - if(!$this->projectID) + if($this->app->openApp == 'qa') { $this->app->loadConfig('qa'); foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; + //$this->lang->noMenuModule[] = $this->app->rawModule; } - else + elseif($this->app->openApp == 'project') { - $this->lang->testtask->menu = $this->lang->projectQa->menu; - $this->lang->testtask->subMenu = $this->lang->projectQa->subMenu; + $this->lang->testcase->menu = $this->lang->projectQa->menu; + $this->lang->testcase->subMenu = $this->lang->projectQa->subMenu; + } + elseif($this->app->openApp == 'execution') + { + $this->lang->testcase->menu = $this->lang->execution->qaMenu; + $this->lang->testcase->subMenu = ''; } $this->loadModel('product'); diff --git a/module/testtask/model.php b/module/testtask/model.php index af5080ca05..112fa4cb88 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -983,11 +983,13 @@ class testtaskModel extends model $this->dao->replace(TABLE_TESTRUN)->data($row)->exec(); /* When the cases linked the testtask, the cases link to the project. */ - if($this->lang->navGroup->testtask != 'qa') + if($this->app->openApp != 'qa') { $lastOrder = (int)$this->dao->select('*')->from(TABLE_PROJECTCASE)->where('project')->eq($projectID)->orderBy('order_desc')->limit(1)->fetch('order'); + $project = $this->app->openApp == 'project' ? $this->session->PRJ : $this->session->execution; + $data = new stdclass(); - $data->project = $this->session->PRJ; + $data->project = $project; $data->product = $this->session->product; $data->case = $caseID; $data->version = 1;