Merge branch 'sprint/170_mayue_44493,44494' into 'sprint/170'
* Finish task #44493,44494. See merge request easycorp/zentaopms!477
This commit is contained in:
@@ -207,13 +207,20 @@ 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);
|
||||
if($product and $product->type != 'normal')
|
||||
{
|
||||
$this->app->loadLang('datatable');
|
||||
$this->lang->datatable->showBranch = sprintf($this->lang->datatable->showBranch, $this->lang->product->branchName[$product->type]);
|
||||
}
|
||||
|
||||
/* Set view. */
|
||||
$this->view->title = $productName . $this->lang->colon . $this->lang->bug->common;
|
||||
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $productName,'','title=' . $productName);
|
||||
$this->view->position[] = $this->lang->bug->common;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->product = $this->product->getById($productID);
|
||||
$this->view->product = $product;
|
||||
$this->view->projectProducts = $this->product->getProducts($this->projectID);
|
||||
$this->view->productName = $productName;
|
||||
$this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID);
|
||||
|
||||
@@ -2751,7 +2751,8 @@ class bugModel extends model
|
||||
echo "<span class='$class'>" . zget($this->lang->bug->confirmedList, $bug->confirmed, $bug->confirmed) . "</span> ";
|
||||
break;
|
||||
case 'title':
|
||||
if($bug->branch and isset($branches[$bug->branch])) echo "<span class='label label-outline label-badge'>{$branches[$bug->branch]}</span> ";
|
||||
$showBranch = isset($this->config->bug->browse->showBranch) ? $this->config->bug->browse->showBranch : 1;
|
||||
if($bug->branch and isset($branches[$bug->branch]) and $showBranch) echo "<span class='label label-outline label-badge'>{$branches[$bug->branch]}</span> ";
|
||||
if($bug->module and isset($modulePairs[$bug->module])) echo "<span class='label label-gray label-badge'>{$modulePairs[$bug->module]}</span> ";
|
||||
echo $canView ? html::a($bugLink, $bug->title, null, "style='color: $bug->color'") : "<span style='color: $bug->color'>{$bug->title}</span>";
|
||||
break;
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<?php $datatableId = $this->moduleName . ucfirst($this->methodName);?>
|
||||
<?php $currentModule = $this->moduleName;?>
|
||||
<?php $currentMethod = $this->methodName;?>
|
||||
<?php $datatableId = $this->moduleName . ucfirst($this->methodName);?>
|
||||
|
||||
<style>
|
||||
#setShowModule {margin-left: 30px;}
|
||||
</style>
|
||||
@@ -37,6 +40,8 @@ $(function()
|
||||
{
|
||||
if('<?php echo $this->app->user->account?>' == 'guest') return;
|
||||
datatableId = '<?php echo $datatableId?>';
|
||||
currentModule = '<?php echo $currentModule?>';
|
||||
currentMethod = '<?php echo $currentMethod?>';
|
||||
var value = $('#showModuleModal input[name="showModule"]:checked').val();
|
||||
var allModule = $('#showModuleModal input[name="showAllModule"]:checked').val();
|
||||
var showBranch = $('#showModuleModal input[name="showBranch"]:checked').val();
|
||||
@@ -53,6 +58,8 @@ $(function()
|
||||
value: value,
|
||||
allModule: allModule,
|
||||
showBranch: showBranch,
|
||||
currentModule: currentModule,
|
||||
currentMethod: currentMethod,
|
||||
},
|
||||
success:function(){window.location.reload();},
|
||||
url: '<?php echo $this->createLink('datatable', 'ajaxSave')?>'
|
||||
@@ -98,10 +105,10 @@ $(function()
|
||||
<td><?php echo html::radio('showAllModule', $lang->datatable->showAllModuleList, isset($config->execution->task->allModule) ? $config->execution->task->allModule : 0);?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php if($this->app->tab == 'product' and $app->moduleName == 'product' and $app->methodName == 'browse'):?>
|
||||
<?php if($this->app->tab == 'product' or $this->app->tab == 'qa'):?>
|
||||
<tr>
|
||||
<td><?php echo $lang->datatable->showBranch;?></td>
|
||||
<td><?php echo html::radio('showBranch', $lang->datatable->showBranchList, isset($config->product->browse->showBranch) ? $config->product->browse->showBranch : 1);?></td>
|
||||
<td><?php echo html::radio('showBranch', $lang->datatable->showBranchList, isset($config->$currentModule->$currentMethod->showBranch) ? $config->$currentModule->$currentMethod->showBranch : 1);?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
|
||||
@@ -38,7 +38,7 @@ class datatable extends control
|
||||
$name = 'datatable.' . $this->post->target . '.' . $this->post->name;
|
||||
$this->loadModel('setting')->setItem($account . '.' . $name, $this->post->value);
|
||||
if($this->post->allModule !== false) $this->setting->setItem("$account.execution.task.allModule", $this->post->allModule);
|
||||
if($this->post->showBranch !== false) $this->setting->setItem("$account.product.browse.showBranch", $this->post->showBranch);
|
||||
if($this->post->showBranch !== false) $this->setting->setItem($account . '.' . $this->post->currentModule . '.' . $this->post->currentMethod . '.showBranch', $this->post->showBranch);
|
||||
if($this->post->global) $this->setting->setItem('system.' . $name, $this->post->value);
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => 'dao error.'));
|
||||
|
||||
@@ -210,7 +210,6 @@ class product extends control
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$product = $this->product->getById($productID);
|
||||
|
||||
if($product and $product->type != 'normal')
|
||||
{
|
||||
$this->app->loadLang('datatable');
|
||||
@@ -273,7 +272,6 @@ class product extends control
|
||||
$this->product->buildSearchForm($productID, $this->products, $queryID, $actionURL);
|
||||
|
||||
$showModule = !empty($this->config->datatable->productBrowse->showModule) ? $this->config->datatable->productBrowse->showModule : '';
|
||||
$this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'story', $showModule) : array();
|
||||
|
||||
$productName = ($this->app->rawModule == 'projectstory' and empty($productID)) ? $this->lang->product->all : $this->products[$productID];
|
||||
|
||||
@@ -311,6 +309,7 @@ class product extends control
|
||||
$this->view->projectProducts = isset($projectProducts) ? $projectProducts : array();
|
||||
$this->view->storyType = $storyType;
|
||||
$this->view->from = $this->app->tab;
|
||||
$this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'story', $showModule) : array();
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -174,7 +174,6 @@ class testcase extends control
|
||||
$this->testcase->buildSearchForm($productID, $this->products, $queryID, $actionURL);
|
||||
|
||||
$showModule = !empty($this->config->datatable->testcaseBrowse->showModule) ? $this->config->datatable->testcaseBrowse->showModule : '';
|
||||
$this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'case', $showModule) : array();
|
||||
|
||||
/* Get module tree.*/
|
||||
if($projectID and empty($productID))
|
||||
@@ -186,13 +185,20 @@ class testcase extends control
|
||||
$moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'case', $startModuleID = 0, array('treeModel', 'createCaseLink'), '', $branch);
|
||||
}
|
||||
|
||||
$product = $this->product->getById($productID);
|
||||
if($product and $product->type != 'normal')
|
||||
{
|
||||
$this->app->loadLang('datatable');
|
||||
$this->lang->datatable->showBranch = sprintf($this->lang->datatable->showBranch, $this->lang->product->branchName[$product->type]);
|
||||
}
|
||||
|
||||
/* Assign. */
|
||||
$tree = $moduleID ? $this->tree->getByID($moduleID) : '';
|
||||
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->common;
|
||||
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]);
|
||||
$this->view->position[] = $this->lang->testcase->common;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->product = $this->product->getById($productID);
|
||||
$this->view->product = $product;
|
||||
$this->view->productName = $this->products[$productID];
|
||||
$this->view->modules = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $branch);
|
||||
$this->view->moduleTree = $moduleTree;
|
||||
@@ -211,6 +217,7 @@ class testcase extends control
|
||||
$this->view->suiteList = $this->loadModel('testsuite')->getSuites($productID);
|
||||
$this->view->suiteID = $suiteID;
|
||||
$this->view->setModule = true;
|
||||
$this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'case', $showModule) : array();
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -1521,7 +1521,8 @@ class testcaseModel extends model
|
||||
echo "</span>";
|
||||
break;
|
||||
case 'title':
|
||||
if($case->branch) echo "<span class='label label-info label-outline'>{$branches[$case->branch]}</span> ";
|
||||
$showBranch = isset($this->config->testcase->browse->showBranch) ? $this->config->testcase->browse->showBranch : 1;
|
||||
if($case->branch and $showBranch) echo "<span class='label label-info label-outline'>{$branches[$case->branch]}</span> ";
|
||||
if($modulePairs and $case->module and isset($modulePairs[$case->module])) echo "<span class='label label-gray label-badge'>{$modulePairs[$case->module]}</span> ";
|
||||
echo $canView ? ($fromCaseID ? html::a($caseLink, $case->title, null, "style='color: $case->color' data-app='{$this->app->tab}'") . html::a(helper::createLink('testcase', 'view', "caseID=$fromCaseID"), "[<i class='icon icon-share' title='{$this->lang->testcase->fromCase}'></i>#$fromCaseID]", '', "data-app='{$this->app->tab}'") : html::a($caseLink, $case->title, null, "style='color: $case->color' data-app='{$this->app->tab}'")) : "<span style='color: $case->color'>$case->title</span>";
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user