This commit is contained in:
王怡栋
2021-11-30 09:38:44 +08:00
10 changed files with 50 additions and 45 deletions
-3
View File
@@ -320,7 +320,6 @@ class commonModel extends model
if($module == 'block' and $method == 'main') return true;
if($module == 'block' and $method == 'delete') return true;
if($module == 'product' and $method == 'showerrornone') return true;
if($module == 'report' and $method == 'annualdata') return true;
}
return false;
}
@@ -2150,8 +2149,6 @@ EOD;
$rights = $app->user->rights['rights'];
$acls = $app->user->rights['acls'];
if((($app->user->account != 'guest') or ($app->company->guest and $app->user->account == 'guest')) and $module == 'report' and $method == 'annualdata') return true;
if(isset($rights[$module][$method]))
{
if(!commonModel::hasDBPriv($object, $module, $method)) return false;
+2 -2
View File
@@ -1310,7 +1310,7 @@ class execution extends control
->where('t1.id')->eq($plan->product)
->fetchAll('id');
$productPlan = $this->loadModel('productplan')->getPairsForStory($plan->product, $plan->branch, 'skipParent|unexpired');
$productPlan = $this->loadModel('productplan')->getPairsForStory($plan->product, $plan->branch, 'skipParent|unexpired|withMainPlan');
$linkedBranches = array();
$linkedBranches[$plan->product][$plan->branch] = $plan->branch;
@@ -2494,7 +2494,7 @@ class execution extends control
$this->loadModel('branch');
foreach($products as $product)
{
$productModules = $this->tree->getOptionMenu($product->id, 'story', 0, $branches[$product->id]);
$productModules = $this->tree->getOptionMenu($product->id, 'story', 0, array_keys($branches[$product->id]));
foreach($productModules as $branch => $branchModules)
{
foreach($branchModules as $moduleID => $moduleName) $modules[$moduleID] = ((count($products) >= 2 and $moduleID != 0) ? $product->name : '') . $moduleName;
+8 -6
View File
@@ -1303,18 +1303,20 @@ $lang->tree->methodOrder[30] = 'delete';
/* Report. */
$lang->resource->report = new stdclass();
$lang->resource->report->index = 'index';
$lang->resource->report->projectDeviation = 'projectDeviation';
$lang->resource->report->productSummary = 'productSummary';
$lang->resource->report->bugCreate = 'bugCreate';
$lang->resource->report->bugAssign = 'bugAssign';
$lang->resource->report->workload = 'workload';
$lang->resource->report->index = 'index';
$lang->resource->report->projectDeviation = 'projectDeviation';
$lang->resource->report->productSummary = 'productSummary';
$lang->resource->report->bugCreate = 'bugCreate';
$lang->resource->report->bugAssign = 'bugAssign';
$lang->resource->report->workload = 'workload';
$lang->resource->report->annualData = 'annual';
$lang->report->methodOrder[0] = 'index';
$lang->report->methodOrder[5] = 'projectDeviation';
$lang->report->methodOrder[10] = 'productSummary';
$lang->report->methodOrder[15] = 'bugCreate';
$lang->report->methodOrder[20] = 'workload';
$lang->report->methodOrder[25] = 'annual';
/* Search. */
$lang->resource->search = new stdclass();
+4 -4
View File
@@ -430,8 +430,8 @@ class productplan extends control
else
{
$this->config->product->search['fields']['branch'] = $this->lang->product->branch;
$branch = $this->loadModel('branch')->getById($plan->branch);
$branches = array('' => '', BRANCH_MAIN => $this->lang->branch->main, $plan->branch => $branch->name);
$branchName = $this->loadModel('branch')->getById($plan->branch);
$branches = array('' => '', BRANCH_MAIN => $this->lang->branch->main, $plan->branch => $branchName);
$this->config->product->search['params']['branch']['values'] = $branches;
}
$this->loadModel('search')->setSearchParams($this->config->product->search);
@@ -573,8 +573,8 @@ class productplan extends control
else
{
$this->config->bug->search['fields']['branch'] = $this->lang->product->branch;
$branch = $this->loadModel('branch')->getById($plan->branch);
$branches = array('' => '', BRANCH_MAIN => $this->lang->branch->main, $plan->branch => $branch->name);
$branchName = $this->loadModel('branch')->getById($plan->branch);
$branches = array('' => '', BRANCH_MAIN => $this->lang->branch->main, $plan->branch => $branchName);
$this->config->bug->search['params']['branch']['values'] = $branches;
}
$this->loadModel('search')->setSearchParams($this->config->bug->search);
+3 -2
View File
@@ -11,7 +11,8 @@ td.c-PM {white-space: nowrap; overflow: hidden;}
.icon-cards-view {padding-left: 7px; font-size: 16px;}
.icon-list {padding-left: 7px;}
.panel-actions {position: relative; padding: 0 0;}
@media screen and (max-width: 1460px)
th.c-name {width: 360px !important;}
@media screen and (min-width: 1460px)
{
th.c-name {width: 360px !important;}
th.c-name {width: auto;}
}
+11 -10
View File
@@ -470,8 +470,8 @@ class projectrelease extends control
$this->config->product->search['actionURL'] = $this->createLink('projectrelease', 'view', "releaseID=$releaseID&type=story&link=true&param=" . helper::safe64Encode('&browseType=bySearch&queryID=myQueryID'));
$this->config->product->search['queryID'] = $queryID;
$this->config->product->search['style'] = 'simple';
$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']['plan']['values'] = $this->loadModel('productplan')->getPairsForStory($release->product, $release->branch, 'skipParent|withMainPlan');
$this->config->product->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($release->product, 'story', 0, $release->branch);;
$this->config->product->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $this->lang->story->statusList);
if($release->productType == 'normal')
{
@@ -481,8 +481,8 @@ class projectrelease extends control
else
{
$this->config->product->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$release->productType]);
$branches = array('' => '') + $this->loadModel('branch')->getPairs($release->product, 'noempty');
if($release->branch) $branches = array('' => '', $release->branch => $branches[$release->branch]);
$branchName = $this->loadModel('branch')->getById($release->branch);
$branches = array('' => '', BRANCH_MAIN => $this->lang->branch->main, $release->branch => $branchName);
$this->config->product->search['params']['branch']['values'] = $branches;
}
$this->loadModel('search')->setSearchParams($this->config->product->search);
@@ -493,7 +493,7 @@ class projectrelease extends control
}
else
{
$allStories = $this->story->getExecutionStories($build->execution, 0, 0, 't1.`order`_desc', 'byProduct', $release->product, 'story', $release->stories, $pager);
$allStories = $this->story->getExecutionStories($build->execution, $release->product, 0, 't1.`order`_desc', 'byBranch', $release->branch, 'story', $release->stories, $pager);
}
$this->view->allStories = $allStories;
@@ -585,12 +585,13 @@ class projectrelease extends control
$this->loadModel('bug');
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
unset($this->config->bug->search['fields']['product']);
unset($this->config->bug->search['fields']['project']);
$this->config->bug->search['actionURL'] = $this->createLink('projectrelease', 'view', "releaseID=$releaseID&type=$type&link=true&param=" . helper::safe64Encode('&browseType=bySearch&queryID=myQueryID'));
$this->config->bug->search['queryID'] = $queryID;
$this->config->bug->search['style'] = 'simple';
$this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($release->product => $release->product));
$this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($release->product, $viewType = 'bug', $startModuleID = 0);
$this->config->bug->search['params']['execution']['values'] = $this->loadModel('product')->getExecutionPairsByProduct($release->product, 0, 'id_desc', $release->project);
$this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairsForStory($release->product, $release->branch, 'skipParent|withMainPlan');
$this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($release->product, 'bug', 0, $release->branch);
$this->config->bug->search['params']['execution']['values'] = $this->loadModel('product')->getExecutionPairsByProduct($release->product, $release->branch, 'id_desc', $release->project);
$this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($release->product, $branch = 0, $params = '');
$this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values'];
if($release->productType == 'normal')
@@ -601,8 +602,8 @@ class projectrelease extends control
else
{
$this->config->bug->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$release->productType]);
$branches = array('' => '') + $this->loadModel('branch')->getPairs($release->product, 'noempty');
if($release->branch) $branches = array('' => '', $release->branch => $branches[$release->branch]);
$branchName = $this->loadModel('branch')->getById($release->branch);
$branches = array('' => '', BRANCH_MAIN => $this->lang->branch->main, $release->branch => $branchName);
$this->config->bug->search['params']['branch']['values'] = $branches;
}
$this->loadModel('search')->setSearchParams($this->config->bug->search);
+6 -6
View File
@@ -430,19 +430,19 @@ class release extends control
else
{
$this->config->product->search['fields']['branch'] = $this->lang->product->branch;
$branch = $this->loadModel('branch')->getById($release->branch);
$branches = array('' => '', BRANCH_MAIN => $this->lang->branch->main, $release->branch => $branch->name);
$branchName = $this->loadModel('branch')->getById($release->branch);
$branches = array('' => '', BRANCH_MAIN => $this->lang->branch->main, $release->branch => $branchName);
$this->config->product->search['params']['branch']['values'] = $branches;
}
$this->loadModel('search')->setSearchParams($this->config->product->search);
if($browseType == 'bySearch')
if($browseType == 'bySearch' or $build->execution == 0)
{
$allStories = $this->story->getBySearch($release->product, $release->branch, $queryID, 'id', $build->execution ? $build->execution : '', 'story', $release->stories, $pager);
}
else
{
$allStories = $this->story->getExecutionStories($build->execution, 0, 0, 't1.`order`_desc', 'byProduct', $release->product, 'story', $release->stories, $pager);
$allStories = $this->story->getExecutionStories($build->execution, $build->product, 0, 't1.`order`_desc', 'byBranch', $release->branch, 'story', $release->stories, $pager);
}
$this->view->allStories = $allStories;
@@ -550,8 +550,8 @@ class release extends control
else
{
$this->config->bug->search['fields']['branch'] = $this->lang->product->branch;
$branch = $this->loadModel('branch')->getById($release->branch);
$branches = array('' => '', BRANCH_MAIN => $this->lang->branch->main, $release->branch => $branch->name);
$branchName = $this->loadModel('branch')->getById($release->branch);
$branches = array('' => '', BRANCH_MAIN => $this->lang->branch->main, $release->branch => $branchName);
$this->config->bug->search['params']['branch']['values'] = $branches;
}
$this->loadModel('search')->setSearchParams($this->config->bug->search);
+9 -9
View File
@@ -2453,19 +2453,19 @@ class storyModel extends model
$allBranch = "`branch` = 'all'";
if($executionID != '')
{
$branches = array();
foreach($products as $product)
$branches = array(BRANCH_MAIN => BRANCH_MAIN);
if($branch === '')
{
if($product->type != 'normal')
foreach($products as $product)
{
$branches[BRANCH_MAIN] = BRANCH_MAIN;
foreach($product->branches as $branchID)
{
if($branch == BRANCH_MAIN and $branchID) continue;
$branches[$branchID] = $branchID;
}
foreach($product->branches as $branchID) $branches[$branchID] = $branchID;
}
}
else
{
$branches[$branch] = $branch;
}
$branches = join(',', $branches);
$storyQuery .= " AND `branch`" . helper::dbIN($branches);
+5 -1
View File
@@ -1718,6 +1718,9 @@ class testcase extends control
{
$browseType = strtolower($browseType);
$queryID = (int)$queryID;
$product = $this->loadModel('product')->getById($productID);
$branches = array();
if($product->type != 'normal') $branches = array('0' => $this->lang->branch->main) + $this->loadModel('branch')->getPairs($productID, '', $projectID);
if($_POST)
{
@@ -1758,6 +1761,7 @@ class testcase extends control
$this->view->libraries = $libraries;
$this->view->libID = $libID;
$this->view->product = $product;
$this->view->productID = $productID;
$this->view->branch = $branch;
$this->view->cases = $this->loadModel('testsuite')->getNotImportedCases($productID, $libID, $orderBy, $pager, $browseType, $queryID);
@@ -1765,7 +1769,7 @@ class testcase extends control
$this->view->libModules = $this->tree->getOptionMenu($libID, 'caselib');
$this->view->pager = $pager;
$this->view->orderBy = $orderBy;
$this->view->branches = array('0' => $this->lang->branch->main) + $this->loadModel('branch')->getPairs($productID, '', $projectID);
$this->view->branches = $branches;
$this->view->browseType = $browseType;
$this->view->queryID = $queryID;
+2 -2
View File
@@ -33,7 +33,7 @@
</div>
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
</th>
<?php if($branches):?>
<?php if($product->type != 'normal'):?>
<th class='c-branch'><?php echo $lang->testcase->branch ?></th>
<?php endif;?>
<th class='c-pri'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
@@ -54,7 +54,7 @@
</div>
<?php printf('%03d', $case->id);?>
</td>
<?php if($branches):?>
<?php if($product->type != 'normal'):?>
<td><?php echo html::select("branch[{$case->id}]", $branches, $branch, "class='form-control'")?></td>
<?php endif;?>
<td><span class='label-pri <?php echo 'label-pri-' . $case->pri;?>' title='<?php echo zget($lang->testcase->priList, $case->pri, $case->pri);?>'><?php echo $case->pri == '0' ? '' : zget($lang->testcase->priList, $case->pri, $case->pri);?></span></td>