diff --git a/module/branch/css/manage.css b/module/branch/css/manage.css index 35334b5a45..171db9731a 100644 --- a/module/branch/css/manage.css +++ b/module/branch/css/manage.css @@ -2,6 +2,8 @@ .c-order {width: 70px;} .c-check {width: 40px} +a.setDefault {padding-left: 8px !important} + td.flex {display: flex; flex-flow: row nowrap; justify-content: flex-start; align-items: center;} td.flex .label-primary {min-width: 40px;} td.flex .setDefault {min-width: 120px;} diff --git a/module/branch/view/manage.html.php b/module/branch/view/manage.html.php index 4f90fae36a..16cc1bf75a 100644 --- a/module/branch/view/manage.html.php +++ b/module/branch/view/manage.html.php @@ -86,7 +86,7 @@ elseif($branch->status == 'active') { $setDefaultLink = helper::createLink('branch', 'setDefault', "productID=$productID&branchID=$branch->id", '', true); - $setDefaultHtml = html::a($setDefaultLink, " {$lang->branch->setDefault}", 'hiddenwin', "class='btn btn-icon-left btn-sm setDefault hidden'"); + $setDefaultHtml = html::a($setDefaultLink, " {$lang->branch->setDefault}", 'hiddenwin', "class='btn btn-icon-left btn-sm setDefault hidden'"); echo common::hasPriv('branch', 'setDefault') ? $setDefaultHtml : ''; } diff --git a/module/build/control.php b/module/build/control.php index 292221e7f0..84d090749c 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -66,25 +66,21 @@ class build extends control $productGroups = $this->execution->getProducts($executionID); $productID = $productID ? $productID : key($productGroups); $branchGroups = $this->loadModel('project')->getBranchesByProject($executionID); - $branchPairs = $this->loadModel('branch')->getPairs($productID, 'active'); + $branchPairs = $this->loadModel('branch')->getPairs($productID); $branches = array(); $products = array(); - foreach($productGroups as $product) + + /* Set branches and products. */ + if($productGroups[$productID]->type != 'normal' and isset($branchGroups[$productID])) { - $products[$product->id] = $product->name; - if(isset($productGroups[$productID]) and $productGroups[$productID]->type != 'normal') + foreach($branchGroups[$productID] as $branchID => $branch) { - $branches[$product->id] = array(); - if(isset($branchGroups[$product->id])) - { - foreach($branchGroups[$product->id] as $branchID => $branch) - { - $branches[$product->id][$branchID] = $branchPairs[$branchID]; - } - } + $branches[$branchID] = $branchPairs[$branchID]; } } + foreach($productGroups as $product) $products[$product->id] = $product->name; + $this->view->title = $this->lang->build->create; $this->view->position[] = $this->lang->build->create; @@ -165,27 +161,22 @@ class build extends control $productGroups[$build->product] = $product; } - $products = array(); $branchGroups = $this->loadModel('project')->getBranchesByProject($build->execution); - $branchPairs = $this->loadModel('branch')->getPairs($build->product, 'active'); + $branchPairs = $this->loadModel('branch')->getPairs($build->product); + $products = array(); $branches = array(); - foreach($productGroups as $product) + /* Set branches and products. */ + if($productGroups[$build->product]->type != 'normal' and isset($branchGroups[$build->product])) { - $products[$product->id] = $product->name; - if(isset($productGroups[$build->product]) and $productGroups[$build->product]->type != 'normal') + foreach($branchGroups[$build->product] as $branchID => $branch) { - $branches[$product->id] = array(); - if(isset($branchGroups[$product->id])) - { - foreach($branchGroups[$product->id] as $branchID => $branch) - { - $branches[$product->id][$branchID] = $branchPairs[$branchID]; - } - } + $branches[$branchID] = $branchPairs[$branchID]; } } + foreach($productGroups as $product) $products[$product->id] = $product->name; + $this->view->title = $execution->name . $this->lang->colon . $this->lang->build->edit; $this->view->position[] = html::a($this->createLink('execution', 'task', "executionID=$build->execution"), $execution->name); $this->view->position[] = $this->lang->build->edit; diff --git a/module/build/model.php b/module/build/model.php index 8a556bf792..605d0f6200 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -379,7 +379,7 @@ class buildModel extends model $buildID = (int)$buildID; $oldBuild = $this->dao->select('*')->from(TABLE_BUILD)->where('id')->eq($buildID)->fetch(); $build = fixer::input('post')->stripTags($this->config->build->editor->edit['id'], $this->config->allowedTags) - ->setIF($this->post->branch === '', 'branch', $oldBuild->branch) + ->setIF(!isset($this->post->branch), 'branch', $oldBuild->branch) ->setDefault('product', $oldBuild->product) ->cleanInt('product,branch,execution') ->remove('allchecker,resolvedBy,files,labels,uid') diff --git a/module/build/view/create.html.php b/module/build/view/create.html.php index 0c1d6bb3cf..f724bac973 100644 --- a/module/build/view/create.html.php +++ b/module/build/view/create.html.php @@ -32,9 +32,8 @@
id, "onchange='loadBranches(this.value);' class='form-control chosen' required");?> type != 'normal' and isset($branches[$product->id])) + if(!empty($product) and $product->type != 'normal') { - $branches = $branches[$product->id]; echo "" . html::select('branch', $branches, $product->branch, "class='form-control chosen'"); } ?> diff --git a/module/build/view/edit.html.php b/module/build/view/edit.html.php index 8804542efb..a712be401a 100644 --- a/module/build/view/edit.html.php +++ b/module/build/view/edit.html.php @@ -33,9 +33,8 @@
product, "onchange='loadBranches(this.value);' class='form-control chosen' $disabled required");?> productType != 'normal' and isset($branches[$build->product])) + if($build->productType != 'normal') { - $branches = $branches[$build->product]; echo "" . html::select('branch', $branches, $build->branch, "class='form-control chosen' $disabled"); } ?> diff --git a/module/common/view/datatable.fix.html.php b/module/common/view/datatable.fix.html.php index c51f1a56c9..cf7801bc0b 100644 --- a/module/common/view/datatable.fix.html.php +++ b/module/common/view/datatable.fix.html.php @@ -105,7 +105,7 @@ $(function() datatable->showAllModuleList, isset($config->execution->task->allModule) ? $config->execution->task->allModule : 0);?> - type != 'normal' and $this->app->tab == 'product' or $this->app->tab == 'qa'):?> + type != 'normal' and ($this->app->tab == 'product' or $this->app->tab == 'qa')):?> datatable->showBranch;?> datatable->showBranchList, isset($config->$currentModule->$currentMethod->showBranch) ? $config->$currentModule->$currentMethod->showBranch : 1);?> diff --git a/module/execution/control.php b/module/execution/control.php index 6981d3f0de..c427af1184 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1382,7 +1382,7 @@ class execution extends control $this->view->code = $code; $this->view->team = $team; $this->view->teams = array(0 => '') + $this->execution->getTeamPairsByProject((int)$projectID); - $this->view->allProjects = array(0 => '') + $this->project->getPairsByModel(); + $this->view->allProjects = array(0 => '') + $this->project->getPairsByModel('all', 0, 'noclosed'); $this->view->executionID = $executionID; $this->view->productID = $productID; $this->view->projectID = $projectID; @@ -1538,7 +1538,7 @@ class execution extends control $this->view->qdUsers = $qdUsers; $this->view->rdUsers = $rdUsers; $this->view->users = $this->user->getPairs('nodeleted|noclosed'); - $this->view->allProjects = $this->project->getPairsByModel(); + $this->view->allProjects = $this->project->getPairsByModel('all', 0, 'noclosed'); $this->view->groups = $this->loadModel('group')->getPairs(); $this->view->allProducts = $allProducts; $this->view->linkedProducts = $linkedProducts; @@ -1619,7 +1619,7 @@ class execution extends control $this->view->position[] = $this->lang->execution->batchEdit; $this->view->executionIDList = $executionIDList; $this->view->executions = $executions; - $this->view->allProjects = $this->project->getPairsByModel(); + $this->view->allProjects = $this->project->getPairsByModel('all', 0, 'noclosed'); $this->view->pmUsers = $pmUsers; $this->view->poUsers = $poUsers; $this->view->qdUsers = $qdUsers; diff --git a/module/execution/view/testcase.html.php b/module/execution/view/testcase.html.php index 0ed45b34a7..002f050ade 100644 --- a/module/execution/view/testcase.html.php +++ b/module/execution/view/testcase.html.php @@ -49,7 +49,7 @@ pri?>' title='testcase->priList, $case->pri, $case->pri);?>'>testcase->priList, $case->pri, $case->pri)?> version";?> task";?> - createLink('testcase', 'view', $params, '', '', $case->project), $case->title, null, "style='color: $case->color' data-app='{$this->app->tab}'");?> + createLink('testcase', 'view', $params, '', '', $case->project), $case->title, null, "style='color: $case->color' data-app='{$this->app->tab}'");?> testcase->typeList, $case->type);?> openedBy);?> lastRunner);?> diff --git a/module/misc/lang/en.php b/module/misc/lang/en.php index f8f3178751..88093fceb3 100644 --- a/module/misc/lang/en.php +++ b/module/misc/lang/en.php @@ -86,6 +86,7 @@ $lang->misc->feature->detailed = 'Detail'; $lang->misc->feature->introduction = 'Features'; $lang->misc->feature->tutorial = 'Tutorial'; $lang->misc->feature->youngBlueTheme = 'Young Blue Theme'; +$lang->misc->feature->youngBlueImage = 'theme/default/images/main/new_theme_en.png'; $lang->misc->feature->nextStep = 'Next step'; $lang->misc->feature->close = 'Close'; $lang->misc->feature->downloadFile = 'Download introduction'; diff --git a/module/misc/lang/zh-cn.php b/module/misc/lang/zh-cn.php index 3969285bdc..7d7f6c5c79 100644 --- a/module/misc/lang/zh-cn.php +++ b/module/misc/lang/zh-cn.php @@ -86,6 +86,7 @@ $lang->misc->feature->detailed = '详情'; $lang->misc->feature->introduction = '新功能介绍'; $lang->misc->feature->tutorial = '新手引导教程'; $lang->misc->feature->youngBlueTheme = '全新青春蓝主题'; +$lang->misc->feature->youngBlueImage = 'theme/default/images/main/new_theme.png'; $lang->misc->feature->nextStep = '下一步'; $lang->misc->feature->close = '关闭'; $lang->misc->feature->downloadFile = '下载新版本功能介绍文档'; diff --git a/module/misc/view/features.html.php b/module/misc/view/features.html.php index 995a287805..6a622b8894 100644 --- a/module/misc/view/features.html.php +++ b/module/misc/view/features.html.php @@ -40,7 +40,7 @@
misc->feature->themeDesc;?> - ' /> +
diff --git a/module/product/model.php b/module/product/model.php index fb3df99ec8..1dd7d1603c 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -884,7 +884,7 @@ class productModel extends model else { $this->config->product->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$productInfo->type]); - $this->config->product->search['params']['branch']['values'] = array('' => '', '0' => $this->lang->branch->main) + $this->loadModel('branch')->getPairs($productID, 'noempty') + array('all' => $this->lang->branch->all); + $this->config->product->search['params']['branch']['values'] = array('' => '', '0' => $this->lang->branch->main) + $this->loadModel('branch')->getPairs($productID, 'noempty'); } $this->loadModel('search')->setSearchParams($this->config->product->search); diff --git a/module/project/model.php b/module/project/model.php index b667be0876..1725ab1d59 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -647,7 +647,7 @@ class projectModel extends model * @access public * @return array */ - public function getPairsByModel($model = 'all', $programID = 0) + public function getPairsByModel($model = 'all', $programID = 0, $param = '') { if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getProjectPairs(); @@ -655,6 +655,7 @@ class projectModel extends model ->where('type')->eq('project') ->beginIF($programID)->andWhere('parent')->eq($programID)->fi() ->beginIF($model != 'all')->andWhere('model')->eq($model)->fi() + ->beginIF(strpos($param, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi() ->andWhere('deleted')->eq('0') ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi() ->orderBy('id_desc') diff --git a/www/theme/default/images/main/new_theme_en.png b/www/theme/default/images/main/new_theme_en.png new file mode 100644 index 0000000000..38e792f6fd Binary files /dev/null and b/www/theme/default/images/main/new_theme_en.png differ