* [bug#48352] Hidden the button batch create story when product is empty.

This commit is contained in:
xieqiyu
2024-09-19 14:44:08 +08:00
committed by 王于听
parent 082322f316
commit 97ab0099ec
2 changed files with 12 additions and 8 deletions
+1
View File
@@ -479,6 +479,7 @@ class execution extends control
$this->executionZen->assignCountForStory($executionID, $stories, $storyType);
$this->executionZen->assignRelationForStory($execution, $products, $productID, $type, $storyType, $param, $orderBy, $pager);
$this->view->productID = $productID;
$this->view->project = $project;
$this->view->linkedProductCount = count($products);
$this->display();
+11 -8
View File
@@ -132,14 +132,17 @@ if(in_array($execution->attribute, array('mix', 'request', 'design')) || !$execu
if($canOpreate['batchCreateEpic']) $batchItems[] = array('text' => $lang->ERCommon, 'url' => $batchCreateEpicLink);
}
if(count($batchItems) > 1)
if($productID > 0)
{
$createItems[] = array('text' => $lang->story->batchCreate, 'items' => $batchItems);
}
else
{
$batchItems[0]['text'] = $lang->story->batchCreate;
$createItems = array_merge($createItems, $batchItems);
if(count($batchItems) > 1)
{
$createItems[] = array('text' => $lang->story->batchCreate, 'items' => $batchItems);
}
else
{
$batchItems[0]['text'] = $lang->story->batchCreate;
$createItems = array_merge($createItems, $batchItems);
}
}
$canLinkStory = ($execution->hasProduct || $app->tab == 'execution') && $canModifyProduct && $canModifyExecution && hasPriv('execution', 'linkStory');
@@ -168,7 +171,7 @@ if($canOpreate['create'])
set::url($createLink),
$lang->story->create
),
dropdown
empty($createItems) ? null : dropdown
(
btn(setClass('btn secondary dropdown-toggle'),
setStyle(array('padding' => '6px', 'border-radius' => '0 2px 2px 0'))),