From 9c04bd1fd19fbf82f2bdd157d6218304a6395f54 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 27 Oct 2015 08:27:06 +0800 Subject: [PATCH 1/9] * change for db. --- db/update7.3.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/update7.3.sql b/db/update7.3.sql index 9c80ac0ff4..f6929aa0a6 100644 --- a/db/update7.3.sql +++ b/db/update7.3.sql @@ -9,8 +9,8 @@ ALTER TABLE `zt_build` ADD `branch` mediumint(8) unsigned NOT NULL AFTER `produc ALTER TABLE `zt_release` ADD `branch` mediumint(8) unsigned NOT NULL AFTER `product`; ALTER TABLE `zt_bug` ADD `branch` mediumint(8) unsigned NOT NULL AFTER `product`; ALTER TABLE `zt_case` ADD `branch` mediumint(8) unsigned NOT NULL AFTER `product`; -ALTER TABLE `zt_module` ADD `branch` varchar(50) COLLATE 'utf8_general_ci' unsigned NOT NULL AFTER `root`; -ALTER TABLE `zt_story` ADD `branch` varchar(50) COLLATE 'utf8_general_ci' NOT NULL AFTER `product`; +ALTER TABLE `zt_module` ADD `branch` mediumint(8) unsigned NOT NULL AFTER `root`; +ALTER TABLE `zt_story` ADD `branch` mediumint(8) unsigned NOT NULL AFTER `product`; CREATE TABLE `zt_branch` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, From 695815c2d6da0dc543d9d82629494d021cb13016 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 27 Oct 2015 08:27:25 +0800 Subject: [PATCH 2/9] * fix bug #751. --- www/theme/default/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/theme/default/style.css b/www/theme/default/style.css index e7f4261b0c..9b04d018fe 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -62,7 +62,7 @@ a,a:focus,a:active {text-decoration: none; outline:none;} .label-badge {padding: 2px 6px} /* dropdown */ -.dropdown-menu {min-width: 80px; padding: 4px 0} +.dropdown-menu {min-width: 80px; padding: 4px 0; z-index:2222;} .dropdown-menu > li > a, .dropdown-header {font-size: 12px; padding: 5px 25px 5px 15px} .dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:active {background: #f1f1f1; font-weight: bold;} .dropdown-menu > .active {position: relative;} From b979a5da3898395fb71b127b870c70be0038209f Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 27 Oct 2015 09:34:05 +0800 Subject: [PATCH 3/9] * finish task #2352. --- module/product/control.php | 3 +- module/product/model.php | 1 + module/project/model.php | 10 ++-- module/release/control.php | 5 +- module/story/control.php | 2 +- module/testcase/config.php | 2 + module/testcase/control.php | 68 +++++++++++++++--------- module/testcase/js/common.js | 28 +++++++++- module/testcase/lang/zh-cn.php | 1 + module/testcase/model.php | 9 ++-- module/testcase/view/browse.html.php | 2 +- module/testcase/view/caseheader.html.php | 13 ++--- module/testcase/view/create.html.php | 5 +- module/testcase/view/edit.html.php | 7 ++- module/testcase/view/view.html.php | 6 +++ 15 files changed, 111 insertions(+), 51 deletions(-) diff --git a/module/product/control.php b/module/product/control.php index 46633adb86..d6627d343a 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -117,7 +117,6 @@ class product extends control /* Set product, module and query. */ $productID = $this->product->saveState($productID, $this->products); - $product = $this->product->getById($productID); if($branch === '') $branch = $this->session->branch; $moduleID = ($browseType == 'bymodule') ? (int)$param : 0; $queryID = ($browseType == 'bysearch') ? (int)$param : 0; @@ -172,7 +171,7 @@ class product extends control $this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($productID); $this->config->product->search['params']['product']['values'] = array($productID => $this->products[$productID], 'all' => $this->lang->product->allProduct); $this->config->product->search['params']['module']['values'] = $this->tree->getOptionMenu($productID, $viewType = 'story', $startModuleID = 0); - if($product->type == 'normal') + if($this->session->currentProductType == 'normal') { unset($this->config->product->search['fields']['branch']); unset($this->config->product->search['params']['branch']); diff --git a/module/product/model.php b/module/product/model.php index 23b91a6812..cac8e7b950 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -64,6 +64,7 @@ class productModel extends model setCookie("lastProduct", $productID, $this->config->cookieLife, $this->config->webRoot); setCookie("lastBranch", "$productID-$branch", $this->config->cookieLife, $this->config->webRoot); $currentProduct = $this->getById($productID); + $this->session->set('currentProductType', $currentProduct->type); $output = "{$currentProduct->name}
"; if($currentProduct->type != 'normal') { diff --git a/module/project/model.php b/module/project/model.php index 1f2fba6ea3..89928d01e0 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -555,15 +555,13 @@ class projectModel extends model { if($productID != 0) { - return $this->dao->select('t2.*') - ->from(TABLE_PROJECTPRODUCT)->alias('t1') - ->leftJoin(TABLE_PROJECT)->alias('t2') - ->on('t1.project = t2.id') + return $this->dao->select('t2.*')->from(TABLE_PROJECTPRODUCT)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') ->where('t1.product')->eq($productID) ->andWhere('t2.deleted')->eq(0) ->andWhere('t2.iscat')->eq(0) ->beginIF($status == 'undone')->andWhere('t2.status')->ne('done')->fi() - ->beginIF($branch != 0)->andWhere('t1.branch')->like(",$branch,")->fi() + ->beginIF($branch != 0)->andWhere('t1.branch')->eq($branch)->fi() ->beginIF($status == 'isdoing')->andWhere('t2.status')->ne('done')->andWhere('t2.status')->ne('suspended')->fi() ->beginIF($status != 'all' and $status != 'isdoing' and $status != 'undone')->andWhere('status')->in($status)->fi() ->orderBy('order_desc') @@ -634,7 +632,7 @@ class projectModel extends model public function getProjectStats($status = 'undone', $productID = 0, $itemCounts = 30, $orderBy = 'order_desc', $pager = null) { /* Init vars. */ - $projects = $this->getList($status, 0, $productID, $branch); + $projects = $this->getList($status, 0, $productID); foreach($projects as $projectID => $project) { if(!$this->checkPriv($project)) unset($projects[$projectID]); diff --git a/module/release/control.php b/module/release/control.php index 96c8c94507..0cf7d701c4 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -335,7 +335,6 @@ class release extends control $this->loadModel('product'); /* Build search form. */ - $product = $this->product->getByID($release->product); $queryID = ($browseType == 'bySearch') ? (int)$param : 0; unset($this->config->product->search['fields']['product']); unset($this->config->product->search['fields']['project']); @@ -345,14 +344,14 @@ class release extends control $this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($release->product => $release->product)); $this->config->product->search['params']['module']['values'] = $this->tree->getOptionMenu($release->product, $viewType = 'story', $startModuleID = 0); $this->config->product->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $this->lang->story->statusList); - if($product->type == 'normal') + if($this->session->currentProductType == 'normal') { unset($this->config->product->search['fields']['branch']); unset($this->config->product->search['params']['branch']); } else { - $this->config->product->search['params']['branch']['values'] = array('' => '') + $this->loadModel('branch')->getPairs($product->id, 'noempty'); + $this->config->product->search['params']['branch']['values'] = array('' => '') + $this->loadModel('branch')->getPairs($release->product, 'noempty'); } $this->loadModel('search')->setSearchParams($this->config->product->search); diff --git a/module/story/control.php b/module/story/control.php index fb533d0515..b99951f1fd 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -109,7 +109,7 @@ class story extends control $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch); /* Set menu. */ - $this->product->setMenu($products, $product->id); + $this->product->setMenu($products, $product->id, $branch); /* Init vars. */ $planID = 0; diff --git a/module/testcase/config.php b/module/testcase/config.php index 291dc9980f..329bdddabd 100644 --- a/module/testcase/config.php +++ b/module/testcase/config.php @@ -35,6 +35,7 @@ $config->testcase->search['fields']['type'] = $lang->testcase->type; $config->testcase->search['fields']['openedBy'] = $lang->testcase->openedBy; $config->testcase->search['fields']['status'] = $lang->testcase->status; $config->testcase->search['fields']['product'] = $lang->testcase->product; +$config->testcase->search['fields']['branch'] = $lang->testcase->branch; $config->testcase->search['fields']['stage'] = $lang->testcase->stage; $config->testcase->search['fields']['module'] = $lang->testcase->module; $config->testcase->search['fields']['pri'] = $lang->testcase->pri; @@ -52,6 +53,7 @@ $config->testcase->search['params']['pri'] = array('operator' => '=', $config->testcase->search['params']['openedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); $config->testcase->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->testcase->statusList); $config->testcase->search['params']['product'] = array('operator' => '=', 'control' => 'select', 'values' => ''); +$config->testcase->search['params']['branch'] = array('operator' => '=', 'control' => 'select', 'values' => ''); $config->testcase->search['params']['stage'] = array('operator' => 'include', 'control' => 'select', 'values' => $lang->testcase->stageList); $config->testcase->search['params']['openedDate'] = array('operator' => '>=', 'control' => 'input', 'values' => '', 'class' => 'date'); diff --git a/module/testcase/control.php b/module/testcase/control.php index ba282b5614..b007b44c7e 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -52,7 +52,7 @@ class testcase extends control * @access public * @return void */ - public function browse($productID = 0, $browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function browse($productID = 0, $branch = 0, $browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { /* Set browseType, productID, moduleID and queryID. */ $browseType = strtolower($browseType); @@ -61,7 +61,7 @@ class testcase extends control $queryID = ($browseType == 'bysearch') ? (int)$param : 0; /* Set menu, save session. */ - $this->testcase->setMenu($this->products, $productID); + $this->testcase->setMenu($this->products, $productID, $branch); $this->session->set('caseList', $this->app->getURI(true)); $this->session->set('productID', $productID); $this->session->set('moduleID', $moduleID); @@ -80,7 +80,7 @@ class testcase extends control if($browseType == 'bymodule' or $browseType == 'all') { $childModuleIds = $this->tree->getAllChildId($moduleID); - $cases = $this->testcase->getModuleCases($productID, $childModuleIds, $sort, $pager); + $cases = $this->testcase->getModuleCases($productID, $branch, $childModuleIds, $sort, $pager); } /* Cases need confirmed. */ elseif($browseType == 'needconfirm') @@ -142,13 +142,22 @@ class testcase extends control /* Build the search form. */ $this->config->testcase->search['params']['product']['values']= array($productID => $this->products[$productID], 'all' => $this->lang->testcase->allProduct); $this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'case'); - $this->config->testcase->search['actionURL'] = $this->createLink('testcase', 'browse', "productID=$productID&browseType=bySearch&queryID=myQueryID"); + if($this->session->currentProductType == 'normal') + { + unset($this->config->testcase->search['fields']['branch']); + unset($this->config->testcase->search['params']['branch']); + } + else + { + $this->config->testcase->search['params']['branch']['values'] = array('' => '') + $this->loadModel('branch')->getPairs($productID, 'noempty'); + } + $this->config->testcase->search['actionURL'] = $this->createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID"); $this->config->testcase->search['queryID'] = $queryID; $this->loadModel('search')->setSearchParams($this->config->testcase->search); /* Assign. */ $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->common; - $this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]); + $this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]); $this->view->position[] = $this->lang->testcase->common; $this->view->productID = $productID; $this->view->productName = $this->products[$productID]; @@ -160,6 +169,7 @@ class testcase extends control $this->view->browseType = $browseType; $this->view->param = $param; $this->view->cases = $cases; + $this->view->branch = $branch; $this->display(); } @@ -172,17 +182,17 @@ class testcase extends control * @access public * @return void */ - public function groupCase($productID = 0, $groupBy = 'stroy') + public function groupCase($productID = 0, $branch = 0, $groupBy = 'stroy') { $groupBy = empty($groupBy) ? 'stroy' : $groupBy; $productID = $this->product->saveState($productID, $this->products); $this->app->loadLang('testtask'); - $this->testcase->setMenu($this->products, $productID); + $this->testcase->setMenu($this->products, $productID, $branch); $this->session->set('caseList', $this->app->getURI(true)); - $cases = $this->testcase->getModuleCases($productID, 0, $groupBy); + $cases = $this->testcase->getModuleCases($productID, $branch, 0, $groupBy); $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', false); $groupCases = array(); @@ -248,13 +258,14 @@ class testcase extends control $this->loadModel('action'); $this->action->create('case', $caseID, 'Opened'); - $response['locate'] = $this->createLink('testcase', 'browse', "productID=$_POST[product]&browseType=byModule&args=$_POST[module]"); + $response['locate'] = $this->createLink('testcase', 'browse', "productID={$_POST['product']}&branch={$_POST['branch']}&browseType=byModule&args={$_POST['module']}"); $this->send($response); } if(empty($this->products)) $this->locate($this->createLink('product', 'create')); /* Set productID and currentModuleID. */ $productID = $this->product->saveState($productID, $this->products); + $product = $this->product->getById($productID); if($storyID and empty($moduleID)) { $story = $this->loadModel('story')->getByID($storyID); @@ -263,7 +274,7 @@ class testcase extends control $currentModuleID = (int)$moduleID; /* Set menu. */ - $this->testcase->setMenu($this->products, $productID); + $this->testcase->setMenu($this->products, $productID, $branch); /* Init vars. */ $type = 'feature'; @@ -312,7 +323,7 @@ class testcase extends control } $title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->create; - $position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]); + $position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]); $position[] = $this->lang->testcase->common; $position[] = $this->lang->testcase->create; @@ -332,7 +343,7 @@ class testcase extends control $this->view->position = $position; $this->view->productID = $productID; $this->view->productName = $this->products[$productID]; - $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0); + $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $branch); $this->view->currentModuleID = $currentModuleID ? $currentModuleID : (isset($stories[$storyID]) ? $stories[$storyID]->module : 0); $this->view->stories = $stories; $this->view->type = $type; @@ -343,6 +354,9 @@ class testcase extends control $this->view->precondition = $precondition; $this->view->keywords = $keywords; $this->view->steps = $steps; + $this->view->product = $product; + $this->view->branch = $branch; + $this->view->branches = $product->type != 'normal' ? $this->loadModel('branch')->getPairs($productID) : array(); $this->display(); } @@ -364,7 +378,7 @@ class testcase extends control { $caseID = $this->testcase->batchCreate($productID, $storyID); if(dao::isError()) die(js::error(dao::getError())); - die(js::locate($this->createLink('testcase', 'browse', "productID=$productID&browseType=byModule¶m=$moduleID"), 'parent')); + die(js::locate($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=byModule¶m=$moduleID"), 'parent')); } if(empty($this->products)) $this->locate($this->createLink('product', 'create')); @@ -385,7 +399,7 @@ class testcase extends control $title = ''; $title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->batchCreate; - $position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]); + $position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]); $position[] = $this->lang->testcase->common; $position[] = $this->lang->testcase->batchCreate; @@ -459,8 +473,8 @@ class testcase extends control if($from == 'testtask') $run = $this->loadModel('testtask')->getRunByCase($taskID, $caseID); $productID = $case->product; - $this->testcase->setMenu($this->products, $productID); - + $product = $this->loadModel('product')->getById($productID); + $this->testcase->setMenu($this->products, $productID, $case->branch); $this->view->title = "CASE #$case->id $case->title - " . $this->products[$productID]; $this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]); @@ -472,6 +486,8 @@ class testcase extends control $this->view->taskID = $taskID; $this->view->version = $version ? $version : $case->version; $this->view->productName = $this->products[$productID]; + $this->view->product = $product; + $this->view->branchName = $product->type == 'normal' ? '' : $this->loadModel('branch')->getById($case->branch); $this->view->modulePath = $this->tree->getParents($case->module); $this->view->users = $this->user->getPairs('noletter'); $this->view->actions = $this->loadModel('action')->getList('case', $caseID); @@ -523,6 +539,7 @@ class testcase extends control $case->steps[] = $step; } $productID = $case->product; + $product = $this->loadModel('product')->getById($productID); $currentModuleID = $case->module; $title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->edit; $position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]); @@ -530,13 +547,15 @@ class testcase extends control $position[] = $this->lang->testcase->edit; /* Set menu. */ - $this->testcase->setMenu($this->products, $productID); + $this->testcase->setMenu($this->products, $productID, $case->branch); $this->view->title = $title; $this->view->position = $position; $this->view->productID = $productID; + $this->view->product = $product; + $this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($productID); $this->view->productName = $this->products[$productID]; - $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0); + $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $case->branch); $this->view->currentModuleID = $currentModuleID; $this->view->users = $this->user->getPairs('noletter'); $this->view->stories = $this->story->getProductStoryPairs($productID, $case->branch); @@ -553,7 +572,7 @@ class testcase extends control * @access public * @return void */ - public function batchEdit($productID = 0) + public function batchEdit($productID = 0, $branch = 0) { if($this->post->titles) { @@ -580,9 +599,9 @@ class testcase extends control /* The cases of a product. */ if($productID) { - $this->testcase->setMenu($this->products, $productID); + $this->testcase->setMenu($this->products, $productID, $branch); $product = $this->product->getByID($productID); - $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0); + $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $branch); $this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]); $this->view->title = $product->name . $this->lang->colon . $this->lang->testcase->batchEdit; } @@ -906,7 +925,7 @@ class testcase extends control * @access public * @return void */ - public function import($productID) + public function import($productID, $branch = 0) { if($_FILES) { @@ -958,7 +977,7 @@ class testcase extends control $this->session->set('importFile', $fileName); - die(js::locate(inlink('showImport', "productID=$productID"), 'parent.parent')); + die(js::locate(inlink('showImport', "productID=$productID&branch=$branch"), 'parent.parent')); } $this->display(); } @@ -1093,7 +1112,7 @@ class testcase extends control if(empty($caseData)) { echo js::alert($this->lang->error->noData); - die(js::locate($this->createLink('testcase', 'browse'))); + die(js::locate($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch"))); } $this->view->title = $this->lang->testcase->common . $this->lang->colon . $this->lang->testcase->showImport; @@ -1105,6 +1124,7 @@ class testcase extends control $this->view->caseData = $caseData; $this->view->stepData = $stepData; $this->view->productID = $productID; + $this->view->branch = $branch; $this->view->product = $this->products[$productID]; $this->display(); } diff --git a/module/testcase/js/common.js b/module/testcase/js/common.js index 982a046b46..1912cd2a17 100644 --- a/module/testcase/js/common.js +++ b/module/testcase/js/common.js @@ -8,10 +8,32 @@ var newRowID = 0; */ function loadAll(productID) { + loadProductBranches(productID) loadProductModules(productID); setStories(); } +function loadBranch() +{ + var branch = $('#branch').val(); + if(typeof(branch) == 'undefined') branch = 0; + loadProductModules($('#product').val(), branch); + setStories(); +} + +function loadProductBranches(productID) +{ + $('#branch').remove(); + $.get(createLink('branch', 'ajaxGetBranches', "productID=" + productID), function(data) + { + if(data) + { + $('#product').closest('.input-group').append(data); + $('#branch').css('width', '65px'); + } + }) +} + /** * Load stories of module. * @@ -30,9 +52,11 @@ function loadModuleRelated() * @access public * @return void */ -function loadProductModules(productID) +function loadProductModules(productID, branch) { - link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=case&rootModuleID=0&returnType=html&needManage=true'); + if(typeof(branch) == 'undefined') branch = 0; + if(!branch) branch = 0; + link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=case&branch=' + branch + '&rootModuleID=0&returnType=html&needManage=true'); $('#moduleIdBox').load(link, function(){$(this).find('select').chosen(defaultChosenOptions)}); setStories(); } diff --git a/module/testcase/lang/zh-cn.php b/module/testcase/lang/zh-cn.php index 181c955753..c8b7442e7a 100644 --- a/module/testcase/lang/zh-cn.php +++ b/module/testcase/lang/zh-cn.php @@ -11,6 +11,7 @@ */ $lang->testcase->id = '用例编号'; $lang->testcase->product = "所属{$lang->productCommon}"; +$lang->testcase->branch = "所属分支"; $lang->testcase->module = '所属模块'; $lang->testcase->story = '相关需求'; $lang->testcase->storyVersion = '需求版本'; diff --git a/module/testcase/model.php b/module/testcase/model.php index 1d3d5084b2..1127b1e4ef 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -21,10 +21,10 @@ class testcaseModel extends model * @access public * @return void */ - public function setMenu($products, $productID) + public function setMenu($products, $productID, $branch = 0) { - $this->loadModel('product')->setMenu($products, $productID); - $selectHtml = $this->product->select($products, $productID, 'testcase', 'browse'); + $this->loadModel('product')->setMenu($products, $productID, $branch); + $selectHtml = $this->product->select($products, $productID, 'testcase', 'browse', '', $branch); foreach($this->lang->testcase->menu as $key => $menu) { $replace = ($key == 'product') ? $selectHtml : $productID; @@ -170,11 +170,12 @@ class testcaseModel extends model * @access public * @return array */ - public function getModuleCases($productID, $moduleIds = 0, $orderBy = 'id_desc', $pager = null) + public function getModuleCases($productID, $branch = 0, $moduleIds = 0, $orderBy = 'id_desc', $pager = null) { return $this->dao->select('t1.*, t2.title as storyTitle')->from(TABLE_CASE)->alias('t1') ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story=t2.id') ->where('t1.product')->eq((int)$productID) + ->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi() ->beginIF($moduleIds)->andWhere('t1.module')->in($moduleIds)->fi() ->andWhere('t1.deleted')->eq('0') ->orderBy($orderBy)->page($pager)->fetchAll('id'); diff --git a/module/testcase/view/browse.html.php b/module/testcase/view/browse.html.php index 6a83cf191d..c096d544e3 100644 --- a/module/testcase/view/browse.html.php +++ b/module/testcase/view/browse.html.php @@ -107,7 +107,7 @@ js::set('batchDelete', $lang->testcase->confirmBatchDelete);
createLink('testcase', 'batchEdit', "productID=$productID"); + $actionLink = $this->createLink('testcase', 'batchEdit', "productID=$productID&branch=$branch"); $misc = common::hasPriv('testcase', 'batchEdit') ? "onclick=\"setFormAction('$actionLink')\"" : "disabled='disabled'"; echo html::commonButton($lang->edit, $misc); ?> diff --git a/module/testcase/view/caseheader.html.php b/module/testcase/view/caseheader.html.php index 299231b280..ce2bab6369 100644 --- a/module/testcase/view/caseheader.html.php +++ b/module/testcase/view/caseheader.html.php @@ -1,8 +1,9 @@ +
'; } @@ -45,11 +46,11 @@
diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index 9c6ad59de3..8a4f56fe75 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -27,7 +27,10 @@ testcase->lblProductAndModule;?> - +
+ + type != 'normal') echo html::select('branch', $branches, $branch, "onchange='loadBranch();' class='form-control' style='width:65px'");?> +
diff --git a/module/testcase/view/edit.html.php b/module/testcase/view/edit.html.php index b1be0276af..8a0020b659 100644 --- a/module/testcase/view/edit.html.php +++ b/module/testcase/view/edit.html.php @@ -89,7 +89,12 @@ - + diff --git a/module/testcase/view/view.html.php b/module/testcase/view/view.html.php index 5dd63fe25f..9bde7e6d90 100644 --- a/module/testcase/view/view.html.php +++ b/module/testcase/view/view.html.php @@ -122,6 +122,12 @@ + type != 'normal'):?> + + + + +
testcase->product;?> +
+ + type != 'normal') echo html::select('branch', $branches, $case->branch, "onchange='loadBranch();' class='form-control' style='width:65px'");?> +
+
testcase->module;?>testcase->product;?> product", $productName)) echo $productName;?>
testcase->branch;?>product&branch=$case->branch", $branchName)) echo $branchName;?>
testcase->module;?> From 71240b18a799c0e489d113f75ebb124ae45b691c Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 27 Oct 2015 14:15:05 +0800 Subject: [PATCH 4/9] * finish task #2351. --- module/branch/control.php | 2 +- module/bug/config.php | 2 + module/bug/control.php | 86 ++++++++++++++++------------ module/bug/js/common.js | 72 ++++++++++++++++++----- module/bug/lang/zh-cn.php | 1 + module/bug/model.php | 49 ++++++++++------ module/bug/view/browse.html.php | 34 +++++------ module/bug/view/create.html.php | 5 +- module/bug/view/edit.html.php | 9 ++- module/bug/view/view.html.php | 12 +++- module/build/control.php | 30 +++++----- module/build/model.php | 14 +++-- module/product/control.php | 4 +- module/product/model.php | 10 ++-- module/product/view/browse.html.php | 2 +- module/project/view/bug.html.php | 2 +- module/story/control.php | 6 +- module/story/model.php | 14 ++--- module/testcase/control.php | 10 +--- module/testcase/model.php | 5 +- module/testcase/view/browse.html.php | 4 +- module/testcase/view/create.html.php | 2 +- module/testcase/view/edit.html.php | 4 +- module/testtask/lang/zh-cn.php | 4 +- 24 files changed, 231 insertions(+), 152 deletions(-) diff --git a/module/branch/control.php b/module/branch/control.php index 177ddf17a4..3e1a3d550e 100644 --- a/module/branch/control.php +++ b/module/branch/control.php @@ -54,7 +54,7 @@ class branch extends control if(empty($product) or $product->type == 'normal') die(); $branches = $this->branch->getPairs($productID); - die(html::select('branch', $branches, '', "class='form-control'")); + die(html::select('branch', $branches, '', "class='form-control' onchange='loadBranch()'")); } } diff --git a/module/bug/config.php b/module/bug/config.php index d5217f2307..8f8c1baa82 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -61,6 +61,7 @@ $config->bug->search['fields']['status'] = $lang->bug->status; $config->bug->search['fields']['confirmed'] = $lang->bug->confirmed; $config->bug->search['fields']['product'] = $lang->bug->product; +$config->bug->search['fields']['branch'] = $lang->bug->branch; $config->bug->search['fields']['plan'] = $lang->bug->productplan; $config->bug->search['fields']['module'] = $lang->bug->module; $config->bug->search['fields']['project'] = $lang->bug->project; @@ -102,6 +103,7 @@ $config->bug->search['params']['status'] = array('operator' => '=', $config->bug->search['params']['confirmed'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->bug->confirmedList); $config->bug->search['params']['product'] = array('operator' => '=', 'control' => 'select', 'values' => ''); +$config->bug->search['params']['branch'] = array('operator' => '=', 'control' => 'select', 'values' => ''); $config->bug->search['params']['plan'] = array('operator' => '=', 'control' => 'select', 'values' => ''); $config->bug->search['params']['module'] = array('operator' => 'belong', 'control' => 'select', 'values' => 'modules'); $config->bug->search['params']['project'] = array('operator' => '=', 'control' => 'select', 'values' => 'projects'); diff --git a/module/bug/control.php b/module/bug/control.php index 610c07f756..7dd41dbfd5 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -61,7 +61,7 @@ class bug extends control * @access public * @return void */ - public function browse($productID = 0, $browseType = 'unclosed', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function browse($productID = 0, $branch = 0, $browseType = 'unclosed', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1) { /* Set browseType, productID, moduleID and queryID. */ $browseType = strtolower($browseType); @@ -70,7 +70,7 @@ class bug extends control $queryID = ($browseType == 'bysearch') ? (int)$param : 0; /* Set menu and save session. */ - $this->bug->setMenu($this->products, $productID); + $this->bug->setMenu($this->products, $productID, $branch); $this->session->set('bugList', $this->app->getURI(true)); /* Process the order by field. */ @@ -90,23 +90,23 @@ class bug extends control /* Get bugs. */ $bugs = array(); - if($browseType == 'all') $bugs = $this->bug->getAllBugs($productID, $projects, $sort, $pager); + if($browseType == 'all') $bugs = $this->bug->getAllBugs($productID, $branch, $projects, $sort, $pager); elseif($browseType == "bymodule") { $childModuleIds = $this->tree->getAllChildId($moduleID); - $bugs = $this->bug->getModuleBugs($productID, $childModuleIds, $projects, $sort, $pager); + $bugs = $this->bug->getModuleBugs($productID, $branch, $childModuleIds, $projects, $sort, $pager); } - elseif($browseType == 'assigntome') $bugs = $this->bug->getByAssigntome($productID, $projects, $sort, $pager); - elseif($browseType == 'openedbyme') $bugs = $this->bug->getByOpenedbyme($productID, $projects, $sort, $pager); - elseif($browseType == 'resolvedbyme') $bugs = $this->bug->getByResolvedbyme($productID, $projects, $sort, $pager); - elseif($browseType == 'assigntonull') $bugs = $this->bug->getByAssigntonull($productID, $projects, $sort, $pager); - elseif($browseType == 'unconfirmed') $bugs = $this->bug->getUnconfirmed($productID, $projects, $sort, $pager); - elseif($browseType == 'unresolved') $bugs = $this->bug->getByStatus($productID, $projects, 'unresolved', $sort, $pager); - elseif($browseType == 'unclosed') $bugs = $this->bug->getByStatus($productID, $projects, 'unclosed', $sort, $pager); - elseif($browseType == 'toclosed') $bugs = $this->bug->getByStatus($productID, $projects, 'toclosed', $sort, $pager); - elseif($browseType == 'longlifebugs') $bugs = $this->bug->getByLonglifebugs($productID, $projects, $sort, $pager); - elseif($browseType == 'postponedbugs') $bugs = $this->bug->getByPostponedbugs($productID, $projects, $sort, $pager); - elseif($browseType == 'needconfirm') $bugs = $this->bug->getByNeedconfirm($productID, $projects, $sort, $pager); + elseif($browseType == 'assigntome') $bugs = $this->bug->getByAssigntome($productID, $branch, $projects, $sort, $pager); + elseif($browseType == 'openedbyme') $bugs = $this->bug->getByOpenedbyme($productID, $branch, $projects, $sort, $pager); + elseif($browseType == 'resolvedbyme') $bugs = $this->bug->getByResolvedbyme($productID, $branch, $projects, $sort, $pager); + elseif($browseType == 'assigntonull') $bugs = $this->bug->getByAssigntonull($productID, $branch, $projects, $sort, $pager); + elseif($browseType == 'unconfirmed') $bugs = $this->bug->getUnconfirmed($productID, $branch, $projects, $sort, $pager); + elseif($browseType == 'unresolved') $bugs = $this->bug->getByStatus($productID, $branch, $projects, 'unresolved', $sort, $pager); + elseif($browseType == 'unclosed') $bugs = $this->bug->getByStatus($productID, $branch, $projects, 'unclosed', $sort, $pager); + elseif($browseType == 'toclosed') $bugs = $this->bug->getByStatus($productID, $branch, $projects, 'toclosed', $sort, $pager); + elseif($browseType == 'longlifebugs') $bugs = $this->bug->getByLonglifebugs($productID, $branch, $projects, $sort, $pager); + elseif($browseType == 'postponedbugs') $bugs = $this->bug->getByPostponedbugs($productID, $branch, $projects, $sort, $pager); + elseif($browseType == 'needconfirm') $bugs = $this->bug->getByNeedconfirm($productID, $branch, $projects, $sort, $pager); elseif($browseType == 'bysearch') $bugs = $this->bug->getBySearch($productID, $queryID, $sort, $pager); /* Process the sql, get the conditon partion, save it to session. */ @@ -116,7 +116,7 @@ class bug extends control $bugs = $this->loadModel('story')->checkNeedConfirm($bugs); /* Build the search form. */ - $this->config->bug->search['actionURL'] = $this->createLink('bug', 'browse', "productID=$productID&browseType=bySearch&queryID=myQueryID"); + $this->config->bug->search['actionURL'] = $this->createLink('bug', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID"); $this->config->bug->search['queryID'] = $queryID; $this->config->bug->search['params']['product']['values'] = array($productID => $this->products[$productID], 'all' => $this->lang->bug->allProduct); $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($productID); @@ -124,6 +124,15 @@ class bug extends control $this->config->bug->search['params']['project']['values'] = $this->product->getProjectPairs($productID); $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($productID); $this->config->bug->search['params']['resolvedBuild']['values'] = $this->build->getProductBuildPairs($productID); + if($this->session->currentProductType == 'normal') + { + unset($this->config->bug->search['fields']['branch']); + unset($this->config->bug->search['params']['branch']); + } + else + { + $this->config->bug->search['params']['branch']['values'] = array('' => '') + $this->loadModel('branch')->getPairs($productID, 'noempty'); + } $this->loadModel('search')->setSearchParams($this->config->bug->search); $users = $this->user->getPairs('noletter'); @@ -165,6 +174,7 @@ class bug extends control $this->view->orderBy = $orderBy; $this->view->moduleID = $moduleID; $this->view->memberPairs = $memberPairs; + $this->view->branch = $branch; $this->display(); } @@ -253,8 +263,7 @@ class bug extends control /* Get product, then set menu. */ $productID = $this->product->saveState($productID, $this->products); - $product = $this->product->getById($productID); - $branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($productID); + $branches = $this->session->currentProductType == 'normal' ? array() : $this->loadModel('branch')->getPairs($productID); $this->bug->setMenu($this->products, $productID, $branch); /* Init vars. */ @@ -336,9 +345,9 @@ class bug extends control $this->view->productID = $productID; $this->view->productName = $this->products[$productID]; - $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0); + $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch); $this->view->stories = $stories; - $this->view->projects = $this->product->getProjectPairs($productID, $params = 'nodeleted'); + $this->view->projects = $this->product->getProjectPairs($productID, $branch, $params = 'nodeleted'); $this->view->builds = $builds; $this->view->moduleID = $moduleID; $this->view->projectID = $projectID; @@ -360,7 +369,6 @@ class bug extends control $this->view->keywords = $keywords; $this->view->severity = $severity; $this->view->type = $type; - $this->view->product = $product; $this->view->branch = $branch; $this->view->branches = $branches; @@ -380,24 +388,24 @@ class bug extends control { if(!empty($_POST)) { - $actions = $this->bug->batchCreate($productID); + $actions = $this->bug->batchCreate($productID, $branch); foreach($actions as $bugID => $actionID) $this->sendmail($bugID, $actionID); die(js::locate($this->session->bugList, 'parent')); } /* Get product, then set menu. */ $productID = $this->product->saveState($productID, $this->products); - $this->bug->setMenu($this->products, $productID); + $this->bug->setMenu($this->products, $productID, $branch); /* If projectID is setted, get builds and stories of this project. */ if($projectID) { - $builds = $this->loadModel('build')->getProjectBuildPairs($projectID, $productID, 'noempty'); + $builds = $this->loadModel('build')->getProjectBuildPairs($projectID, $productID, $branch, 'noempty'); $stories = $this->story->getProjectStoryPairs($projectID); } else { - $builds = $this->loadModel('build')->getProductBuildPairs($productID, 'noempty'); + $builds = $this->loadModel('build')->getProductBuildPairs($productID, $branch, 'noempty'); $stories = $this->story->getProductStoryPairs($productID, $branch); } @@ -419,7 +427,7 @@ class bug extends control } $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->batchCreate; - $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); + $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]); $this->view->position[] = $this->lang->bug->batchCreate; $this->view->productID = $productID; @@ -428,8 +436,9 @@ class bug extends control $this->view->users = $this->user->getPairs('nodeleted,devfirst'); $this->view->projects = $this->product->getProjectPairs($productID, $params = 'nodeleted'); $this->view->projectID = $projectID; - $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0); + $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch); $this->view->moduleID = $moduleID; + $this->view->branch = $branch; $this->display(); } @@ -456,7 +465,7 @@ class bug extends control if($bug->assignedTo == $this->app->user->account) $this->loadModel('action')->read('bug', $bugID); /* Set menu. */ - $this->bug->setMenu($this->products, $bug->product); + $this->bug->setMenu($this->products, $bug->product, $bug->branch); /* Get product info. */ $productID = $bug->product; @@ -472,6 +481,7 @@ class bug extends control $this->view->productName = $productName; $this->view->modulePath = $this->tree->getParents($bug->module); $this->view->bug = $bug; + $this->view->branchName = $this->session->currentProductType == 'normal' ? '' : $this->loadModel('branch')->getById($bug->branch); $this->view->users = $this->user->getPairs('noletter'); $this->view->actions = $this->action->getList('bug', $bugID); $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID); @@ -532,7 +542,7 @@ class bug extends control $currentModuleID = $bug->module; /* Set the menu. */ - $this->bug->setMenu($this->products, $productID); + $this->bug->setMenu($this->products, $productID, $bug->branch); /* Set header and position. */ $this->view->title = $this->lang->bug->edit . "BUG #$bug->id $bug->title - " . $this->products[$productID]; @@ -542,13 +552,13 @@ class bug extends control /* Assign. */ if($projectID) { - $openedBuilds = $this->loadModel('build')->getProjectBuildPairs($projectID, $productID, 'noempty,noterminate,nodone'); - $allBuilds = $this->loadModel('build')->getProjectBuildPairs($projectID, $productID, 'noempty'); + $openedBuilds = $this->loadModel('build')->getProjectBuildPairs($projectID, $productID, $bug->branch, 'noempty,noterminate,nodone'); + $allBuilds = $this->loadModel('build')->getProjectBuildPairs($projectID, $productID, $bug->branch, 'noempty'); } else { - $openedBuilds = $this->loadModel('build')->getProductBuildPairs($productID, 'noempty,noterminate,nodone'); - $allBuilds = $this->loadModel('build')->getProductBuildPairs($productID, 'noempty'); + $openedBuilds = $this->loadModel('build')->getProductBuildPairs($productID, $bug->branch, 'noempty,noterminate,nodone'); + $allBuilds = $this->loadModel('build')->getProductBuildPairs($productID, $bug->branch, 'noempty'); } /* Set the openedBuilds list*/ @@ -563,10 +573,11 @@ class bug extends control $this->view->productID = $productID; $this->view->productName = $this->products[$productID]; $this->view->plans = $this->loadModel('productplan')->getPairs($productID, $bug->branch); - $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0); + $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $bug->branch); $this->view->currentModuleID = $currentModuleID; $this->view->projects = $this->product->getProjectPairs($bug->product); $this->view->stories = $bug->project ? $this->story->getProjectStoryPairs($bug->project) : $this->story->getProductStoryPairs($bug->product, $bug->branch); + $this->view->branches = $this->session->currentProductType == 'normal' ? array() : $this->loadModel('branch')->getPairs($bug->product); $this->view->tasks = $this->task->getProjectTaskPairs($bug->project); $this->view->users = $this->user->getPairs('nodeleted', "$bug->assignedTo,$bug->resolvedBy,$bug->closedBy,$bug->openedBy"); $this->view->openedBuilds = $openedBuilds; @@ -584,7 +595,7 @@ class bug extends control * @access public * @return void */ - public function batchEdit($productID = 0) + public function batchEdit($productID = 0, $branch = 0) { if($this->post->titles) { @@ -623,9 +634,9 @@ class bug extends control $product = $this->product->getByID($productID); /* Set product menu. */ - $this->bug->setMenu($this->products, $productID); + $this->bug->setMenu($this->products, $productID, $branch); $this->view->title = $product->name . $this->lang->colon . "BUG" . $this->lang->bug->batchEdit; - $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); + $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]); } /* The bugs of my. */ else @@ -652,6 +663,7 @@ class bug extends control $this->view->bugIDList = $bugIDList; $this->view->productID = $productID; $this->view->bugs = $bugs; + $this->view->branch = $branch; $this->view->users = $this->user->getPairs('nodeleted,devfirst'); $this->display(); diff --git a/module/bug/js/common.js b/module/bug/js/common.js index 80098c9d2d..b734cd7f38 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -43,6 +43,7 @@ function loadAll(productID) { $('#taskIdBox').innerHTML = ''; // Reset the task. $('#task').chosen(defaultChosenOptions); + loadProductBranches(productID) loadProductModules(productID); loadProductProjects(productID); loadProductBuilds(productID); @@ -51,6 +52,18 @@ function loadAll(productID) } } +function loadBranch() +{ + $('#taskIdBox').innerHTML = ''; // Reset the task. + $('#task').chosen(defaultChosenOptions); + productID = $('#product').val(); + loadProductModules(productID); + loadProductProjects(productID); + loadProductBuilds(productID); + loadProductplans(productID); + loadProductStories(productID); +} + /** *Load all builds of one project or product. * @@ -80,9 +93,11 @@ function loadAllBuilds() */ function loadAllProjectBuilds(projectID, productID) { + branch = $('#branch').val(); + if(typeof(branch) == 'undefined') branch = 0; if(page == 'create') oldOpenedBuild = $('#openedBuild').val() ? $('#openedBuild').val() : 0; - link = createLink('build', 'ajaxGetAllProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild); + link = createLink('build', 'ajaxGetAllProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + '&branch=' + branch); if(page == 'create') { $('#buildBox').load(link, function(){ notice(); $('#openedBuild').chosen(defaultChosenOptions);}); @@ -91,7 +106,7 @@ function loadAllProjectBuilds(projectID, productID) { $('#openedBuildBox').load(link, function(){$(this).find('select').chosen(defaultChosenOptions)}); - buildLink = createLink('build', 'ajaxGetAllProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild); + buildLink = createLink('build', 'ajaxGetAllProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=' + branch); $('#resolvedBuildBox').load(buildLink, function(){$(this).find('select').chosen(defaultChosenOptions)}); } } @@ -105,7 +120,9 @@ function loadAllProjectBuilds(projectID, productID) */ function loadAllProductBuilds(productID) { - link = createLink('build', 'ajaxGetAllProductBuilds', 'productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild); + branch = $('#branch').val(); + if(typeof(branch) == 'undefined') branch = 0; + link = createLink('build', 'ajaxGetAllProductBuilds', 'productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + '&branch=' + branch); if(page == 'create') { $('#buildBox').load(link, function(){ notice(); $('#openedBuild').chosen(defaultChosenOptions);}); @@ -114,7 +131,7 @@ function loadAllProductBuilds(productID) { $('#openedBuildBox').load(link, function(){$(this).find('select').chosen(defaultChosenOptions)}); - buildLink = createLink('build', 'ajaxGetAllProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild); + buildLink = createLink('build', 'ajaxGetAllProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=' + branch); $('#resolvedBuildBox').load(buildLink, function(){$(this).find('select').chosen(defaultChosenOptions)}); } } @@ -128,7 +145,9 @@ function loadAllProductBuilds(productID) */ function loadProductModules(productID) { - link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=bug&rootModuleID=0&returnType=html&needManage=true'); + branch = $('#branch').val(); + if(typeof(branch) == 'undefined') branch = 0; + link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=bug&branch=' + branch + '&rootModuleID=0&returnType=html&needManage=true'); $('#moduleIdBox').load(link, function(){$(this).find('select').chosen(defaultChosenOptions)}); } @@ -141,7 +160,9 @@ function loadProductModules(productID) */ function loadProductStories(productID) { - link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=0&moduleId=0&storyID=' + oldStoryID); + branch = $('#branch').val(); + if(typeof(branch) == 'undefined') branch = 0; + link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branch + '&moduleId=0&storyID=' + oldStoryID); $('#storyIdBox').load(link, function(){$('#story').chosen(defaultChosenOptions);}); } @@ -154,7 +175,9 @@ function loadProductStories(productID) */ function loadProductProjects(productID) { - link = createLink('product', 'ajaxGetProjects', 'productID=' + productID + '&projectID=' + oldProjectID); + branch = $('#branch').val(); + if(typeof(branch) == 'undefined') branch = 0; + link = createLink('product', 'ajaxGetProjects', 'productID=' + productID + '&projectID=' + oldProjectID + '&branch=' + branch); $('#projectIdBox').load(link, function(){$(this).find('select').chosen(defaultChosenOptions)}); } @@ -167,7 +190,9 @@ function loadProductProjects(productID) */ function loadProductplans(productID) { - link = createLink('productplan', 'ajaxGetProductplans', 'productID=' + productID); + branch = $('#branch').val(); + if(typeof(branch) == 'undefined') branch = 0; + link = createLink('productplan', 'ajaxGetProductplans', 'productID=' + productID + '&branch=' + branch); $('#planIdBox').load(link, function(){$(this).find('select').chosen(defaultChosenOptions)}); } @@ -180,7 +205,9 @@ function loadProductplans(productID) */ function loadProductBuilds(productID) { - link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild); + branch = $('#branch').val(); + if(typeof(branch) == 'undefined') branch = 0; + link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + '&branch=' + branch); if(page == 'create') { @@ -189,7 +216,7 @@ function loadProductBuilds(productID) else { $('#openedBuildBox').load(link, function(){$(this).find('select').chosen(defaultChosenOptions)}); - link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild); + link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=' + branch); $('#resolvedBuildBox').load(link, function(){$(this).find('select').chosen(defaultChosenOptions)}); } } @@ -240,7 +267,9 @@ function loadProjectTasks(projectID) */ function loadProjectStories(projectID) { - link = createLink('story', 'ajaxGetProjectStories', 'projectID=' + projectID + '&productID=' + $('#product').val() + '&moduleID=0&storyID=' + oldStoryID); + branch = $('#branch').val(); + if(typeof(branch) == 'undefined') branch = 0; + link = createLink('story', 'ajaxGetProjectStories', 'projectID=' + projectID + '&productID=' + $('#product').val() + '&branch=' + branch + '&moduleID=0&storyID=' + oldStoryID); $('#storyIdBox').load(link, function(){$('#story').chosen(defaultChosenOptions);}); } @@ -253,20 +282,22 @@ function loadProjectStories(projectID) */ function loadProjectBuilds(projectID) { + branch = $('#branch').val(); + if(typeof(branch) == 'undefined') branch = 0; productID = $('#product').val(); if(page == 'create') oldOpenedBuild = $('#openedBuild').val() ? $('#openedBuild').val() : 0; if(page == 'create') { - link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + "&index=0&needCreate=true"); + link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + "&branch=" + branch + "&index=0&needCreate=true"); $('#buildBox').load(link, function(){ notice(); $('#openedBuild').chosen(defaultChosenOptions);}); } else { - link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild); + link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + '&branch=' + branch); $('#openedBuildBox').load(link, function(){$(this).find('select').chosen(defaultChosenOptions)}); - link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild); + link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=' + branch); $('#resolvedBuildBox').load(link, function(){$(this).find('select').chosen(defaultChosenOptions)}); } } @@ -293,6 +324,19 @@ function setStories(moduleID, productID) }); } +function loadProductBranches(productID) +{ + $('#branch').remove(); + $.get(createLink('branch', 'ajaxGetBranches', "productID=" + productID), function(data) + { + if(data) + { + $('#product').closest('.input-group').append(data); + $('#branch').css('width', page == 'create' ? '100px' : '65px'); + } + }) +} + /** * notice for create build. * diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php index 142387c24e..584bdf4013 100644 --- a/module/bug/lang/zh-cn.php +++ b/module/bug/lang/zh-cn.php @@ -14,6 +14,7 @@ $lang->bug->common = 'Bug'; $lang->bug->id = 'Bug编号'; $lang->bug->product = '所属' . $lang->productCommon; $lang->bug->productplan = '所属计划'; +$lang->bug->branch = '所属分支'; $lang->bug->module = '所属模块'; $lang->bug->path = '模块路径'; $lang->bug->project = '所属' . $lang->projectCommon; diff --git a/module/bug/model.php b/module/bug/model.php index ead85f75b5..b1a9f171ce 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -21,10 +21,10 @@ class bugModel extends model * @access public * @return void */ - public function setMenu($products, $productID) + public function setMenu($products, $productID, $branch = 0) { - $this->loadModel('product')->setMenu($products, $productID); - $selectHtml = $this->product->select($products, $productID, 'bug', 'browse'); + $this->loadModel('product')->setMenu($products, $productID, $branch); + $selectHtml = $this->product->select($products, $productID, 'bug', 'browse', '', $branch); foreach($this->lang->bug->menu as $key => $menu) { $replace = ($key == 'product') ? $selectHtml : $productID; @@ -76,7 +76,7 @@ class bugModel extends model * @access public * @return void */ - public function batchCreate($productID) + public function batchCreate($productID, $branch = 0) { $this->loadModel('action'); $now = helper::now(); @@ -84,7 +84,7 @@ class bugModel extends model $data = fixer::input('post')->get(); $batchNum = count(reset($data)); - $result = $this->loadModel('common')->removeDuplicate('bug', $data, "product=$productID"); + $result = $this->loadModel('common')->removeDuplicate('bug', $data, "product=$productID&branch=$branch"); $data = $result['data']; for($i = 0; $i < $batchNum; $i++) @@ -93,7 +93,7 @@ class bugModel extends model } /* Get pairs(moduleID => moduleOwner) for bug. */ - $stmt = $this->dbh->query($this->loadModel('tree')->buildMenuQuery($productID, 'bug', $startModuleID = 0)); + $stmt = $this->dbh->query($this->loadModel('tree')->buildMenuQuery($productID, 'bug', $startModuleID = 0, $branch)); $moduleOwners = array(); while($module = $stmt->fetch()) $moduleOwners[$module->id] = $module->owner; @@ -126,6 +126,7 @@ class bugModel extends model $bug->openedBy = $this->app->user->account; $bug->openedDate = $now; $bug->product = $productID; + $bug->branch = $branch; $bug->module = $data->modules[$i]; $bug->project = $data->projects[$i]; $bug->openedBuild = implode(',', $data->openedBuilds[$i]); @@ -209,10 +210,11 @@ class bugModel extends model * @access public * @return array */ - public function getModuleBugs($productID, $moduleIds = 0, $projects, $orderBy = 'id_desc', $pager = null) + public function getModuleBugs($productID, $branch, $moduleIds = 0, $projects, $orderBy = 'id_desc', $pager = null) { return $this->dao->select('*')->from(TABLE_BUG) ->where('product')->eq((int)$productID) + ->beginIF(!empty($branch))->andWhere('branch')->in($branch)->fi() ->beginIF(!empty($moduleIds))->andWhere('module')->in($moduleIds)->fi() ->andWhere('project')->in(array_keys($projects)) ->andWhere('deleted')->eq(0) @@ -1353,13 +1355,13 @@ class bugModel extends model * @access public * @return array */ - public function getAllBugs($productID, $projects, $orderBy, $pager = null) + public function getAllBugs($productID, $branch, $projects, $orderBy, $pager = null) { - $bugs = $this->dao->select('t1.*, t2.title as planTitle') - ->from(TABLE_BUG)->alias('t1') + $bugs = $this->dao->select('t1.*, t2.title as planTitle')->from(TABLE_BUG)->alias('t1') ->leftJoin(TABLE_PRODUCTPLAN)->alias('t2')->on('t1.plan = t2.id') ->where('t1.product')->eq($productID) ->andWhere('t1.project')->in(array_keys($projects)) + ->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi() ->andWhere('t1.deleted')->eq(0) ->orderBy($orderBy)->page($pager)->fetchAll(); @@ -1379,9 +1381,10 @@ class bugModel extends model * @access public * @return array */ - public function getByAssigntome($productID, $projects, $orderBy, $pager) + public function getByAssigntome($productID, $branch, $projects, $orderBy, $pager) { return $this->dao->findByAssignedTo($this->app->user->account)->from(TABLE_BUG)->andWhere('product')->eq($productID) + ->beginIF($branch)->andWhere('branch')->in($branch)->fi() ->andWhere('project')->in(array_keys($projects)) ->andWhere('deleted')->eq(0) ->orderBy($orderBy)->page($pager)->fetchAll(); @@ -1398,9 +1401,10 @@ class bugModel extends model * @access public * @return array */ - public function getByOpenedbyme($productID, $projects, $orderBy, $pager) + public function getByOpenedbyme($productID, $branch, $projects, $orderBy, $pager) { return $this->dao->findByOpenedBy($this->app->user->account)->from(TABLE_BUG)->andWhere('product')->eq($productID) + ->beginIF($branch)->andWhere('branch')->in($branch)->fi() ->andWhere('project')->in(array_keys($projects)) ->andWhere('deleted')->eq(0) ->orderBy($orderBy)->page($pager)->fetchAll(); @@ -1417,9 +1421,10 @@ class bugModel extends model * @access public * @return array */ - public function getByResolvedbyme($productID, $projects, $orderBy, $pager) + public function getByResolvedbyme($productID, $branch, $projects, $orderBy, $pager) { return $this->dao->findByResolvedBy($this->app->user->account)->from(TABLE_BUG)->andWhere('product')->eq($productID) + ->beginIF($branch)->andWhere('branch')->in($branch)->fi() ->andWhere('project')->in(array_keys($projects)) ->andWhere('deleted')->eq(0) ->orderBy($orderBy)->page($pager)->fetchAll(); @@ -1436,10 +1441,11 @@ class bugModel extends model * @access public * @return array */ - public function getByAssigntonull($productID, $projects, $orderBy, $pager) + public function getByAssigntonull($productID, $branch, $projects, $orderBy, $pager) { return $this->dao->findByAssignedTo('')->from(TABLE_BUG)->andWhere('product')->eq($productID) + ->beginIF($branch)->andWhere('branch')->in($branch)->fi() ->andWhere('project')->in(array_keys($projects)) ->andWhere('deleted')->eq(0) ->orderBy($orderBy)->page($pager)->fetchAll(); @@ -1455,10 +1461,11 @@ class bugModel extends model * @access public * @return void */ - public function getUnconfirmed($productID, $projects, $orderBy, $pager) + public function getUnconfirmed($productID, $branch, $projects, $orderBy, $pager) { return $this->dao->select('*')->from(TABLE_BUG) ->where('confirmed')->eq(0) + ->beginIF($branch)->andWhere('branch')->in($branch)->fi() ->andWhere('product')->eq($productID) ->andWhere('project')->in(array_keys($projects)) ->andWhere('deleted')->eq(0) @@ -1477,11 +1484,12 @@ class bugModel extends model * @access public * @return array */ - public function getByStatus($productID, $projects, $status, $orderBy, $pager) + public function getByStatus($productID, $branch, $projects, $status, $orderBy, $pager) { return $this->dao->select('*')->from(TABLE_BUG) ->where('project')->in(array_keys($projects)) ->andWhere('product')->eq($productID) + ->beginIF($branch)->andWhere('branch')->in($branch)->fi() ->beginIF($status == 'unclosed')->andWhere('status')->ne('closed')->fi() ->beginIF($status == 'unresolved')->andWhere('status')->eq('active')->fi() ->beginIF($status == 'toclosed')->andWhere('status')->eq('resolved')->fi() @@ -1500,10 +1508,11 @@ class bugModel extends model * @access public * @return array */ - public function getByLonglifebugs($productID, $projects, $orderBy, $pager) + public function getByLonglifebugs($productID, $branch, $projects, $orderBy, $pager) { return $this->dao->findByLastEditedDate("<", date(DT_DATE1, strtotime('-7 days')))->from(TABLE_BUG)->andWhere('product')->eq($productID) ->andWhere('project')->in(array_keys($projects)) + ->beginIF($branch)->andWhere('branch')->in($branch)->fi() ->andWhere('openedDate')->lt(date(DT_DATE1,strtotime('-7 days'))) ->andWhere('deleted')->eq(0) ->andWhere('status')->ne('closed')->orderBy($orderBy)->page($pager)->fetchAll(); @@ -1520,9 +1529,10 @@ class bugModel extends model * @access public * @return array */ - public function getByPostponedbugs($productID, $projects, $orderBy, $pager) + public function getByPostponedbugs($productID, $branch, $projects, $orderBy, $pager) { return $this->dao->findByResolution('postponed')->from(TABLE_BUG)->andWhere('product')->eq($productID) + ->beginIF($branch)->andWhere('branch')->in($branch)->fi() ->andWhere('project')->in(array_keys($projects)) ->andWhere('deleted')->eq(0) ->orderBy($orderBy)->page($pager)->fetchAll(); @@ -1539,11 +1549,12 @@ class bugModel extends model * @access public * @return array */ - public function getByNeedconfirm($productID, $projects, $orderBy, $pager) + public function getByNeedconfirm($productID, $branch, $projects, $orderBy, $pager) { return $this->dao->select('t1.*, t2.title AS storyTitle')->from(TABLE_BUG)->alias('t1')->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') ->where("t2.status = 'active'") ->andWhere('t1.product')->eq($productID) + ->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi() ->andWhere('t2.version > t1.storyVersion') ->andWhere('t1.project')->in(array_keys($projects)) ->andWhere('t1.deleted')->eq(0) diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index b5902ca725..f268eb9924 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -19,18 +19,18 @@ js::set('moduleID', $moduleID);
@@ -55,8 +55,8 @@ js::set('moduleID', $moduleID);
@@ -82,7 +82,7 @@ js::set('moduleID', $moduleID);
- recTotal}&recPerPage={$pager->recPerPage}"; ?> + recTotal}&recPerPage={$pager->recPerPage}"; ?> @@ -154,7 +154,7 @@ js::set('moduleID', $moduleID); common::printIcon('bug', 'resolve', $params, $bug, 'list', '', '', 'iframe', true); common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); common::printIcon('bug', 'edit', $params, $bug, 'list'); - common::printIcon('bug', 'create', "product=$bug->product&extra=bugID=$bug->id", $bug, 'list', 'copy'); + common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=bugID=$bug->id", $bug, 'list', 'copy'); ?> @@ -175,7 +175,7 @@ js::set('moduleID', $moduleID);
createLink('bug', 'batchEdit', "productID=$productID"); + $actionLink = $this->createLink('bug', 'batchEdit', "productID=$productID&branch=$branch"); $misc = common::hasPriv('bug', 'batchEdit') ? "onclick=\"setFormAction('$actionLink')\"" : "disabled='disabled'"; echo html::commonButton($lang->edit, $misc); ?> diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index ea0dea59c8..b769af99f5 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -32,7 +32,10 @@ js::set('refresh', $lang->refresh);
idAB);?>
bug->lblProductAndModule;?> - +
+ + session->currentProductType != 'normal') echo html::select('branch', $branches, $branch, "onchange='loadBranch()' class='form-control' style='width:100px'");?> +
diff --git a/module/bug/view/edit.html.php b/module/bug/view/edit.html.php index 318fccfe0e..5c614bea78 100644 --- a/module/bug/view/edit.html.php +++ b/module/bug/view/edit.html.php @@ -71,12 +71,17 @@ js::set('oldResolvedBuild' , $bug->resolvedBuild); - + diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index 91aefb6273..36b8c8b104 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -24,8 +24,8 @@ session->bugList != false ? $app->session->bugList : inlink('browse', "productID=$bug->product"); $params = "bugID=$bug->id"; - $copyParams = "productID=$productID&extras=bugID=$bug->id"; - $convertParams = "productID=$productID&moduleID=0&from=bug&bugID=$bug->id"; + $copyParams = "productID=$productID&branch=$bug->branch&extras=bugID=$bug->id"; + $convertParams = "productID=$productID&branch=$bug->branch&moduleID=0&from=bug&bugID=$bug->id"; if(!$bug->deleted) { ob_start(); @@ -36,7 +36,7 @@ common::printIcon('bug', 'close', $params, $bug, 'button', '', '', 'text-danger iframe showinonlybody', true); common::printIcon('bug', 'activate', $params, $bug, 'button', '', '', 'text-success iframe showinonlybody', true); - common::printIcon('bug', 'toStory', "product=$bug->product&module=0&story=0&project=0&bugID=$bug->id", $bug, 'button', $lang->icons['story']); + common::printIcon('bug', 'toStory', "product=$bug->product&branch=$bug->branch&module=0&story=0&project=0&bugID=$bug->id", $bug, 'button', $lang->icons['story']); common::printIcon('bug', 'createCase', $convertParams, '', 'button', 'sitemap'); echo ''; @@ -110,6 +110,12 @@ + session->currentProductType != 'normal'):?> + + + + + build->getProductBuildPairs($productID, 'noempty,release,noterminate,nodone'), $build, 'size=4 class=form-control multiple')); - if($varName == 'openedBuilds' ) die(html::select($varName . "[$index][]", $this->build->getProductBuildPairs($productID, 'noempty,release'), $build, 'size=4 class=form-control multiple')); - if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProductBuildPairs($productID, 'noempty,release,noterminate,nodone'), $build, "class='form-control'")); + if($varName == 'openedBuild' ) die(html::select($varName . '[]', $this->build->getProductBuildPairs($productID, $branch, 'noempty,release,noterminate,nodone'), $build, 'size=4 class=form-control multiple')); + if($varName == 'openedBuilds' ) die(html::select($varName . "[$index][]", $this->build->getProductBuildPairs($productID, $branch, 'noempty,release'), $build, 'size=4 class=form-control multiple')); + if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProductBuildPairs($productID, $branch, 'noempty,release,noterminate,nodone'), $build, "class='form-control'")); } /** @@ -224,17 +224,17 @@ class build extends control * @access public * @return string */ - public function ajaxGetProjectBuilds($projectID, $productID, $varName, $build = '', $index = 0, $needCreate = false) + public function ajaxGetProjectBuilds($projectID, $productID, $varName, $build = '', $branch = 0, $index = 0, $needCreate = false) { if($varName == 'openedBuild') { - $builds = $this->build->getProjectBuildPairs($projectID, $productID, 'noempty,release,noterminate,nodone'); + $builds = $this->build->getProjectBuildPairs($projectID, $productID, $branch, 'noempty,release,noterminate,nodone'); $output = html::select($varName . '[]', $builds , $build, 'size=4 class=form-control multiple'); die($output); } - if($varName == 'openedBuilds') die(html::select($varName . "[$index][]", $this->build->getProjectBuildPairs($projectID, $productID, 'noempty'), $build, 'size=4 class=form-control multiple')); - if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProjectBuildPairs($projectID, $productID, 'noempty,noterminate,nodone'), $build, "class='form-control'")); - if($varName == 'testTaskBuild') die(html::select('build', $this->build->getProjectBuildPairs($projectID, $productID, 'noempty'), $build, "class='form-control'")); + if($varName == 'openedBuilds') die(html::select($varName . "[$index][]", $this->build->getProjectBuildPairs($projectID, $productID, $branch, 'noempty'), $build, 'size=4 class=form-control multiple')); + if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProjectBuildPairs($projectID, $productID, $branch, 'noempty,noterminate,nodone'), $build, "class='form-control'")); + if($varName == 'testTaskBuild') die(html::select('build', $this->build->getProjectBuildPairs($projectID, $productID, $branch, 'noempty'), $build, "class='form-control'")); } /** @@ -246,10 +246,10 @@ class build extends control * @access public * @return string */ - public function ajaxGetAllProductBuilds($productID, $varName, $build = '') + public function ajaxGetAllProductBuilds($productID, $varName, $build = '', $branch = 0) { - if($varName == 'openedBuild' ) die(html::select($varName . '[]', $this->build->getProductBuildPairs($productID, 'noempty,release'), $build, 'size=4 class=form-control multiple')); - if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProductBuildPairs($productID, 'noempty,release'), $build, "class='form-control'")); + if($varName == 'openedBuild' ) die(html::select($varName . '[]', $this->build->getProductBuildPairs($productID, $branch, 'noempty,release'), $build, 'size=4 class=form-control multiple')); + if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProductBuildPairs($productID, $branch, 'noempty,release'), $build, "class='form-control'")); } /** @@ -261,15 +261,15 @@ class build extends control * @access public * @return string */ - public function ajaxGetAllProjectBuilds($projectID, $productID, $varName, $build = '') + public function ajaxGetAllProjectBuilds($projectID, $productID, $varName, $build = '', $branch = 0) { if($varName == 'openedBuild') { - $builds = $this->build->getProjectBuildPairs($projectID, $productID, 'noempty,release'); + $builds = $this->build->getProjectBuildPairs($projectID, $productID, $branch, 'noempty,release'); $output = html::select($varName . '[]', $builds , $build, 'size=4 class=form-control multiple'); die($output); } - if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProjectBuildPairs($projectID, $productID, 'noempty'), $build, "class='form-control'")); + if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProjectBuildPairs($projectID, $productID, $branch, 'noempty'), $build, "class='form-control'")); } /** diff --git a/module/build/model.php b/module/build/model.php index 77ddde7c01..e50bd063a9 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -64,17 +64,17 @@ class buildModel extends model * @access public * @return array */ - public function getProjectBuildPairs($projectID, $productID, $params = '') + public function getProjectBuildPairs($projectID, $productID, $branch = 0, $params = '') { $sysBuilds = array(); if(strpos($params, 'noempty') === false) $sysBuilds = array('' => ''); if(strpos($params, 'notrunk') === false) $sysBuilds = $sysBuilds + array('trunk' => 'Trunk'); $builds = $this->dao->select('t1.id, t1.name')->from(TABLE_BUILD)->alias('t1') - ->leftJoin(TABLE_PROJECT)->alias('t2') - ->on('t1.project = t2.id') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') ->where('t1.project')->eq((int)$projectID) ->beginIF($productID)->andWhere('t1.product')->eq((int)$productID)->fi() + ->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi() ->beginIF(strpos($params, 'nodone') !== false)->andWhere('t2.status')->ne('done')->fi() ->andWhere('t1.deleted')->eq(0) ->orderBy('t1.date desc, t1.id desc')->fetchPairs(); @@ -82,6 +82,7 @@ class buildModel extends model $releases = $this->dao->select('build,name')->from(TABLE_RELEASE) ->where('build')->in(array_keys($builds)) ->beginIF(strpos($params, 'noterminate') !== false)->andWhere('status')->ne('terminate')->fi() + ->beginIF($branch)->andWhere('branch')->in($branch)->fi() ->andWhere('deleted')->eq(0) ->fetchPairs(); foreach($releases as $buildID => $releaseName) $builds[$buildID] = $releaseName; @@ -96,22 +97,23 @@ class buildModel extends model * @access public * @return string */ - public function getProductBuildPairs($products, $params = '') + public function getProductBuildPairs($products, $branch = 0, $params = '') { $sysBuilds = array(); if(strpos($params, 'noempty') === false) $sysBuilds = array('' => ''); if(strpos($params, 'notrunk') === false) $sysBuilds = $sysBuilds + array('trunk' => 'Trunk'); $productBuilds = $this->dao->select('t1.id, t1.name, t1.project')->from(TABLE_BUILD)->alias('t1') - ->leftJoin(TABLE_PROJECT)->alias('t2') - ->on('t1.project = t2.id') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') ->where('t1.product')->in($products) + ->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi() ->beginIF(strpos($params, 'nodone') !== false)->andWhere('t2.status')->ne('done')->fi() ->andWhere('t1.deleted')->eq(0) ->orderBy('t1.date desc, t1.id desc')->fetchAll('id'); $releases = $this->dao->select('build,name,deleted')->from(TABLE_RELEASE) ->where('product')->in($products) ->beginIF(strpos($params, 'noterminate') !== false)->andWhere('status')->ne('terminate')->fi() + ->beginIF($branch)->andWhere('branch')->in($branch)->fi() ->fetchAll('build'); $builds = array(); diff --git a/module/product/control.php b/module/product/control.php index d6627d343a..3196173e3e 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -501,9 +501,9 @@ class product extends control * @access public * @return void */ - public function ajaxGetProjects($productID, $projectID = 0) + public function ajaxGetProjects($productID, $projectID = 0, $branch = 0) { - $projects = $this->product->getProjectPairs($productID, $params = 'nodeleted'); + $projects = $this->product->getProjectPairs($productID, $branch, $params = 'nodeleted'); die(html::select('project', $projects, $projectID, 'class=form-control onchange=loadProjectRelated(this.value)')); } diff --git a/module/product/model.php b/module/product/model.php index cac8e7b950..dd1af775ef 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -349,14 +349,14 @@ class productModel extends model * @access public * @return array */ - public function getProjectPairs($productID, $param = 'all') + public function getProjectPairs($productID, $branch = 0, $param = 'all') { $projectList = array_keys($this->loadModel('project')->getPairs()); $projects = array(); - $datas = $this->dao->select('t2.id, t2.name, t2.deleted') - ->from(TABLE_PROJECTPRODUCT)->alias('t1')->leftJoin(TABLE_PROJECT)->alias('t2') - ->on('t1.project = t2.id') + $datas = $this->dao->select('t2.id, t2.name, t2.deleted')->from(TABLE_PROJECTPRODUCT) + ->alias('t1')->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') ->where('t1.product')->eq((int)$productID) + ->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi() ->andWhere('t2.id')->in($projectList) ->orderBy('t1.project desc') ->fetchAll(); @@ -698,7 +698,7 @@ class productModel extends model } else { - $link = helper::createLink($module, $method, "productID=%s&branch=%s"); + $link = helper::createLink($module, $method, "productID=%s" . ($branch ? "&branch=%s" : '')); } } else if($module == 'productplan' || $module == 'release') diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index e1bc979f21..444c6ffa80 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -115,7 +115,7 @@ common::printIcon('story', 'review', $vars, $story, 'list', 'search'); common::printIcon('story', 'close', $vars, $story, 'list', 'off', '', 'iframe', true); common::printIcon('story', 'edit', $vars, $story, 'list', 'pencil'); - common::printIcon('story', 'createCase', "productID=$story->product&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap'); + common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap'); ?> diff --git a/module/project/view/bug.html.php b/module/project/view/bug.html.php index 717fc8c5a2..c8e8e2e679 100644 --- a/module/project/view/bug.html.php +++ b/module/project/view/bug.html.php @@ -18,7 +18,7 @@
- id");?> + id");?>
diff --git a/module/story/control.php b/module/story/control.php index b99951f1fd..4391a92271 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -166,7 +166,7 @@ class story extends control $this->view->contactLists = $this->user->getContactLists($this->app->user->account, 'withnote'); $this->view->moduleID = $moduleID; $this->view->moduleOptionMenu = $moduleOptionMenu; - $this->view->plans = $this->loadModel('productplan')->getPairs($productID, 'unexpired'); + $this->view->plans = $this->loadModel('productplan')->getPairs($productID, $branch, 'unexpired'); $this->view->planID = $planID; $this->view->source = $source; $this->view->pri = $pri; @@ -896,14 +896,14 @@ class story extends control * @access public * @return void */ - public function ajaxGetProjectStories($projectID, $productID = 0, $moduleID = 0, $storyID = 0, $number = '', $type= 'full') + public function ajaxGetProjectStories($projectID, $productID = 0, $branch = 0, $moduleID = 0, $storyID = 0, $number = '', $type= 'full') { if($moduleID) { $moduleID = $this->loadModel('tree')->getStoryModule($moduleID); $moduleID = $this->tree->getAllChildID($moduleID); } - $stories = $this->story->getProjectStoryPairs($projectID, $productID, $moduleID, $type); + $stories = $this->story->getProjectStoryPairs($projectID, $productID, $branch, $moduleID, $type); $storyName = $number === '' ? 'story' : "story[$number]"; die(html::select($storyName, empty($stories) ? array('' => '') : $stories, $storyID, 'class=form-control onchange=setStoryRelated(' . $number . ');')); } diff --git a/module/story/model.php b/module/story/model.php index 8412f9f798..62cc810a2a 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -215,23 +215,20 @@ class storyModel extends model $stories = fixer::input('post')->get(); $batchNum = count(reset($stories)); - $result = $this->loadModel('common')->removeDuplicate('story', $stories, "product={$productID}"); + $result = $this->loadModel('common')->removeDuplicate('story', $stories, "product={$productID}&branch=$branch"); $stories = $result['data']; $module = 0; $plan = 0; $pri = 0; - $branch = 0; for($i = 0; $i < $batchNum; $i++) { $module = $stories->module[$i] == 'same' ? $module : $stories->module[$i]; $plan = $stories->plan[$i] == 'same' ? $plan : $stories->plan[$i]; $pri = $stories->pri[$i] == 'same' ? $pri : $stories->pri[$i]; - $branch = $stories->pri[$i] == 'same' ? $branch : $stories->branch[$i]; $stories->module[$i] = (int)$module; $stories->plan[$i] = (int)$plan; $stories->pri[$i] = (int)$pri; - $stories->branch[$i] = (int)$branch; } if(isset($stories->uploadImage)) $this->loadModel('file'); @@ -1220,17 +1217,16 @@ class storyModel extends model * @access public * @return array */ - public function getProjectStoryPairs($projectID = 0, $productID = 0, $moduleIds = 0, $type = 'full') + public function getProjectStoryPairs($projectID = 0, $productID = 0, $branch = 0, $moduleIds = 0, $type = 'full') { $stories = $this->dao->select('t2.id, t2.title, t2.module, t2.pri, t2.estimate, t3.name AS product') ->from(TABLE_PROJECTSTORY)->alias('t1') - ->leftJoin(TABLE_STORY)->alias('t2') - ->on('t1.story = t2.id') - ->leftJoin(TABLE_PRODUCT)->alias('t3') - ->on('t1.product = t3.id') + ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') + ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id') ->where('t1.project')->eq((int)$projectID) ->andWhere('t2.deleted')->eq(0) ->beginIF($productID)->andWhere('t1.product')->eq((int)$productID)->fi() + ->beginIF($branch)->andWhere('t2.branch')->eq((int)$branch)->fi() ->beginIF($moduleIds)->andWhere('t2.module')->in($moduleIds)->fi() ->fetchAll(); if(!$stories) return array(); diff --git a/module/testcase/control.php b/module/testcase/control.php index b007b44c7e..57233641d3 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -265,7 +265,6 @@ class testcase extends control /* Set productID and currentModuleID. */ $productID = $this->product->saveState($productID, $this->products); - $product = $this->product->getById($productID); if($storyID and empty($moduleID)) { $story = $this->loadModel('story')->getByID($storyID); @@ -354,9 +353,8 @@ class testcase extends control $this->view->precondition = $precondition; $this->view->keywords = $keywords; $this->view->steps = $steps; - $this->view->product = $product; $this->view->branch = $branch; - $this->view->branches = $product->type != 'normal' ? $this->loadModel('branch')->getPairs($productID) : array(); + $this->view->branches = $this->session->currentProductType != 'normal' ? $this->loadModel('branch')->getPairs($productID) : array(); $this->display(); } @@ -376,7 +374,7 @@ class testcase extends control $this->loadModel('story'); if(!empty($_POST)) { - $caseID = $this->testcase->batchCreate($productID, $storyID); + $caseID = $this->testcase->batchCreate($productID, $branch, $storyID); if(dao::isError()) die(js::error(dao::getError())); die(js::locate($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=byModule¶m=$moduleID"), 'parent')); } @@ -539,7 +537,6 @@ class testcase extends control $case->steps[] = $step; } $productID = $case->product; - $product = $this->loadModel('product')->getById($productID); $currentModuleID = $case->module; $title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->edit; $position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]); @@ -552,8 +549,7 @@ class testcase extends control $this->view->title = $title; $this->view->position = $position; $this->view->productID = $productID; - $this->view->product = $product; - $this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($productID); + $this->view->branches = $this->session->currentProductType == 'normal' ? array() : $this->loadModel('branch')->getPairs($productID); $this->view->productName = $this->products[$productID]; $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $case->branch); $this->view->currentModuleID = $currentModuleID; diff --git a/module/testcase/model.php b/module/testcase/model.php index 1127b1e4ef..0293dadc7e 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -86,13 +86,13 @@ class testcaseModel extends model * @access public * @return void */ - function batchCreate($productID, $storyID) + function batchCreate($productID, $branch, $storyID) { $now = helper::now(); $cases = fixer::input('post')->get(); $batchNum = count(reset($cases)); - $result = $this->loadModel('common')->removeDuplicate('case', $cases, "product=$productID"); + $result = $this->loadModel('common')->removeDuplicate('case', $cases, "product=$productID&branch=$branch"); $cases = $result['data']; for($i = 0; $i < $batchNum; $i++) @@ -119,6 +119,7 @@ class testcaseModel extends model { $data[$i] = new stdclass(); $data[$i]->product = $productID; + $data[$i]->branch = $branch; $data[$i]->module = $cases->module[$i]; $data[$i]->type = $cases->type[$i]; $data[$i]->story = $storyID ? $storyID : $cases->story[$i]; diff --git a/module/testcase/view/browse.html.php b/module/testcase/view/browse.html.php index c096d544e3..1c9aa483a7 100644 --- a/module/testcase/view/browse.html.php +++ b/module/testcase/view/browse.html.php @@ -38,7 +38,7 @@ js::set('batchDelete', $lang->testcase->confirmBatchDelete);
bug->product;?> +
+ + session->currentProductType != 'normal') echo html::select('branch', $branches, $bug->branch, "onchange='loadBranch();' class='form-control' style='width:65px'");?> +
+
bug->module;?> - +
bug->product;?> product", $productName)) echo $productName;?>
bug->branch;?>product&branch=$bug->branch", $branchName)) echo $branchName;?>
bug->module;?>
- recTotal}&recPerPage={$pager->recPerPage}"; ?> + recTotal}&recPerPage={$pager->recPerPage}"; ?> @@ -82,7 +82,7 @@ js::set('batchDelete', $lang->testcase->confirmBatchDelete); common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", '', 'list', 'play', '', 'runCase iframe'); common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", '', 'list', 'flag-checkered', '', 'results iframe'); common::printIcon('testcase', 'edit', "caseID=$case->id", $case, 'list'); - common::printIcon('testcase', 'create', "productID=$case->product&moduleID=$case->module&from=testcase¶m=$case->id", $case, 'list', 'copy'); + common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$case->id", $case, 'list', 'copy'); if(common::hasPriv('testcase', 'delete')) { diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index 8a4f56fe75..8c74066b1d 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -29,7 +29,7 @@ diff --git a/module/testtask/lang/zh-cn.php b/module/testtask/lang/zh-cn.php index 61a869fe8d..31504c1a78 100644 --- a/module/testtask/lang/zh-cn.php +++ b/module/testtask/lang/zh-cn.php @@ -35,13 +35,13 @@ $lang->testtask->wait = "待测版本"; $lang->testtask->done = "已测版本"; $lang->testtask->common = '测试视图版本'; -$lang->testtask->id = '版本编号'; +$lang->testtask->id = '编号'; $lang->testtask->product = '所属' . $lang->productCommon; $lang->testtask->project = '所属' . $lang->projectCommon; $lang->testtask->build = '版本'; $lang->testtask->owner = '负责人'; $lang->testtask->pri = '优先级'; -$lang->testtask->name = '版本名称'; +$lang->testtask->name = '名称'; $lang->testtask->begin = '开始日期'; $lang->testtask->end = '结束日期'; $lang->testtask->desc = '描述'; From 36732015096a75d0e7bf009adf0a3c7b9d91bcd2 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 27 Oct 2015 15:03:20 +0800 Subject: [PATCH 5/9] * adjust for task #2336. --- config/config.php | 1 + module/action/config.php | 1 + module/action/lang/zh-cn.php | 12 +++++++----- module/branch/control.php | 19 ++++++++++++++---- module/branch/css/manage.css | 1 + module/branch/js/manage.js | 11 +++++++++++ module/branch/lang/zh-cn.php | 2 ++ module/branch/view/manage.html.php | 31 ++++++++++++++++++------------ module/common/lang/zh-cn.php | 1 + module/product/model.php | 1 + 10 files changed, 59 insertions(+), 21 deletions(-) create mode 100644 module/branch/css/manage.css create mode 100644 module/branch/js/manage.js diff --git a/config/config.php b/config/config.php index fef6e3bc31..b45d6b4e70 100644 --- a/config/config.php +++ b/config/config.php @@ -174,6 +174,7 @@ $config->objectTables['doc'] = TABLE_DOC; $config->objectTables['doclib'] = TABLE_DOCLIB; $config->objectTables['todo'] = TABLE_TODO; $config->objectTables['custom'] = TABLE_LANG; +$config->objectTables['branch'] = TABLE_BRANCH; /* Include extension config files. */ $extConfigFiles = glob($configRoot . 'ext/*.php'); diff --git a/module/action/config.php b/module/action/config.php index 004fad5817..576dd76dc6 100755 --- a/module/action/config.php +++ b/module/action/config.php @@ -14,5 +14,6 @@ $config->action->objectNameFields['user'] = 'account'; $config->action->objectNameFields['doc'] = 'title'; $config->action->objectNameFields['doclib'] = 'name'; $config->action->objectNameFields['todo'] = 'name'; +$config->action->objectNameFields['branch'] = 'name'; $config->action->commonImgSize = 870; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index daabd99266..7d02886dfb 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -58,6 +58,7 @@ $lang->action->objectTypes['user'] = '用户'; $lang->action->objectTypes['doc'] = '文档'; $lang->action->objectTypes['doclib'] = '文档库'; $lang->action->objectTypes['todo'] = '待办'; +$lang->action->objectTypes['branch'] = '分支'; /* 用来描述操作历史记录。*/ $lang->action->desc = new stdclass(); @@ -171,11 +172,12 @@ $lang->action->search->objectTypeList['task'] = '任务'; $lang->action->search->objectTypeList['testtask'] = '测试任务'; $lang->action->search->objectTypeList['user'] = '用户'; $lang->action->search->objectTypeList['doc'] = '文档'; -$lang->action->search->objectTypeList['doclib'] = '文档库'; -$lang->action->search->objectTypeList['todo'] = '待办'; -$lang->action->search->objectTypeList['build'] = 'Build'; -$lang->action->search->objectTypeList['release'] = '发布'; -$lang->action->search->objectTypeList['productplan'] = '计划'; +$lang->action->search->objectTypeList['doclib'] = '文档库'; +$lang->action->search->objectTypeList['todo'] = '待办'; +$lang->action->search->objectTypeList['build'] = 'Build'; +$lang->action->search->objectTypeList['release'] = '发布'; +$lang->action->search->objectTypeList['productplan'] = '计划'; +$lang->action->search->objectTypeList['branch'] = '分支'; /* 用来在动态显示中显示动作 */ $lang->action->search->label[''] = ''; diff --git a/module/branch/control.php b/module/branch/control.php index 3e1a3d550e..6f1404c549 100644 --- a/module/branch/control.php +++ b/module/branch/control.php @@ -18,12 +18,15 @@ class branch extends control $this->branch->manage($productID); die(js::reload('parent')); } - $this->view->title = $this->lang->branch->manage; - $this->view->position[] = $this->lang->branch->manage; - $this->loadModel('product')->setMenu($this->product->getPairs('nocode'), $productID); + $products = $this->loadModel('product')->getPairs('nocode'); + $this->product->setMenu($products, $productID); - $this->view->product = $this->product->getById($productID); + $position[] = html::a($this->createLink('product', 'browse', "productID=$productID"), $products[$productID]); + $position[] = $this->lang->branch->manage; + + $this->view->title = $this->lang->branch->manage; + $this->view->position = $position; $this->view->branches = $this->branch->getPairs($productID, 'noempty'); $this->display(); } @@ -56,5 +59,13 @@ class branch extends control $branches = $this->branch->getPairs($productID); die(html::select('branch', $branches, '', "class='form-control' onchange='loadBranch()'")); } + + public function delete($branchID, $confirm = 'no') + { + if($confirm == 'no') die(js::confirm($this->lang->branch->confirmDelete, inlink('delete', "branchID=$branchID&confirm=yes"))); + + $this->branch->delete(TABLE_BRANCH, $branchID); + die(js::reload('parent')); + } } diff --git a/module/branch/css/manage.css b/module/branch/css/manage.css new file mode 100644 index 0000000000..7db96b5b73 --- /dev/null +++ b/module/branch/css/manage.css @@ -0,0 +1 @@ +#branches .input-group{margin-bottom:5px;} diff --git a/module/branch/js/manage.js b/module/branch/js/manage.js new file mode 100644 index 0000000000..215d1a0549 --- /dev/null +++ b/module/branch/js/manage.js @@ -0,0 +1,11 @@ +function addItem() +{ + var $inputgroup = $('#branches .input-group:last'); + $('#branches').append($inputgroup.clone()).find('.input-group:last').find('input').val(''); +} + +function deleteItem(obj) +{ + if($(obj).closest('#branches').find("input[id^='newbranch']").size() <= 1) return; + $(obj).closest('.input-group').remove(); +} diff --git a/module/branch/lang/zh-cn.php b/module/branch/lang/zh-cn.php index 180dd612a0..8fe78bcfa4 100644 --- a/module/branch/lang/zh-cn.php +++ b/module/branch/lang/zh-cn.php @@ -2,3 +2,5 @@ $lang->branch->manage = '分支管理'; $lang->branch->all = '所有'; + +$lang->branch->confirmDelete = '分支删除,会影响关联该分支的需求、模块、计划、发布、Bug、用例等等,请慎重考虑。是否删除改分支?'; diff --git a/module/branch/view/manage.html.php b/module/branch/view/manage.html.php index da4dc294eb..e04b968487 100644 --- a/module/branch/view/manage.html.php +++ b/module/branch/view/manage.html.php @@ -17,26 +17,33 @@
idAB);?>
- type != 'normal') echo html::select('branch', $branches, $branch, "onchange='loadBranch();' class='form-control' style='width:65px'");?> + session->currentProductType != 'normal') echo html::select('branch', $branches, $branch, "onchange='loadBranch();' class='form-control' style='width:65px'");?>
diff --git a/module/testcase/view/edit.html.php b/module/testcase/view/edit.html.php index 8a0020b659..c5da37b5e9 100644 --- a/module/testcase/view/edit.html.php +++ b/module/testcase/view/edit.html.php @@ -15,7 +15,7 @@ testcase->deleteStep);?> testcase->insertBefore);?> testcase->insertAfter);?> - +
icons['testcase']);?> id;?> @@ -92,7 +92,7 @@
- type != 'normal') echo html::select('branch', $branches, $case->branch, "onchange='loadBranch();' class='form-control' style='width:65px'");?> + session->currentProductType != 'normal') echo html::select('branch', $branches, $case->branch, "onchange='loadBranch();' class='form-control' style='width:65px'");?>
- $branch):?> - + - - - - - - - - - +
+
+ $branch):?> + + + +
+ + + +
+ +
+
- diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 1916a19737..5c37bd1f92 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -320,6 +320,7 @@ $lang->dev->menu = $lang->admin->menu; $lang->menugroup = new stdclass(); $lang->menugroup->release = 'product'; $lang->menugroup->story = 'product'; +$lang->menugroup->branch = 'product'; $lang->menugroup->productplan = 'product'; $lang->menugroup->task = 'project'; $lang->menugroup->build = 'project'; diff --git a/module/product/model.php b/module/product/model.php index dd1af775ef..abe69d628e 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -66,6 +66,7 @@ class productModel extends model $currentProduct = $this->getById($productID); $this->session->set('currentProductType', $currentProduct->type); $output = "{$currentProduct->name}
"; + if($currentProduct->type == 'normal') unset($this->lang->product->menu->branch); if($currentProduct->type != 'normal') { $branches = $this->loadModel('branch')->getPairs($productID); From 1046a25f09c0cc9520779902ecb24ac4cec427c6 Mon Sep 17 00:00:00 2001 From: wwccss Date: Tue, 27 Oct 2015 16:36:16 +0800 Subject: [PATCH 6/9] * fix the comment error. --- framework/router.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/router.class.php b/framework/router.class.php index 1e42f98fcd..678c4758d0 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -1189,7 +1189,7 @@ class router */ private function mergeParams($defaultParams, $passedParams) { - /* If the not strict mode, the keys of passed params and defaaul params msut be the same. */ + /* If not strict mode, the keys of passed params and default params must be the same order. */ if(!isset($this->config->strictParams) or $this->config->strictParams == false) { unset($passedParams['onlybody']); From a8429345bc1b6b216f80cf4c73af53af0dc8a535 Mon Sep 17 00:00:00 2001 From: wwccss Date: Tue, 27 Oct 2015 16:39:42 +0800 Subject: [PATCH 7/9] * change readme. --- README.md | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f518e1705d..55b7f5c6f0 100644 --- a/README.md +++ b/README.md @@ -1 +1,37 @@ -欢迎访问禅道项目管理软件主站,获得最新动态和文档支持。 +1. What is ZenTao for? + +ZenTao, developed by Nature Easy Soft Network Technology Development Co. Ltd, is an open source project management software. Combining product management, project management, quality management, document project, organization management and todo management, ZenTao is professional R&D project management software, completely covering the core processes of R & D project. Results-oriented with perfect functions, easy operation, beautiful interface, powerful search functions, various statistical statements and complete API, ZenTao is reasonably structured and can be extended flexibly. + +ZenTao - focuses on R & D project management. + +2. Why are we called ZenTao? + +In Chinese, Zen(禅) and Tao(道) are two words that have rich meanings in both religion and culture. ZenTao Project Management Software is originated in the cultural meanings of Zen and Tao, expecting to convey our understanding and thinking on management. Inspired by two books The Tao of Programming and The Zen of Programming, we name our software ZenTao. + +3. Design philosophy of ZenTao Project Management Software + +The main management theory of ZenTao Project Management Software is based on Scrum, an internationally popular agile management methodology. Results-oriented and operable, Scrum is very suitable for the fast sprint development of software development projects. However, Scrum only defines the core management framework. There are still many details and processes needing to be extended by the teams. On the basis of following the management methods of Scrum and with the consideration of the current domestic R&D status, ZenTao integrates the functions, such as bug management, test case management, release management and document management and completely covers the entire life cycle of software R&D projects. In ZenTao, the concepts of product, project and test are clearly defined. Product team, development team and testing team coordinate and check with each other while they are separated. With the interaction through requirements, tasks and bugs between the three teams, qualified products are ultimately made within the project. + +4. Why choose ZenTao Project Management Software + +* ZenTao is a professional R&D project management software, beyond comparison with any other simple project management software. +* Precise and pragmatic management theory, which will help companies achieve fast and agile development. +* Complete functions: you don’t need to integrate several systems together, like mantisbt + trac + testlink. +* Open source codes and flexible extension mechanism, convenient for uses and secondary development of companies. +* Underlying framework and front-end UI framework developed independently: robust and stable with beautiful interface and friendly interaction. +* Perfect community mechanism: you can get timely technical support and help. +* Zero input: you have no risk for choosing ZenTao compared with other commercial software of tens of thousands of dollars. +* Various deployments supported, either private deployment or cloud services. + +5. Function lists of ZenTao Project Management Software + +* Product management: including products, requirements, plans, releases and roadmaps; +* Project management: including projects, tasks, teams, versions and burn-down charts; +* Quality management: including bus, test cases, test tasks and test results; +* Document management: including product document library, project document library and user-defined document library; +* Affair management: including to-do management and personal affairs management like my tasks, my bugs, my requirement and my projects; +* Organization management: including department, users, groups and authorities; +* Statistics function: various statistical statements; +* Search function: powerful search functions to help you find the data you need. +* Extension mechanism:extensible nearly anywhere in ZenTao; +* API mechanism, visible API: convenient for integration with other systems. From 76c9841dc9a88544191c247bf196c1c1fa4ebb0f Mon Sep 17 00:00:00 2001 From: wwccss Date: Tue, 27 Oct 2015 16:42:18 +0800 Subject: [PATCH 8/9] * change the readme. --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 55b7f5c6f0..eb2dd1f171 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,22 @@ 1. What is ZenTao for? +===================== ZenTao, developed by Nature Easy Soft Network Technology Development Co. Ltd, is an open source project management software. Combining product management, project management, quality management, document project, organization management and todo management, ZenTao is professional R&D project management software, completely covering the core processes of R & D project. Results-oriented with perfect functions, easy operation, beautiful interface, powerful search functions, various statistical statements and complete API, ZenTao is reasonably structured and can be extended flexibly. ZenTao - focuses on R & D project management. 2. Why are we called ZenTao? +============================ In Chinese, Zen(禅) and Tao(道) are two words that have rich meanings in both religion and culture. ZenTao Project Management Software is originated in the cultural meanings of Zen and Tao, expecting to convey our understanding and thinking on management. Inspired by two books The Tao of Programming and The Zen of Programming, we name our software ZenTao. 3. Design philosophy of ZenTao Project Management Software +========================================================== The main management theory of ZenTao Project Management Software is based on Scrum, an internationally popular agile management methodology. Results-oriented and operable, Scrum is very suitable for the fast sprint development of software development projects. However, Scrum only defines the core management framework. There are still many details and processes needing to be extended by the teams. On the basis of following the management methods of Scrum and with the consideration of the current domestic R&D status, ZenTao integrates the functions, such as bug management, test case management, release management and document management and completely covers the entire life cycle of software R&D projects. In ZenTao, the concepts of product, project and test are clearly defined. Product team, development team and testing team coordinate and check with each other while they are separated. With the interaction through requirements, tasks and bugs between the three teams, qualified products are ultimately made within the project. 4. Why choose ZenTao Project Management Software +=============================================== * ZenTao is a professional R&D project management software, beyond comparison with any other simple project management software. * Precise and pragmatic management theory, which will help companies achieve fast and agile development. @@ -24,6 +28,7 @@ The main management theory of ZenTao Project Management Software is based on Scr * Various deployments supported, either private deployment or cloud services. 5. Function lists of ZenTao Project Management Software +====================================================== * Product management: including products, requirements, plans, releases and roadmaps; * Project management: including projects, tasks, teams, versions and burn-down charts; From 11b33e1e7f6e09b732ba85ecb85039fd34c4c996 Mon Sep 17 00:00:00 2001 From: wwccss Date: Tue, 27 Oct 2015 16:52:50 +0800 Subject: [PATCH 9/9] * add link of zentao.pm. --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index eb2dd1f171..d7f9fbced7 100644 --- a/README.md +++ b/README.md @@ -40,3 +40,11 @@ The main management theory of ZenTao Project Management Software is based on Scr * Search function: powerful search functions to help you find the data you need. * Extension mechanism:extensible nearly anywhere in ZenTao; * API mechanism, visible API: convenient for integration with other systems. + +6. Website + +Our website is: [www.zentao.pm](http://www.zentao.pm) + + +====================================================== +