From 4720997a6b4c156104bc04694dd10729441e6064 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 19 Sep 2023 10:56:24 +0800 Subject: [PATCH] * Fix bug #38760. --- module/execution/view/task.html.php | 2 +- module/task/model.php | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/module/execution/view/task.html.php b/module/execution/view/task.html.php index cd593a56ae..fec8dbe0b8 100644 --- a/module/execution/view/task.html.php +++ b/module/execution/view/task.html.php @@ -15,7 +15,7 @@ include '../../common/view/header.html.php'; include '../../common/view/datatable.fix.html.php'; include '../../common/view/zui3dtable.html.php'; $cols = $this->task->generateCol($orderBy); -$tasks = $this->task->generateRow($tasks, $users, $productID); +$tasks = $this->task->generateRow($tasks, $users, $executionID, $showBranch, $branchGroups, $modulePairs); $sortLink = helper::createLink('execution', 'task', "executionID={$execution->id}&status={$status}¶m={$param}&orderBy={orderBy}&recTotal={$recTotal}&recPerPage={$recPerPage}"); js::set('moduleID', $moduleID); js::set('productID', $productID); diff --git a/module/task/model.php b/module/task/model.php index 16f2f0091e..2aa0f65a5a 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -4638,15 +4638,20 @@ class taskModel extends model * * @param array $tasks * @param array $users + * @param int $executionID + * @param bool $showBranch + * @param array $branchGroups + * @param array $modulePairs * @access public * @return array */ - public function generateRow($tasks, $users) + public function generateRow($tasks, $users, $executionID, $showBranch, $branchGroups, $modulePairs) { $userFields = array('assignedTo', 'openedBy', 'closedBy', 'lastEditedBy', 'finishedBy'); $dateFields = array('assignedDate', 'openedDate', 'deadline', 'finishedDate', 'closedDate', 'lastEditedDate', 'canceledDate', 'activatedDate', 'estStarted', 'realStarted', 'replacetypeDate'); $canView = common::hasPriv('task', 'view'); $rows = array(); + if($showBranch) $showBranch = isset($this->config->execution->task->showBranch) ? $this->config->execution->task->showBranch : 1; foreach($tasks as $task) { $task->assignedTo = $this->printAssignedHtml($task, $users, false); @@ -4657,10 +4662,10 @@ class taskModel extends model $linkClass = $this->config->vision == 'lite' ? 'class="iframe"' : ''; 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) $taskName .= "" . $branchGroups[$task->product][$task->branch] . ' '; if($task->module and isset($modulePairs[$task->module])) $taskName .= "" . $modulePairs[$task->module] . ' '; if($task->parent > 0) $taskName .= '' . $this->lang->task->childrenAB . ' '; if(!empty($task->team)) $taskName .= '' . $this->lang->task->multipleAB . ' '; - $taskName .= $canView ? html::a($taskLink, $task->name, null, "$linkClass style='color: $task->color' title='$task->name'") : "$task->name"; if(!empty($task->children)) $taskName .= ''; if($task->fromBug) $taskName .= html::a(helper::createLink('bug', 'view', "id=$task->fromBug"), "[BUG#$task->fromBug]", '', "class='bug'");