This commit is contained in:
sunguangming
2024-01-24 13:18:53 +08:00
parent 965caf8d08
commit 1e9b7d7202
+7 -6
View File
@@ -74,7 +74,6 @@ class productsBox extends wg
$productsBox = array();
$hidden = !empty($project) && empty($project->hasProduct) ? 'hidden' : '';
$disabledProduct = $app->rawMethod != 'create' && $isStage && !empty($project) && $project->stageBy == 'project';
$productsBox[] = $hasNewProduct ? div
(
setClass('addProductBox flex hidden'),
@@ -139,7 +138,7 @@ class productsBox extends wg
)
),
),
$disabledProduct ? null : div
div
(
setClass('pl-2 flex self-center line-btn c-actions'),
btn
@@ -193,18 +192,20 @@ class productsBox extends wg
{
if(empty($linkedProducts)) return array();
global $lang, $app;
global $lang;
list($productItems, $branchGroups, $planGroups, $productPlans) = $this->prop(array('productItems', 'branchGroups', 'planGroups', 'productPlans'));
list($linkedBranches, $currentProduct, $currentPlan) = $this->prop(array('linkedBranches', 'currentProduct', 'currentPlan'));
list($project, $isStage) = $this->prop(array('project', 'isStage'));
list($linkedBranches, $currentProduct, $currentPlan, $project) = $this->prop(array('linkedBranches', 'currentProduct', 'currentPlan', 'project'));
$unmodifiableProducts = data('unmodifiableProducts');
$disabledProduct = $app->rawMethod != 'create' && $isStage && !empty($project) && $project->stageBy == 'project';
$linkedProductsBox = array();
foreach(array_values($linkedProducts) as $i => $product)
{
$hasBranch = $product->type != 'normal' && isset($branchGroups[$product->id]);
$branches = isset($branchGroups[$product->id]) ? $branchGroups[$product->id] : array();
$disabledProduct = !empty($project) && $project->model == 'waterfall' && in_array($product->id, $unmodifiableProducts);
$branchIdList = '';
if(isset($product->branches)) $branchIdList = $product->branches;
if(!empty($linkedBranches[$product->id])) $branchIdList = is_array($linkedBranches) ? array_keys($linkedBranches[$product->id]) : $linkedBranches[$product->id];