From 1c9afbdbc43637b28e761ce1d54ef963a05b0b99 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Mon, 11 Apr 2022 15:54:10 +0800 Subject: [PATCH] * Fix bug #18296. --- module/productplan/view/browsebylist.html.php | 2 +- module/productplan/view/view.html.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/productplan/view/browsebylist.html.php b/module/productplan/view/browsebylist.html.php index c7fcbf092f..776abaaf9a 100644 --- a/module/productplan/view/browsebylist.html.php +++ b/module/productplan/view/browsebylist.html.php @@ -182,7 +182,7 @@ common::printIcon('productplan', 'edit', "planID=$plan->id", $plan, 'list'); if(common::hasPriv('productplan', 'create', $plan)) { - if($plan->parent > 0) + if($plan->parent > 0 or strpos('done,closed', $plan->status) !== false) { echo " "; } diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index 2468ae1fd1..ebc4261f96 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -57,8 +57,8 @@ common::printLink('productplan', 'activate', "planID=$plan->id", "{$lang->productplan->activateAB}", '', "class='btn btn-link {$class}' target='hiddenwin' title='{$lang->productplan->activate}'", '', false, $plan); } - $class= (isset($branchStatus) and $branchStatus == 'closed') ? 'disabled' : ''; - if(common::hasPriv('productplan', 'create', $plan) and $plan->parent <= 0) echo html::a($this->createLink('productplan', 'create', "product={$plan->product}&branch={$plan->branch}&parent={$plan->id}"), " " . $this->lang->productplan->children , '', "class='btn btn-link {$class}' title='{$this->lang->productplan->children}'"); + $class = (isset($branchStatus) and $branchStatus == 'closed') ? 'disabled' : ''; + if(common::hasPriv('productplan', 'create', $plan) and $plan->parent <= 0 and strpos('wait,doing', $plan->status) !== false) echo html::a($this->createLink('productplan', 'create', "product={$plan->product}&branch={$plan->branch}&parent={$plan->id}"), " " . $this->lang->productplan->children , '', "class='btn btn-link {$class}' title='{$this->lang->productplan->children}'"); if(common::hasPriv('productplan', 'edit', $plan)) echo html::a($this->createLink('productplan', 'edit', "planID=$plan->id"), " " . $this->lang->edit, '', "class='btn btn-link' title='{$this->lang->edit}'"); if(common::hasPriv('productplan', 'delete', $plan) and $plan->parent >= 0) echo html::a($this->createLink('productplan', 'delete', "planID=$plan->id"), " " . $this->lang->delete, '', "class='btn btn-link' title='{$this->lang->delete}' target='hiddenwin'"); }