From b7af7a37546d78243e624fa7a9451e4ad823d0fd Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 31 Dec 2021 13:00:10 +0800 Subject: [PATCH] * Modify judgment. --- module/productplan/view/browsebylist.html.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/module/productplan/view/browsebylist.html.php b/module/productplan/view/browsebylist.html.php index 236571474e..c77d9b0288 100644 --- a/module/productplan/view/browsebylist.html.php +++ b/module/productplan/view/browsebylist.html.php @@ -163,23 +163,23 @@ common::printIcon('productplan', 'close', "planID=$plan->id", $plan, 'list', 'off', '', $class, false, $attr); } - $attr = $plan->expired ? "disabled='disabled'" : ''; - $disabled = ''; + $attr = $plan->expired ? "disabled='disabled'" : ''; + $class = ''; + if($product->type != 'normal') + { + $branchStatus = isset($branchStatusList[$plan->branch]) ? $branchStatusList[$plan->branch] : ''; + if($branchStatus == 'closed') $class = 'disabled'; + } if(common::hasPriv('execution', 'create', $plan) and $plan->parent >= 0) { $disabled = ''; $executionLink = $config->systemMode == 'new' ? '#projects' : $this->createLink('execution', 'create', "projectID=0&executionID=0©ExecutionID=0&plan=$plan->id&confirm=no&productID=$productID"); - if($product->type != 'normal') - { - $branchStatus = isset($branchStatusList[$plan->branch]) ? $branchStatusList[$plan->branch] : ''; - if($branchStatus == 'closed') $disabled = 'disabled'; - } if(in_array($plan->status, array('done', 'closed'))) $disabled = 'disabled'; if($config->systemMode == 'new') { - echo html::a($executionLink, '', '', "data-toggle='modal' data-id='$plan->id' onclick='getPlanID(this, $plan->branch)' class='btn {$disabled}' title='{$lang->productplan->createExecution}' $attr"); + echo html::a($executionLink, '', '', "data-toggle='modal' data-id='$plan->id' onclick='getPlanID(this, $plan->branch)' class='btn {$disabled} {$class}' title='{$lang->productplan->createExecution}' $attr"); } else { @@ -197,7 +197,7 @@ } else { - echo html::a($this->createLink('productplan', 'create', "product=$productID&branch=$branch&parent={$plan->id}"), "", '', "class='btn {$disabled}' title='{$this->lang->productplan->children}'"); + echo html::a($this->createLink('productplan', 'create', "product=$productID&branch=$branch&parent={$plan->id}"), "", '', "class='btn {$class}' title='{$this->lang->productplan->children}'"); } }