Merge branch 'sprint/185_xieqiyu_49304' into 'pailei'

Sprint/185 xieqiyu 49304

See merge request easycorp/zentaopms!2007
This commit is contained in:
孙广明
2022-03-01 07:04:26 +00:00
16 changed files with 409 additions and 228 deletions
+100 -3
View File
@@ -85,8 +85,6 @@ class branchModel extends model
$mainBranch->desc = sprintf($this->lang->branch->mainBranch, $this->lang->product->branchName[$product->type]);
$mainBranch->order = 0;
if($productID) $product = $this->loadModel('product')->getById($productID);
if(isset($product) and $product->type == 'normal') return $branchList;
return array($mainBranch) + $branchList;
}
@@ -351,16 +349,115 @@ class branchModel extends model
/**
* Unlink branches for projects when product type is normal.
*
* @param int $productIDList
* @param int|array $productIDList
* @access public
* @return void
*/
public function unlinkBranch4Project($productIDList)
{
$productLinkedProject = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)
->where('product')->in($productIDList)
->andWhere('branch')->gt(0)
->fetchGroup('product', 'project');
$this->dao->delete()->from(TABLE_PROJECTPRODUCT)
->where('product')->in($productIDList)
->andWhere('branch')->gt(0)
->exec();
foreach($productLinkedProject as $productID => $projectList)
{
foreach($projectList as $projectID => $project)
{
$data = new stdClass();
$data->product = $productID;
$data->project = $projectID;
$data->branch = 0;
$data->plan = 0;
$this->dao->replace(TABLE_PROJECTPRODUCT)->data($data)->exec();
}
}
}
/**
* Link branches for projects when product type is not normal.
*
* @param int $productID
* @access public
* @return void
*/
public function linkBranch4Project($productID)
{
if(is_array($productID))
{
foreach($productID as $id) $this->linkBranch4Project($id);
}
$linkedBranchProject = array();
$storyLinkedBranchProject = $this->dao->select('project,branch')->from(TABLE_PROJECTSTORY)
->where('product')->eq($productID)
->andWhere('branch')->gt(0)
->fetchGroup('project', 'branch');
foreach($storyLinkedBranchProject as $projectID => $branchList)
{
foreach($branchList as $branchID => $branch) $linkedBranchProject[$projectID][$branchID] = $branchID;
}
$bugLinkedBranchProject = $this->dao->select('project,branch')->from(TABLE_BUG)
->where('product')->eq($productID)
->andWhere('branch')->gt(0)
->andWhere('project')->ne(0)
->fetchGroup('project', 'branch');
foreach($bugLinkedBranchProject as $projectID => $branchList)
{
foreach($branchList as $branchID => $branch) $linkedBranchProject[$projectID][$branchID] = $branchID;
}
$bugLinkedBranchExecution = $this->dao->select('execution,branch')->from(TABLE_BUG)
->where('product')->eq($productID)
->andWhere('branch')->gt(0)
->andWhere('execution')->ne(0)
->fetchGroup('execution', 'branch');
foreach($bugLinkedBranchExecution as $executionID => $branchList)
{
foreach($branchList as $branchID => $branch) $linkedBranchProject[$executionID][$branchID] = $branchID;
}
$caseLinkedBranchProject = $this->dao->select('project,branch')->from(TABLE_CASE)
->where('product')->eq($productID)
->andWhere('branch')->gt(0)
->andWhere('project')->ne(0)
->fetchGroup('project', 'branch');
foreach($caseLinkedBranchProject as $projectID => $branchList)
{
foreach($branchList as $branchID => $branch) $linkedBranchProject[$projectID][$branchID] = $branchID;
}
$caseLinkedBranchExecution = $this->dao->select('execution,branch')->from(TABLE_CASE)
->where('product')->eq($productID)
->andWhere('branch')->gt(0)
->andWhere('execution')->ne(0)
->fetchGroup('execution', 'branch');
foreach($caseLinkedBranchExecution as $executionID => $branchList)
{
foreach($branchList as $branchID => $branch) $linkedBranchProject[$executionID][$branchID] = $branchID;
}
foreach($linkedBranchProject as $projectID => $branchList)
{
foreach($branchList as $branchID)
{
$data = new stdClass();
$data->product = $productID;
$data->project = $projectID;
$data->branch = $branchID;
$data->plan = 0;
$this->dao->replace(TABLE_PROJECTPRODUCT)->data($data)->exec();
}
}
}
/**
+74 -56
View File
@@ -89,16 +89,23 @@ class bug extends control
$this->loadModel('datatable');
$productID = $this->product->saveState($productID, $this->products);
$product = $this->product->getById($productID);
if($product->type != 'normal')
{
/* Set productID, moduleID, queryID and branch. */
$branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch;
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
}
else
{
$branch = 'all';
}
$this->qa->setMenu($this->products, $productID, $branch);
/* Set browse type. */
$browseType = strtolower($browseType);
/* Set productID, moduleID, queryID and branch. */
$branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch;
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
if($this->cookie->preProductID != $productID or $this->cookie->preBranch != $branch or $browseType == 'bybranch')
{
$_COOKIE['bugModule'] = 0;
@@ -191,19 +198,22 @@ class bug extends control
$showModule = !empty($this->config->datatable->bugBrowse->showModule) ? $this->config->datatable->bugBrowse->showModule : '';
$productName = ($productID and isset($this->products[$productID])) ? $this->products[$productID] : $this->lang->product->allProduct;
$product = $this->product->getById($productID);
/* Display of branch label. */
$showBranch = $this->loadModel('branch')->showBranch($productID);
/* Display status of branch. */
$branches = $this->loadModel('branch')->getList($productID, 0, 'all');
$showBranch = false;
$branchOption = array();
$branchTagOption = array();
foreach($branches as $branchInfo)
if($product and $product->type != 'normal')
{
$branchOption[$branchInfo->id] = $branchInfo->name;
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
/* Display of branch label. */
$showBranch = $this->loadModel('branch')->showBranch($productID);
/* Display status of branch. */
$branches = $this->loadModel('branch')->getList($productID, 0, 'all');
foreach($branches as $branchInfo)
{
$branchOption[$branchInfo->id] = $branchInfo->name;
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
}
}
/* Set view. */
@@ -985,13 +995,16 @@ class bug extends control
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
}
$moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $bug->branch);
if(!isset($moduleOptionMenu[$bug->module])) $moduleOptionMenu += $this->tree->getModulesName($bug->module);
$this->view->bug = $bug;
$this->view->productID = $productID;
$this->view->product = $product;
$this->view->productName = $this->products[$productID];
$this->view->plans = $this->loadModel('productplan')->getPairs($productID, $bug->branch, '', true);
$this->view->projects = array(0 => '') + $this->product->getProjectPairsByProduct($productID, $bug->branch, $bug->project);
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $bug->branch);
$this->view->moduleOptionMenu = $moduleOptionMenu;
$this->view->currentModuleID = $currentModuleID;
$this->view->executions = array(0 => '') + $this->product->getExecutionPairsByProduct($bug->product, $bug->branch, 'id_desc', $bug->project);
$this->view->stories = $bug->execution ? $this->story->getExecutionStoryPairs($bug->execution) : $this->story->getProductStoryPairs($bug->product, $bug->branch);
@@ -1065,57 +1078,58 @@ class bug extends control
$plans = array('' => '', 'ditto' => $this->lang->bug->ditto) + $plans;
/* Set branches and modules. */
$branches = array();
$branches = 0;
$branchTagOption = array();
$modules = array();
$modules = array();
if($product->type != 'normal')
{
$branches = $this->loadModel('branch')->getList($productID, 0 ,'all');
foreach($branches as $branchInfo)
{
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
}
foreach($branchTagOption as $branchID => $branchName)
{
$modules[$productID][$branchID] = $this->tree->getOptionMenu($productID, 'bug', 0, $branchID);
}
}
else
{
$modules[$productID][0] = $this->tree->getOptionMenu($productID, 'bug');
foreach($branches as $branchInfo) $branchTagOption[$productID][$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
$branches = array_keys($branches);
}
$modulePairs = $this->tree->getOptionMenu($productID, 'bug', 0, $branches);
$modules[$productID] = $product->type != 'normal' ? $modulePairs : array(0 => $modulePairs);
/* Set product menu. */
$this->qa->setMenu($this->products, $productID, $branch);
$this->view->title = $product->name . $this->lang->colon . "BUG" . $this->lang->bug->batchEdit;
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]);
$this->view->plans = $plans;
$this->view->branchTagOption = $branchTagOption;
$this->view->modules = $modules;
$this->view->title = $product->name . $this->lang->colon . "BUG" . $this->lang->bug->batchEdit;
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]);
$this->view->plans = $plans;
}
/* The bugs of my. */
else
{
$branchProduct = false;
$productIdList = array();
$branchProduct = false;
$productIdList = array();
$branchTagOption = array();
foreach($bugs as $bug) $productIdList[$bug->product] = $bug->product;
$products = $this->product->getByIdList($productIdList);
foreach($products as $product)
$productList = $this->product->getByIdList($productIdList);
foreach($productList as $product)
{
$branches = 0;
if($product->type != 'normal')
{
$branches = $this->loadModel('branch')->getList($product->id, 0 ,'all');
foreach($branches as $branchInfo) $branchTagOption[$product->id][$branchInfo->id] = '/' . $product->name . '/' . $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
$branches = array_keys($branches);
$branchProduct = true;
break;
}
$modulePairs = $this->tree->getOptionMenu($product->id, 'bug', 0, $branches);
$modules[$product->id] = $product->type != 'normal' ? $modulePairs : array(0 => $modulePairs);
}
$this->app->loadLang('my');
$this->lang->task->menu = $this->lang->my->menu->work;
$this->lang->my->menu->work['subModule'] = 'bug';
$this->view->position[] = html::a($this->createLink('my', 'bug'), $this->lang->my->bug);
$this->view->title = "BUG" . $this->lang->bug->batchEdit;
$this->view->position[] = html::a($this->createLink('my', 'bug'), $this->lang->my->bug);
$this->view->title = "BUG" . $this->lang->bug->batchEdit;
$this->view->plans = $this->loadModel('productplan')->getPairs($product->id, $branch);
$this->view->productList = $productList;
}
/* Judge whether the editedBugs is too large and set session. */
@@ -1134,25 +1148,29 @@ class bug extends control
{
$appendUsers[$bug->assignedTo] = $bug->assignedTo;
$appendUsers[$bug->resolvedBy] = $bug->resolvedBy;
if(!isset($modules[$bug->product][$bug->branch])) $modules[$bug->product][$bug->branch] = $modules[$bug->product][0] + $this->tree->getModulesName($bug->module);
}
$users = $this->user->getPairs('devfirst', $appendUsers, $this->config->maxCount);
$users = array('' => '', 'ditto' => $this->lang->bug->ditto) + $users;
/* Assign. */
$this->view->position[] = $this->lang->bug->common;
$this->view->position[] = $this->lang->bug->batchEdit;
$this->view->productID = $productID;
$this->view->branchProduct = $branchProduct;
$this->view->severityList = array('ditto' => $this->lang->bug->ditto) + $this->lang->bug->severityList;
$this->view->typeList = array('' => '', 'ditto' => $this->lang->bug->ditto) + $this->lang->bug->typeList;
$this->view->priList = array('0' => '', 'ditto' => $this->lang->bug->ditto) + $this->lang->bug->priList;
$this->view->resolutionList = array('' => '', 'ditto' => $this->lang->bug->ditto) + $this->lang->bug->resolutionList;
$this->view->statusList = array('' => '', 'ditto' => $this->lang->bug->ditto) + $this->lang->bug->statusList;
$this->view->osList = array('' => '', 'ditto' => $this->lang->bug->ditto) + $this->lang->bug->osList;
$this->view->browserList = array('' => '', 'ditto' => $this->lang->bug->ditto) + $this->lang->bug->browserList;
$this->view->bugs = $bugs;
$this->view->branch = $branch;
$this->view->users = $users;
$this->view->position[] = $this->lang->bug->common;
$this->view->position[] = $this->lang->bug->batchEdit;
$this->view->productID = $productID;
$this->view->branchProduct = $branchProduct;
$this->view->severityList = array('ditto' => $this->lang->bug->ditto) + $this->lang->bug->severityList;
$this->view->typeList = array('' => '', 'ditto' => $this->lang->bug->ditto) + $this->lang->bug->typeList;
$this->view->priList = array('0' => '', 'ditto' => $this->lang->bug->ditto) + $this->lang->bug->priList;
$this->view->resolutionList = array('' => '', 'ditto' => $this->lang->bug->ditto) + $this->lang->bug->resolutionList;
$this->view->statusList = array('' => '', 'ditto' => $this->lang->bug->ditto) + $this->lang->bug->statusList;
$this->view->osList = array('' => '', 'ditto' => $this->lang->bug->ditto) + $this->lang->bug->osList;
$this->view->browserList = array('' => '', 'ditto' => $this->lang->bug->ditto) + $this->lang->bug->browserList;
$this->view->bugs = $bugs;
$this->view->branch = $branch;
$this->view->users = $users;
$this->view->modules = $modules;
$this->view->branchTagOption = $branchTagOption;
$this->display();
}
+3 -22
View File
@@ -74,24 +74,6 @@
<?php foreach($bugs as $bugID => $bug):?>
<?php
if(!empty($this->config->user->moreLink)) $this->config->moreLinks["assignedTos[$bugID]"] = $this->config->user->moreLink;
if(!$productID)
{
$branchTagOption = array();
$product = $this->product->getByID($bug->product);
$plans = $this->loadModel('productplan')->getPairs($bug->product, $branch);
$branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getList($product->id, 0 ,'all');
foreach($branches as $branchInfo)
{
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
}
$modules[$bug->product][0] = $this->tree->getOptionMenu($bug->product, 'bug');
if($product->type != 'normal')
{
foreach($branchTagOption as $branchID => $branchName) $branchTagOption[$branchID] = '/' . $product->name . '/' . $branchName;
$modules[$bug->product][$bug->branch] = $this->tree->getOptionMenu($bug->product, 'bug', 0, $bug->branch);
}
}
?>
<tr>
<td><?php echo $bugID . html::hidden("bugIDList[$bugID]", $bugID);?></td>
@@ -114,12 +96,11 @@
</td>
<?php if($branchProduct):?>
<td style='overflow:visible'>
<?php $branchProductID = $productID ? $productID : $product->id;?>
<?php $disabled = (isset($product) and $product->type == 'normal') ? "disabled='disabled'" : '';?>
<?php echo html::select("branches[$bugID]", $branchTagOption, $bug->branch, "class='form-control chosen' $disabled onchange='setBranchRelated(this.value, $bug->product, $bug->id)'");?>
<?php $disabled = (isset($productList) and $productList[$bug->product]->type == 'normal') ? "disabled='disabled'" : '';?>
<?php echo html::select("branches[$bugID]", !empty($disabled) ? array() : $branchTagOption[$bug->product], $bug->branch, "class='form-control chosen' $disabled onchange='setBranchRelated(this.value, $bug->product, $bug->id)'");?>
</td>
<?php endif;?>
<td><?php echo html::select("modules[$bugID]", $modules[$bug->product][$bug->branch], $bug->module, "class='form-control chosen'");?></td>
<td><?php echo html::select("modules[$bugID]", isset($modules[$bug->product][$bug->branch]) ? $modules[$bug->product][$bug->branch] : array(0 => '/'), $bug->module, "class='form-control chosen'");?></td>
<td class='<?php echo zget($visibleFields, 'productplan', ' hidden')?>' style='overflow:visible'><?php echo html::select("plans[$bugID]", $plans, $bug->plan, "class='form-control chosen'");?></td>
<td class='<?php echo zget($visibleFields, 'assignedTo', ' hidden')?>' style='overflow:visible'><?php echo html::select("assignedTos[$bugID]", $users, $bug->assignedTo, "class='form-control chosen'");?></td>
<td class='<?php echo zget($visibleFields, 'deadline', ' hidden')?>' style='overflow:visible'><?php echo html::input("deadlines[$bugID]", $bug->deadline, "class='form-control form-date'");?></td>
+9 -2
View File
@@ -2579,8 +2579,8 @@ class execution extends control
$this->view->unmodifiableProducts = $unmodifiableProducts;
$this->view->unmodifiableBranches = $unmodifiableBranches;
$this->view->linkedBranches = $linkedBranches;
$this->view->branchGroups = $this->execution->getBranchByProduct(array_keys($allProducts), $this->config->systemMode == 'new' ? $execution->project : 0);
$this->view->allBranches = $this->execution->getBranchByProduct(array_keys($allProducts), $this->config->systemMode == 'new' ? $execution->project : 0, 'all');
$this->view->branchGroups = $this->execution->getBranchByProduct(array_keys($allProducts), $this->config->systemMode == 'new' ? $execution->project : 0, 'ignoreNormal|noclosed');
$this->view->allBranches = $this->execution->getBranchByProduct(array_keys($allProducts), $this->config->systemMode == 'new' ? $execution->project : 0, 'ignoreNormal');
$this->display();
}
@@ -2795,6 +2795,13 @@ class execution extends control
{
if(isset($linkedStories[$story->id])) unset($allStories[$id]);
if($story->parent < 0) unset($allStories[$id]);
if(!isset($modules[$story->module]))
{
$storyModule = $this->tree->getModulesName($story->module);
$productName = count($products) > 1 ? $products[$story->product]->name : '';
$modules[$story->module] = $productName . $storyModule[$story->module];
}
}
/* Pager. */
+19 -8
View File
@@ -135,9 +135,18 @@ class product extends control
public function browse($productID = 0, $branch = '', $browseType = '', $param = 0, $storyType = 'story', $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1, $projectID = 0)
{
$productID = $this->app->tab != 'project' ? $this->product->saveState($productID, $this->products) : $productID;
$branches = $this->loadModel('branch')->getList($productID, $projectID, 'all');
$branch = ($this->cookie->preBranch !== '' and $branch === '' and isset($branches[$this->cookie->preBranch])) ? $this->cookie->preBranch : $branch;
$branchID = $branch;
$product = $this->product->getById($productID);
if($product and $product->type != 'normal')
{
$branchPairs = $this->loadModel('branch')->getPairs($productID, 'all');
$branch = ($this->cookie->preBranch !== '' and $branch === '' and isset($branchPairs[$this->cookie->preBranch])) ? $this->cookie->preBranch : $branch;
$branchID = $branch;
}
else
{
$branchID = $branch = 'all';
}
/* Set menu. */
if($this->app->tab == 'product')
@@ -224,8 +233,6 @@ class product extends control
/* Display of branch label. */
$showBranch = $this->loadModel('branch')->showBranch($productID);
$product = $this->product->getById($productID);
/* Get stories. */
if($this->app->rawModule == 'projectstory')
{
@@ -248,10 +255,14 @@ class product extends control
/* Display status of branch. */
$branchOption = array();
$branchTagOption = array();
foreach($branches as $branchInfo)
if($product and $product->type != 'normal')
{
$branchOption[$branchInfo->id] = $branchInfo->name;
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
$branches = $this->loadModel('branch')->getList($productID, $projectID, 'all');
foreach($branches as $branchInfo)
{
$branchOption[$branchInfo->id] = $branchInfo->name;
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
}
}
/* Process the sql, get the conditon partion, save it to session. */
+4
View File
@@ -695,6 +695,7 @@ class productModel extends model
$this->loadModel('personnel')->updateWhitelist($whitelist, 'product', $productID);
if($product->acl != 'open') $this->loadModel('user')->updateUserView($productID, 'product');
if($product->type == 'normal' and $oldProduct->type != 'normal') $this->loadModel('branch')->unlinkBranch4Project($productID);
if($product->type != 'normal' and $oldProduct->type == 'normal') $this->loadModel('branch')->linkBranch4Project($productID);
return common::createChanges($oldProduct, $product);
}
@@ -745,6 +746,7 @@ class productModel extends model
if(dao::isError()) return print(js::error(dao::getError()));
$unlinkProducts = array();
$linkProducts = array();
foreach($products as $productID => $product)
{
$oldProduct = $oldProducts[$productID];
@@ -763,11 +765,13 @@ class productModel extends model
if($product->acl == 'open') $this->loadModel('personnel')->updateWhitelist('', 'product', $productID);
if($product->acl != 'open') $this->loadModel('user')->updateUserView($productID, 'product');
if($product->type == 'normal' and $oldProduct->type != 'normal') $unlinkProducts[] = $productID;
if($product->type != 'normal' and $oldProduct->type == 'normal') $linkProducts[] = $productID;
$allChanges[$productID] = common::createChanges($oldProduct, $product);
}
if(!empty($unlinkProducts)) $this->loadModel('branch')->unlinkBranch4Project($unlinkProducts);
if(!empty($linkProducts)) $this->loadModel('branch')->linkBranch4Project($linkProducts);
return $allChanges;
}
+2 -1
View File
@@ -489,7 +489,8 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : '';
</div>
<?php $isShowModuleBTN = ($this->app->tab == 'project' and $browseType != 'bybranch') ? false : true;?>
<?php if($canBatchChangeModule and $productID and $branchID !== 'all' and $isShowModuleBTN):?>
<?php if($canBatchChangeModule and $productID and $isShowModuleBTN):?>
<?php if(($product->type != 'normal' and $branchID != 'all') or $product->type == 'normal')?>
<div class="btn-group dropup">
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->story->moduleAB;?> <span class="caret"></span></button>
<?php $withSearch = count($modules) > 8;?>
+14 -2
View File
@@ -397,8 +397,14 @@ class productplan extends control
if($plan->branch > 0) $this->view->branchStatus = $this->loadModel('branch')->getById($plan->branch, $plan->product, 'status');
$modulePairs = $this->loadModel('tree')->getOptionMenu($plan->product, 'story', 0, 'all');
foreach($planStories as $story)
{
if(!isset($modulePairs[$story->module])) $modulePairs += $this->tree->getModulesName($story->module);
}
$this->loadModel('datatable');
$this->view->modulePairs = $this->loadModel('tree')->getOptionMenu($plan->product, 'story', 0, 'all');
$this->view->modulePairs = $modulePairs;
$this->view->title = "PLAN #$plan->id $plan->title/" . zget($products, $plan->product, '');
$this->view->position[] = $this->lang->productplan->view;
$this->view->planStories = $planStories;
@@ -643,6 +649,12 @@ class productplan extends control
$allStories = $this->story->getProductStories($this->view->product->id, $plan->branch ? "0,{$plan->branch}" : 0, $moduleID = '0', $status = 'draft,active,changed', 'story', 'id_desc', $hasParent = false, array_keys($planStories), $pager);
}
$modules = $this->loadModel('tree')->getOptionMenu($plan->product, 'story', 0, 'all');
foreach($allStories as $story)
{
if(!isset($modules[$story->module])) $modules += $this->tree->getModulesName($story->module);
}
$this->view->allStories = $allStories;
$this->view->planStories = $planStories;
$this->view->products = $products;
@@ -650,7 +662,7 @@ class productplan extends control
$this->view->plans = $this->dao->select('id, end')->from(TABLE_PRODUCTPLAN)->fetchPairs();
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->browseType = $browseType;
$this->view->modules = $this->loadModel('tree')->getOptionMenu($plan->product, 'story', 0, 'all');
$this->view->modules = $modules;
$this->view->param = $param;
$this->view->orderBy = $orderBy;
$this->view->pager = $pager;
+1 -1
View File
@@ -220,7 +220,7 @@
</td>
<?php if($canOrder):?><td class='sort-handler'><i class='icon-move'></i></td><?php endif;?>
<td><span class='label-pri <?php echo 'label-pri-' . $story->pri;?>' title='<?php echo zget($lang->story->priList, $story->pri, $story->pri);?>'><?php echo zget($lang->story->priList, $story->pri, $story->pri);?></span></td>
<td class='text-left nobr'><?php echo zget($modulePairs, $story->module, '');?></td>
<td class='text-left nobr' title='<?php echo zget($modulePairs, $story->module, '');?>'><?php echo zget($modulePairs, $story->module, '');?></td>
<td class='text-left nobr' title='<?php echo $story->title?>'>
<?php
if($story->parent > 0) echo "<span class='label label-badge label-light' title={$lang->story->children}>{$lang->story->childrenAB}</span>";
+65 -57
View File
@@ -718,6 +718,9 @@ class story extends control
$this->story->replaceURLang($story->type);
/* Process the module when branch products are switched to normal products. */
if($product->type == 'normal' and !empty($story->branch)) $this->view->moduleOptionMenu += $this->tree->getModulesName($story->module);
$this->view->title = $this->lang->story->edit . "STORY" . $this->lang->colon . $this->view->story->title;
$this->view->position[] = $this->lang->story->edit;
$this->view->story = $story;
@@ -802,81 +805,69 @@ class story extends control
$stories = $this->story->getByList($storyIdList);
$this->loadModel('branch');
if($productID or $executionID)
if($productID and !$executionID)
{
if(!$executionID)
$product = $this->product->getByID($productID);
$branchProduct = $product->type == 'normal' ? false : true;
$branches = 0;
$branchTagOption = array();
if($branchProduct)
{
$branches = $this->branch->getList($productID, $executionID, 'all');
$branchOption = array();
$branchTagOption = array();
foreach($branches as $branchInfo) $branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
$product = $this->product->getByID($productID);
$branchProduct = $product->type == 'normal' ? false : true;
$modulePairs = $this->tree->getOptionMenu($productID, 'story', 0, array_keys($branches));
$branchModules = $branchProduct ? $modulePairs : array('0' => $modulePairs);
$modules = array($productID => $branchModules);
$plans = array($productID => $this->productplan->getBranchPlanPairs($productID, '', true));
$products = array($productID => $product);
$branchTagOption = array($productID => $branchTagOption);
$branches = array_keys($branches);
}
else
{
$modules = array();
$branches = array();
$branchTagOption = array();
$execution = $this->execution->getByID($executionID);
$branchProduct = false;
$linkedProducts = $this->loadModel('product')->getProducts($executionID);
foreach($linkedProducts as $linkedProduct)
{
$branchList = $this->branch->getList($linkedProduct->id, $executionID, 'all');
foreach($branchList as $branchInfo) $branches[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
$branchTagOption[$linkedProduct->id] = array(BRANCH_MAIN => $this->lang->branch->main) + $branches;
$modulePairs = $this->tree->getOptionMenu($productID, 'story', 0, $branches);
$moduleList = $branchProduct ? $modulePairs : array(0 => $modulePairs);
$moduleList = $this->tree->getOptionMenu($linkedProduct->id, 'story', 0, array_keys($branchList));
$modules[$linkedProduct->id] = $linkedProduct->type != 'normal' ? $moduleList : array(0 => $moduleList);
$plans[$linkedProduct->id] = $this->productplan->getBranchPlanPairs($linkedProduct->id, array_keys($branchList), true);
if(empty($plans[$linkedProduct->id])) $plans[$linkedProduct->id][0] = $plans[$linkedProduct->id];
if($linkedProduct->type != 'normal') $branchProduct = true;
}
$products = $linkedProducts;
}
$this->view->title = (isset($product) ? $product->name : $execution->name) . $this->lang->colon . $this->lang->story->batchEdit;
$this->view->branchTagOption = $branchTagOption;
$this->view->modules = $modules;
$this->view->productName = isset($product) ? $product->name : '';
$modules = array($productID => $moduleList);
$plans = array($productID => $this->productplan->getBranchPlanPairs($productID, '', true));
$products = array($productID => $product);
$branchTagOption = array($productID => $branchTagOption);
}
else
{
/* The stories of my. */
$branchProduct = false;
$productIdList = array();
foreach($stories as $story) $productIdList[$story->product] = $story->product;
$products = $this->product->getByIdList($productIdList);
$branchProduct = false;
$modules = array();
$branchTagOption = array();
$products = array();
if($executionID)
{
/* The stories of project or execution. */
$execution = $this->execution->getByID($executionID);
$products = $this->loadModel('product')->getProducts($executionID);
}
else
{
/* The stories of my. */
$productIdList = array();
foreach($stories as $story) $productIdList[$story->product] = $story->product;
$products = $this->product->getByIdList($productIdList);
}
foreach($products as $storyProduct)
{
$branchList = array();
$branches = $this->branch->getList($storyProduct->id, 0, 'all');
foreach($branches as $branchInfo) $branchList[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
$branchIdList = array_keys($branchList) ? array_keys($branchList) : 0;
$branchTagOption[$storyProduct->id] = $branchList;
$branches = 0;
if($storyProduct->type != 'normal')
{
$branches = $this->branch->getList($storyProduct->id, $executionID, 'all');
foreach($branches as $branchInfo) $branches[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
$branchTagOption[$storyProduct->id] = array(BRANCH_MAIN => $this->lang->branch->main) + $branches;
$modules[$storyProduct->id] = $this->tree->getOptionMenu($storyProduct->id, 'story', 0, $branchIdList);
if($storyProduct->type == 'normal') $modules[$storyProduct->id][0] = $modules[$storyProduct->id];
$branches = array_keys($branches);
}
$plans[$storyProduct->id] = $this->productplan->getBranchPlanPairs($storyProduct->id, array_keys($branchList), true);
$modulePairs = $this->tree->getOptionMenu($storyProduct->id, 'story', 0, $branches);
$modules[$storyProduct->id] = $storyProduct->type != 'normal' ? $modulePairs : array(0 => $modulePairs);
$plans[$storyProduct->id] = $this->productplan->getBranchPlanPairs($storyProduct->id, $branches, true);
if(empty($plans[$storyProduct->id])) $plans[$storyProduct->id][0] = $plans[$storyProduct->id];
if($storyProduct->type != 'normal') $branchProduct = true;
}
$this->view->title = $this->lang->story->batchEdit;
$this->view->branchTagOption = $branchTagOption;
$this->view->modules = $modules;
}
/* Set ditto option for users. */
@@ -901,8 +892,23 @@ class story extends control
$showSuhosinInfo = common::judgeSuhosinSetting($countInputVars);
if($showSuhosinInfo) $this->view->suhosinInfo = extension_loaded('suhosin') ? sprintf($this->lang->suhosinInfo, $countInputVars) : sprintf($this->lang->maxVarsInfo, $countInputVars);
/* Append module when change product type. */
$moduleList = array(0 => '/');
foreach($stories as $story)
{
if(isset($modules[$story->product][$story->branch]))
{
$moduleList[$story->id] = $modules[$story->product][$story->branch];
}
else
{
$moduleList[$story->id] = $modules[$story->product][0] + $this->tree->getModulesName($story->module);
}
}
$this->view->position[] = $this->lang->story->common;
$this->view->position[] = $this->lang->story->batchEdit;
$this->view->title = $this->lang->story->batchEdit;
$this->view->users = $users;
$this->view->priList = array('0' => '', 'ditto' => $this->lang->story->ditto) + $this->lang->story->priList;
$this->view->sourceList = array('' => '', 'ditto' => $this->lang->story->ditto) + $this->lang->story->sourceList;
@@ -917,6 +923,8 @@ class story extends control
$this->view->storyType = $storyType;
$this->view->stories = $stories;
$this->view->executionID = $executionID;
$this->view->branchTagOption = $branchTagOption;
$this->view->moduleList = $moduleList;
$this->display();
}
+65 -12
View File
@@ -2267,12 +2267,42 @@ class storyModel extends model
{
if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getStories();
if(is_array($branch)) $branch = join(',', $branch);
$stories = array();
$branchProducts = array();
$normalProducts = array();
$productList = $this->dao->select('*')->from(TABLE_PRODUCT)->where('id')->in($productID)->fetchAll('id');
foreach($productList as $product)
{
if($product->type != 'normal')
{
$branchProducts[$product->id] = $product->id;
continue;
}
$normalProducts[$product->id] = $product->id;
}
$productQuery = '(';
if(!empty($normalProducts)) $productQuery .= '`product` ' . helper::dbIN(array_keys($normalProducts));
if(!empty($branchProducts))
{
if(!empty($normalProducts)) $productQuery .= " OR ";
$productQuery .= "(`product` " . helper::dbIN(array_keys($branchProducts));
if($branch !== 'all')
{
if(is_array($branch)) $branch = join(',', $branch);
$productQuery .= " AND `branch` " . helper::dbIN($branch);
}
$productQuery .= ')';
}
if(empty($normalProducts) and empty($branchProducts)) $productQuery .= '1 = 1';
$productQuery .= ') ';
$stories = $this->dao->select('*')->from(TABLE_STORY)
->where('product')->in($productID)
->andWhere($productQuery)
->beginIF(!$hasParent)->andWhere("parent")->ge(0)->fi()
->beginIF($branch !== 'all')->andWhere("branch")->in($branch)->fi()
->beginIF(!empty($moduleIdList))->andWhere('module')->in($moduleIdList)->fi()
->beginIF(!empty($excludeStories))->andWhere('id')->notIN($excludeStories)->fi()
->beginIF($status and $status != 'all')->andWhere('status')->in($status)->fi()
@@ -2537,27 +2567,50 @@ class storyModel extends model
$storyQuery = str_replace($allProduct, '1', $storyQuery);
$queryProductID = 'all';
}
$storyQuery = $storyQuery . ' AND `product` ' . helper::dbIN(array_keys($products));
if($excludeStories) $storyQuery = $storyQuery . ' AND `id` NOT ' . helper::dbIN($excludeStories);
if($this->app->moduleName == 'productplan') $storyQuery .= " AND `status` NOT IN ('closed') AND `parent` >= 0 ";
$allBranch = "`branch` = 'all'";
if($executionID != '')
{
$branches = array(BRANCH_MAIN => BRANCH_MAIN);
if($branch === '')
$normalProducts = array();
$branchProducts = array();
foreach($products as $product)
{
foreach($products as $product)
if($product->type != 'normal')
{
foreach($product->branches as $branchID) $branches[$branchID] = $branchID;
$branchProducts[$product->id] = $product;
continue;
}
}
else
{
$branches[$branch] = $branch;
$normalProducts[$product->id] = $product;
}
$branches = join(',', $branches);
$storyQuery .= " AND `branch`" . helper::dbIN($branches);
$storyQuery .= ' AND (';
if(!empty($normalProducts)) $storyQuery .= '`product` ' . helper::dbIN(array_keys($normalProducts));
if(!empty($branchProducts))
{
$branches = array(BRANCH_MAIN => BRANCH_MAIN);
if($branch === '')
{
foreach($branchProducts as $product)
{
foreach($product->branches as $branchID) $branches[$branchID] = $branchID;
}
}
else
{
$branches[$branch] = $branch;
}
$branches = join(',', $branches);
if(!empty($normalProducts)) $storyQuery .= " OR ";
$storyQuery .= "(`product` " . helper::dbIN(array_keys($branchProducts)) . " AND `branch` " . helper::dbIN($branches) . ")";
}
if(empty($normalProducts) and empty($branchProducts)) $storyQuery .= '1 = 1';
$storyQuery .= ') ';
if($this->app->moduleName == 'release' or $this->app->moduleName == 'build')
{
+1 -1
View File
@@ -77,7 +77,7 @@ foreach(explode(',', $showFields) as $field)
</td>
<?php endif;?>
<td class='text-left<?php echo zget($visibleFields, 'module')?>'>
<?php echo html::select("modules[$storyID]", isset($modules[$story->product][$story->branch]) ? $modules[$story->product][$story->branch] : array('0' => '/'), $story->module, "class='form-control chosen'");?>
<?php echo html::select("modules[$storyID]", zget($moduleList, $story->id, array(0 => '/')), $story->module, "class='form-control chosen'");?>
</td>
<td class='text-left<?php echo zget($visibleFields, 'plan', ' hidden')?>'>
<?php echo html::select("plans[$storyID]", isset($plans[$story->product][$story->branch]) ? array('' => '') + $plans[$story->product][$story->branch] : '', $story->plan, "class='form-control chosen'");?>
+41 -25
View File
@@ -175,20 +175,24 @@ class testcase extends control
$moduleTree = $this->tree->getTreeMenu($productID, 'case', 0, array('treeModel', 'createCaseLink'), array('projectID' => $projectID, 'productID' => $productID), $projectID ? '' : $branch);
}
/* Display of branch label. */
$showBranch = $this->loadModel('branch')->showBranch($productID);
$product = $this->product->getById($productID);
/* Display status of branch. */
$branches = $this->loadModel('branch')->getList($productID, $projectID, 'all');
$showBranch = false;
$branchOption = array();
$branchTagOption = array();
foreach($branches as $branchInfo)
if($product and $product->type != 'normal')
{
$branchOption[$branchInfo->id] = $branchInfo->name;
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
}
/* Display of branch label. */
$showBranch = $this->loadModel('branch')->showBranch($productID);
$product = $this->product->getById($productID);
/* Display status of branch. */
$branches = $this->loadModel('branch')->getList($productID, $projectID, 'all');
foreach($branches as $branchInfo)
{
$branchOption[$branchInfo->id] = $branchInfo->name;
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
}
}
/* Assign. */
$tree = $moduleID ? $this->tree->getByID($moduleID) : '';
@@ -871,6 +875,8 @@ class testcase extends control
}
}
if(!isset($moduleOptionMenu[$case->module])) $moduleOptionMenu += $this->tree->getModulesName($case->module);
/* Get product and branches. */
$product = $this->product->getById($productID);
if($this->app->tab == 'execution' or $this->app->tab == 'project')
@@ -960,7 +966,6 @@ class testcase extends control
/* Set modules. */
$modules[$productID][$branch] = $this->tree->getOptionMenu($libID, 'caselib', 0, $branch);
$this->view->modules = $modules;
$this->view->title = $libraries[$libID] . $this->lang->colon . $this->lang->testcase->batchEdit;
$this->view->position[] = html::a($this->createLink('caselib', 'browse', "libID=$libID"), $libraries[$libID]);
}
@@ -992,8 +997,7 @@ class testcase extends control
$modules[$productID][BRANCH_MAIN] = $this->tree->getOptionMenu($productID, 'case');
}
$this->view->branchTagOption = $branchTagOption;
$this->view->modules = $modules;
$this->view->branchTagOption = array($productID => $branchTagOption);
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->title = $product->name . $this->lang->colon . $this->lang->testcase->batchEdit;
$this->view->product = $product;
@@ -1021,31 +1025,27 @@ class testcase extends control
$productIdList = array();
foreach($cases as $case) $productIdList[$case->product] = $case->product;
$products = $this->product->getByIdList($productIdList);
$branches = 0;
$branchTagOption = array();
$products = $this->product->getByIdList($productIdList);
foreach($products as $product)
{
if($product->type != 'normal')
{
$branches = $this->loadModel('branch')->getList($product->id, 0, 'all');
foreach($branches as $branchInfo) $branchTagOption[$product->id][$branchInfo->id] = '/' . $product->name . '/' . $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
$branches = array_keys($branches);
$branchProduct = true;
break;
}
}
if($this->app->tab == 'project')
{
$productBranches = $this->loadModel('execution')->getBranchByProduct(array_keys($products), $this->session->project, 'all');
}
else
{
$productBranches = $this->loadModel('branch')->getByProducts(array_keys($products), 'ignoreNormal');
$modulePairs = $this->tree->getOptionMenu($product->id, 'case', 0, $branches);
$modules[$product->id] = $product->type != 'normal' ? $modulePairs : array(0 => $modulePairs);
}
$this->view->products = $products;
$this->view->productBranches = $productBranches;
$this->view->branchTagOption = $branchTagOption;
}
// if(!$this->testcase->forceNotReview()) unset($this->lang->testcase->statusList['wait']); /* Bug#1343 */
/* Judge whether the editedCases is too large and set session. */
$countInputVars = count($cases) * (count(explode(',', $this->config->testcase->custom->batchEditFields)) + 3);
$showSuhosinInfo = common::judgeSuhosinSetting($countInputVars);
@@ -1059,6 +1059,21 @@ class testcase extends control
$this->view->customFields = $customFields;
$this->view->showFields = $this->config->testcase->custom->batchEditFields;
/* Append module when change product type. */
$modulePairs = array(0 => '/');
foreach($cases as $case)
{
$caseProduct = $type == 'lib' ? $productID : $case->product;
if(isset($modules[$caseProduct][$case->branch]))
{
$modulePairs[$case->id] = $modules[$caseProduct][$case->branch];
}
else
{
$modulePairs[$case->id] = $modules[$caseProduct][0] + $this->tree->getModulesName($case->module);
}
}
/* Assign. */
$this->view->position[] = $this->lang->testcase->common;
$this->view->position[] = $this->lang->testcase->batchEdit;
@@ -1069,6 +1084,7 @@ class testcase extends control
$this->view->typeList = array('' => '', 'ditto' => $this->lang->testcase->ditto) + $this->lang->testcase->typeList;
$this->view->cases = $cases;
$this->view->forceNotReview = $this->testcase->forceNotReview();
$this->view->modulePairs = $modulePairs;
$this->display();
}
+5 -26
View File
@@ -66,27 +66,7 @@
</thead>
<tbody>
<?php foreach($caseIDList as $caseID):?>
<?php
if(!isset($cases[$caseID])) continue;
$caseBranch = isset($cases[$caseID]->branch) ? $cases[$caseID]->branch : 0;
if(!$productID and !$cases[$caseID]->lib)
{
$caseProductID = $cases[$caseID]->product;
$product = $products[$caseProductID];
$branchTagOption = array();
if($product->type != 'normal')
{
$branches = $this->loadModel('branch')->getList($product->id, 0, 'all');
foreach($branches as $branchInfo)
{
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
}
foreach($branchTagOption as $branchID => $branchName) $branchTagOption[$branchID] = '/' . $product->name . '/' . $branchName;
}
$modules[$caseProductID][$caseBranch] = $this->tree->getOptionMenu($cases[$caseID]->product, 'case', 0, $caseBranch);
}
?>
<?php if(!isset($cases[$caseID])) continue; ?>
<tr class='text-center'>
<td><?php echo $caseID . html::hidden("caseIDList[$caseID]", $caseID);?></td>
<td class='<?php echo zget($visibleFields, 'pri', 'hidden')?>'> <?php echo html::select("pris[$caseID]", $priList, $cases[$caseID]->pri, 'class=form-control');?></td>
@@ -105,13 +85,12 @@
</td>
<?php if($branchProduct):?>
<td class='text-left' style='overflow:visible'>
<?php $branchProductID = $productID ? $productID : $product->id;?>
<?php $disabled = (isset($product) and $product->type == 'normal') ? "disabled='disabled'" : '';?>
<?php echo html::select("branches[$caseID]", $branchTagOption, $product->type == 'normal' ? '' : $cases[$caseID]->branch, "class='form-control chosen' onchange='loadBranches($branchProductID, this.value, $caseID)', $disabled");?>
<?php $branchProductID = $productID ? $productID : $cases[$caseID]->product;?>
<?php $disabled = $products[$branchProductID]->type != 'normal' ? '' : "disabled='disabled'";?>
<?php echo html::select("branches[$caseID]", !empty($disabled) ? array() : $branchTagOption[$branchProductID], $products[$branchProductID]->type != 'normal' ? $cases[$caseID]->branch : '', "class='form-control chosen' onchange='loadBranches($branchProductID, this.value, $caseID)', $disabled");?>
</td>
<?php endif;?>
<?php $caseProductID = isset($caseProductID) ? $caseProductID : $productID;?>
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'><?php echo html::select("modules[$caseID]", $modules[$caseProductID][$caseBranch], $cases[$caseID]->module, "class='form-control chosen' onchange='loadStories($productID, this.value, $caseID)'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'><?php echo html::select("modules[$caseID]", zget($modulePairs, $caseID, array(0 => '/')), $cases[$caseID]->module, "class='form-control chosen' onchange='loadStories($productID, this.value, $caseID)'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'story', ' hidden')?>' style='overflow:visible'><?php echo html::select("story[$caseID]", $stories, $cases[$caseID]->story, "class='form-control chosen'");?></td>
<td style='overflow:visible' title='<?php echo $cases[$caseID]->title?>'>
<div class='input-group'>
+5 -4
View File
@@ -1246,7 +1246,6 @@ class testtask extends control
{
$this->loadModel('qa')->setMenu($this->products, $productID, $taskID);
}
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, 'case', 0, 'all');
$cases = $this->dao->select('*')->from(TABLE_CASE)->where('id')->in($caseIDList)->fetchAll('id');
}
@@ -1269,11 +1268,13 @@ class testtask extends control
->leftJoin(TABLE_TESTRUN)->alias('t2')->on('t1.id = t2.case')
->where('t2.id')->in($caseIDList)
->fetchAll('id');
$caseIDList = array();
foreach($cases as $case) $caseIDList[] = $case->id;
}
/* Set modules. */
$moduleOptionMenu = array(0 => '/');
foreach($cases as $case) $moduleOptionMenu += $this->tree->getModulesName($case->module);
$this->view->moduleOptionMenu = $moduleOptionMenu;
/* If case has changed and not confirmed, remove it. */
if($from == 'testtask')
{
+1 -8
View File
@@ -28,16 +28,9 @@
<th><?php echo $lang->testcase->stepDesc . '/' . $lang->testcase->stepExpect?></th>
</tr>
</thead>
<?php $moduleOptionMenu = $productID ? $moduleOptionMenu : array();?>
<?php foreach($cases as $caseID => $case):?>
<?php if($case->status == 'wait') continue;?>
<?php
if(!$productID)
{
echo html::hidden("caseIDList[$case->id]", $caseID);
if(!isset($moduleOptionMenu[$case->module])) $moduleOptionMenu += $this->tree->getOptionMenu($case->product, 'case', 0, $case->branch);
}
?>
<?php if(!$productID) echo html::hidden("caseIDList[$case->id]", $caseID); ?>
<tr class='text-center'>
<td><?php echo $caseID . html::hidden("version[$caseID]", $case->version)?></td>
<td class='text-left'><?php echo "<span title='" . $moduleOptionMenu[$case->module] . "'>" . $moduleOptionMenu[$case->module] . "</span>"?></td>