Merge branch 'sprint/174_mayue_44987,44988,44989' into 'master'

* Fix bug #16987.

See merge request easycorp/zentaopms!723
This commit is contained in:
李玉春
2021-12-02 01:48:29 +00:00
10 changed files with 21 additions and 19 deletions
+1 -1
View File
@@ -520,7 +520,7 @@ class branchModel extends model
* @access public
* @return bool
*/
public function isShowBranch($productID, $moduleID = 0, $executionID = 0)
public function showBranch($productID, $moduleID = 0, $executionID = 0)
{
$this->loadModel('product');
if(empty($productID) and empty($moduleID))
+2 -2
View File
@@ -205,7 +205,7 @@ class bug extends control
$product = $this->product->getById($productID);
/* Display of branch label. */
$isShowBranch = $this->loadModel('branch')->isShowBranch($productID);
$showBranch = $this->loadModel('branch')->showBranch($productID);
/* Set view. */
$this->view->title = $productName . $this->lang->colon . $this->lang->bug->common;
@@ -237,7 +237,7 @@ class bug extends control
$this->view->setModule = true;
$this->view->isProjectBug = ($productID and !$this->projectID) ? false : true;
$this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'bug', $showModule) : array();
$this->view->isShowBranch = $isShowBranch;
$this->view->showBranch = $showBranch;
$this->display();
}
+1
View File
@@ -231,6 +231,7 @@ class caselib extends control
$this->view->moduleName = $moduleID ? $this->tree->getById($moduleID)->name : $this->lang->tree->all;
$this->view->param = $param;
$this->view->setModule = true;
$this->view->showBranch = false;
$this->display();
}
+1 -1
View File
@@ -104,7 +104,7 @@ $(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($isShowBranch):?>
<?php if($showBranch):?>
<tr>
<td><?php echo $lang->datatable->showBranch;?></td>
<td><?php echo html::radio('showBranch', $lang->datatable->showBranchList, isset($config->$currentModule->$currentMethod->showBranch) ? $config->$currentModule->$currentMethod->showBranch : 1);?></td>
+4 -4
View File
@@ -222,7 +222,7 @@ class execution extends control
$product = $this->product->getById($productID);
/* Display of branch label. */
$isShowBranch = $this->loadModel('branch')->isShowBranch($productID, $moduleID, $executionID);
$showBranch = $this->loadModel('branch')->showBranch($productID, $moduleID, $executionID);
/* Build the search form. */
$actionURL = $this->createLink('execution', 'task', "executionID=$executionID&status=bySearch&param=myQueryID");
@@ -261,7 +261,7 @@ class execution extends control
$this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noempty');
$this->view->setModule = true;
$this->view->canBeChanged = common::canModify('execution', $execution); // Determines whether an object is editable.
$this->view->isShowBranch = $isShowBranch;
$this->view->showBranch = $showBranch;
$this->display();
}
@@ -799,7 +799,7 @@ class execution extends control
}
/* Display of branch label. */
$isShowBranch = $this->loadModel('branch')->isShowBranch($this->cookie->storyProductParam, $this->cookie->storyModuleParam, $executionID);
$showBranch = $this->loadModel('branch')->showBranch($this->cookie->storyProductParam, $this->cookie->storyModuleParam, $executionID);
/* Get execution's product. */
$productPairs = $this->loadModel('product')->getProductPairsByProject($executionID);
@@ -831,7 +831,7 @@ class execution extends control
$this->view->setModule = true;
$this->view->branchGroups = $branchGroups;
$this->view->canBeChanged = common::canModify('execution', $execution); // Determines whether an object is editable.
$this->view->isShowBranch = $isShowBranch;
$this->view->showBranch = $showBranch;
$this->display();
}
+2 -2
View File
@@ -220,8 +220,8 @@
<?php endif;?>
<td class='c-pri'><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='c-name' title="<?php echo $story->title?>">
<?php if($isShowBranch) $isShowBranch = isset($this->config->execution->story->showBranch) ? $this->config->execution->story->showBranch : 1;?>
<?php if(isset($branchGroups[$story->product][$story->branch]) and $isShowBranch) echo "<span class='label label-outline label-badge'>" . $branchGroups[$story->product][$story->branch] . '</span>';?>
<?php if($showBranch) $showBranch = isset($this->config->execution->story->showBranch) ? $this->config->execution->story->showBranch : 1;?>
<?php if(isset($branchGroups[$story->product][$story->branch]) and $showBranch) echo "<span class='label label-outline label-badge'>" . $branchGroups[$story->product][$story->branch] . '</span>';?>
<?php if(!empty($story->module) and isset($modulePairs[$story->module])) echo "<span class='label label-gray label-badge'>{$modulePairs[$story->module]}</span> ";?>
<?php if($story->parent > 0) echo "<span class='label'>{$lang->story->childrenAB}</span>";?>
<?php echo html::a($storyLink,$story->title, null, "style='color: $story->color' data-app='execution'");?>
+2 -2
View File
@@ -250,7 +250,7 @@ body {margin-bottom: 25px;}
<tbody>
<?php foreach($tasks as $task):?>
<tr data-id='<?php echo $task->id;?>' data-status='<?php echo $task->status?>' data-estimate='<?php echo $task->estimate?>' data-consumed='<?php echo $task->consumed?>' data-left='<?php echo $task->left?>'>
<?php foreach($customFields as $field) $this->task->printCell($field, $task, $users, $browseType, $branchGroups, $modulePairs, $useDatatable ? 'datatable' : 'table');?>
<?php foreach($customFields as $field) $this->task->printCell($field, $task, $users, $browseType, $branchGroups, $modulePairs, $useDatatable ? 'datatable' : 'table', false, $showBranch);?>
</tr>
<?php if(!empty($task->children)):?>
<?php $i = 0;?>
@@ -258,7 +258,7 @@ body {margin-bottom: 25px;}
<?php $class = $i == 0 ? ' table-child-top' : '';?>
<?php $class .= ($i + 1 == count($task->children)) ? ' table-child-bottom' : '';?>
<tr class='table-children<?php echo $class;?> parent-<?php echo $task->id;?>' data-id='<?php echo $child->id?>' data-status='<?php echo $child->status?>' data-estimate='<?php echo $child->estimate?>' data-consumed='<?php echo $child->consumed?>' data-left='<?php echo $child->left?>'>
<?php foreach($customFields as $field) $this->task->printCell($field, $child, $users, $browseType, $branchGroups, $modulePairs, $useDatatable ? 'datatable' : 'table', true);?>
<?php foreach($customFields as $field) $this->task->printCell($field, $child, $users, $browseType, $branchGroups, $modulePairs, $useDatatable ? 'datatable' : 'table', true, $showBranch);?>
</tr>
<?php $i ++;?>
<?php endforeach;?>
+3 -3
View File
@@ -212,14 +212,14 @@ class product extends control
$pager = new pager($recTotal, $recPerPage, $pageID);
/* Display of branch label. */
$isShowBranch = $this->loadModel('branch')->isShowBranch($productID);
$showBranch = $this->loadModel('branch')->showBranch($productID);
$product = $this->product->getById($productID);
/* Get stories and branches. */
if($this->app->rawModule == 'projectstory')
{
$isShowBranch = $this->loadModel('branch')->isShowBranch($productID, 0, $projectID);
$showBranch = $this->loadModel('branch')->showBranch($productID, 0, $projectID);
$branches = array();
if(!empty($product))
@@ -309,7 +309,7 @@ class product extends control
$this->view->branch = $branch;
$this->view->branchID = $branchID;
$this->view->branches = $branches;
$this->view->isShowBranch = $isShowBranch;
$this->view->showBranch = $showBranch;
$this->view->storyStages = $this->product->batchGetStoryStage($stories);
$this->view->setModule = true;
$this->view->storyTasks = $storyTasks;
+3 -2
View File
@@ -3007,11 +3007,12 @@ class taskModel extends model
* @param array $modulePairs
* @param string $mode
* @param bool $child
* @param bool $showBranch
*
* @access public
* @return void
*/
public function printCell($col, $task, $users, $browseType, $branchGroups, $modulePairs = array(), $mode = 'datatable', $child = false)
public function printCell($col, $task, $users, $browseType, $branchGroups, $modulePairs = array(), $mode = 'datatable', $child = false, $showBranch = false)
{
$canBatchEdit = common::hasPriv('task', 'batchEdit', !empty($task) ? $task : null);
$canBatchClose = (common::hasPriv('task', 'batchClose', !empty($task) ? $task : null) and strtolower($browseType) != 'closed');
@@ -3070,7 +3071,7 @@ class taskModel extends model
echo "</span>";
break;
case 'name':
$showBranch = isset($this->config->execution->task->showBranch) ? $this->config->execution->task->showBranch : 1;
if($showBranch) $showBranch = isset($this->config->execution->task->showBranch) ? $this->config->execution->task->showBranch : 1;
if($task->parent > 0 and isset($task->parentName)) $task->name = "{$task->parentName} / {$task->name}";
if(!empty($task->product) and isset($branchGroups[$task->product][$task->branch]) and $showBranch) echo "<span class='label label-badge label-outline'>" . $branchGroups[$task->product][$task->branch] . '</span> ';
if($task->module and isset($modulePairs[$task->module])) echo "<span class='label label-gray label-badge'>" . $modulePairs[$task->module] . '</span> ';
+2 -2
View File
@@ -187,7 +187,7 @@ class testcase extends control
}
/* Display of branch label. */
$isShowBranch = $this->loadModel('branch')->isShowBranch($productID);
$showBranch = $this->loadModel('branch')->showBranch($productID);
$product = $this->product->getById($productID);
@@ -218,7 +218,7 @@ class testcase extends control
$this->view->suiteID = $suiteID;
$this->view->setModule = true;
$this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'case', $showModule) : array();
$this->view->isShowBranch = $isShowBranch;
$this->view->showBranch = $showBranch;
$this->display();
}