* finish task #2416.

This commit is contained in:
wangyidong
2015-11-26 13:11:01 +08:00
parent 6670b94caf
commit 48ada5974b
9 changed files with 156 additions and 26 deletions
+28 -6
View File
@@ -274,7 +274,8 @@ class build extends control
}
$this->session->set('storyList', inlink('view', "buildID=$buildID&type=story&link=true&param=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")));
$build = $this->build->getById($buildID);
$build = $this->build->getById($buildID);
$product = $this->loadModel('product')->getById($build->product);
$this->loadModel('project')->setMenu($this->project->getPairs(), $build->project);
$this->loadModel('story');
$this->loadModel('tree');
@@ -290,8 +291,18 @@ class build extends control
$this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($build->product => $build->product));
$this->config->product->search['params']['module']['values'] = $this->tree->getOptionMenu($build->product, $viewType = 'story', $startModuleID = 0);
$this->config->product->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $this->lang->story->statusList);
unset($this->config->product->search['fields']['branch']);
unset($this->config->product->search['params']['branch']);
if($product->type == 'normal')
{
unset($this->config->product->search['fields']['branch']);
unset($this->config->product->search['params']['branch']);
}
else
{
$this->config->product->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]);
$branches = array('' => '') + $this->loadModel('branch')->getPairs($build->product, 'noempty');
if($build->branch) $branches = array('' => '', $build->branch => $branches[$build->branch]);
$this->config->product->search['params']['branch']['values'] = $branches;
}
$this->loadModel('search')->setSearchParams($this->config->product->search);
if($browseType == 'bySearch')
@@ -374,7 +385,8 @@ class build extends control
$this->session->set('bugList', inlink('view', "buildID=$buildID&type=bug&link=true&param=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")));
/* Set menu. */
$build = $this->build->getByID($buildID);
$build = $this->build->getByID($buildID);
$product = $this->loadModel('product')->getByID($build->product);
$this->loadModel('project')->setMenu($this->project->getPairs(), $build->project);
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
@@ -389,8 +401,18 @@ class build extends control
$this->config->bug->search['params']['project']['values'] = $this->loadModel('product')->getProjectPairs($build->product);
$this->config->bug->search['params']['openedBuild']['values'] = $this->build->getProductBuildPairs($build->product, $branch = 0, $params = '');
$this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values'];
unset($this->config->bug->search['fields']['branch']);
unset($this->config->bug->search['params']['branch']);
if($product->type == 'normal')
{
unset($this->config->bug->search['fields']['branch']);
unset($this->config->bug->search['params']['branch']);
}
else
{
$this->config->bug->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]);
$branches = array('' => '') + $this->loadModel('branch')->getPairs($build->product, 'noempty');
if($build->branch) $branches = array('' => '', $build->branch => $branches[$build->branch]);
$this->config->bug->search['params']['branch']['values'] = $branches;
}
$this->loadModel('search')->setSearchParams($this->config->bug->search);
if($browseType == 'bySearch')
+1 -1
View File
@@ -29,7 +29,7 @@ $lang->group->errorNotSaved = '没有保存,请确认选择了权限数
$lang->group->viewList = '允许访问视图';
$lang->group->productList = '允许访问' . $lang->productCommon;
$lang->group->projectList = '允许访问' . $lang->projectCommon;
$lang->group->noticeVisit = '空代访问没有访问限制';
$lang->group->noticeVisit = '空代表访问没有访问限制';
$lang->group->id = '编号';
$lang->group->name = '分组名称';
+24 -2
View File
@@ -283,8 +283,18 @@ class productplan extends control
$storyStatusList = $this->lang->story->statusList;
unset($storyStatusList['closed']);
$this->config->product->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $storyStatusList);
unset($this->config->product->search['fields']['branch']);
unset($this->config->product->search['params']['branch']);
if($this->session->currentProductType == 'normal')
{
unset($this->config->product->search['fields']['branch']);
unset($this->config->product->search['params']['branch']);
}
else
{
$this->config->product->search['fields']['branch'] = $this->lang->product->branch;
$branches = array('' => '') + $this->loadModel('branch')->getPairs($plan->product, 'noempty');
if($plan->branch) $branches = array('' => '', $plan->branch => $branches[$plan->branch]);
$this->config->product->search['params']['branch']['values'] = $branches;
}
$this->loadModel('search')->setSearchParams($this->config->product->search);
if($browseType == 'bySearch')
@@ -400,6 +410,18 @@ class productplan 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, $branch = 0, $params = '');
$this->config->bug->search['params']['resolvedBuild']['values'] = $this->build->getProductBuildPairs($productID, $branch = 0, $params = '');
if($this->session->currentProductType == 'normal')
{
unset($this->config->bug->search['fields']['branch']);
unset($this->config->bug->search['params']['branch']);
}
else
{
$this->config->bug->search['fields']['branch'] = $this->lang->product->branch;
$branches = array('' => '') + $this->loadModel('branch')->getPairs($plan->product, 'noempty');
if($plan->branch) $branches = array('' => '', $plan->branch => $branches[$plan->branch]);
$this->config->bug->search['params']['branch']['values'] = $branches;
}
$this->loadModel('search')->setSearchParams($this->config->bug->search);
if($browseType == 'bySearch')
+7 -1
View File
@@ -29,6 +29,9 @@
<tr class='colhead'>
<th class='w-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
<th> <?php common::printOrderLink('title', $orderBy, $vars, $lang->productplan->title);?></th>
<?php if($this->session->currentProductType != 'normal'):?>
<th class='w-100px'> <?php common::printOrderLink('branch',$orderBy, $vars, $lang->product->branch);?></th>
<?php endif;?>
<th class='w-p50'> <?php common::printOrderLink('desc', $orderBy, $vars, $lang->productplan->desc);?></th>
<th class='w-100px'> <?php common::printOrderLink('begin', $orderBy, $vars, $lang->productplan->begin);?></th>
<th class='w-100px'> <?php common::printOrderLink('end', $orderBy, $vars, $lang->productplan->end);?></th>
@@ -43,6 +46,9 @@
<?php echo $plan->id;?>
</td>
<td class='text-left' title="<?php echo $plan->title?>"><?php echo html::a(inlink('view', "id=$plan->id"), $plan->title);?></td>
<?php if($this->session->currentProductType != 'normal'):?>
<td><?php echo $branches[$plan->branch];?></td>
<?php endif;?>
<td class='text-left content'><div class='article-content'><?php echo $plan->desc;?></div></td>
<td><?php echo $plan->begin;?></td>
<td><?php echo $plan->end;?></td>
@@ -64,7 +70,7 @@
</tbody>
<tfoot>
<tr>
<td colspan='6'>
<td colspan='<?php echo $this->session->currentProductType == 'normal' ? '6' : '7';?>'>
<?php echo html::selectButton();?>
<?php if(common::hasPriv('productplan', 'batchEdit')) echo html::submitButton($lang->edit);?>
<?php $pager->show();?>
+32 -5
View File
@@ -1537,14 +1537,33 @@ class project extends control
$queryID = ($browseType == 'bySearch') ? (int)$param : 0;
$productPairs = array();
$allBranches = $this->loadModel('branch')->getByProducts(array_keys($products), 'noempty');
$branchPairs = array();
$productType = 'normal';
$productNum = count($products);
foreach($products as $product)
{
$branches[$product->branch] = $product->branch;
$productPairs[$product->id] = $product->name;
if($product->type != 'normal')
{
$branches[$product->branch] = $product->branch;
$productType = $product->type;
if($product->branch)
{
$branchPairs[$product->branch] = ($productNum > 1 ? $product->name . '/' : '') . $allBranches[$product->id][$product->branch];
}
else
{
$productBranches = $allBranches[$product->id];
if($productNum > 1)
{
foreach($productBranches as $branchID => $branchName) $productBranches[$branchID] = $product->name . '/' . $branchName;
}
$branchPairs += $productBranches;
}
}
}
/* Build search form. */
unset($this->config->product->search['fields']['module']);
$this->config->product->search['actionURL'] = $this->createLink('project', 'linkStory', "projectID=$projectID&browseType=bySearch&queryID=myQueryID");
@@ -1552,8 +1571,16 @@ class project extends control
$this->config->product->search['params']['product']['values'] = $productPairs + array('all' => $this->lang->product->allProductsOfProject);
$this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts($products);
unset($this->lang->story->statusList['draft']);
unset($this->config->product->search['fields']['branch']);
unset($this->config->product->search['params']['branch']);
if($productType == 'normal')
{
unset($this->config->product->search['fields']['branch']);
unset($this->config->product->search['params']['branch']);
}
else
{
$this->config->product->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$productType]);
$this->config->product->search['params']['branch']['values'] = array('' => '') + $branchPairs;
}
$this->config->product->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $this->lang->story->statusList);
$this->loadModel('search')->setSearchParams($this->config->product->search);
+24 -4
View File
@@ -347,8 +347,18 @@ 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);
unset($this->config->product->search['fields']['branch']);
unset($this->config->product->search['params']['branch']);
if($this->session->currentProductType == 'normal')
{
unset($this->config->product->search['fields']['branch']);
unset($this->config->product->search['params']['branch']);
}
else
{
$this->config->product->search['fields']['branch'] = $this->lang->product->branch;
$branches = array('' => '') + $this->loadModel('branch')->getPairs($release->product, 'noempty');
if($release->branch) $branches = array('' => '', $release->branch => $branches[$release->branch]);
$this->config->product->search['params']['branch']['values'] = $branches;
}
$this->loadModel('search')->setSearchParams($this->config->product->search);
if($browseType == 'bySearch')
@@ -447,8 +457,18 @@ class release extends control
$this->config->bug->search['params']['project']['values'] = $this->loadModel('product')->getProjectPairs($release->product);
$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'];
unset($this->config->bug->search['fields']['branch']);
unset($this->config->bug->search['params']['branch']);
if($this->session->currentProductType == 'normal')
{
unset($this->config->bug->search['fields']['branch']);
unset($this->config->bug->search['params']['branch']);
}
else
{
$this->config->bug->search['fields']['branch'] = $this->lang->product->branch;
$branches = array('' => '') + $this->loadModel('branch')->getPairs($release->product, 'noempty');
if($release->branch) $branches = array('' => '', $release->branch => $branches[$release->branch]);
$this->config->bug->search['params']['branch']['values'] = $branches;
}
$this->loadModel('search')->setSearchParams($this->config->bug->search);
$allBugs = array();
+6
View File
@@ -30,6 +30,9 @@
<th class='w-id'><?php echo $lang->release->id;?></th>
<th><?php echo $lang->release->name;?></th>
<th><?php echo $lang->release->build;?></th>
<?php if($product->type != 'normal'):?>
<th class='w-100px'><?php echo $lang->product->branch;?></th>
<?php endif;?>
<th class='w-100px'><?php echo $lang->release->date;?></th>
<th class='w-100px'><?php echo $lang->release->status;?></th>
<th class='w-150px'><?php echo $lang->actions;?></th>
@@ -41,6 +44,9 @@
<td class='text-center'><?php echo $release->id;?></td>
<td><?php echo html::a(inlink('view', "release=$release->id"), $release->name);?></td>
<td><?php echo $release->buildName;?></td>
<?php if($product->type != 'normal'):?>
<td class='text-center'><?php echo $branches[$release->branch];?></td>
<?php endif;?>
<td class='text-center'><?php echo $release->date;?></td>
<td class='text-center'><?php echo $lang->release->statusList[$release->status];?></td>
<td class='text-center'>
+17 -2
View File
@@ -304,7 +304,15 @@ foreach($fieldParams as $fieldName => $param)
/* Get params of current field. */
$currentField = $formSession["field$fieldNO"];
$param = $fieldParams[$currentField];
if(!isset($fieldParams[$currentField]))
{
$currentField = key($searchFields);
$formSession["field$fieldNO"] = $currentField;
$formSession["operator$fieldNO"] = isset($fieldParams[$currentField]['operator']) ? $fieldParams[$currentField]['operator'] : '=';
$formSession["value$fieldNO"] = '';
}
$param = $fieldParams[$currentField];
/* Print and or. */
echo "<td class='text-right w-60px'>";
@@ -346,7 +354,14 @@ foreach($fieldParams as $fieldName => $param)
/* Get params of current field. */
$currentField = $formSession["field$fieldNO"];
$param = $fieldParams[$currentField];
if(!isset($fieldParams[$currentField]))
{
$currentField = key($searchFields);
$formSession["field$fieldNO"] = $currentField;
$formSession["operator$fieldNO"] = isset($fieldParams[$currentField]['operator']) ? $fieldParams[$currentField]['operator'] : '=';
$formSession["value$fieldNO"] = '';
}
$param = $fieldParams[$currentField];
/* Print and or. */
echo "<td class='text-right w-60px'>";
+17 -5
View File
@@ -567,6 +567,9 @@ class testtask extends control
$task = $this->testtask->getById($taskID);
$productID = $this->product->saveState($task->product, $this->products);
/* Save session. */
$this->testtask->setMenu($this->products, $productID, $task->branch);
/* Load pager. */
$this->app->loadClass('pager', $static = true);
$pager = pager::init($recTotal, $recPerPage, $pageID);
@@ -576,13 +579,20 @@ class testtask extends control
$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'] = inlink('linkcase', "taskID=$taskID");
unset($this->config->testcase->search['fields']['branch']);
unset($this->config->testcase->search['params']['branch']);
if($this->session->currentProductType == 'normal')
{
unset($this->config->testcase->search['fields']['branch']);
unset($this->config->testcase->search['params']['branch']);
}
else
{
$this->config->testcase->search['fields']['branch'] = $this->lang->product->branch;
$branches = array('' => '') + $this->loadModel('branch')->getPairs($task->product, 'noempty');
if($task->branch) $branches = array('' => '', $task->branch => $branches[$task->branch]);
$this->config->testcase->search['params']['branch']['values'] = $branches;
}
$this->loadModel('search')->setSearchParams($this->config->testcase->search);
/* Save session. */
$this->testtask->setMenu($this->products, $productID, $task->branch);
$this->view->title = $task->name . $this->lang->colon . $this->lang->testtask->linkCase;
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->testtask->common;
@@ -612,6 +622,7 @@ class testtask extends control
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)
->andWhere('product')->eq($productID)
->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()
->beginIF($task->branch)->andWhere('branch')->in("0,$task->branch")->fi()
->andWhere('story')->in($stories)
->andWhere('deleted')->eq(0)
->orderBy('id desc')
@@ -628,6 +639,7 @@ class testtask extends control
$cases = empty($bugs) ? array() : $this->dao->select('*')->from(TABLE_CASE)->where($query)
->andWhere('product')->eq($productID)
->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()
->beginIF($task->branch)->andWhere('branch')->in("0,$task->branch")->fi()
->andWhere('fromBug')->in($bugs)
->andWhere('deleted')->eq(0)
->orderBy('id desc')