* [refac] Modify the issue of code review.

This commit is contained in:
xieqiyu
2024-05-29 09:50:04 +08:00
committed by caoyanyi
parent a84c5dbe9b
commit 4ce0041a84
3 changed files with 9 additions and 7 deletions
+1 -1
View File
@@ -2190,7 +2190,7 @@ class bugZen extends bug
helper::setcookie('bugModule', '0', 0);
/* Remove upload image file and session. */
if(!empty($_POST['uploadImage']) and !empty($_SESSION['bugImagesFile']))
if(!empty($_POST['uploadImage']) && !empty($_SESSION['bugImagesFile']))
{
$classFile = $this->app->loadClass('zfile');
$file = current($_SESSION['bugImagesFile']);
+8 -4
View File
@@ -558,6 +558,7 @@ class story extends control
$this->view->story = $story;
$this->view->product = $product;
$this->view->actions = $this->action->getList('story', $storyID);
$this->view->branch = $story->branch;
$this->display();
}
@@ -1782,8 +1783,9 @@ class story extends control
$this->story->replaceURLang($storyType);
$fileName = $storyType == 'requirement' ? $this->lang->URCommon : $this->lang->SRCommon;
$project = null;
$fileName = $storyType == 'requirement' ? $this->lang->URCommon : $this->lang->SRCommon;
$project = null;
$hasBranch = false;
if($executionID)
{
$execution = $this->loadModel('execution')->getByID($executionID);
@@ -1792,12 +1794,10 @@ class story extends control
if($execution->type == 'execution') $project = $this->project->getById($execution->project);
$products = $this->loadModel('product')->getProducts($executionID);
$hasBranch = false;
foreach($products as $product)
{
if($product->type != 'normal') $hasBranch = true;
}
if(!$hasBranch) $this->config->story->exportFields = str_replace(', branch', '', $this->config->story->exportFields);
}
else
{
@@ -1808,6 +1808,7 @@ class story extends control
$productName = $product->name;
if($product->shadow) $project = $this->project->getByShadowProduct($productID);
if($product->type != 'normal') $hasBranch = true;
}
if(isset($this->lang->product->featureBar['browse'][$browseType]))
{
@@ -1821,6 +1822,9 @@ class story extends control
$fileName = $productName . $this->lang->dash . $browseType . $fileName;
}
/* Unset branch field. */
if(!$hasBranch) $this->config->story->exportFields = str_replace(', branch', '', $this->config->story->exportFields);
/* Unset product field when in single project. */
if(isset($project->hasProduct) && !$project->hasProduct)
{
-2
View File
@@ -14,8 +14,6 @@ use function zin\utils\flat;
include($this->app->getModuleRoot() . 'ai/ui/promptmenu.html.php');
data('branch', $story->branch);
$isInModal = isInModal();
$isRequirement = $story->type == 'requirement';
$isStoryType = $story->type == 'story';