diff --git a/module/bug/js/common.js b/module/bug/js/common.js index b3db94683d..a4e7a32948 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -629,7 +629,7 @@ function notice() productID = $('#product').val(); projectID = $('#project').val(); link = createLink('build', 'create','executionID=' + executionID + '&productID=' + productID + '&projectID=' + projectID); - link += config.requestType == 'GET' ? '&onlybody=yes' : '?onlybody=yes'; + if(config.onlybody != 'yes') link += config.requestType == 'GET' ? '&onlybody=yes' : '?onlybody=yes'; html += '' + createBuild + ' '; html += '' + refresh + ''; } diff --git a/module/build/control.php b/module/build/control.php index d422615cb4..707bedd53f 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -44,6 +44,7 @@ class build extends control } /* Set menu. */ + $executions = array(); if($this->app->tab == 'project') { $this->loadModel('project')->setMenu($projectID); @@ -64,7 +65,7 @@ class build extends control $executions = $this->execution->getPairs($execution->project); } - $executionList = $this->execution->getByIdList(array_keys($executions)); + $executionList = empty($executions) ? array() : $this->execution->getByIdList(array_keys($executions)); foreach($executionList as $execution) { if($execution->lifetime == 'ops') unset($executions[$execution->id]); diff --git a/module/execution/model.php b/module/execution/model.php index 1d2c4dcfb2..56e0a41dcd 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1374,6 +1374,10 @@ class executionModel extends model { $link = helper::createLink($module, 'browse', "executionID=%s&from=execution"); } + elseif($module == 'testreport' and $method == 'create') + { + $link = helper::createLink('execution', 'testtask', "executionID=%s"); + } else { $link = helper::createLink($module, $method, "executionID=%s"); diff --git a/module/gitlab/css/managegroupmembers.css b/module/gitlab/css/managegroupmembers.css new file mode 100644 index 0000000000..0d940091ae --- /dev/null +++ b/module/gitlab/css/managegroupmembers.css @@ -0,0 +1 @@ +.table-form {min-width: 600px;} diff --git a/module/gitlab/css/manageprojectmembers.css b/module/gitlab/css/manageprojectmembers.css new file mode 100644 index 0000000000..0d940091ae --- /dev/null +++ b/module/gitlab/css/manageprojectmembers.css @@ -0,0 +1 @@ +.table-form {min-width: 600px;} diff --git a/module/gitlab/lang/en.php b/module/gitlab/lang/en.php index 75fb0e0dd1..4ec1cdea56 100644 --- a/module/gitlab/lang/en.php +++ b/module/gitlab/lang/en.php @@ -16,6 +16,7 @@ $lang->gitlab->gitlabAccount = 'GitLab Account'; $lang->gitlab->zentaoAccount = 'Zentao Account'; $lang->gitlab->bindingStatus = 'Binding Status'; $lang->gitlab->binded = 'Binded'; +$lang->gitlab->bindedError = 'The bound user has been deleted or modified. Please bind again.'; $lang->gitlab->serverFail = 'Connect to GitLab server failed, please check the GitLab server.'; $lang->gitlab->lastUpdate = 'Last Update'; $lang->gitlab->confirmAddWebhook = 'Are you sure about creating Webhook?'; diff --git a/module/gitlab/lang/zh-cn.php b/module/gitlab/lang/zh-cn.php index 940581f9f6..d911572925 100644 --- a/module/gitlab/lang/zh-cn.php +++ b/module/gitlab/lang/zh-cn.php @@ -16,6 +16,7 @@ $lang->gitlab->gitlabAccount = 'GitLab用户'; $lang->gitlab->zentaoAccount = '禅道用户'; $lang->gitlab->bindingStatus = '绑定状态'; $lang->gitlab->binded = '已绑定'; +$lang->gitlab->bindedError = '绑定的用户已删除或者已修改,请重新绑定'; $lang->gitlab->serverFail = '连接GitLab服务器异常,请检查GitLab服务器。'; $lang->gitlab->lastUpdate = '最后更新'; $lang->gitlab->confirmAddWebhook = '您确定创建Webhook吗?'; diff --git a/module/gitlab/view/binduser.html.php b/module/gitlab/view/binduser.html.php index 8a87c6cf4a..107697b1e2 100644 --- a/module/gitlab/view/binduser.html.php +++ b/module/gitlab/view/binduser.html.php @@ -22,7 +22,7 @@ gitlab->gitlabAccount;?> gitlab->zentaoAccount;?> - gitlab->bindingStatus;?> + gitlab->bindingStatus;?> @@ -37,11 +37,11 @@ id]", $userPairs, '', "class='form-control select chosen'" );?> - - - - zentaoAccount)) continue;?> - + + + + zentaoAccount)) continue;?> + avatar, "height=40");?> realname;?> @@ -49,9 +49,17 @@ account . " <" . $gitlabUser->email . ">";?> id]", $userPairs, $gitlabUser->zentaoAccount, "class='form-control select chosen'" );?> - zentaoAccount]) ? $lang->gitlab->binded : ""; ?> - - + + zentaoAccount])):?> + zentaoAccount, ''))):?> + gitlab->binded;?> + + ' . $lang->gitlab->bindedError . '';?> + + + + + diff --git a/module/mr/control.php b/module/mr/control.php index 9e484e791d..aba3903a58 100644 --- a/module/mr/control.php +++ b/module/mr/control.php @@ -402,8 +402,7 @@ class mr extends control $MR = $this->mr->getByID($MRID); $result = $this->mr->close($MR); - if($result['result'] == 'fali') return $this->send($result); - die(js::locate($result['locate'], 'parent')); + return $this->send($result); } /** diff --git a/module/mr/js/view.js b/module/mr/js/view.js index f75fc67687..a6433ab5d2 100644 --- a/module/mr/js/view.js +++ b/module/mr/js/view.js @@ -1,6 +1,6 @@ $(document).ready(function() { - $('#mergeButton').click(function() + $('#mergeButton,.mergeButton').click(function() { link = $(this).attr('href'); $.getJSON(link, function(response) diff --git a/module/mr/view/browse.html.php b/module/mr/view/browse.html.php index 557bbe03d7..65dc8c834c 100644 --- a/module/mr/view/browse.html.php +++ b/module/mr/view/browse.html.php @@ -64,11 +64,13 @@ + sourceProject])) $projects[$MR->sourceProject] = $this->loadModel('gitlab')->apiGetSingleProject($MR->gitlabID, $MR->sourceProject); ?> + targetProject])) $projects[$MR->targetProject] = $this->loadModel('gitlab')->apiGetSingleProject($MR->gitlabID, $MR->targetProject); ?> id;?> id}"), $MR->title);?> - loadModel('gitlab')->apiGetSingleProject($MR->gitlabID, $MR->sourceProject)->name_with_namespace . ':' . $MR->sourceBranch;?> - loadModel('gitlab')->apiGetSingleProject($MR->gitlabID, $MR->targetProject)->name_with_namespace . ':' . $MR->targetBranch;?> + sourceBranch;?>'>sourceProject]->name_with_namespace . ':' . $MR->sourceBranch;?> + targetBranch;?>'>targetProject]->name_with_namespace . ':' . $MR->targetBranch;?> status == 'closed'):?> mr->statusList, $MR->status);?> diff --git a/module/mr/view/view.html.php b/module/mr/view/view.html.php index 7b1b1f5a3e..54667871b7 100644 --- a/module/mr/view/view.html.php +++ b/module/mr/view/view.html.php @@ -103,18 +103,18 @@
approvalStatus != 'approved' or ($MR->compileID !=0 and $MR->compileStatus != 'success')) ? ' disabled' : ''; ?> - state == 'opened' and !$rawMR->has_conflicts) echo html::a(inlink('accept', "mr=$MR->id"), ' ' . $lang->mr->acceptMR, '', "id='mergeButton' class='btn' $acceptDisabled"); ?> + state == 'opened' and !$rawMR->has_conflicts) common::printIcon('mr', 'accept', "mr=$MR->id", $MR, 'button', 'flow', 'hiddenwin', 'mergeButton btn', false, $acceptDisabled, $lang->mr->acceptMR);?> state == 'opened'): ?> has_conflicts or ($MR->compileID !=0 and $MR->compileStatus != 'success') or $MR->approvalStatus == 'approved'):?> - id&action=approve", '', true), ' ' . $lang->mr->approve, '', "id='mergeButton' class='btn iframe showinonlybody' disabled"); ?> + id&action=approve", $MR, 'button', 'ok', 'hiddenwin', 'mergeButton', true, 'disabled', $lang->mr->approve);?> - id&action=approve", '', true), ' ' . $lang->mr->approve, '', "id='mergeButton' class='btn iframe showinonlybody'"); ?> + id&action=approve", $MR, 'button', 'ok', 'hiddenwin', 'mergeButton btn iframe showinonlybody', true, '', $lang->mr->approve);?> - id&action=reject", '', true), ' ' . $lang->mr->reject, '', "id='mergeButton' class='btn iframe showinonlybody'" . ($MR->approvalStatus == 'rejected' ? 'disabled' : '')); ?> - id", $MR, 'button', 'off', 'hiddenwin');?> - id"), ' ' . str_replace($lang->mr->common, '', $lang->mr->edit), '', "id='mergeButton' class='btn'"); ?> + id&action=reject", $MR, 'button', 'bug', 'hiddenwin', 'mergeButton btn iframe showinonlybody', true, ($MR->approvalStatus == 'rejected' ? 'disabled' : ''), $lang->mr->reject);?> + id", $MR, 'button', 'off', 'hiddenwin', 'mergeButton');?> + id", $MR, 'button', 'edit');?> - state == 'closed') echo html::a(inlink('reopen', "mr=$MR->id"), ' ' . $lang->mr->reopen, '', "id='mergeButton' class='btn'"); ?> + state == 'closed') common::printIcon('mr', 'reopen', "mr=$MR->id", $MR, 'button', 'restart', 'hiddenwin', 'mergeButton'); ?> id", $MR, 'button', 'trash', 'hiddenwin');?>
diff --git a/module/product/model.php b/module/product/model.php index 0776982ac8..3d268bed7c 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -1994,6 +1994,12 @@ class productModel extends model $projectID = isset($output['projectID']) ? $output['projectID'] : 0; $link = helper::createLink($module, $method, "productID=%s&branch=" . ($branch ? "%s" : '') . "&groupBy=&projectID=$projectID") . "#app=project"; } + elseif($module == 'testreport' and ($method == 'create' or $method == 'edit')) + { + $vars = $method == 'edit' ? "objectID=%s" : "objectID=&objectType=testtask&extra=%s"; + $method = $method == 'edit' ? 'browse' : $method; + $link = helper::createLink($module, $method, $vars); + } else { $link = helper::createLink($module, $method, "productID=%s" . ($branch ? "&branch=%s" : '')); diff --git a/module/report/model.php b/module/report/model.php index 7dfc100dac..bcfda09e5f 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -382,10 +382,10 @@ class reportModel extends model { if(isset($parents[$task->id])) continue; - $project[$task->projectname]['projectID'] = isset($project[$task->projectname]['projectID']) ? $project[$task->projectname]['projectID'] : $task->project; - $project[$task->projectname]['execution'][$task->executionName]['executionID'] = isset($project[$task->projectname]['execution'][$task->executionName]['executionID']) ? $project[$task->projectname]['execution'][$task->executionName]['executionID'] : $task->execution; - $project[$task->projectname]['execution'][$task->executionName]['count'] = isset($project[$task->projectname]['execution'][$task->executionName]['count']) ? $project[$task->projectname]['execution'][$task->executionName]['count'] + 1 : 1; - $project[$task->projectname]['execution'][$task->executionName]['manhour'] = isset($project[$task->projectname]['execution'][$task->executionName]['manhour']) ? $project[$task->projectname]['execution'][$task->executionName]['manhour'] + $task->left : $task->left; + $project[$task->projectname]['projectID'] = isset($project[$task->projectname]['projectID']) ? $project[$task->projectname]['projectID'] : $task->project; + $project[$task->projectname]['execution'][$task->executionName]['executionID'] = isset($project[$task->projectname]['execution'][$task->executionName]['executionID']) ? $project[$task->projectname]['execution'][$task->executionName]['executionID'] : $task->execution; + $project[$task->projectname]['execution'][$task->executionName]['count'] = isset($project[$task->projectname]['execution'][$task->executionName]['count']) ? $project[$task->projectname]['execution'][$task->executionName]['count'] + 1 : 1; + $project[$task->projectname]['execution'][$task->executionName]['manhour'] = isset($project[$task->projectname]['execution'][$task->executionName]['manhour']) ? $project[$task->projectname]['execution'][$task->executionName]['manhour'] + $task->left : $task->left; $workload[$user]['total']['count'] = isset($workload[$user]['total']['count']) ? $workload[$user]['total']['count'] + 1 : 1; $workload[$user]['total']['manhour'] = isset($workload[$user]['total']['manhour']) ? $workload[$user]['total']['manhour'] + $task->left : $task->left; @@ -1059,8 +1059,10 @@ class reportModel extends model public function getProjectStatusOverview($accounts = array()) { $projectStatus = $this->dao->select('t1.id,t1.status')->from(TABLE_PROJECT)->alias('t1') - ->leftJoin(TABLE_TEAM)->alias('t2')->on("t1.id=t2.root && t2.type='project'") + ->leftJoin(TABLE_TEAM)->alias('t2')->on("t1.id=t2.root") ->where('t1.type')->in($this->config->systemMode == 'classic' ? 'sprint,stage' : 'project') + ->beginIF($this->config->systemMode == 'classic')->andWhere('t2.type')->eq('execution')->fi() + ->beginIF($this->config->systemMode == 'new')->andWhere('t2.type')->eq('project')->fi() ->beginIF(!empty($accounts))->andWhere('t2.account')->in($accounts)->fi() ->fetchPairs('id', 'status'); diff --git a/module/task/css/view.css b/module/task/css/view.css index e3b77998b9..e605f6862d 100644 --- a/module/task/css/view.css +++ b/module/task/css/view.css @@ -1,3 +1,5 @@ .side-col .cell {padding: 0px;} .side-col #legendProjectAndTask .list-unstyled {padding: 10px; border: 1px solid #ddd; border-top: 0px; margin: 0px;} .tab-pane table {border: 1px solid #ddd; border-top: none;} +.page-title{max-width: 80%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;} +.pull-left{max-width: 80%;} diff --git a/module/testcase/control.php b/module/testcase/control.php index 4527d1573e..8817d56461 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -1847,7 +1847,7 @@ class testcase extends control $caseLang = $this->lang->testcase; $caseConfig = $this->config->testcase; $branches = $this->loadModel('branch')->getPairs($productID); - $modules = $this->loadModel('tree')->getOptionMenu($productID, 'case', 0, empty(array_keys($branches)) ? 0 : array_keys($branches)); + $modules = $this->loadModel('tree')->getOptionMenu($productID, 'case', 0, empty($branches) ? 0 : array_keys($branches)); $stories = $this->loadModel('story')->getProductStoryPairs($productID, $branch); $fields = $this->testcase->getImportFields($productID); $fields = array_flip($fields); diff --git a/module/testcase/model.php b/module/testcase/model.php index d622bca03d..b6d0896748 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -231,10 +231,13 @@ class testcaseModel extends model */ public function getModuleCases($productID, $branch = 0, $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $browseType = '', $auto = 'no') { - 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($this->app->tab == 'project')->andWhere('t1.project')->eq($this->session->project)->fi() + $stmt = $this->dao->select('t1.*, t2.title as storyTitle')->from(TABLE_CASE)->alias('t1') + ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story=t2.id'); + + if($this->app->tab == 'project') $stmt = $stmt->leftJoin(TABLE_PROJECTCASE)->alias('t3')->on('t1.id=t3.case'); + + return $stmt ->where('t1.product')->eq((int)$productID) + ->beginIF($this->app->tab == 'project')->andWhere('t3.project')->eq($this->session->project)->fi() ->beginIF($branch !== 'all')->andWhere('t1.branch')->eq($branch)->fi() ->beginIF($moduleIdList)->andWhere('t1.module')->in($moduleIdList)->fi() ->beginIF($browseType == 'wait')->andWhere('t1.status')->eq($browseType)->fi() diff --git a/module/testreport/control.php b/module/testreport/control.php index b5ce1cfbe5..5f3a9164c2 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -189,7 +189,7 @@ class testreport extends control $taskPairs = array(); $scopeAndStatus[0] = 'local'; $scopeAndStatus[1] = 'totalStatus'; - $tasks = $this->testtask->getProductTasks($productID, $task->branch, 'id_desc', null, $scopeAndStatus); + $tasks = $this->testtask->getProductTasks($productID, empty($objectID) ? 0 : $task->branch, 'id_desc', null, $scopeAndStatus); foreach($tasks as $testTask) { if($testTask->build == 'trunk') continue; diff --git a/module/tree/model.php b/module/tree/model.php index 016f0eeba5..64aaa9aa32 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -114,15 +114,16 @@ class treeModel extends model /** * Create an option menu in html. * - * @param int $rootID - * @param string $type - * @param int $startModule - * @param int $branch + * @param int $rootID + * @param string $type + * @param int $startModule + * @param int|array $branch * @access public * @return string */ public function getOptionMenu($rootID, $type = 'story', $startModule = 0, $branch = 0) { + if(empty($branch)) $branch = 0; if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getModulePairs(); /* If type of $branch is array, get modules of these branches. */ diff --git a/module/user/model.php b/module/user/model.php index 382b1f592d..2b1661f103 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -969,8 +969,12 @@ class userModel extends model } /* Get can manage projects by user. */ - $projectAdminGroupID = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->eq('projectAdmin')->fetch('id'); - $canManageProjects = $this->dao->select('project')->from(TABLE_USERGROUP)->where('`group`')->eq($projectAdminGroupID)->andWhere('account')->eq($account)->fetch('project'); + $canManageProjects = array(); + if(!defined('IN_UPGRADE')) + { + $projectAdminGroupID = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->eq('projectAdmin')->fetch('id'); + $canManageProjects = $this->dao->select('project')->from(TABLE_USERGROUP)->where('`group`')->eq($projectAdminGroupID)->andWhere('account')->eq($account)->fetch('project'); + } return array('rights' => $rights, 'acls' => $acls, 'projects' => $canManageProjects); }