From 07f2c4520e5d562f036fd3cc2bae5b16c3df621e Mon Sep 17 00:00:00 2001 From: zhujinyong Date: Tue, 28 Feb 2023 10:18:51 +0800 Subject: [PATCH] * Fix bug: hide bug in tree view. --- module/execution/control.php | 2 ++ module/execution/view/grouptask.html.php | 2 +- module/execution/view/tree.html.php | 9 ++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 922df1037f..700be841e7 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -472,6 +472,7 @@ class execution extends control $this->view->users = $users; $this->view->moduleID = 0; $this->view->moduleName = $this->lang->tree->all; + $this->view->features = $this->execution->getExecutionFeatures($execution); $this->view->filter = $filter; $this->view->allCount = $allCount; $this->display(); @@ -2953,6 +2954,7 @@ class execution extends control $this->view->executionID = $executionID; $this->view->level = $type; $this->view->tree = $this->execution->printTree($tree, $project->hasProduct); + $this->view->features = $this->execution->getExecutionFeatures($execution); $this->display(); } diff --git a/module/execution/view/grouptask.html.php b/module/execution/view/grouptask.html.php index 5633b05d66..2e457a02d7 100644 --- a/module/execution/view/grouptask.html.php +++ b/module/execution/view/grouptask.html.php @@ -63,7 +63,7 @@ $link = common::hasPriv('execution', 'importTask') ? $this->createLink('execution', 'importTask', "execution=$execution->id") : '#'; echo "
  • " . html::a($link, $lang->execution->importTask, '', $misc) . "
  • "; - if(isset($this->lang->execution->menu->qa)) + if($features['qa']) { $class = common::hasPriv('execution', 'importBug') ? '' : "class=disabled"; $misc = common::hasPriv('execution', 'importBug') ? "class='import'" : "class=disabled"; diff --git a/module/execution/view/tree.html.php b/module/execution/view/tree.html.php index 12a63f011d..9df7653619 100644 --- a/module/execution/view/tree.html.php +++ b/module/execution/view/tree.html.php @@ -41,9 +41,12 @@ $link = common::hasPriv('execution', 'importTask') ? $this->createLink('execution', 'importTask', "execution=$execution->id") : '#'; echo "
  • " . html::a($link, $lang->execution->importTask, '', $misc) . "
  • "; - $misc = common::hasPriv('execution', 'importBug') ? '' : "class=disabled"; - $link = common::hasPriv('execution', 'importBug') ? $this->createLink('execution', 'importBug', "execution=$execution->id") : '#'; - echo "
  • " . html::a($link, $lang->execution->importBug, '', $misc) . "
  • "; + if($features['qa']) + { + $misc = common::hasPriv('execution', 'importBug') ? '' : "class=disabled"; + $link = common::hasPriv('execution', 'importBug') ? $this->createLink('execution', 'importBug', "execution=$execution->id") : '#'; + echo "
  • " . html::a($link, $lang->execution->importBug, '', $misc) . "
  • "; + } ?>