| 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);
}